Posts

Showing posts from May, 2011

eclipse - cursor.next() always returns "java.util.NoSuchElementException" -

i writing program in java reads query results mongodb. below code (which gives exception): if(output != null){ basicdbobject wherequery = new basicdbobject(); dbcursor cursor = null; (dbobject obj : output.results()) { string userid = obj.get("userid").tostring(); wherequery.put("user_id", userid); cursor = users.find(wherequery); system.out.println(cursor.tostring()); system.out.println("this user name tweeted "+ cursor.next()); } } when run code, first value of cursor gets printed using sysout statement in last line, second value comes 'for' loop results in exception. wonder why? the sysout statement before cursor.next() prints current value in cursor time, placed there verify whether cursor has va

html - My php script wont send proper emails -

i created php script online application have built online. code seems able send emails, emails receive not contain of information filled online application. not sure wrong... help! html <html> <p align="left"><form action="application.php" method="get" enctype="multipart/form-data" name="jobapp" lang="en"> <div align="left"><strong>personal details</strong></div> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="25%" align="right" valign="top"><span id="sprytextfield1"> <label for="fullname">full name:*</label> <span class="textfieldrequiredmsg">a value required.</span></span></td> <td width="35%" align="left" valign="top">

javascript - Why the AJAX function is not getting called and alert is not getting printed upon calling the function? -

i want call ajax function once user clicks on select control or select control gets focus keyboard. html code follows : <select id="scanner" name="scanner" class="form-control"></select> the jquery-ajax function wrote follows aler("hello") not getting printed. why so? $("#scanner").bind("change",function() { alert("hello"); var mod_url = $('#mod_url').val(); $.ajax({ url : mod_url, cache: false, datatype: "json", type: "get", async: false, data: { 'request_type':'ajax', 'op':'get_all_stores' }, success: function(result, success) { alert(result); $('#scanner').html(result); }, error: function() { alert("error occured"); } }); }); in code haven't seen options html select box and, have r

Implementation of BInary Tree in java -

