FAQ Database Discussion Community


How to create alarm with date, time and repetition for some days(suppose 10 days) which show alert even the phone is reset or lock?

android,broadcastreceiver,alarmmanager,android-alarms,repetition
I am creating a reminder application for that i want to create a alarm with date time and number of days repetation. As i am new in android development can any one please help me with this? I have check this link...

Back button takes me to launcher activity not deep-linker activity

android,android-activity,deep-linking,android-navigation,activity-stack
Following procedure: Start my application, Stack: [HomeActivity] Going to Facebook, using a deep link to get into Activity X Pressing back button results in getting back to HomeActivity instead of Facebook Expected Start my application, Stack: [HomeActivity] Going to Facebook, using a deep link to get into Activity X Pressing...

LinearLayout.getWidth() not reflecting new width from setLayoutParams

android,android-layout,layoutparams
tl/dr I am trying to change some layouts sizes in code, and I can change some of them, but the other ones that needed to update based on the changes won't update together. Instead, they retain the previous width that the changed ones had. So, I am fooling around...

Is parse.com a fairly substandard method of creating backend databases for android applications?

php,android,mysql,json,parse.com
i have become quite good at using parse.com for remote databases in android studio, for android apps, which hasn't been all that difficult. Do professional, high quality android apps mainly use php and mysql for remote database interaction, what are the advantages of using php and mysql over something like...

How to fadeIn and fadeOut in sequence

javascript,jquery,css,fadein,fadeout
I want fadeIn and fadeOut effect on div one by one sequentially with regular interval. I tried with following code but it will all div at a time fadeIn and fadeOut. HTML <div></div> <div></div> <div></div> <div></div> <div></div> jQuery function fade() { $("div").each(function(){ $(this).fadeOut(3000); }); $("div").each(function(){ $(this).fadeIn(3000); }); } setInterval(fade,6000); Update...

PHP constructor parameter not working properly?

