Posts

Showing posts from May, 2012

jquery - Datatables with modals for editing. Is it possible? -

jquery - Datatables with modals for editing. Is it possible? - i have datatable (fetches info remote server), , in each cell have mouse-over link can pop-up modal (all links same). problem cannot pass row's unique id , cell's data. there method code can understand @ row i'm clicking? <!doctype html> <html lang="tr"> <head> <meta charset="utf-8"> <link href="http://127.0.0.1/hcawebapp/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <title>binalar</title> <style type="text/css" title="currentstyle"> /* twitter bootstrap temalı tablo için */ div.datatables_length label { float: left; text-align: left; } div.datatables_length select { width: 75px; } div.datatables_filter label { ...

Android: Populate ListView from an internal XML -

Android: Populate ListView from an internal XML - i found tutorial makes need : http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ the problem listview gets populated xml found out on url. have alter can load list items (image+text) internal xml ? what mean "internal" xml? xml file on sd card or compiled in application raw resource? take @ these links : reading .xml file sdcard android : reading xml local resource (for testing) the line in code need alter : string xml = parser.getxmlfromurl(url); // getting xml url android xml listview

css - Swap image with text in print -

css - Swap image with text in print - i utilize sprites insert images on page. <div class="sprites logo1"></div> <div class="sprites logo2"></div> however, when print page, unless settings changed print background images, nil printed. i print text instead of logos. set image within div , hide @media screen , show @media print i'm not sure how deal sprites. desired outcome print like: <div>logo1</div> <div>logo2</div> my css sprites looks lile this: .sprites{ background: url(../logos.png) no-repeat top left } .logo1{ background-position: 0 0; width: 184px; height: 57px } .logo2{ background-position: 0 -60px; width: 175px; height: 34px } so thought adding may right: @media print { .logo1{ content: url(../logos.png) no-repeat 0 0; width: 184px; height: 57px } } the problem solution, shows entire sprites image, condensed dimensions of ...

iphone - Why am I getting "Expected getter method not found"? -

iphone - Why am I getting "Expected getter method not found"? - i working on iphone database app , got "expected getter method not found".i don't why i'm getting message. tried sorts of troubleshooting. it's in line of code: nsstring *inserstmt = [nsstring stringwithformat:@"insert persons(name,age) values ('%s' '%d')",[self.namefield.text utf8string],[self.agefield.text intvalue]]; here's code: #import "viewcontroller.h" @interface viewcontroller () { nsmutablearray *arrayofperson; sqlite3 *persondb; nsstring *dbpathstring; } @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; arrayofperson = [[nsmutablearray alloc]init]; [[self mytableview]setdelegate:self]; [[self mytableview]setdatasource:self]; [self createoropendb]; } -(void)createoropendb { nsarray *path = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuser...

java - Is there any way to truncate org.eclipse.swt.widgets.Table item's text -

java - Is there any way to truncate org.eclipse.swt.widgets.Table item's text - i'm using org.eclipse.swt.widgets.table . have column width 100, if corresponding tableitem 's text longer column width, want remaining text appear in new line in cell. is possible? you can utilize multiline tableitem s shown in this example: however, have handle insertion of newlines (i.e. \n ) yourself. tableitem s not back upwards wrapping themselves. java swt

c++ - File Input - File not being read QT -