i trying implement binary tree in java , here code: class testclass { public static void newnode(int , node root,){ root = new node(a); system.out.println(root.data); // printing out 22 } public static void main(string args[] ) throws ioexception { node root = null; newnode(22,root); system.out.println(root.data); // giving nullpointerexception } } class node{ node left ; node right; int data ; node(int dataa){ this.data = dataa; } } i not insert new node in tree , value of root not changes when call newnode function getting correct value of root node in main function gives me null point exception why value of root not updating class testclass { public static node newnode(int , node root){ root = new node(a); system.out.println(root.data); // printing out 22 re

html - Background attribute not working CSS3 -

on site, declaring .menu tag. style in css, used .menu { background:url('images/menu.svg'); background-repeat: no-repeat; background-size:cover; background-position:center center; height:50px; width:50px; position:absolute; top:7px; left:7px; transition: .5s cubic-bezier(.67,.99,.48,.96); z-index:2000; } i expecting menu.svg show up. isn't. why? ps have tried background-image . if css file , image inside in different folder must code .menu { background:url('../images/menu.svg'); background-repeat: no-repeat; background-size:cover; background-position:center center; height:50px; width:50px; position:absolute; top:7px; left:7px; transition: .5s cubic-bezier(.67,.99,.48,.96); z-index:2000; }

php - Need to reset the file permission in plesk -

i use plesk panel upload , download files server , httpdocs folder permission being set rwx r-x --- , when try access folder not allows me access folder ftp plesk. from plesk though error following error: unable change directory /httpdocs: filemng: opendir failed: permission denied system error 13: permission denied i need change folder permission httpdocs can access files in it. i have tried refer kb parallel http://kb.sp.parallels.com/en/1528 but confused in sense how change permission. using windows pc , please guide me on , lot. i had same problem, after tried install magento plesk application manager. searched , got link http://kb.odin.com/en/124519and did article instructed. domain.tld - means particular domain name extension, such .com, .org, .net. worked, in ftp , file manager able access files , folders. resolution run commands below superuser privileges download archived shell script. unzip , execute, providing needed domain name argument:

c - Unable to understand scanf() behaviour in the following code -

input - cometq hvngat here's code - #include <stdio.h> #include <stdlib.h> #define maxlen 6 main(void) { char comet[maxlen], group[maxlen]; unsigned long int result[2] = { 1,1 }; short int i, j; scanf("%s",comet); scanf("%s",group); printf("\ncomet's name: %s\ngroup's name: %s",comet,group); printf("\ncomet's no.: %ld\ngroup's no.: %ld",result[0],result[1]); = j = 0; while(comet[i]!='\0' && i<maxlen){ result[0] *= (comet[i] - 'a' + 1); i++; } while(group[j]!='\0' && j<maxlen){ result[1] *= (comet[j] - 'a' + 1); j++; } printf("\ncomet's no.: %ld\ngroup's no.: %ld",result[0],result[1]); printf("\ncomet's no. mod 47: %ld\ngroup's no. mod 47: %ld",result[0]%47,result[1]%47); if(result[0]%47 == result[1]%47) printf(&q

java - Json to HashMap -

i have following json output, how convert hashmap using gson: { "result": { "haystack": [ "svqfd", "ucr3y", "azvb0", "drdql", "gc8lq", "jqkdk", "9ze4g", "820gw", "ekwkr", "qgdrr", "enpyz", "lf4b8", "szsut", "yo0cq", "cd1o0", "rvw8t", "eusc0", "3oemt", "6bugc", "m8pfk" ], "needle": "lf4b8" } } i tried: type stringarraymap = new typetoken<map<string, string[]>>(){}.gettype(); map<string,string[]> thecollection = gson.fromjson(output, stringarraymap); edit

javascript - onComplete() does not get called in node cron -

hi trying test out node-cron not able desired response in 1 case. i need initiate cron request 1 more time when current cron gets completed. so, need oncomplete() called not able callback. my code snippet : cronwrapper.prototype.pushnotificationcron = function() { // change console winston in real implementation. console.log('creating job'); var jobpattern = '*/10 * * * * *'; var job = new cronjob(jobpattern, onjobstarted, onjobcompleted, false); console.log('starting job'); job.start(); }; var onjobstarted = function(){ var date = new date(); console.log('cron started on \t' + date); return; }; var onjobcompleted = function(){ winston.info('job completed:'); }; output: cron started on tue dec 16 2014 12:59:40 gmt+0530 (ist) cron started on tue dec 16 2014 12:59:50 gmt+0530 (ist) cron started on tue dec 16 2014 13:00:00 gmt+0530 (ist) please point out mistake making. lib de

javascript - Smooth Transition On Hovering -

i've been working on finding way change out <img id="repair" src="http://d3vi9nkvdbmq5l.cloudfront.net/service-icons/repair.svg" using :hover image called repair_h.svg . doing placing :hover on #repair #repair :hover , giving repair background-image:url not working , think there few reasons why. that initial process...since did not work did research on how achieve correctly , found way achieve js. way less hackie other css , html solutions looking into. using js ended working great purpose of need done although there's 1 piece i'd add , i'm not quite sure how it. i'd add smooth transition between image's when hovered on. link current build http://kapena.github.io/pp_web/ icon working on here called repair services html <li> <a href="#"> <img id="repair" src="http://d3vi9nkvdbmq5l.cloudfront.net/service-icons/repair.svg" onmouseover="this.src='htt

python 2.7 - Adding of trailing slash with urllib2 -

i refer this . it seems urllib2.build_opener not add document path ( / ) if url contains domain name. example web request http://ibm.com result in: get http://ibm.com http/1.1 instead of: get http://ibm.com/ http/1.1 or: get / http/1.1 host: ibm.com as practiced other http clients such web browsers or .net's httpwebrequest. is design or bug?

javascript - Scrolling tile images with css -

i wish have row of 3 images contain around 10 images per row. the image dimensions 270x270px , should animate you'd imagine clouds floating right left on screen. i'd top row of images go right left, middle opposite direction , bottom same top @ different intervals. i'm not 100% sure on how accomplish , i'm new css animations. i've tried floating list items inside of browser appears clip ul inside of window , doesn't let float off screen. see image details the images should loop , continue show flow of images without interruption in animation or placement. any getting started appreciated. g do mean jsfiddle ? html <div class="container"> <div class="rowcontainer"> <div class="row rtl"> <div class="cell">1</div> <div class="cell">2</div> <div class="cell">3</div>

jquery - Regex replace doesn't replace the matched numbers -

i'm trying replace attribute values using regex check when try replace numbers doesn't work. when check console can see numbers getting changed correctly: ["5, 6"] //this after initial matching [4, 5] //this result after i've done converting , subtracting in for loop convert items in array integers first , subtract each 1. button.on('click', function() { var btnparent = $(this).parent().parent(); btnparent.fadeout(400, function() { btnparent.remove(); }); btnparent.nextall('li').find('input, label').each(function () { var self = $(this); $.each(this.attributes, function(i, attrib){ var attribvalue = attrib.value; var attribname = attrib.name; var intregex = /\d+/g; var originalnum = attribvalue.match(intregex); var newnum = originalnum; var newvalue; if (newnum != null) { (j

javascript - Jquery incorrectly sort <li> by id -

i have <li> sort id: <ul id="members-list"> <li id="member_8"> <li id="member_4"> <li id="member_7"> <li id="member_12"> <li id="member_11"> <li id="member_13"> <li id="member_5"> <li id="member_6"> <li id="member_9"> <li id="member_3"> <li id="member_2"> <li id="member_1"> <li id="member_10"> </ul> the code use: <script> $( document ).ready(function() { $("li[id*='member_']").sort(function (a, b) { return parseint(a.id.replace('member_', '')) > parseint(b.id.replace('member_', '')); }).each(function () { var elem = $(this); elem.remove(); $(elem).appendto("ul#members-list"); }); }); </scrip

razor - Ajax bound Telerik MVC UI Grid not using DisplayTemplate -

Image
how 1 ajax bound telerik mvc ui grid display format or else display template? looking @ example here , see grid shows "unit price" column currency symbol. looking @ razor code below see grid ajax bound. unfortunately cannot see viewmodel, "unit price" property not formatted string, since clicking edit button shows numeric textbox. have created editortemplates , displaytemplates , somehow editor templates working. my viewmodel looks this: [uihint("moneytemplate")] public decimal itemprice { get; set; } where moneytemplate name of display , editor templates views/shared/displaytemplates/moneytemplate.cshtml , views/shared/editortemplates/moneytemplate.cshtml respectively when grid shows up, display template not picked editor template is?!? this how did currency symbol show without client side template? why display template not picked up? after reading through documentation discovered answer use displayformat attribute: [uihint(

Spring Data Rest Projections with or without explicit Declaration in Repository -

what difference between creating sdr projection , (i) explicitly declaring in corresponding repository in - @repositoryrestresource(excerptprojection = usersummaryprojection.class) public interface userrepository extends jparepository<user, integer> { .. } (ii) not explicitly defining projection in repository what find when projection explicitly declared in repository , projection shown entity wherever findall or findbyid gets called. but when not declared, there option left either user / not use them so, default fields shown. some examples - i find when projection defined, link disappears. example - there userlanguage , reflanguage , say, there 2 repositories userlanguagerepository , resflanguagerepository , there reflangsummaryprojection userlanguage -> manytoone -> reflanguage reflanguage -> onetomany -> userlanguage so, going url /userlanguages or /userlanguages/{id} shows embedded data reflanguage field coming out reflangsummaryprojection

ios - How to prevent UITableViewCell to use leading space in editing mode? -

Image
i have tableview , in editing mode not want use leading space, want keep content use full available width. self.tableview.setediting(true, animated: false) i set editing style this: override func tableview(tableview: uitableview, editingstyleforrowatindexpath indexpath: nsindexpath) -> uitableviewcelleditingstyle { return .none }} uitableviewdelegate has method purpose override func tableview(tableview: uitableview, shouldindentwhileeditingrowatindexpath indexpath: nsindexpath) -> bool { return false }

Is there any way to read/modify the binary value of REG_SZ Registry Key using vbscript -

is there way read/modify binary value of reg_sz registry key using vbscript? i want change binary value of following reg_sz registry key hkcu\control panel\international\spositivesign note: asking code modify binary value (right click on key , select modify binary value) , not normal value of reg_sz binary key. please take @ screenshot in below url: [here dont want edit "select" text of adefaultselect registry key want remove 2 trailing zeroes of adefaultselect registry key] http://www.imagesup.net/?di=1614190953031 consider code set registry key wallpaper solid color . here, (string) value set "0 0 0" in following statement: wshshell.regwrite "hkey_current_user\control panel\colors\background", "0 0 0","reg_sz" nothing stops passing other valid string value regwrite , in here: wshshell.regwrite "hkey_current_user\control panel\colors\background", chr(1),"reg_sz" if mean "binary

java - Problems with Maven -

this question has answer here: deployment issue maven plugin [duplicate] 2 answers i following error when want run "mvn deploy" in project: [info] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ jimp --- [info] downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar [info] downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar (245 kb @ 188.8 kb/sec) [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 17.973 s [info] finished at: 2014-12-16t10:35:39+01:00 [info] final memory: 24m/226m [info] ------------------------------------------------------------------------ [error] failed execute goal org

haskell - partial applied function in the recursion -

i beginner in haskell. wrote function, applies function several times argument: frepeat :: (integral n) => n -> (a -> a) -> -> frepeat n f | n <= 0 = error "invalid count." | n == 1 = f | otherwise = f (frepeat (n-1) f a) it works: ghci> frepeat 3 (^2) 2 256 ghci> frepeat 4 (++ "-bla") "bla" "bla-bla-bla-bla-bla" now want rewrite more compactly , without last argument. want - must partial applied function. tried this: frepeat :: (integral n) => n -> (a -> a) -> -> frepeat n f | n <= 0 = error "invalid count." | n == 1 = f | otherwise = f (frepeat (n-1) f) but ghci doesn't eat it... mean can't it? you need 1 (.) in last part | otherwise = f . (frepeat (n-1) f) in general, this let f x = f (g x) can rewritten this let f = f . g

asp.net - Image is not displaying -

i want display image in image tag in asp.net. if image in project folder image ll display suppose image path in apart project folder isn't display . though need it. can me? i tried following code ll work ie image in project floader <img src="d:\new folder (4)\2014_images\aa10196.jpg" style="padding-left: 0px; border:0px; height: 60px;" alt="img not found" /> i tried code isn't work ie image in apart project code <img src="e:\new folder (4)\2014_images\aa10196.jpg" style="padding-left: 0px; border:0px; height: 60px;" alt="img not found" /> use resolveurl absolute path imgupload.src = resolveurl("/2014_images/aa10196.jpg");

c# - Configuration for WCF service in windows form application -

i'm trying run simple calculator web service in windows form application. during applications start got error: an unhandled exception of type 'system.invalidoperationexception' occurred in system.servicemodel.dll additional information: service 'calculatorwcf.calculatorservice' has 0 application (non-infrastructure) endpoints. might because no configuration file found application, or because no service element matching service name found in configuration file, or because no endpoints defined in service element. i suppose wrong configuration file. problem? form1 code: namespace calculatorwcf { partial class form1 { /// <summary> /// required designer variable. /// </summary> private system.componentmodel.icontainer components = null; /// <summary> /// clean resources being used. /// </summary> /// <pa

c# - Unit Testing with ASP.NET MVC 5 and Web API -

i new unit testing.. first of want know how unit testing in asp.net mvc. in project using mvc5 , web api2. want implement unit testing within project. can of tell me how start , provide me links approach? check this: http://www.developerhandbook.com/2013/08/30/csharp-writing-unit-tests-with-nunit-and-moq/ -it introduction mocking , aaa approach. you can use nsubstitute instead of moq if want - more popular , can find more examples nsubstitute.

Not Enough Space to Show Ads On Custom Dialog Android Issue -

Image
i'm having problem showing ads admob on custom dialog. says not enough space show ad, needs 320x50dp , has 294x250dp. i'm using custom dialog such one: i believe problem in dialog itself, has empty space on left , right size, i'm not sure how solve it. i'm asking type of advice me show ad properly. below xml code adview present: http://pastebin.com/phybjtu1 try code <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="match_parent" tools:context="com.example.kaladont.postgamescreen" android:gravity="center" > <relativelayout android:layout_width="320dp" android:minwidth="320dp" android:layout_height="250dp"

stored procedures - Syntax error when assign a variable for top clause in sql server -

i need top 10, top 100 records table. need assign value top clause such 10 or 100 in variable. but when give below, gives syntax error "incorrect syntax near '@numberofrecords'.". declare @numberofrecords int select @numberofrecords = configvalue tblconfigitems (nolock) configname = 'toprecords' select top @numberofrecords [id],typeid, messagetype, operationdate notifytbl (nolock) status in ('1', '2') how achieve this? avoid dinamic sql. use this: select top (@numberofrecords) [id],typeid, messagetype, operationdate notifytbl (nolock) status in ('1', '2') you need @ least sql 2005 have working. yes () trick.

android - Volley Cache not get updated -

hi using volley jar in android app cache json data offline mode.it works perfectly.here code cache cache1 = appcontroller.getinstance().getrequestqueue().getcache(); entry entry1 = cache1.get(url); if (entry1 != null) { // fetch data cache try { data2 = new string(entry1.data, "utf-8"); try { parsejsonfeed(new jsonobject(data2)); } catch (jsonexception e) { e.printstacktrace(); } } catch (unsupportedencodingexception e) { e.printstacktrace(); } } else { appcontroller.getinstance().getrequestqueue().getcache().remove(url); // making fresh volley request , getting json jsonobjectrequest jsonreq1 = new jsonobjectrequest(method.get, url, null, new response.listener<jsonobject>() { @override

dataset - Refresh a dataview grid in c# -

i have form datagridview item views table databse. form adds new row table , closes self. in first form, @ closing event of second form, want first form update/refresh/refill new data added. have tried this: this.swimmerstableadapter.update(this.databasedataset1.swimmers); and: this.update(); but unsuccessfully. it refresh self when stop debugging, , run again, ofcource it's not practical client/user. any solutions ? probably need this... form 1: public partial class form1 : form { public form1() { //'add label , buttom form initializecomponent(); } private void button1_click(object sender, eventargs e) { form2 frm2 = new form2(this); frm2.show(); } public void refreshgrid() { datagridview1.update(); } } form 2: public class form2 : form { form1 _frm1; public form2(form1 frm1) { _frm1 = frm1; this.formclosing += form2_formclosing;

symfony - MissingMandatoryParametersException: Some mandatory parameters are missingto generate a URL for route -

it seems missing here , keep getting following message: ## exception has been thrown during rendering of template ("some mandatory parameters missing ("fooid") generate url route "foo_edit".") in adminfoobundle:default:base.html.twig @ line 1. ## this controller's action: /** * @route("/{fooid}/edit", name="foo_edit", requirements={"fooid" = "\d+"}) * @param $fooid * * @return view */ public function editfooformaction($fooid) { $foo = $this->getfoorepository()->findoneby(['fooid' => $fooid]); return $this->render( "adminfoobundle:competition:show_foo.html.twig", ['foo' => $foo] ); } and twig file: {% extends 'fooadmintoolbundle:default:base.html.twig' %} {% block inner_main %} {{ parent() }} <form data-spy="scroll" data-target="#affix-nav" action="{{ path('foo_create') }}" me

perl - Wide character in subroutine entry in otrs on Postgres 9.4beta1 -

after upgrading postgres 9.1.2 postgres 9.4beta1, otrs 3.3.5 stopped working perl error found in http-error.log, raised when closing ticket. error is: wide character in subroutine entry @ [...]/kernel/system.db.pm line 499 the line 499 following: if ( !$self->{dbh}->do( $param{sql}, undef, @array ) ) { it seems perl script fails while executing query. my perl version v5.16.3. i searched lot no solution worked me far. this warning not error. looking in perldiag gives explanation. wide character in %s (s utf8) perl met wide character (>255) when wasn't expecting one. warning default on i/o (like print). easiest way quiet warning add :utf8 layer output, e.g. binmode stdout, ':utf8' . way turn off warning add no warnings 'utf8'; closer cheating. in general, supposed explicitly mark filehandle encoding, see open , binmode. you have utf8-encoded characters perl expecting see bytes. need encode() data before

Alternative for object pools in cocos2d-x v3.3 -

i migrating game andengine, there used object pools efficient use of objects bullets etc in game. alternate have in cocos2d-x scenario? unfortunately cocos2d-x doesn't have built-in object pool. cocos2d-js(cocos2d-html5) have in extensions. http://cocos2d-x.org/docs/manual/framework/html5/v3/cc-pool/en https://github.com/cocos2d/cocos2d-html5/blob/develop/extensions/ccpool/ccpool.js but can implement own object pool example of cocos2d-x book. https://github.com/setiawand/skydefenseexample/blob/master/classes/helloworldscene.h https://github.com/setiawand/skydefenseexample/blob/master/classes/helloworldscene.cpp object pools in cocos2d-x v3.0 final - deprecated ccarray migration 2.x 3.x void createpools(void);

Bootstrap 3 Modal Via Ajax Load(CodeIgniter) -

i trying make bootstrap3 modal work via ajax load using codeigniter. i've tried this it's still not working. it's simple use when follow what's in docs want via ajax load did bootstrap 2.3.2. trying figure out couple of days no luck. here's code: view:(the 1 triggers modal) <li role="presentation"> <a data-toggle="modal" href="<?php echo $this->config->item('ompty_url'); ?>/edit" data-target="#mymodal">edit information</a> </li> controller: function edit(){ $this->load->view('system/modals/edit_form'); } view:(the content of modal) <!-- modal --> <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class=&qu

javascript - Change ul li parent color -

i have code in html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>form</title> <script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script src="script.js"></script> <link href="styles.css" rel="stylesheet" type="text/css" /> </head> <body> <ul class="cars_menu"> <li>audi <ul> <li class="highlight">a4</li> <li>a6</li> <li>a3</li> <li>a5</li> </ul> </li> <li>volkswagen <ul> <li>golf iv</li> <

c# - Login Credentials are not working properly for Admins & Users -

i have created custom login page project. have given roles followed below 0 superadmin 1 admins 2 users the problem here that, login works super admin part. when create admins , users , try login credentials, gives me error invalid username & password . tried checking , debugging don't know why not working. please see code button_click event reference:- protected void btnsubmit_click(object sender, eventargs e) { string loginid = txtusername.text.trim().tolower(); string loginpassword = txtpassword.text.trim(); sqlconnection conn = new sqlconnection(system.configuration.configurationmanager.connectionstrings["defaultcsrconnection"].connectionstring); conn.open(); sqlcommand cmd = new sqlcommand("select username,password,usertype tbl_user username=@username , password=@password , active=@active", conn); cmd.parameters.addwithvalue("@username", txtusername.text); cmd.param

google calendar - .ics file for all day events - dropping off one day -

i'm writing simple holiday request app our department. it's writes .ics file emails necessary people. an example of contents of is: begin:vcalendar version:2.0 prodid:-//google inc//google calendar 70.9054//en x-wr-calname:holiday x-wr-timezone:europe/london begin:vevent dtstamp:20141216t111644z uid:20141216t111644z@random.com dtstart;value=date:20150223t000100 dtend;value=date:20150225t000100 summary:mcvpjd3-holiday end:vevent end:vcalendar' i've tried start , end dates have dates t000100 removed or t000000. i've tried start date t000100 , tagged end date t235959 when importing google calendar works fine single day events, multi day event above, puts 2 day event instead of 3 day event. is me doing wrong or what? thanks your file not correct online validator indicated: have twice begin:vcalendar , specify dtstart date have datetime value. below corrected version begin:vcalendar version:2.0 prodid:-//google inc//google calendar 70.9054

html5 - D3 Map zoom event to keep LineString width constant -

Image
building on top of http://bl.ocks.org/d3noob/5193723 , tried add line string on map. i made modifications in code : var g1 = svg.append("g"); // load , display world d3.json("js/data/world-110m2.json", function(error, topology) { var data = {type: "linestring", coordinates: [[102.0, 0.0], [3.0, 50.0]], count: 1}; g1.selectall(".route") .data([data]) .enter() .append("path") .attr("class", "route") .attr("d", path); g.selectall("path") .data(topojson.object(topology, topology.objects.countries) .geometries) .enter() .append("path") .attr("d", path) }); // zoom , pan var zoom = d3.behavior.zoom() .on("zoom",function() { g.attr("transform","translate("+ d3.event.translate.join(&quo

javascript - Setup eclipse to validate firefox addon-sdk libraries -

is there way configure eclipse aware of firefox addon-sdk libraries .. in such way if errors exist on api methods underlined normal javascript errors? simple test using self api addon-sdk .. var data = require("sdk/self").data; exports.get = function(content) { return data.url(content); } if remove content data.url() there no error or warning in ide, instead see error @ runtime, seems pretty late .. var data = require("sdk/self").data; exports.get = function(content) { return data.url(); }

java - Vaadin CheckBox object becomes null -

i have vaadin object: checkbox mycb = new checkbox("caption"); later on value of checkbox updated database this: mycb.setvalue(dbvalue); dbvalue null in database. mycb not null before line, , null after line. shouldn't value remain same, mycb.getvalue() returning null? furthermore, trying avoid nullpointerexception short-circuit evaluation: if (mycb != null && mycb.getvalue() == true) ... that produces nullpointerexception anyway. normal behavior or there i'm doing wrong? you said mycb doesn't become null. that's great. if (mycb != null && mycb.getvalue() == true) this throws nullpointerexception because java tries cast result of mycb.getvalue() boolean . because mycb.getvalue() returns null , throws nullpointerexception . change to: if (mycb.getvalue() != null && mycb.getvalue() == true) or similar

Call a function when I access a property (PHP magic methods) -

basically i'm using php overloading create dynamic methods , properties. want trigger function property access keeping access methods. in other terms, that's php code: first class: class _class { private $_instance; public function __construct() { $this->_instance = new _object(); } public function __get($name) { switch ($name) { case "instance": //logics break; } return null; } } second class: class _object { public function __call($method, $args) { switch ($method) { case "method": //logics break; } return null; } } now want execute function when access object property in way: $obj = new _class(); echo $obj->instance; //some output here, executing function echo $obj->instance->method(); //different output, executing method of instance thanks, appreciated!

linux - Simulating a process stuck in a blocking system call -

i'm trying test behaviour hard reproduce in controlled environment. use case: linux system; redhat el 5 or 6 (we're starting rhel 7 , systemd, it's out of scope). there're situations need restart service. script use stopping service works quite well; sends sigterm process, designed handle it; if process doesn't handle sigterm within timeout (usually couple of minutes) script sends sigkill, waits couple minutes more. the problem is: in (rare) situations, process doesn't exit after sigkill; happens when it's badly stuck on system call, possibly because of kernel-level issue (corrupt filesystem, or not-working nfs filesystem, or equally bad requiring manual intervention). a bug arose when script didn't realize "old" process hadn't exited , started new process while old still running; we're fixing stronger locking system (so @ least new process doesn't start if old running), i find difficult test whole thing because haven&#

Android Bluetooth Paring Input Device -

i trying make pairing code , works normal devices. if use bluetooth scanner pairs device doesn't work till go android settings , select input device checkbox. how can code? thank you. here pairing code: public static bluetoothsocket createl2capbluetoothsocket(string address, int psm){ return createbluetoothsocket(type_l2cap, -1, false,false, address, psm); } // method creating bluetooth client socket private static bluetoothsocket createbluetoothsocket( int type, int fd, boolean auth, boolean encrypt, string address, int port){ try { constructor<bluetoothsocket> constructor = bluetoothsocket.class.getdeclaredconstructor( int.class, int.class,boolean.class,boolean.class,string.class, int.class); constructor.setaccessible(true); bluetoothsocket clientsocket = (bluetoothsocket) constructor.newinstance(type,fd,auth,encrypt,address,port); return clientsocket; }catch (exception e) { return