php
Somehow my constructor doesn`t seem to work properly: private $matchId; private $region; private $date; private $wAdc; private $wSupp; private $lAdc; private $lSupp; private $summoners; public function _construct($matchId, $region, $date) { $this->matchId = $matchId; $this->region = $region; $this->date = $date; $this->summoners = array(); $this->wAdc = null; $this->wSupp = null; $this->lAdc =...

remove lines from file that does not have dot extension in bash

bash,awk,sed,lines
I am having such of file that contains lines as below: /folder/share/folder1 /folder/share/folder1/file.gz /folder/share/folder2/11072012 /folder/share/folder2/11072012/file1.rar I am trying to remove these lines: /folder/share/folder1/ /folder/share/folder2/11072012 To get a final result the following: /folder/share/folder2/11072012/file1.rar /folder/share/folder1/file.gz In other words, I am trying to keep only the path for files and not directories....

nonfatal user error in JPAQuery (QueryDSL)

jpa,querydsl
I have to add a search function using QueryDSL / JPAQuery. The search should use a table consisting of parent ids: ID LABEL P_ID 1 A null 2 AB 1 3 ABC 2 A simple SQL statement gives the right result: SELECT * FROM ACT JOIN ORG DEPT ON ACT.ORGID...

Not getting SMS_DELIEVERD Responce when sending sms via SmsManager

android
I am sending a text message using SmsManager but i am using a wrong numbers to send sms. like i am in pakistan where country code is +92 and i am using numbers like these. +92 **** i am trying different combinations of 4 digits after country code.sometimes SmsManager is...

php code to generate unique coupon no in every receipt

php
below is my code ...is it possible for you..to generate max+1 from temp. entered no. i post my code...i need is loop code start from 500 then insert value in receipt_no column like 500,501,502,503 upto reached for($row1=$bookcode;$row1<=$Temp_book;$row1++) { for($row=500;$row<=510;$row++) { $query = $database->getRow("SELECT MAX(receipt_no) AS max1 FROM scheme_master;"); $largestNumber =...

Datepicker on a div, with default value or value from querystring

javascript,jquery,datepicker
So, I'm using datepicker on a div element (so that the calender is always on). I have a default value, but I have cases where I want to start with a value from query string. I tried to put value inside the div, it is just displayed on the div...

SQL rows to columns (Pivot with just bit values)

sql,sql-server,tsql
I am trying to convert my resultant rows in to columns, but only with the bit values. To explain better what I mean, my table looks like this; Id Item ------------------- 1 TextLineA 1 TextLineB 2 TextLineA And what I am trying to achieve is a layout like this; Id...

Add a class or id to a one line Ruby 'if else' statement in Rails?

ruby-on-rails,ruby
I was wondering that can I add a class of id to a one line Ruby 'if else' statement? For example adding class:"glyphicon glyphicon-ok" to this: <%= @example.completed? ? ' Incomplete' : ' Complete' %> EDIT: Sorry for being unclear. I know how I can add a class to an...

MySQL: select the not-empty value from joined tables with the same column name

mysql,join
In my database structure I have two tables with some columns that contain the same name. For this example I have the table products and products_options. Both tables have the column sku. It is possible that the column is filled in both tables or in one of either tables. I...

Facebook Graph API User object subscriptions Whitelisting

ios,facebook-graph-api
in my iPhone app, I implemented the Facebook API, to piggy back on their user identification. Now, rather than polling Facebook every once in a while to see if the information of a logged in user has changed, I would like to use the 'User object subscriptions'. From this document...

GetFiles with spaces in filename

c#,file-upload,getfiles
I use the following code to take all the files from a directory and search for a specific file: string [] fileEntries = Directory.GetFiles("C:\\uploads"); foreach(string fileName in fileEntries) if (fileName.Contains(name)) PicturePath = fileName; where "name" is a string which I get from DB. It seems to work to an extend...

Call function when Animation finish in Swift

swift,animation
I have an animation that start with the app. When this animation finish, I need to call another function, but I don't find the process to do it. This is my animation code: func bettyAnimation(){ var betty: UIImageView = UIImageView() var bettyImageList: [UIImage] = [] for i in 1...77{ let...

Cannot execute chained promises

javascript,angularjs,angular-promise
I need to get feed using $http.jsonp after that I return deferred.resolve(feed) which should pass feed value to chained function EntryStateUrlService.getEntryStateUrl. For some reason it says FeedService.parseFeed(feedSrc) evaluated as undefined therefore then() method cannot be invoked on undefined. How to fix it? app.service('LoadData', ['FeedService', 'EntryStateUrlService', '$q', function(FeedService, EntryStateUrlService, $q) {...

Top 2 Salary Grouped By Department

sql,sql-server
Below is the table I am referring to. I want to find ou the 2 Employees in each department with highest salary....

Converting XYZ to LAB in matlab ,

matlab
I am converting XYZ values to Cie LAB, following is my code clc clear all close all X=19.4100; Y=28.4100; Z=11.5766; Xn = 94.811; % refrence white Yn = 100; Zn = 107.304; if X/Xn >(6/29)^3 fx = (X/Xn)^1/3; else fx = (841/108)* (X/Xn) +4/29; end if Y/Yn >(6/29)^3 fy =...

8086 Assembler compare two operands without CMP

assembly,8086
question: In data segment i have two arrays A,B (DW) with size 1<N<20 with some numbers (code runs only if arrays length less 20), code need to run in both arrays and check if number in same index of arrays equal, push them in to stack. Note: Need to do...

Working with promises inside nodejs controller

javascript,node.js,events,error-handling,promise
I have the following scenario; User requests files to be attached to a project Ctrl first looks to see that the user has access to the project If user has access, then allow the files to be uploaded and attached If something went wrong with the upload then return the...

Removing nested subscribeNext in reactive pipeline

ios,objective-c,reactive-programming,reactive-cocoa
I am trying to construct a reactive pipeline where a change in some input signals will trigger off an asynchronous web api request. But I do not need to perform anything in the subscribeNext block of the web api. This is how it looks: RACSignal *inputChanged = [[RACSignal merge:@[ RACObserve(self,...

INSTALL_REFERRER not received before application launched

android,android-intent,broadcastreceiver,android-broadcast
I want to catch INSTALL_REFERRER intent at my own receiver. I implemented receiver public class InstallReferrerReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.d("Broadcast", "RECEIVED!"); } } and add at Manifest <receiver android:name=".receiver.InstallReferrerReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER"/> </intent-filter> </receiver> When i want to test receiver, i...

use variable as column name in where clause in sql

sql,sql-server,ssms
I want to use a variable as column name in my SQL query. Problem: I can not use dynamic SQL as the SQL query that I have is inside of a user defined inline table function. So, 1. Can not use dynamic SQL 2. Can not replace this function with...

Add footer to UITableViewController using storyboard

ios,storyboard
So I try to add a footer to my table. And below is what I did, but the view doesn't go to the bottom of the app, instead, it will stay under the last TableCell. So how can I make it my footer for my page? ...

Would i need to form all permutations and combinations for the following?

c,algorithm,dynamic-programming,brute-force
You have a number of stones with known weights w1, …, wn. Write a program that will rearrange the stones into two piles such that weight difference between the piles is minimal.

exception (handling) in c#

c#,exception-handling,custom-exceptions
catch (Exception ex) { _errorCode = ErrorCodes.SqlGeneralError; CommonTools.vAddToLog(ex, _errorCode, _userID); throw new JOVALException(_errorCode); } I use this peace of code to handle error to an custom exception called (JOVALException) but when an exception is occurred it is open "No source available" page and telled me that is no the...

A Day at the Races - Amount is bigger than Cash [closed]

c#
I'm currently working with a project that a book has assigned for me (Head First C#, 3rd Edition) and I'm facing some problems with my code. The whole project is based on a gambling game that 3 guys can participate in. The gambling game consists of the 3 guys betting...

How to get more accurante results with Maps api with less characters

android,json,google-maps,google-maps-api-3,maps
when requesting to this url: http://maps.google.com/maps/api/geocode/json?address=Mad&sensor=false&language=EN Which (I try) means: Give me the points which addresses "contains" Mad, It returns me with some locations that have nothing to do with what I'm searching. The goal is to build an addres autocomplete on Android. This example i'm giving you is when...

Wont show image instead it gives error on my masterpage layout. Umbraco7, razor

asp.net-mvc,razor,umbraco
Yesterday I posted a question about why i couldn't get my image to show. Cant get the image to show in Umbraco7 with razor I got great and right answers. The problem is when i use those examples of how to get image to show then i get an error...

bower config use svn

git,svn,bower
i successfully installed bower and now i want to use bower with svn+ command. Like this: bower install svn+https://github.com/twbs/bootstrap --save actully this would work, but the bootstrap package automaticly starts installing the jquery package, but without svn+. Error message: bower bootstrap#* not-cached svn+https://github.com/twbs/bootstrap#* bower bootstrap#* resolve svn+https://github.com/twbs/bootstrap#* bower bootstrap#* export...

Perplexed by how this code is processed by Haskell's Layout facility

haskell,layout,rules
Whilst browsing https://wiki.haskell.org/IO_inside, I encountered the following commentary and code ... "Moreover, Haskell layout rules allow us to use the following layout: main = do a <- readLn if (a>=0) then return () else do print "a is negative" ... that may be useful for escaping from the middle of...

Convert past date format in php

php
I'm upload the excel data into mysql. in there date save like 16.5.59(dd.mm.yy) formate. I try to change this using this code $date = '16.5.59'; echo date('d-m-y',strtotime($date)); it always show current time like 04-02-15. Pls change this to dd-mm-yyyy formate. Thanks in Advance....

How can i make toggle from left whitout jquery-ui

javascript,toggle
How can i make toggle from left without using jquery-ui $(document).ready(function(){ $("button").click(function(){ $("#content").slideToggle(); }); }); <div id="content">This is a paragraph.</div> <button>my toggle</button> #content { background:khaki; padding:10px; } http://jsfiddle.net/kashifkiduniya/w6xzq5n4/1/...

Prevent browser from caching link destination

asp.net-mvc
I have an ASP.MVC application. There are some sites in the application which are accesible only with certain user permissions. If user doesn't have required permissions I am redirecting to another controller and displaying page with Not authorized message. When user without permission tries to visit restricted page using a...

Mounted lvm volume not passed to container

docker
I'm running out of space on my docker container so I decided I'll create lvm volume on host, mount it to /mnt/data and pass it to docker using docker run -v /mnt/data:/mnt -i -t fedora:wrt /bin/bash But when I do that, my /mnt dir inside container appears empty, if I...

Pusher: Decrease timeout for connection state

java,websocket,timeout,pusher
I'm currently experimenting with websockets using the Pusher library for Java. Pusher automatically changes its connection state from CONNECTED to DISCONNECTED if the internet connection is lost. However, this only seems to happen after 150 seconds of being disconnected. This is very unfortunate as in those 150s, a lot of...

Replacing levels of multiple factors

r,rename,level,factors
I would need to replace the levels of multiple factors in one data frame, so they would be all unified. These are, for example, the levels in the one of those factors: > levels(workco[,5]) [1] " " "1" "2" [4] "kóko" "kesätyö" "Kesätyö kokoaika" [7] "koko" "kokop" "kokop." [10] "Kokopäivä"...

Issue displaying JSON through a service with Angular

json,angularjs
I have created a service which reads json and returns data. But for some reason it does not seem to work and is not giving me an error - which is making it really hard to debug. I was hoping someone here might find the issue. First up, I have...

Solved: HTMLParser does not parse the entire input

class,python-3.x,html-parsing
[Sry, I don't know which keywords might give an answer to my question, although it might be a general one. I was not able to find other questions pointing at my problem.] I wrote some scripts in python, but never really got in contact with classes. Now I need one...

Hyphenator.js not working when class is added with jQuery

javascript,jquery
I'm currently looking into hyphenation and due to the lack of hyphens support in Chrome and other browsers I decided to use the Hyphenator.js script. That works all fine but for reason it breaks when I add the hyphenate class, to trigger the Hyphenator.js script, with jQuery like below: $(function()...

How to keep an empty slice area in highcharts after clicking on legendItem [duplicate]

charts,highcharts
This question already has an answer here: How to disable legend click to stop pie slice from disappearing in Highcharts? 1 answer In this example http://www.highcharts.com/demo/pie-legend label click, sliced the part of pie chart. I need to set visible to clicked pie chart part, but when I use setVisible...

Order results by two differents fields in entity framework

asp.net-mvc,entity-framework
I have advertisement table, i want to order it first by special, then order by last added, but special ads has end date, so i want to order special ads that its date is still This is my code List<S_Advertisements> moduleItems = db.S_Advertisements .Include(x => x.S_AdvertisementsImages) .Where(x => x.CatId ==...

How can I stop event to trigger in other magento module

magento,events,triggers
I have a magento extension which sends user data to an aPI on newsletter_subscriber_save_before event. But now I have to send something more to that api and that new var is only available at newsletter_subscriber_save_after. Question is how can I stop newsletter_subscriber_save_before for that module with out removing from extenion's...

elasticsearch phrase_prefix expected results

elasticsearch,elasticsearch-marvel
I'm having some weird behavior with elastic search. I'm using custom analyzer with custom tokenizer which spilts the words in case of space, + , -. when I'm searching { "query": { "match_phrase_prefix": { "name.default": { "query": "paris oly" } } } } I get results as expected paris olympia...

Why do inherited data annotations stop working?

c#,asp.net-mvc-5,data-annotations
If someone misses the tags: I'm using .NET MVC5 to develop a web application, and using data annotations for validation (both client and server side). I wanted to customise the built in annotations (Required, StringLentgth, Range etc.) to suit my needs a little better. I started by making my own...

How to group all recorders that start with a number together

ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,rails-activerecord
I have a simple rails blog that displays the list of all artist and I would like to group all those that start with a number in a group called 0-9, followed by a, b, c, d where a, b, c, d displays artists that start with those respective characters....

mono - the requested feature is not implemented - what feature?

c#,mono
I'm receiving this error when I start my application but I have NO idea what feature isn't implemented. It doesn't print anything to the console or tell me what isn't implemented. Is there a way to figure this out? The only thing I have to go on is this error...

Run the following method three times with a 1s break on each attempt before throwing exception

c#
Is it possible to run the following method 3 times (specifically the code within the try) before throwing an error message (i.e. fail-retry, fail-retry, fail-retry, throw error message), with a break of 1 seconds between each attempt? public static int CheckBidDuplicate(int plotId, int operatorId) { const string query = "SELECT...

Android Performance [closed]

java,android,performance,code-execution
My android application growing and getting more interactive. Now I'm wondering are there methods to make the Code more efficient except this Android Performance tips How I can measure method call efficiency?...

ifelse with multiple condition for creating new variable in data.table R [duplicate]

r,if-statement,data.table
This question already has an answer here: R - boolean operators && and || 3 answers I have a data.table and want to create a new variable based on multiple conditions in an ifelse statement but what I get as a result seems to be strange. Let's imagine the...

How to edit MULTIPLE rows/data entries in SQL Server Management Studio [closed]

sql,sql-server,edit,ssms
I want to update/edit multiple rows in a database using SQL Server Management Studio. I know you can edit one entry using solutions provided here, here or here using Edit Top(200) function. But I want to edit >100 entries so this is not an adequate solution. I am using SSMS...

Copy char input into array of strings

objective-c,c,arrays,char
I'm currently refreshing my C skills and having trouble with the following code: int main (int argc, const char * argv[]) { @autoreleasepool { int numberOfTestCases; scanf("%d", &numberOfTestCases); char *a[numberOfTestCases]; for (int i = 0; i < numberOfTestCases; i++) { char input[100]; scanf("%s", input); a[i] = input; } for (int...

Iterating over IEnumerable using foreach skips some elements

c#,ienumerable
I've faced with difference in behavior between iterating over enumerable and over enumerable.ToList(). public static void Kill(Point location) { Wound(location); foreach(var point in GetShipPointsAndTheirNeighbors(location).ToList()) { CellsWithShips[point.X, point.Y] = false; } } /// <summary> /// This version does not work for strange reasons, it just skips a half of points. See...

Parse a big file and populate a Neo4j database

ruby-on-rails,neo4j,neography
I am working on a Ruby on Rails project that will read and parse somewhat big text file (around 100k lines) and build Neo4j nodes (I am using Neography) with that data. This is the Neo4j related fraction of the code I wrote: d= Neography::Rest.new.execute_query("MATCH (n:`Label`) WHERE (n.`name`='#{id}') RETURN n")...

Capture Image using WP.1 store app

c#,camera,windows-phone-8.1
I am developing an Windows Store App in WP8.1. I need to take photo through camera and save it and use it for showing but it throws exception everytime. My code is-- async private void capturePhoto_Tapped(object sender, TappedRoutedEventArgs e) { try { MediaCapture mediaCapture = new MediaCapture(); StorageFile sf =...

BUILD FAILED by org.grails.plugins: spring-security-core:2.0-RC4 on Gradle

grails,spring-security,gradle
I just started to make a Grails-application with Gradle. But, it does not work well. I configured the build.gradle like below. buildscript { repositories{ jcenter() } dependencies { classpath 'org.grails:grails-gradle-plugin:2.1.2' } } apply plugin: 'grails' version = '0.0.1' grails{ grailsVersion = '2.4.4' } repositories { grails.central() mavenLocal() mavenCentral() maven {...

Jetty: is it possible to use SPDY/3.1?

java,jetty,spdy
I run Jetty server using JDK 1.8 and ALPN as described at: How to run Jetty with SPDY using ALPN? There is line: ALPNServerConnectionFactory alpn = new ALPNServerConnectionFactory("spdy/3", "http/1.1"); and: HTTPSPDYServerConnectionFactory spdy = new HTTPSPDYServerConnectionFactory(SPDY.V3, httpConfig, push); But Chrome 40 uses only "spdy/3.1" and "http/1.1". With ALPN debug enabled it...

cakephp saving data from different tables

cakephp,cakephp-2.0
I'm having a problem on saving the data inputted in the package and image table because I want to save both's data at the same time. I have a table for Package and Image. The Image table consist of (id, package_id, and image). Package hasmany Image and Image belongs to...

Using datepick function inside another datepick function

jquery,validation,date,datepicker
I am having two date picker. If first date is selected as 20 February, then the second date picker's maximum date should be February 20. How to make this work. I am using keith-wood js. This is my code. $("#campusOnDate").datepick({ onSelect: function(dates) { var campusOnDate = document.getElementById('campusOnDate').value; var firstIndex =...

What is difference between below two multithreaded java codes?

java,multithreading
Want to know difference between below two codes My first code is package com.app.myclasses; class RunnableTest implements Runnable { @Override public void run() { // TODO Auto-generated method stub for (int i = 0; i < 5; i++) { System.out.println(i); } } } public class ThreadTesting { public static void...

How bad is $wp_rewrite->flush_rules() on 'init' action hook?

wordpress,performance,rewrite
According to the Codex: [...] This function can be extremely costly in terms of performance. It should be used as sparingly as possible - such as during activation or deactivation of plugins or themes. Every attempt should be made to avoid using it in hooks that execute on each page...

Cookie possibly not set or overflowed because it was too large

ruby-on-rails,angularjs
Using a tutorial on how to implement rails authentication with devise and angular as front end. http://www.sotoseattle.com/blog/2014/10/30/Devise-Angular-Rails/ All good except the cookie error I get when I try log in, or when I signup, cause after a valid signup user is signed in automatically. Error I get is: Cookie 'logged_user'...

PHP compare two text files by lines

php,file
I need to compare two language files - English and German. Each text file has one word/phrase per line. Word/phrase [x] in first language is word/phrase [x] in second language. The translated word is on the same line in the second file. I tried to get the translation using the...

UIWebView - Set default date programmatically

javascript,ios,html5,uiwebview
I'm trying to display default date in input embedded in iOS UIWebview : <input type="date" id="startDate" format="dd/mm/yyyy" /> by using this javascript code : var myDate = new Date(); document.getElementById("startDate").value = myDate.getDate()+1.0 + "/" + (myDate.getMonth() * 1.0 + 1.0 * 1.0) + "/" + myDate.getFullYear(); The date appears only...

SharePoint Online (Office 365) login form in a Office task pane app

office365,sharepoint-online,apps-for-office
The end goal of what I am trying to achieve is to open a page from a SharePoint Online instance - any page, it doesn't matter - in a Office Task Pane app. The issue is that the login page (https://login.microsoftonline.com) is shown fine, but when you click 'login' it...

Basic laravel route password protection without setting up database?

php,laravel,laravel-4,basic-authentication
I'm looking for a dead simple password protection solution (username and password stored as key-value pair in array) to a domain (example.com/demo). I know this is bad practice in production but this is just a quick demo to someone. The code I have currently is pretty trivial stuff: Route::group(['prefix' =>...

Condition for some column in foreign key

sql,sql-server,tsql,foreign-keys,constraints
There is table A with columns (Id, BId). BId is foreign key to table B. B has columns (Id, Type). CREATE TABLE [A] ( [Id] INT IDENTITY CONSTRAINT [PK_A_Id] PRIMARY KEY, [BId] INT NOT NULL CONSTRAINT [FK_A_B] REFERENCES [B](Id) ) GO CREATE TABLE [B] ( [Id] INT IDENTITY CONSTRAINT [PK_B_Id]...

Incompatible pointer types assigning to 'NSString *' from 'NSMutableArray *'

ios,objective-c,pointers,nsmutablearray,xcode6
I'm presently taking an iOS development course and this line of the code I've encountered in the course generates this warning: Incompatible pointer types assigning to 'NSString *' from 'NSMutableArray *'. media.comments = randomComments; The array is created in this line: NSMutableArray *randomComments = [NSMutableArray array]; I tried adding mutableCopy...

Launch directions from Android Wear app

android,google-maps,android-wear
Hi Android developers, Google Maps Micro (Maps for Android Wear) does not work like the Google Maps for smartphone. The app just crashes when using the classic intent : Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("google.navigation:q=48.649469,-2.02579")); startActivity(intent); So, how to start directions from an Android Wear app? Julien...

ADB echo gives “No such file or directory”

android,echo,adb
I'm trying to write text to a file with adb and stumble on some problems. If I do it in two steps, like this: adb shell echo "hello" > /sdcard/temp/hello.txt it works. But if I try to do it on one row like this: adb shell echo "hello" > /sdcard/temp/hello.txt...

JScrollPane loses scroll position when focus lost [closed]

java,swing,jscrollpane
I'm working on a legacy swing application. This app has a customised JTextArea in a JScrollPane. The problem I have is that when the application loses focus (e.g. Alt-Tabs to another app), the scrollbar and caret position return to the top. What I want to happen is that when focus...

Get current line text when some previous lines was collapsed

java,eclipse,eclipse-plugin,swt,text-editor
Im trying to get the text beginning of the current line to the mouse cursor. ITextSelection textSelection= (ITextSelection) textEditor.getSelectionProvider().getSelection(); IRegion lineInfo = null; int offsetCurrentCursor = textSelection.getOffset(); int offsetLine; // THIS IS THE VALUE THAT I WANT try { int lineNumber = document.getLineOfOffset(offsetCurrentCursor); lineInfo = document.getLineInformation(lineNumber); offsetLine = lineInfo.getOffset(); }...

Store and retrieve checkbox state in wordpress using database

php,wordpress
I am developing a WordPress plugin. I want to create checkbox as per user roles in WordPress and disable some features for checked user roles. Is there any way to store checkbox state in the database and retrieve it from the database.

Passing optional arguments to a function (where they are also optional)

function,coldfusion,optional-arguments
Background I am experiencing a problem when I attempt to pass optional arguments to another function. The function being called also has optional arguments so I'm trying to get that optionality to propagate all the way through. The problem I'm experiencing is that since cold fusion doesn't have a concept...

mysql selecting room types issue

php,mysql,sql,mysqli,phpmyadmin
i have two tables as below, For each hotel there will be room types and for each room type there will be rooms..So under each hotel i want to show the room types assigned to them and all the rooms assigned to that room type. Room types Table ID ||...

Visual Basic and MySQL [closed]

mysql,vb.net,security,login
I need to build an application in Visual Basic 2010 to connect to a MySQL database. I saw many examples for that, but i've a question: should the login form be the first or the splashscreen ?? should i check the connection before the login form appears ou after ?...

Sort XML in alphabetic Order [duplicate]

xml,bash,sorting,xslt
This question already has an answer here: Sort XML nodes in alphabetical order using XSL 1 answer I have an xml config file: <icecast> <mount> <mount-name>/yourradio.mp3</mount-name> <accesslog> <name>/access/yourradio/yourradiomp3.log</name> <duration>86400</duration> <archive>true</archive> <size>20000000</size> </accesslog> </mount> <mount> <mount-name>/aire.mp3</mount-name> <accesslog>...

Avoid leak in Boost Log trivial usage

c++,logging,boost,memory-leaks,boost-log
I am getting valgrind leak reports from a server side application that use boostlog that is distributed with boost 1.56. the valgrind report is : ==8021== 37,088 bytes in 1,159 blocks are definitely lost in loss record 1,613 of 1,642 ==8021== at 0x4A05588: memalign (vg_replace_malloc.c:727) ==8021== by 0x3FDA61118F: tls_get_addr_tail (in...

h4 HTML tag affecting div alignment

html,css
I'm testing out some web layout, and I've come across a curious problem. When I use an h4 tag in the top of a div, it "pushes" the div downwards. It's easily fixed by adding a padding (or other things) to the div element, but I would like to know...

Best Practices when using Application Keys on Server and Git Repo

node.js,git,twitter,parse.com,cloud
What are the best practices for using application keys (such as Twitter API keys or Parse.com keys) on a server? We have some NodeJS code that needs to be deployed to a cloud server that will access the Twitter and Parse.com API. Is it safe to push the keys in...

Find previous class anywhere on page with JQuery

jquery
I want to find the previous class .parent-row on click of .add-image Following is the HTML: <form> <div class="row parent-row"> <div class="col-xs-9"> <div class="form-group form-group-default"> <label>Exercise Name</label> <input type="text" class="form-control" name="data[img][0][]" required> </div> </div> <div class="col-xs-3"> <a href="javascript:void(0)" class="text-info small add-extra"><i class="fa fa-plus"></i> Add Exercise</a> </div>...

“Load more” content from the server and add it to the page

ember.js,pagination,ember-cli
I've waded through a lot of pages/questions regarding pagination/infinite scrolling/load more content. Either the content is pre-loaded completely in the store or the examples requesting new data simply don't work. I've got a blog displaying 5 posts then a 'load more' button. Upon hitting this button I'd like to request...

Synchronous XMLHttpRequest warning and