Posts

Showing posts from July, 2015

jQuery tabs: append active tab ID to all href attributes in a list -

i have list of links: <ul class="links"> <li><a href="link-1.html">page 1</a></li> <li><a href="link-2.html">page 2</a></li> <li><a href="link-3.html">page 3</a></li> </ul> and below jquery tabs: <div id="tabs"> <ul> <li><a href="#tabs-1">first</a></li> <li><a href="#tabs-2">second</a></li> <li><a href="#tabs-3">third</a></li> </ul> <div id="tabs-1">first tab content</div> <div id="tabs-2">second tab content</div> <div id="tabs-3">third tab content</div> </div> when clicking on tab i'd id of active tab appended of href attributes in list of links. example, if second tab active, list of links be

c# - Can't detect Right Click on listBox in MVVM -

i don't understand why can't detect right click on list box when use mvvm. use event trigger events doesn't work. <listbox x:name="playlistslist" itemssource="{binding playlistslist}" horizontalalignment="left"> <i:interaction.triggers> <i:eventtrigger eventname="mouserightbuttondown"> <i:invokecommandaction command="{binding newplaylistcommand}"/> </i:eventtrigger> </i:interaction.triggers> </listbox> my command "newplaylistcommand" never call. me ? thank you. edit: found solution problem, used contextmenu interact listboxitem <listbox.itemtemplate> <datatemplate> <stackpanel x:name="listbox"> <textblock text="{binding name}"/> <stackpanel.contextmenu> <contextmen

dataframe - copying data from one data frame to other using variable in R -

i trying transfer data 1 data frame other. want copy 8 columns huge data frame smaller 1 , name columns n1, n2, etc.. first trying find column number need copy using this x=as.numeric(which(colnames(old_df)=='n1_data')) then pasting in new data frame way new_df[paste('n',1:8,'new',sep='')]=old_df[x:x+7] however, when run this, new 8 columns have same data. however, instead if directly use value of x, want like new_df[paste('n',1:8,'new',sep='')]=old_df[10:17] so questions are why not able use variable x. added as.numeric make sure number not list. however, not seem help. is there better or more efficient way achieve this? if i'm understanding question correctly, may overthinking problem. library(dplyr); new_df <- select(old_df, n1_data, n2_data, n3_data, n4_data, n5_data, n6_data, n7_data, n8_data); colnames(new_df) <- sub("n(\\d)_data", "n\\\\1&q

ios - JsonModel NSString transform null to empty string -