c++ - File Input - File not being read QT - i'm new c++ , qt. basically, done java stuff, we're beingness thrown in c++ module, in have design zork game ui. way planning create room object have room constructed roomnum.long, .short , .name long desc, short desc , name. for first room, i'm going load file straight moment until onto objects etc properly. however, can't seem file written text label. homecoming "restart game etc" written on button press, not contents of file. rooms folder in same folder source file (islandmain.cpp in case) any ideas? void theislandmain::on_startbutton_clicked() { ui->roomdesc->settext(readfirstroom("/rooms/room1.long")); ui->roomdesc->setwordwrap(true); } qstring theislandmain::readfirstroom(qstring filename) { qfile mfile(filename); if (!mfile.open(qfile::readonly | qfile::text)) { qdebug() << "could not open file reading line 31"; homecom...

java - Ridiculous use of a switch statement -

java - Ridiculous use of a switch statement - i doing some java homework friend. instructor wants him write java programme translate integer input numeric grade. 100-90 = , on. grab must utilize switch statement. must also: include case in switch statement display polite error message if user enters number less 0 or greater 100." originally thought of this... import java.util.scanner; public class grade { public static void main(string[] args) { int ng;//number grade string lg = "";//letter grade system.out.println("enter grade"); scanner in = new scanner(system.in); ng = in.nextint(); switch (ng/10) { case 10: case 9: lg = "a"; break; case 8: lg = "b"; break; case 7: lg = "c"; break; ...

Jquery menu syntax not working to old -

Jquery menu syntax not working to old - hi utilize code of jquery menus, problem im using newer version (i think) of jquery because dock menu mac style client ask,.. menu working , slidedown function dont remain open, menu not working.. i used utilize jquery.. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> whit code: <script type="text/javascript"> $(document).ready(function(){ $("ul.submenu").parent().append("<span></span>"); $("ul.menu li span").hover(function() { //al hacer click se ejecuta... //con este codigo aplicamos el movimiento de arriva y abajo para el submenu $(this).parent().find("ul.submenu").slidedown('fast').show(); //menu desplegable al hacer click $(this).parent().hover(function() { }, function(){ $(this).parent().find("ul.submenu").slide...

Javascript RegEx for Global phone numbers -

Javascript RegEx for Global phone numbers - i browsing through net find proper javascript regular look phone numbers ones find not ones need. the acceptable phone number type case have match next rules: may start + or 0-9 all rest string allowed have 0-9 , - , space (preferably 1 space between numbers) i tried far this: /^\+[\-\d\s]/ not getting proper result. i've tried read tutorials new , seems missing something. an acceptable phone number illustration be: +30 6995 4488551 (spaces allowed) or 0030 6995 4488551 etc. any help much appreciated! :) your regex matches starts + followed single - , digit or whitespace character. match example: +4qwertzuiopasdfghjkl +-asdfasdfasdfasdf i suggest @ examples , tutorials on http://www.regular-expressions.info/. telephone numbers improve regex be: /^\+?[\d -]+$/ this match valid numbers invalid constructions +--------- or + trailing space. if want close denying lot of invalid combinations sugge...

How to retrieve sharepoint 2013 list data using JQuery or JavaScript and Fill DropDownList? -

How to retrieve sharepoint 2013 list data using JQuery or JavaScript and Fill DropDownList? - i trying retrieve list info using javascript. goes wrong. trying debug code not able understand thing. next javascript code: executeordelayuntilscriptloaded(populatedepartments, "sp.js"); var _ctx = null; var _web = null; var _allitems = null; function populatedepartments() { debugger; _ctx = sp.clientcontext.get_current(); _web = _ctx.get_web(); var list = _web.get_lists().getbytitle("servicetype"); var query = new sp.camlquery(); query.set_viewxml("<view><query><orderby><fieldref name='title'/></orderby></query></view>"); _allitems = list.getitems(query); _ctx.load(_allitems, 'include(title,id)'); debugger; _ctx.executequeryasync(function.createdelegate(this, this.populatedepartmentsuccess), function.createdelegate(this, this.populatedepartmentfa...

c++ - ideone doesn't show any output -

c++ - ideone doesn't show any output - this code of problem http://www.spoj.com/problems/base/ , runs fine on windows , linux when run on ideone not show me output. can tell me reason behind this? #include<stdio.h> #include<math.h> #include<string.h> #include<string> #include<iostream> using namespace std; long int convert_base10(char *num, int base) { int len, dig; long int result = 0; len = strlen(num); // printf("len = %d\n", len); // converting base of operations 10 for(int i=0; i<len; i++) { if((num[len-i-1] >= 'a') && (num[len-i-1] <= 'f')) dig = num[len-i-1] - 55; else dig = num[len-i-1] - 48; result += (dig * pow(base, i)); // printf("num[%d] = %d\n", len-i-1, dig); } homecoming result; } void convert_basei(long int num, int base, string &result1) { bool error = false; int pos = 6; char result[7], rem; // storing space on position for(...

jquery - creating bell graph using js function or jQ plugin -

jquery - creating bell graph using js function or jQ plugin - i need js function or jq plugin creating next type bell graph. if know link pls help me raphaël little js library generating vector based images may need. can find @ http://raphaeljs.com/. jquery graph charts

c++ - Interesting behavior with dynamically allocated array -

c++ - Interesting behavior with dynamically allocated array - so i'm working dynamically allocated array, , i've set hold 5 elements, should 0-4. made function reserve if necessary, wanted see if getting programme crash expected when assigned value array @ [5]. but, no error, not until [6]. here's code: int* dynamic_arr; dynamic_arr = new int[5]; for(int = 0; <= 100; i++){ dynamic_arr[i] = i; used++; cout << dynamic_arr[i]<<endl; } here's output: 0 //i[0] 1 //i[1] 2 //i[2] 3 //i[3] 4 //i[4] 5 //i[5] <-- should out of range after crashes. why able assign value portion of array is, well, out of range lack of improve term? thanks opsrcftw edit: appreciate answers guys, thanks. i'll read more before posting quick reply next time, sorry. accessing beyond end of array produces undefined behavior. not produce crash. can happen. c++ arrays dynamic

java - How to copy projects into workspace of eclipse after importing the project? -

java - How to copy projects into workspace of eclipse after importing the project? - i imported project eclipse incidentally forgot check-mark checkbox "copy projects workspace" option. after wards(importing has been done) there way through can re-create project workspace. also, while importing maven project eclipse alternative should select in order re-create project workspace? delete project (just workspace, prompt on delete check box) , re import it java eclipse maven

file - LogParser Lizard -

file - LogParser Lizard - i using logparser lizard parse log4net files , when trying query such as: select * "c:\logs*.log". error saying "the process cannot access file [...] because beingness used process" (correct, web app deployed in iis writing it). there way circumvent behavior , still open file reading if in use? this question little old, i'll give work-around anyway. re-create log files temp folder. utilize log parser lizard on copies. file logging log4net file-access logparser

git checkout - How to get a copy of an older version of a file in a git repository? -

git checkout - How to get a copy of an older version of a file in a git repository? - i have version of .tex file number of commits ago re-create of. have sha1 hash value commit has version of file want. not want replace current version of file. rather, want separate re-create of reflects state @ older version. a lot of similar questions suggest using git checkout <sha1> -- file.tex , keeps giving "error: pathspec 'file.tex' did not match file(s) known git." the file interested in existed in top-level directory of repository. in sub-directory of repository trying run command older version of file.tex in subdirectory. is possible? how can this? you can utilize git cat-file dump contents of file standard output , redirect desired destination: git cat-file -p <sha1>:./file.tex > wherever.tex the ./ necessary if in subdirectory of repository, if you're in top-level of repository may omitted. also, may not work in older ver...

regex - How to remove commas, brackets in python using regular expression? -

regex - How to remove commas, brackets in python using regular expression? - these contents of text file (eg:abc.doc): {'data': [{'name': 'abc'},{'name': 'xyz'}]} after opening file in python; how remove brackets, quotes , commas. final output should be: data: name:abc name:xyz use ast.literal_eval() turn python structure, print values: with open(r'd:\output1.doc', 'r') inputfile: inputstring = inputfile.read() info = ast.literal_eval(inputstring) key, sublist in data.items(): print '{}:'.format(key) subdict in sublist: key, value in subdict.items(): print('{}:{}'.format(key, value)) for illustration results in: >>> inputstring = "{'data': [{'name': 'abc'},{'name': 'xyz'}]}" >>> import ast >>> info = ast.literal_eval(inputstring) >>> key, sublist i...

python - Advanced database query in Django -

python - Advanced database query in Django - i have table(model) in database this: name|avarage|evaluation marco| 9.6 | 1 marco| 9.3 | 2 kevin | 8.8 | 1 kevin | 9.4 | 2 so need info show table @ template in way: name | eval1 | eval2 marco | 9.6 | 9.3 kevin | 8.8 | 9.4 how can create query in view? there no easy way using orm. seek using itertools.groupby : from itertools import groupby results = modelcls.objects.order_by("name") grouped = groupby(results, lambda r: r.name) you have models grouped name: for name, objects in grouped: # process model objects in each grouping obj in objects: # each object passing groupby object template should work fine, aware it's generator , exhausted after iterate on it. python django orm django-models django-views

Django: what is the difference between using request and context as argument -

Django: what is the difference between using request and context as argument - i defining function in context_processor pass value settings utilize in templates. right way, , more importantly difference? def baseurl(request): homecoming {'base_url': settings.base_url} or def baseurl(context): homecoming {'base_url': settings.base_url} i have used first, have run few examples of second you free phone call argument whatever request mutual or clear. django docs: https://docs.djangoproject.com/en/1.4/ref/templates/api/#writing-your-own-context-processors a context processor has simple interface: it's python function takes 1 argument, httprequest object, , returns dictionary gets added template context. while there nil stopping naming argument context misleading since passed httprequest object. django

Measure Control with double.PositiveInfinity WPF -

Measure Control with double.PositiveInfinity WPF - i working on custom command has custom panel , within custom panel have little , simple measureoverride method passes size of double.positiveinfinity children measureoverride method. custom panel should take care of layout , should create children bigger or smaller depending on window size. if have dealt controls should know how wpf layout scheme works , every kid calls measureoverride calls measureoverride of childs children , on. now problem when resize window, custom panel receive flag measure 1 time again hence measureoverride called 1 time again time while passing double.positiveinfitinty size children, children measureoverride doesn't called @ (but method should called according definition of wpf layout system). why so? thought when phone call measureoverride on parent children forced measure. obviously wrong explain me how control/child know when measure again? by way passing size of double.po...

php - using binary operator in Python... translating if (c1 >= "\xc0" & c1 <= "\xdf") -

php - using binary operator in Python... translating if (c1 >= "\xc0" & c1 <= "\xdf") - i converting external class php python, tricks : if ($c1 >= "\xc0" & $c1 <= "\xdf") [...] $cc1 = (chr(ord($c1) / 64) | "\xc0"); [...] $cc2 = ($c1 & "\x3f") | "\x80"; where $c1,^$cc1, $cc2 characters and realized cannot utilize such python, characters string, , not duplicately seen "binary representation of character" operators & , | create sense... please, how translate of these in pythonic way ? >>> c1 = "a" >>> (c1 & "\x3f") | "\x80" traceback (most recent phone call last): file "<pyshell#202>", line 1, in <module> (c1 & "\x3f") | "\x80" typeerror: unsupported operand type(s) &: 'str' , 'str' edit: actually, seems php class not work, not fit nee...

sql server - Sql data sorted by calendar date -

sql server - Sql data sorted by calendar date - sql info sorted weekly calendar days..ex feb 1, 2013 friday, in need pull in info feb 1 & 2. right pulls info entire week of 1-27-2013 2-2-2013. results set in total billed week end dates. ex( 1-5-13, 1-12-13) end of jan , origin of feburary need results 1-27-13 1-31-13 = "total" week ending date 31st. febuary 2-1-13 2-2-13 = "total" i have been able individual days, thats not how "accounting" wants it. thanks in advance. here code: select dateadd(week, datediff(wk, 0, bd.[service date 1]) ,5) month, bd.chart, bd.[transaction code], sum(bd.units) [total billed] dbo.[billing detail] bd inner bring together dbo.patient p on bd.chart = p.[chart number] (bd.[transaction code] = 'h2016') , (bd.[service date 1] >= '01/01/2013') , (bd.[service date 1] < '12/31/2013') grouping dateadd(week, datediff(wk, 0, bd.[servic...

jpa - how to merge a shop entity to a client entity (many to one) in jsf -

jpa - how to merge a shop entity to a client entity (many to one) in jsf - i'm trying merge existing shop new client in jsf isn't successful. programme consists off backing bean controller,an ejb , jsf page (register) have been able populate shoplist in combobox ui. here code. register.xhtml: clientcontroller.client.fname sfsb. property persisted trying merged. shop list ( shopcontroller.shoplist ) <h:form> <h:panelgrid columns="3" > <h:outputtext value="select from. available shops :" /> <h:selectonemenu value="#. {shopcontroller.shop}" > <f:selectitems var="s" value="#. {shopcontroller.shoplist}" /> </h:selectonemenu> <h:commandbutton value="register". action="#{clientcontroller.register(s)}" /> </h:panelgrid> </h:form> backing bean class: managedbean(name="clientcontroller") @requestscope...

html5 - phonegap.js or cordova.js not working in appmobi XDK and app.lab -

html5 - phonegap.js or cordova.js not working in appmobi XDK and app.lab - i'm beginner in phnegap. while searching easy testing tool phonegap found appmobi xdk desktop , app.lab mobile. looks easy work it. when tried run phonegap functions like: function capturevideo() { // launch device video recording application, // allowing user capture 2 video clips navigator.device.capture.capturevideo(capturesuccess, captureerror, {limit: 2}); } etc. throws , error "can't read property 'capture' of undefined". i'v set <script src="phonegap.js"></script> inside head tag no luck. when tried phonegap build in https://build.phonegap.com/apps. works fine. i'm bit confused here. xdk , app.lab testing html5 apps or supports phonegap features notification, camera, capture etc. thanks ! i ran in same issue times ago. depending on configuration device or capture undefined object. have add together device...

use php to login users to ASP.Net Membership users database -

use php to login users to ASP.Net Membership users database - i have database of users created in asp.net membership .net 4.0 using sha-256 base64 hash algorithm. i utilize php , write function log in user if user provides right email , password. less woriend connection database etc. more php functions or need step step create same password has in php. don't need know passwords. i have email addresses available. i have passwords , passwords salts encode using sort of combination of sha-256 , base64. i have no experience in asp or .net, php, utilize info , write log in script in php. is possible? additional info need it? any help appreciated. php asp.net passwords password-protection password-encryption

html5 - How can I reduce the gap between my content and header? -

html5 - How can I reduce the gap between my content and header? - here's js fiddle of problem: http://bit.ly/zd8jau i'm trying place header logo , centred title @ top of page. thought center title page , not within gap left right of logo, if makes sense? so floated logo on top of title , altered position of logo shifting upwards (as otherwise insists on going beneath title). problem creates gap, cascades downwards page , i'd have somehow shift hight of logo, , don't want have that. so there improve way logo positioned left of title without creating gaps anywhere , without causing off-set on text in title? edit: updated fiddle clearer i'm trying achieve. yes, consider using css background logo part of nav element, makes easier pad text , position image without interference. html5 css3

javascript - References for Ad Blocker like web content filtering -

javascript - References for Ad Blocker like web content filtering - i want implement extension browsers blocks 3rd party pop ads, on lines of advertisement blocker. don't know start. can point me towards references can utilize larn more filtering web content? in advance. i hate shove links have found need on here: http://developer.chrome.com/extensions/index.html if take time read you'll understand how extension built , lives in browser. if read long plenty you'll find section: http://developer.chrome.com/extensions/content_scripts.html which details how can inject javascript tab , run context of page vs. context of plugin. the resources detailed, have read them. to follow comment, no. every browser environment architected differently , you'll have take different approach same problem, if goal same. the way see it, there's 2 ways of doing (at high level). stop transmission happening, or retroactively remove elements page after it...

encryption - Using SHA1 as a message digest when generating an aes256 cbc key with open ssl -

encryption - Using SHA1 as a message digest when generating an aes256 cbc key with open ssl - i have lab computer security class utilize gpg , openssl secure communication. confused step: use openssl enc command line symmetric cipher routine generate 256bit aes key in cbc mode. should utilize sha1 message digest function generating key. save generated secret key, iv, , salt file named aes.key. (use –p opting print out key, salt , iv used exit, don’t encryption @ step.) but looking through the man pages openssl enc , see no options digests. know there openssl dgst command computes hash of input. there flaw question? "you should utilize sha1 message digest function generating key" mean? generate key , sha1(key.aes)? any help appreciated. thank you, zero_dev from usage info openssl enc when giving unknown argument such -h : -md next argument md utilize create key passphrase. 1 of md2, md5, sha or sha1 so...

amazon ec2 - Ruby: Parse API Response -

amazon ec2 - Ruby: Parse API Response - i trying geht script run: http://dysinger.net/2008/10/13/using-amazon-ec2-metadata-as-a-simple-dns dosnt work because using old amazon sdk version, rewrote utilize new one: #!/usr/bin/env ruby require "rubygems" require "aws-sdk" %w(optparse rubygems aws-sdk resolv pp).each {|l| require l} options = {} parser = optionparser.new |p| p.banner = "usage: hosts [options]" p.on("-a", "--access-key user", "the user's aws access key id.") |aki| options[:access_key_id] = aki end p.on("-s", "--secret-key password", "the user's aws secret access key.") |sak| options[:secret_access_key] = sak end p.on_tail("-h", "--help", "show message") { puts(p) exit } p.parse!(argv) rescue puts(p) end if options.key?(:access_key_id) , options.key?(:secret_access_key) puts "127.0.0.1 ...

Sending a json serialized object containing a escaped string using HttpWebRequest on mono -

Sending a json serialized object containing a escaped string using HttpWebRequest on mono - the requirement serialize class , send server. dev environment: monodevelop 3.0.6 runtime: mono 2.10.9 (tarball) gtk 2.24.10 gtk# (2.12.0.0) operating system: mac os x 10.7.4 the class contains string escaped double quote in it. class customclass { public string foo = "hi!\""; } the issue when serialize it, encode , create uri object, backslash used escape double quote in variable foo converted forwards slash, breaking json. below values of different variables of uri instance uri: http://myserver/hello_world/0/{"foo":"hi!/""} absoluteuri: http://myserver/hello_world/0/%7b%22foo%22%3a%22hi%21/%22%22%7d originalstring: http://myserver/hello_world/0/%7b%22foo%22%3a%22hi%21%5c%22%22%7d the httpwebrequest send value "http://myserver/hello_world/0/{"foo":"hi!/""}" server, requi...

c# - How to add an application to the desktop context menu for a specific folder? -

c# - How to add an application to the desktop context menu for a specific folder? - i'm trying set own menu in windows desktop contextmenu. similar dropbox makes. when in dropbox folder, menu called dropbox displayed , lets perform tasks on given file. i know folders need utilize registry key: hkey_classes_root\directory\background\shell anyone know how place own menu in specific folder? regards! c# registry contextmenu

how can i kill javascript process or stop of all functions further execution -

how can i kill javascript process or stop of all functions further execution - i using asp.net ajax toolkit accordion panel . if user click on header want hide pane instead of collapse or expand . write next method in javascript . <script type="text/javascript"> function courtcase() { //var = document.getelementbyid("accourtcases"); // var = document.getelementbyid('<%= accourtcases.clientid %>') //var _accordion = //document.getelementbyid('<%= ctrlcontainer.clientid%>').accordionbehavior.set_selectedindex(1).hide(); // expand panel nr.3 alert('rahul'); document.getelementbyid('<%= ctrlcontainer.clientid%>').accordionbehavior.get_pane(0).content.style.display = 'none'; document.getelementbyid('<%= ctrlcontainer.clientid%>').accordionbehavior.get_pane(0).header.style.display = 'none...

java - Looping does not work properly -

java - Looping does not work properly - i'm having problem programme doesn't loop please help me it. code below. in advance! import java.util.scanner; import javax.swing.joptionpane; import javax.swing.*; public class wewe{ public static void main(string[]args){ scanner inp = new scanner(system.in); boolean tryagain; do{ system.out.print("\ninput username: "); string user = inp.nextline(); system.out.print("\ninput password: "); string pass = inp.nextline(); if(user.equals("admin") && pass.equals("admin")){ system.out.print("success!"); tryagain = true; } if(user!="admin" && pass!="admin"){ joptionpane.showmessagedialog(null, "try again! invalid username or password!","error logging-in", joptionpane.error_message); tryagain = false; } }whi...

What is the difference between packet and payload -

What is the difference between packet and payload - i got defitiniton below true , difference between packet , payload? the esp (encapsulation security payload) protocol fellow member of ipsec suite. purpose guarantee payload's (message) integrity, info origin authentication of ip packets , confidentially of payload. provide protection entire packet, not payload. a payload part of packet actual info (the stuff!) there other parts of packet, packet headers, describe payload, how big is. the description telling protection provided in packet, including it's headers. hope helps! packet payload esp

rest - How to start with writing a RESTful service? -

rest - How to start with writing a RESTful service? - i trying create restful web service accepts json arguments , gives out json response. what want take http requests made url endpoint. like, post /the/endpoint http/1.1 host: mywebsite.com {"name":"yourname", "department":"your_department"} do db read @ backend , give relevant parameters like, manager name, salary etc json object, response. what's best way go it? thinking of using java servlets this? there improve way? ps - getting started detailed answers or links tutorials how implement much appreciated. thanks. yes can servlets , json libs marshalling /unmarshalling json object java object. you can create utilize of json libs jackson , gson etc but must know rest application doesnt end handling request , response , needs take care of other non-functional requirements authentication authorization security etc building scratch...

rotation - rotating camera three.js -

rotation - rotating camera three.js - i trying when click on button move photographic camera around object. dont want move object(it need centered). i having: and js functions function moveup() { camera.position.y -=50; } function movedown() { camera.position.y +=50; } but moving object down/up when click on button. there posibility move photographic camera arround , how? objects cubes.. example: var geometry = new three.cubegeometry( 50, 50, 50 ); var material = new three.meshfacematerial( [ new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'drvo.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageutils.loadtexture( 'beton.jpg' ) } ), new three.meshbasicmaterial( { map: three.imageu...

ruby - The rvm help command output looks strange -

ruby - The rvm help command output looks strange - when type in ubuntu terminal: $ rvm help use the command output looks like: m-bm-^hm-4 rvm utilize [ruby-string] setup current shell utilize specific ruby version. ... what m-bm-^hm-4 characters? should utilize special command read help? this unicode characters: ∴ rvm list ruby ubuntu rvm

Adding animation to a button in BlackBerry -

Adding animation to a button in BlackBerry - i want utilize animation on button created in blackberry app. animation works fine first time when click button. on first click, button starts animation (blinking). on sec click blinking stops. however, when click button 1 time again (third time), blinking should start again. however, error: app error 104 uncaught: illegalstateexception the code creating button , adding animation follows: class="lang-java prettyprint-override"> final bitmap image000 = bitmap.getbitmapresource("panic.png"); final bitmap image001 = bitmap.getbitmapresource("panicon.png"); final timer animationtimer = new timer(); final bitmapfield animationfield = new bitmapfield(image000,bitmapfield.focusable){ protected boolean navigationclick(int status, int time) { if(flag){ animationtask.cancel(); flag=false; }else{ animatio...

jQuery issue - $(this).parent().remove(); -

jQuery issue - $(this).parent().remove(); - this question has reply here: events triggered dynamically generated element not captured event handler 5 answers i found solution many problems before here still cant find reply on problem. have container , adding elements within dynamically jquery. within added div's have button want when click button , button removed. here tried far no success. html <div id="menucontainer"> <ul id="menu"> <li><a href="#" id="addcolumn">add element (max 5)</a></li> <li><a href="#" id="addcard">---</a></li> <li><a href="#" id="delcolumn">---</a></li> <li><a href="#" id="delcard">---</a></li> <li>...

Android: Best method for creating buttons in non-standard UI? ie: yes or no screen with custom background and options -

Android: Best method for creating buttons in non-standard UI? ie: yes or no screen with custom background and options - i've been wondering while. what's best method create custom buttons? have image, contains background yes , no. should have artists create image words yes , no separate, or there way create buttons on top of background? perhaps create buttons transparent? thanks! use button class custom background drawable , desired text styling. background drawable should state list selector. allow define separate 9-patch each state - pressed, enabled, disabled, focused, etc. text drawn scheme on top of button, allowing utilize localized string resources back upwards multiple languages. android button

send javascript timestamp to php function for calculation -

send javascript timestamp to php function for calculation - i have page i'm trying loop through results mysql query , in block need send js new date().gettime() value php function calculation of time elapsed, within while loop. how accomplish this? my php page : <body> <?php while($rows = $result->fetch_assoc()){ echo "<div>".// here want send time value js function time($a js value)."</div>" } ?> </body> edit maybe have confused people trying figure out execution time not case. want time value mysql query compared client machine's time js in php function. php function calculates time elapsed. uh.. strange... of course of study if think important... it not work if think can js-time client while php script still running code! but can info via ajax if want. here go: add together time value sql query dom object of rendered website simple adding javascript var straight (you utilize ...

android - Check if null value is retrieved from an external service -

android - Check if null value is retrieved from an external service - i´m retrieving values external database android application doing phone call on service that's on server. here's php file: $mysqli = new mysqli(db_host, db_user, db_password, db_name); if (!$mysqli) { die('connect error (' . mysqli_connect_errno() . ') ' . sqli_connect_error()); } $q=mysqli_query($mysqli, "select title post upper(title) upper('%" . $_request['searchthis'] . "%')"); while($e=mysqli_fetch_assoc($q)){ $output[]=$e; } print(json_encode($output)); mysqli_close(); and class (i wrote code matters): try{ httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); httppost.setentity(new urlencodedformentity(namevaluepairs)); httpresponse response = httpclient.execute(httppost); httpentity entity = response.getentity(); = entity.getcontent(); } catch(exception e){ l...

c++ - Difference between sending text as string and text between quotation marks -

c++ - Difference between sending text as string and text between quotation marks - i utilize mysql++ library connect database. i've created connection , query: connection conn(false); conn.connect("database", "localhost", "user", "pass"); query query = conn.query(); then can send query database like: query << "select name my_table1, my_table2 age=20" but i'd send number variable instead of 20. tried in way: std::stringstream ss; //create stringstream ss << my_number //add number stream std::string number = ss.str(); query << "select name my_table1, my_table2 age="+number; unfortunately, doesn't work. sec problem analogous. create qpixmap object (here qpixmap doesn't matter anyway) , i've give constructor path image: std:string name; (...) std::string path = "/home/root/img/"+name+".png"; //name variable string qpixmap *tmp = new qpixmap(qst...

How to make a batch file run from any drive letter off of a usb drive? -

How to make a batch file run from any drive letter off of a usb drive? - i'm putting both of these batch files on usb drive, , need find way create tyler.bat have right path when phone call tyler.bat usb drive read usb drive , load tyler.bat right path , follow through commands. i want know how without changing drive name specific. zieske.bat @echo off echo you? set /p answer= if /i "%answer%"=="tyler" (call tyler.bat) if /i "%answer%"=="tyler zieske" (call tyler.bat) if /i "%answer%"=="pediatric gynocologist" (call tyler.bat) echo welcome %answer%! pause tyler.bat @echo off rem run shell admin (example) - set here code rem check windows version ver | findstr /i "5\.0\." > nul if %errorlevel% equ 0 goto :ver_2000 ver | findstr /i "5\.1\." > nul if %errorlevel% equ 0 goto :ver_xp ver | findstr /i "5\.2\." > nul if %errorlevel% equ 0 goto :ver_2003 ver | findstr /...