Posts

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(...