i using jsonmodel in application. possible prepare category jsonvaluetransformer transform nil/null nsstring empty string (@""). far when property in json response null, property in object becomes @"". because whole api not (it's external) avoid overriding initwithdictionary in every object , use valuetransformer every jsonmodel class nsstring property , map correct string or empty string if nil/null. after getting response, run following loop response dictionary , key. for (id dictionary in [[responsedictionary valueforkey:@"responsekey"] allkeys] ) { ([[responsedictionary valueforkey:@"responsekey"] valueforkey:dictionary] == [nsnull null]) ? [[responsedictionary valueforkey:@"responsekey"] setvalue:@"" forkey:dictionary] :[[responsedictionary valueforkey:@"responsekey"] setvalue:[[responsedictionary valueforkey:@"responsekey"] valueforkey:dictionary] forkey:dictiona

java - BaseAdapter Fragment Change page -

Image
public class listviewadapter extends baseadapter { . . . programlarfragment myfragment = new programlarfragment(); bundle bundle = new bundle(); bundle.putstring("asd","asdasdasdasd"); myfragment.setarguments(bundle); android.support.v4.app.fragmenttransaction fragmenttransaction = getsupportfragmentmanager().begintransaction(); fragmenttransaction.replace(r.id.fragment_container, myfragment); fragmenttransaction.commit(); getsupportfragmentmanager error me pls assuming context object appcompatactivity or actionbaractivity (deprecated) try doing this; programlarfragment myfragment = new programlarfragment(); bundle bundle = new bundle(); bundle.putstring("asd","asdasdasdasd"); myfragment.setarguments(bundle); /* use passed in context value , cast class has getsupportfragmentmanager assuming class creates adapter 1 of these class instances ei

angular ui bootstrap - md-button position alignment in the form -

Image
i'm using ng-include call form "test_form", upon display buttons align @ center. how can align them @ bottom right of form. index.html <div class="col-sm-6 sidenav"> <!-- menu bar content @ top --> <div class="column-nav-form" ng-include = "'/views/html/test_form.html'" > </div> test_form.html <form name="testform" ng-app="myapp" ng-controller="formcontroller" class="container-fluid" ng-submit="submit()"> <!-- form labels --> <md-button class="md-raised md-primary testform" type ="button" ng-click ="reset()">cancel</md-button> <md-button class="md-raised md-primary testform" ng-disabled="testform.$invalid">save</md-button> </form> css .md-button.md-raised.md-primary.testform { position: right !important; color: #ffffff; background-col

javascript - Regex match start of string inside lookahead -

i trying match word hello on first , third lines: hello should matched not want hello matched hello should matched when use ^\s*hello , things work not want spaces included in result. (?=\s*)hello closer matches 3 hellos. i expected either ^(?=\s*)hello or (?=^\s*)hello work, , confused why don't. why don't these work , how can create regex matches only "hello" after whitespace? create capture group: str1 = ' hello should matched'; str2 = 'i not want hello matched'; str3 = 'hello should matched'; str1 = str1.match(/^\s*(hello)/); if (str1) { str1 = str1[1]; } else { str1 = ''; } str2 = str2.match(/^\s*(hello)/); if (str2) { str2 = str2[1]; } else { str2 = ''; } str3 = str3.match(/^\s*(hello)/); if (str3) { str3 = str3[1]; } else { str3 = ''; } $('#output').append('str1: ' + str1 + '<br>str2: ' + str2 + '<br>

excel - Convert inputbox data entry to cell data entry -

i want create guessing game without using input boxes. want code read guesses on column , tell me if right or wrong in column c. macro numbers 1 - 10 , macro should go through each guess. here's code - sub vbaguessinggame() dim secret integer dim guess integer dim tries integer randomize 'initializes random-number generator secret = int((10 * rnd) + 1) 'generates random number between 1 , 10 guess = 0 tries = 0 while guess <> secret guess = inputbox("guess number between 1 , 10.") if guess = secret tries = tries + 1 msgbox ("you guessed number!") msgbox ("it took " & tries & " guess number") elseif guess > secret tries = tries + 1 msgbox ("wrong. high. try again.") else tries = tries + 1 msgbox ("wrong. low. try again.") end if loop end sub put behind sheet1(sheet1), if that's sheet you're us

javascript - Angular multiple transclude dynamic number of elements -

angular 1.5 enables ability multi transclude . notably, it'd useful able transclude dynamic number of items directive , declare names , locations of transcludes @ later time (e.g. in link/compile). to further illustrate, want ability like: //example usage of directive <multi-slot-transclude-example> <transclude1>test1</div> <transclude2>test2</div> <transclude3>test3</div> <transclude4>test4</div> .... dynamic number of items ... </multi-slot-transclude-example> //example of directive dynamically transcludes multiple items angular.module("multislottranscludeexample", []) .directive("directivename", function(){ return { restrict: 'e', transclude: { 't1': '?transclude1', 't2': '?transclude2', //i'd list able defined non-statically (e.g. in link) }, template: '<div ng-re

Build real time notification using comet in php -

i want build real time notification system facebook , google+. know using comet , ajax push technology that.i have found tutorial http://www.zeitoun.net/articles/comet_and_php/start link want know how can implement comet iframe technique(you can found on above link) using mysql database , how can identify user whom push data. thank you. i found link useful http://gonzalo123.com/2011/03/14/real-time-notifications-with-php/ you can learn more comet here http://www.ibm.com/developerworks/web/library/wa-reverseajax1/

string - Calculating Date in Java -

ok trying create date in format: simpledateformat dateformat = new simpledateformat("dd-mm-yy"); i having trouble calculating date gives me 1/1/13. date newdate = new date (136199001); string date = dateformat.format(newdate); however can't work out how desired date. know suppose work out 01/01/70 having trouble. question : formula work date out? you can use calendar object specific date. easier. calendar cal = calendar.getinstance(); cal.set(2013, 0, 1); //1st january 2013 date date = cal.gettime(); simpledateformat dateformat = new simpledateformat("dd-mm-yy"); string datestr = dateformat.format(date);

python - Where can I find a text Thesaurus? -

i'm creating program part of it's duty search words , once found open text thesaurus , search synonym. text dictionaries easy enough find, can't seem find text based thesaurus anywhere. have ideas find this? or should make one? found answer here. sql full-text thesaurus thanks everybody...

map - What is job.get() and job.getBoolean() in mapreduce -

i working on pdf document clustering on hadoop learning mapreduce reading examples on internet.in wordcount examples have lines job.get("map.input.file") job.getboolean() what function of these functions?what map.input.file set? or name given input folder? please post answer if know. for code see following link wordcount 2.0 example= http://hadoop.apache.org/docs/r1.0.4/mapred_tutorial.html these job configurations. i.e. set of configurations passed on each mapper , reducer. now, these configurations consist of well defined mapreduce/hadoop related configurations user-defined configurations. in case, map.input.file pre-defined configuration , yes set comma separated list of paths have set input path. while wordcount.skip.patterns custom configuration set per user's input, , may see configuration set in run() follows: conf.setboolean("wordcount.skip.patterns", true); as when use get , when use getboolean , should self-explanator

c# - Stopping SqlDependency exceedingly slow -

i call in c# following stop sqldependency. rslt = sqldependency.stop(myconnstr, _notificationqueue); this takes 4-5 seconds. i've put sql profiler see happening , calls following (in single batch) , takes 4-5 seconds: exec sp_executesql n'begin transaction; drop service [sqlquerynotificationservice-45558b70-3adc-414b-9f7b-1da40abfc5b6]; drop queue [sqlquerynotificationservice-45558b70-3adc-414b-9f7b-1da40abfc5b6]; drop procedure [sqlquerynotificationstoredprocedure-45558b70-3adc-414b-9f7b-1da40abfc5b6]; commit transaction;', n'@p2 int', @p2 = 60000 why slow , how speed up?

ios - how to Remove Dynamically Created UIView and UILabel text? -

i adding dynamic uiview named *cellseparator , other uilabels...now happen when again call code rewrite label text , overwrite on created label text...i not aware ios development.so can please tell me how can remove uiview dynamically before creating again?beacause uiview dynamically created dont know how remove uiview uilabel *indexlabel = [[uilabel alloc] initwithframe:cgrectmake(20, self.view.frame.size.height-150, self.view.frame.size.width/2,30)]; [indexlabel setbackgroundcolor:[uicolor clearcolor]]; indexlabel.textcolor = [uicolor whitecolor]; indexlabel.text = @"details:-"; indexlabel.font = [uifont systemfontofsize:20.00]; uilabel *taglabel = [[uilabel alloc] initwithframe:cgrectmake(20, self.view.frame.size.height-120, self.view.frame.size.width/2, 30)]; taglabel.backgroundcolor = [uicolor clearcolor]; nslog(@"log %@",imageid); nslog(@"log %@"

mysql - JPA one-to-many delete and set foregn key to null -

i use spring data, jpa, hibernate , mysql. have 1 many relation between event , category. 1 event can have 1 category , 1 category can assigned many events. problem appears when try remove category, if event hold foreign key of category error. set foreign key in event table null when category deleted. @ moment update events setting foreign key explicitly in code updating null before deletion of category. there way of doing in use of annotations? this category: @entity @table(name = "category") public class category implements serializable{ @onetomany(mappedby="category", targetentity=event.class, fetch=fetchtype.lazy, cascade= {cascadetype.detach, cascadetype.merge, cascadetype.persist, cascadetype.refresh}) public set<event> getevents_category() { return events_category; } } and event class: @entity @table(name = "event") public class event implements serializable{ @manytoone(cascade={cascade

OpenCV Python, reading video from named pipe -

i trying achieve results shown on video (method 3 using netcat) https://www.youtube.com/watch?v=sygdge3t30o the point stream video raspberry pi ubuntu pc , process using opencv , python. i use command raspivid -vf -n -w 640 -h 480 -o - -t 0 -b 2000000 | nc 192.168.0.20 5777 to stream video pc , on pc created name pipe 'fifo' , redirected output nc -l -p 5777 -v > fifo then trying read pipe , display result in python script import cv2 import sys video_capture = cv2.videocapture(r'fifo') video_capture.set(cv2.cap_prop_frame_width, 640); video_capture.set(cv2.cap_prop_frame_height, 480); while true: # capture frame-by-frame ret, frame = video_capture.read() if ret == false: pass cv2.imshow('video', frame) if cv2.waitkey(1) & 0xff == ord('q'): break # when done, release capture video_capture.release() cv2.destroyallwindows() however end error [mp3 @ 0x18b2940] header missing error produ

Running individual XCTest (UI, Unit) test cases for iOS apps from the command line -

is possible run individual test cases, or individual test suites, ios app test target, instead of test cases, command line interface? you can run tests command line xcodebuild , out of box. when so, run of test cases contained in test target you've selected. you can scan fastlane, though believe you're restricted running of tests of build scheme select (as above), it's not different xcodebuild. you can run specific tests xctool facebook, doesn't use xcodebuild, , restricted running on simulators only, not actual ios test devices. i found reference running xctest command line utility directly, seems undocumented feature , targets deriveddata. complicated fact ui tests, have *xctest files in separate xctrunner bundle . i in similar situation , have built python script triggers set of test case/s want. little bit elaborate process works me , has been useful on time in implementing dataprovider methods, rerunning of failed test cases , other customiz

node.js - Winston logging with HAPI does not work -

i have project winston logging enabled , project uses hapi. have following code: logger.js --------- var winston = require('winston'); winston.emiterrs = true; var logger = new winston.logger({ transports: [ new winston.transports.console({ level: 'debug', json: false, colorize: true }) ], exitonerror: false }); module.exports = logger; module.exports.stream = { write: function(message, encoding){ logger.info(message); } }; server.js --------- var hapi = require('hapi'); var logger = require('./conf/logger.js'); var server = new hapi.server({ }); server.connection({ port: 3000 }); server.register([require('./modules/healthcheck.js'), require('vision')], (err) => { if (err) { console.error('failed load plugin:

c# - Multiple column sorting in Gridview? -

hi want sort multiple column in gridview shown here hierarchical (multi-column) sorting .net gridview? i did home work aspx looks <%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="_default" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="head1" runat="server"> <title>multiple sorting gridview</title> </head> <body> <form id="form1" runat="server"> <div> <asp:gridview id="gridview1" runat="server" autogeneratecolumns="true" allowsorting="true" onsorting="gridview1_sorting" style="margin-right: 541px" width="873px"> &

jquery code in drupal 7 module -

how dispaly following code in drupal 7 module <script type="text/javascript" src="http://dubturbo1.counselstime.com/jwplayer/jwplayer.js"></script> <script>jwplayer.key="76oyax0savqgdm580aj3+k23kiun8hfkgahyrq=="</script> <div id="my-video"></div> <script type="text/javascript"> jwplayer('my-video').setup({ file: 'http://192.168.1.150/sathya/video_test_512kb.mp4', width: '500', height: '300', controls: 'false', autostart: 'true', }); </script> you need add js file, either within module (if necessary) or otherwise put within themes js file if don't need module doing. wrap in drupal behaviours wrapper: (function($) { drupal.behaviors.setupvideo = { attach: function (context) { wplayer('my-video').setup({ fil

typescript - Angular2 - Defining/Injecting Singleton -

i have alert directive defined, so: import { component } 'angular2/core'; import { core_directives } 'angular2/common'; import { alert } 'ng2-bootstrap/ng2-bootstrap'; @component({ selector: 'alert_directive', templateurl: './shared/directives/alert/alert.html', directives: [alert, core_directives] }) export class alertdirective { alerts:array<object> = [ ]; closealert(i:number) { this.alerts.splice(i, 1); } addalert(message: string, style: string) { this.alerts.push({msg: message, type: style, closable: true}); console.log(this.alerts); } } i define app component include directive: import {alertdirective} '../../shared/directives/alert/alert'; ... @component({ selector: 'app', templateurl: './app/components/app.html', styleurls: ['./app/components/app.css'], providers: [userservice, http_providers], encapsulation: viewencapsulation.none, directives: [rout

reactjs - ComponentDidMount vs ComponentWillMount? -

i have question regarding when componentdidmount , when fires, i'm new working react, , examples documentation vague. why component not firing? var app = react.createclass({ getinitialstate: function() { var events = ['initial state has been called']; return { events: events } }, componentwillmount: function() { return { mount: this.state.events.push('componentwillmount has been called') } }, componentdidmount: function() { return console.log('mounted!'); }, render: function() { var eventmap = this.state.events.map(function(event, i) { return <li key={i}>{event}</li>; }) return ( <div> <ul> {eventmap} </ul> </div> ) } }) reactdom.render( <app />, doc

java - Prevent background process from showing up on Dock -

Image
i have java application. tasks, run jvm instance in parallel using processbuilder . i.e. main application starts jvm instance using process , both communicate using i/o. but on dock on mac, shows both process: i not want that, other process back-end work , not required shown front. risk can manually force quit process easily. what should done make sure runs on background , doesn't show on dock if back-end processor not need screen resources simplest thing launch new jvm in headless mode: java -djava.awt.headless=true com.bl.processmain

Looking for a smart way to add new landing pages that are 90% similar. (asp.net) -

in asp.net website, keep adding new landing pages creating new page derives common master page. these "new" pages 90% same (only background image differs). i ended in solution 10+ similar .aspx pages. there way smarter. (not having add different .aspx every "new" page)? how adding code renders css body {background-image:url(...)} part? trick without having have code-behind dll file: <% string[] backgrounds = {"b1.jpg", "b2.jpg", "b3.jpg"}; random rnd = new random(); string background = backgrounds[rnd.next(0, backgrounds.length)]; %> <style type="text/css"> body {background-image:url("<%=background%>");} </style>

javascript - Jquery set different input text and value -

right i'm using $.val() set input's value. want user see different text in input, , still send value set val() server. tried using $.text() doesn't work. there way set html value attribute , set distinct text inside input th## heading ##e user see? i'm not posting code because pretty generic. reason need because want display nice date string in text (i'm using datetime picker) , send compacted version of string server. edit ok, hope helps: <input class="form-control date" id="booking_time" name="hour" type="text"> in javascript have like: var date_booked = new date() $("#booking_time").val(date_booked.todatestring()); but want input's value sent server date whithout todatestring proccessing, , still show date.todatestring() in text box. that, hoped work: $("#booking_time").val(date_booked); $("#booking_time").text(date_booked.todatestring()); but doesn't.

views - SQL update table via join? -

i have following database , wish update room table. table room lists room type either single, double or king, price price of each room per night , name in hotel name of hotel. what need change double rooms king rooms in scotty hotel , increase price 10%. i know how update price , type when in single table, seems here need join hotel , room on hno , update. nested query maybe? create table hotel ( hno char(4), name varchar(20) not null, address varchar(50), constraint pk_hotel primary key (hno) ); create table room ( rno char(4), hno char(4), type char(6) not null, price decimal (7,2), constraint pk_room primary key (hno, rno), constraint fk_room foreign key (hno) references hotel (hno) ); create table guest ( gno char(4), name varchar(20) not null, address varchar(50), constraint pk_guest primary key (gno) ); create table booking ( hno char(4), gno char(4), datefrom date, dateto date, rno char(4), co

ios - Custom UITableView Which is like ASP.Net Grid -

i'm trying develop ipad application , need custom uitableview similar asp.net grid. i can't use default uitableview because need more 1 column , replicates dynamically columns of dataset. i need that: http://www.c-sharpcorner.com/uploadfile/biswapinky/developing-a-multi-select-asp-net-gridview-using-jquery/images/multi_select_gridview.png i searched making customuitablecell's cannot find example that. you can just use single tableview customcell showing values in labels , use [i prefer this] or create subclass of uitableview make design in required initialize , add subviews[ in loop specifying frame width , orgin x in frame ]to view required inputs refer this , this

sql - Show the total of a column for each group in its own row -

my select statement returns: columna columnb columnc date "this" 5 3 "this" 5 3 "this" 5 3 "that" 10 5 "that" 10 5 "that" 10 5 i need select return this: columna columnb columnc date "this" 5 3 "this" 5 3 "this" 5 3 total 15 9 "that" 10 5 "that" 10 5 "that" 10 5 total 30 15 i need group column , show total each group in own row. date populated in code. all can think of selecting column possibilities, looping through columna names, selecting column name, unioning each of these each other. there better way this? i think can grouping sets . however, don't have unique identifiers each row. so, think logic: with t ( select t.*, row_number() on (order (select null)) seqnum (<your q

php - Are there any ways to integrate fingerprint biometrics on HTML5 or Javascript? -

i have new project requires fingerprint bio metrics. a regular fingerprint scanner device used have less idea on how use web technologies(html,js,etc...) device, know 1 way through java. wondering if possible done using basic web technologies javascript, html5 or php. all need save image of scanned fingerprint specific file not sure if html5 or javascript alone can this. i need know if possible , how. solutions do. thanks firstly let me explain basic concept. external devices interact , need device driver in pc , software co-ordinates device driver receive input , send outputs device. you cannot sole html/js alone.also php meant meant server side. if possible sdk/software supports uploading internet, can post & verify data internet using php server. if prefer go java, can refer below post: how capture biometric information on webpage using java

c# - Post form data to server as object -

asp.net can wonderful things. possible send form data objects server? for example, have simple object: public class myclass{ string a; string b; } i make simple form: <form> <input type="text" id="a" value="aaaa"> <input type="text" id="b" value="bbbb"> </form> how send object? public void savedata(myclass postdata){ } yes, possible. model binder can examine posted values , attempt convert them model object. from the documentation a model binder in mvc provides simple way map posted form values .net framework type , pass type action method parameter. binders give control on deserialization of types passed action methods. model binders type converters, because can convert http requests objects passed action method. however, have information current controller context. as far current code, no changes need made server other converting method return actio

html - bootstrap drop down inside navbar not correctly displayed -

the navbar bellow contains drop down menu not displayed correcly , <div style="margin: auto; width: 100%; margin-top: 0px"> <div class="navbar" style="width: 100%"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="brand" href="#">acceuil</a> <div class="nav-collapse collapse navbar-responsive-collapse">

c - Error building NumPy with MKL on OSX with Python 3.3 -

background using 2012 imac 2nd-gen core i7 processor, i'm trying build numpy 1.7.0 (and scipy ) on osx 10.8.3 linked mkl included in evaluation versions of intel's c++ composer xe 2013 , fortran composer xe 2013 osx. following this article on intel's site (loosely adapted, it's not specific in cases) settings, compiler flags, etc. problem using either: $ python3 setup.py config build --compiler=intelem --fcompiler=intelem or $ python3 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem i same error: running build_clib customize intelem64tccompiler customize intelem64tccompiler using build_clib running build_ext customize intelem64tccompiler customize intelem64tccompiler using build_ext building 'numpy.core._dummy' extension compiling c sources c compiler: icc -m64 -march=corei7 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -

ios - NSJSONSerialization Causing Crash in Swift when Verifying App Receipt -

i trying verify app receipt , have done code found online. however, simulating event user not connected internet when attempting validate receipt , getting crash when doing so. following do/catch method causes crash @ anyobj line when device not connected internet: func validaterecipt(){ var response: nsurlresponse? var error: nserror? var receipt: nsdata = nsdata() if let url = nsbundle.mainbundle().appstorereceipturl { if let appreceipt = nsdata(contentsofurl: url) { print("receipt found") receipt = appreceipt }else { print("receipt not found") } }else { print("could not load receipt") } //https://buy.itunes.apple.com/verifyreceipt let request = nsmutableurlrequest(url: nsurl(string: "https://sandbox.itunes.apple.com/verifyreceipt")!, cachepolicy: nsurlrequestcachepolicy.useprotocolcachepolicy, timeoutinterval: 10) let ses

javascript - how to load sibling and there child attribute value -

i try code:- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript" src="jquery.js"></script> <script> function load() { var select = $('#myselect'); var xml = ['<child_2 entity_id="2" value="root" parent_id="1">', '<child_4 entity_id="4" value="activities" parent_id="2">', '<child_10066 entity_id="10066" value="physical1" parent_id="4">', '<child_10067 entity_id="10067" value="cricket" parent_id="10066">', '<child_10068 entity_id="10068" value="one day" parent_id="10067"/>', '</child_10067>', '<

java - How can I get the server-side chart from json -

i have string json example: {"records":[{"x":"02.04.2013","y":31.1093},{"x":"30.03.2013","y":31.0834},{"x":"29.03.2013","y":30.9962}]} . how can chart on server side using java in environment app engine? use highchart api .please check http://www.highcharts.com/

Highlighting regex capture groups in notepad++? -

as of if regex 'find , replace' in notepad++ highlights entire search parameter normal text 'find'. would possible have highlight capture groups in different color can identify i'm capturing in regex? for example, if wanted match: print 'foo.' capture foo replace string, ^print '(\w+).'$ highlight entire line in grey. i'd highlight in grey, highlight foo in red, example, designate captured rather replacing , undo-ing if happened capture wrong thing. each capture group highlighted in different color, maybe blend colors if captured in multiple groups, obv simpler captures. possible in npp? for moment there no such plugin, try testing site: https://regex101.com/ shows lot of information matches. or install regexbuddy http://www.regexbuddy.com/demotest.html . can simple test there , switch notepad++.

Location-based alert using SQLite Android error force close -

i updated last post make location-based alert using sqlite database.. problem different, when try view map using location-based service function force close. this query code public boolean postcheck(string addr) { openconn(); cursor cur = db.rawquery("select * " + tablename + " " + alamat + " = " + addr, null); if (cur != null) { if(cur.getcount() > 0) { return true; } } closeconn(); return false; } then put query on location listener class class mylocationlistener implements locationlistener { //cek untuk lokasi pengguna @override public void onlocationchanged(location location) { if (location != null) { locmanager.removeupdates(loclistener); navigatetolocation(location.getlatitude(), location.getlongitude()); //cek tugas txtaddr = teksalamat.gettext().tostring();

php two self submitting forms on one page -

i have webpage form submits carry out php action. want add second form same webpage capable of self submit not having luck finding working solution setup. here webpage looks like. first, checks see if page has been submitted, , if has, redirects elsewhere. if($_server['request_method'] == "post") { header("location: viewcustomers.php"); } next, form itself. <form id="addcustomer" method="post" action=""> ..stuff.. </form> then, form action. if('post' == $_server['request_method']) { ..phpstuff.. } how adjust form action (or add another) differentiate between 2 different forms? thanks. easy! <?php if(isset($_post['action']) && $_post['action'] == 'form1') { // form 1 } else if(isset($_post['action']) && $_post['action'] == 'form2') { // form 2 } ?> <form action="#

bitmap - Double Buffering with vsync (in sync with refresh rate of screen) - C# windows forms -

i've been trying update bmp of picturebox 60 times per second line pattern changes every update. what's happening image being partially updated in between screen refreshes. so, see part of 1 pattern , part of next. need update precisely once every screen refresh. ideally, goal update buffer , copy front buffer. i've heard can use vsync in games lock front buffer such screen updated right after screen refreshes. if take advantage of locking, allow me precisely updated once per refresh. haven't been able figure out how yet. any ideas? i did try using doublebuffering = true property in windows forms. might not work picturebox. used copymemory (a native dll call) copy new pattern bitmap in picturebox. i tried use writeablebitmap same technique in last paragraph, reason buffer never copied front buffer, though did way other people suggested on stack exchange. tried couple hours or so. image never updated on screen technique. i found solution own question.