Posts

Showing posts from September, 2015

android - trying to open the sdcard's .txt file in my EditText -

i trying open sdcard's .txt file in edittext change text in , save changes using button click not going in right way .may know correct way achieve objective? try one.. must set permission in manifest file: <uses-permission android:name="android.permission.write_external_storage"/> file f = new file(environment.getexternalstoragedirectory().getabsolutepath() + "followed ur file dir"); file f = new file(environment.getexternalstoragedirectory().getabsolutepath() + "sdcard.txt"); (file wavfile : f.listfiles()) { string str = wavfile.getname().tostring(); stringbuffer stringbuffer = new stringbuffer(); string adatarow = ""; string abuffer = ""; try { file myfile = new file("/...

iphone - strange exception NSInvalidArgument on viewDidLoad ios7 -

ok, im writing app iphone under ios7, using xcode 5 i've got main view controller table view controller, , on start good, view loads without errors, after leave view controller, use other scenes, , rewind via segue got this: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** -[__nsarraym insertobject:atindex:]: object cannot nil' here code of method - (void)viewdidload { [super viewdidload]; nslog(@"from collectinfotvc, viewdidload"); // set side bar button action. when it's tapped, it'll show sidebar. _sidebarbutton.target = self.revealviewcontroller; _sidebarbutton.action = @selector(revealtoggle:); // set gesture [self.view addgesturerecognizer:self.revealviewcontroller.pangesturerecognizer]; _cancelcarbutton.hidden = yes; } could guys please me ? upd.#1: call stack looks this 2014-03-24 11:48:23.286 demotaxi[28008:60b] *** terminating app due uncaught exception ...

python - SWIG function not printing output -

i'm having prblem in executing function i've written in c. i've made , interface file given below: %module cnode %{ #include "cnode.h" %} %include "cnode.h" and here c program : #include <stdio.h> #include "cnode.h" void kill(void) { printf("method executed\n"); } the header file: void kill(void); when i'm trying execute in python interpreter, don't output. there problem declarations or bug? figured out, kill() predefined function won't work. changing name of function works fine.

css - I want to align grid in center -

as see code grid_2 has float left. added center class fix in center div block floating left. want place grid_2 div in center. can 1 me fix this? html code: <div class="center"><div class="grid_2">content goes here </div> </div> css: .grid_0 { width: 100%; margin-bottom: 15px; display: block; } .grid_1, .grid_2, .grid_3, .grid_3c, .grid_4, .grid_4c { margin-left : 1.00%; margin-right : 1.00%; margin-bottom : 15px; float : left; display : block; -webkit-box-sizing: border-box; /* safari/chrome, other webkit */ -moz-box-sizing: border-box; /* firefox, other gecko */ box-sizing: border-box; /* opera/ie 8+ */ } .center{ display: block; text-align: center; margin: 0 auto !important; } .grid_1 { width: 98%; } .grid_2 { width: 48%; } please find link below http://jsfiddle.net/kiranm/aqbs6/5/ ok, here problem lies in width of grid_2. as width of grid_2 = 48% of...

oop - Function for all prototypes - Javascript -

i'm working on video player video.js. on side i've got elements (volume, fullscreen, play, pause...) prototypes . on other side i've got functions parse() going use of canvas prototypes (they come different elements). parse function : vjs.parsehex = function(c) { if(c.charat(0) == "#") { return c.substring(1,7); } else if(c.substr(0,2) == "0x") { return c.substring(2,8); } else { return c; } }, vjs.parsered = function(c) { return parseint((this.parsehex(c)).substring(0,2),16); }, vjs.parsegreen = function(c) { return parseint((this.parsehex(c)).substring(2,4),16); }, vjs.parseblue = function(c) { return parseint((this.parsehex(c)).substring(4,6),16); } an exemple of canvas prototype : js.volumebar.prototype.drawsound = function(){ . . . } i want parse functions accessible of different prototypes. possible ? if yes, how can that? thank helping me, léa. it seems vjs sort...

neo4j - Relationship properties are confused with nodes resulting in SyntaxError: Don't know how to compare that -

if make following cypher query results expected: match (:keydata {key:"kgv"})<-[k:keydata]-(s:symbol) k.value>15.0 return k.value nodes of label keydata have properties {key: "some string"} nodes of label symbol have properties {key: "some string"} relationships of label keydata have properties {value: 123.45} but if symbol nodes matched before: match (s:symbol) match (:keydata {key:"kgv"})<-[k:keydata]-(s) k.value>15.0 return k.value i error: don't know how compare that. left: "evn" (string); right: 15.0 (double) i using neo4j 2.0.1 you comparing string value double value, not possible. have 2 options. store values in different type or use neo4j 2.1.0-m01 , use tofloat() method. e.g. where tofloat(k.value)>15.0

Contact Form PHP Email Script -

Image
hello having problem email script on site. i used files https://jonbake.com/blog/bootstrap-3-contact-form-with-captcha/ but add fields. sending email i'm not receiving data inputted on fields. here html form <form role="form" id="feedbackform"> <div class="form-group"> <input type="text" class="form-control" id="first_name" name="first_name" placeholder="first name"> <span class="help-block" style="display: none;">please enter name.</span> </div> <div class="form-group"> <input type="text" class="form-control" id="last_name" name="last_name" placeholder="last name"> <span class="help-block" style="display: none;">please enter name.</span> </di...

SQL server time related -

i want take fields 9 pm 11 table month in sql server 2008. i tried select * your_table datecol between (datecol=cast (getdate() date) , timecol<'21:00:00') , (datecol=cast (getdate() date) , timecol<'11:00:00') , datecol between '2014-01-01 00:00:00.000' , '2014-01-31 23:59:59.760' for month, fields time of 9pm t0 11 am try ! ;with cte ( select *,cast(datetime_col time) x1,cast(datetime_col date) x2 table001 ) select * cte x1 between 21:00:00 , 11:00:00 , x2 between 01-jan-2014 , 31-jan-2014 read date formats

Why isn't this AJAX request waiting? -

i try make ajax request jquery flickr, single images url , return src process further, jquery doesn't wait, returns default declaration of "": function getflickr(url){ var src = ""; var settings = $.extend({ url : url, key : '61328c74e544a789b356a36aec03acfe', secret : 'f119e504140f0964' }), id, method = 'flickr.photos.getinfo', format = 'json', id = settings.url.match(/\/photos\/(.*)/)[1].split('/')[1]; $.ajax({ type: 'get', url: 'http://www.flickr.com/services/rest/?method='+method+'&format='+format+'&api_key='+settings.key, async: false, datatype: 'json', data: {'photo_id':id}, jsonpcallback: 'jsonflickrapi', success: function(data){ src = 'http://farm'+data.photo.farm+'.static.flickr.com/'+data.photo.server+'/'+id+'_'+data.photo.secret+'.jpg'; ...

java - JOptionPane Input Dialog how to decide if the value is 2 or JOptionPane.CANCEL_OPTION -

i use following code inputdialog: string c = joptionpane.showinputdialog("select number",joptionpane.ok_option); i want user uses integervalues between 0 , 100. handle following code: while(notallowed){ try{ int t =integer.parseint(c); if(t==joptionpane.cancel_option) { notallowed=false; cancel=true; } if(t<=100 && t>0 &&notallowed) notallowed=false; } catch( exception err) {} if(notallowed) c = joptionpane.showinputdialog("only numbers between 1 , 100 allowed"); } now if uses types number 2 clicking cancel button because value of joptionpane.cancel_option 2. how can find out if cancel clicked or input value 2. joptionpane returns null if user clicks on cancel. otherwise value returned. figured out using small example: public class joptionpanetest { public static void main(string[] args) { object obj = ...

php - Is "mysqli_query() or die(mysqli_error())" a good practice? -

so use structure execute queries on php, other day pointed out bad practice. could tell me why wrong , give me tips on should instead? i'm looking learn , improve code. thanks in advance. this practice awful. it's bad heredity last century ways of writing code. instead, have add line before connection code mysqli_report(mysqli_report_error | mysqli_report_strict); it relieve need of writing code every mysql call, make mysqli throw exception in case of error automatically. while exception way better regular error, can caught , gracefully handled. yet converted error, if not caught, again right - because regular errors, depends on site-wide settings, can either shown on-screen or logged. again without need of writing single line of code. while developing, have display_errors setting on , see errors moment occurred. while on live site, display_errors have turned off , log_errors have on instead - , make exception logged, future reference.

c++ - Arduino hangs during multiple http requests on Linux but not on Windows -

Image
i have problem when send http requests arduino linux mysql server. randomly hangs after requests (~150) on windows runs smoothly. because of thinking problem not on arduino code somewhere else. the linux server runs on raspberry pi (raspbian). any suggestions? the arduino code here if(!getpage(server,serverport)) serial.print(f("fail ")); byte getpage(ipaddress ipbuf,int thisport) { int inchar; serial.print(f("connecting...")); if(client.connect(ipbuf,thisport)) { serial.println(f("connected")); strcpy(outbuf,"get /write3.php?value0="); itoa(value0,tbuf,10); strcat(outbuf,tbuf); strcat(outbuf,"&value1="); itoa(dht_humidity,tbuf,10); strcat(outbuf,tbuf); strcat(outbuf,"&value2="); itoa(temperature,tbuf,10); strcat(outbuf,tbuf); strcat(outbuf,"&value3="); itoa(pressure,tbuf,10); strcat(outbuf,tbuf); strcat(outbuf,...

java - How to use delimiter using scanner when the file contain "0195153448";"Classical Mythology";"Mark P. O. Morford";"2002";"Oxford University Press" -

how use delimiter using scanner in java when text file contain following line. "0195153448";"classical mythology";"mark p. o. morford";"2002";"oxford university press" how output: 0195153448 classical mythology mark p. o. morford 2002 oxford university press please tell me how use scanner delimiter in java here. scan.usedelimiter(pattern.compile(";")); scanner.usedelimiter("");

c# - is a Field but used like a Type error -

did miss "using"? because how see use instance not type. the error appears first time use of "settings" using system; using system.collections.generic; using system.linq; using system.text; using system.xml; using system.windows.markup; namespace ampelthingy { class save { stringbuilder outstr = new stringbuilder(); xmlwritersettings settings = new xmlwritersettings(); settings.indent = true; settings.omitxmldeclaration = true; settings.newlineonattributes = true; xamldesignerserializationmanager dsm = new xamldesignerserializationmanager(xmlwriter.create(outstr, settings)); dsm.xamlwritermode = xamlwritermode.expression; xamlwriter.save(wrappanel1, dsm); string savedcontrols = outstr.tostring(); file.writealltext(@"aa.xaml", savedcontrols); } } theres lot more wrong code, please wrap code in method. you have namespace { class { ...

ios - creating walls for simple maze game -

i doing single view game demo, maze game walls. player control character uibutton. basically have devised need check if in next step, character going intersect wall, character movement return false. but, cannot seem put them together. i have boolean function check if character going intersect wall -(boolean) checkcollision : (cgrect) newframe{ cgrect frame = self.mainchar.frame; frame.origin.x = self.currentpoint.x; frame.origin.y = self.currentpoint.y; (uiimageview *image in self.hardwalls) { if (cgrectintersectsrect(frame, image.frame)) { return true; } } return false; } my uibutton movement is -(ibaction)charmovingleft:(id)sender; { cgpointmake(mainchar.center.x -charmovement, mainchar.center.y); what should adding button method stop movement when intersection going happen? thanks in advance -(ibaction)charmovingleft:(id)sender { cgrect newframe = your_characters_frame_if_it_moved; if (![self checkcollision:newframe]; ...

java - Use fragments ans swipe views without extend fragmentsActivity -

my main activity have classic tabs, want implement swipable tabs in main actuvity, in every tutorial/guide i've found, each time main activity extends fragmentactivity : public class mainactivity extends fragmentactivity implements actionbar.tablistener { but, have other things in activity, main activity extends activity, question : how add fragments, view pager , other methods, in activity extend activity ? source http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ to host fragments, activity needs fragmentmanager , needs extend fragmentactivity , 1 standard library, or 1 support library. there no other choice.

actionscript 3 - Local connection from Flash to Air not sending data -

im trying pass score as2 swf as3 air application. first im listening local connection , loading as2 swf onto as3 air application. here's receiving side code(as3 air application): var lcairget:localconnection = new localconnection(); lcairget.allowdomain("*"); lcairget.client = this; lcairget.connect("_myconnection"); function savescore(score:string):void { trace("score: "+score); } and sending side code in as2 swf is: var lcairset:localconnection = new localconnection(); lcairset.allowdomain("*"); lcairset.send("_myconnection", "savescore", 50); but score not getting sent. i'm missing? pls help...

VBA Select value from a multicolumn listbox -

before had insert column listbox 1 working fine: listbox1.value = ws.range("g5").value it selects listbox value based on value in "g5" i achieve same functionality two-column listbox, selection in first column of listbox based on "g5" value also 1 give me error : listbox1.column(0).value = ws.range("g5").value

php - jQuery .click method doesn't work on <a> that was already made by previous method -

html: <div id="ajax_search_add_button_div"> <a id="ajax_search_add_button" style="cursor: pointer;">add</a> </div> <div id="ajax_search_added_items"> selected items: <table> <tr> <td>nr.</td> <td>item name</td> <td>amount</td> <td></td> </tr> </table> </div> javascript 1 $("#ajax_search_add_button").click(function() { $("#ajax_search_added_items table").append('<tr><td>1</td><td>2</td><td>3</td><td><a id="ajax_search_remove_button" style="cursor: pointer;">remove</a></td></tr>'); }); javascript 2 $("#ajax_search_remove_button").click(function() { $(this).closest("tr").remove(); }); why nothing happen...

android - How can I get button pressed time when I holding button on -

i have button, press , continue holding it, if holding time exceeds time interval fires kind of intent, how can this. try this you can use touch listener this. try: handler handel = new handler(); b.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view arg0, motionevent arg1) { switch (arg1.getaction()) { case motionevent.action_down: handel.postdelayed(run, 5000/* or amount of time want */); break; default: handel.removecallbacks(run); break; } return true; } }); where b view (in case should button) on want make long click. and runnable run follows runnable run = new runnable() { @override public void run() { // code run on long click } }; hope help... :)

javascript - Using DOMParser to render html is a good way? -

i'm thinking create website chrome , firefox. rendering html element dynamicaly, using domparser code snippet below bad way? googled 'domparser' , didn't see codes in use case. know best practice or general way it. var core = {}; var somehtml = '<div class="test1"><div class="test2">this string more complicated</div></div>'; core.onready = function(){ var parser = new domparser() , parsed = parser.parsefromstring(somehtml, 'text/html') , element = parsed.body.firstchild; document.body.appendchild(element); }; there nothing wrong this. if want test if html valid before adding page. generally, people like: document.body.innerhtml += somehtml; from speed point of view, you're unlikely notice massive performance hit using domparser unless you're doing lot of html. http://jsperf.com/html-parsing-performance-element-innerhtml-vs-domparser/2

Create exe with custom icon using Perl Par Packer -

i trying create exe file perl script custom icon .i have tried these commands pp -i "myicon.ico" -o file.exe file.pl pp --icon "myicon.ico" -o file.exe file.pl pp --icon "fullpath\myicon.ico" -o file.exe file.pl but couldnt solve issue.any suggestions appreciated.thanks. update : code pp --gui --icon myicon.ico -o out.exe file.pl . have got error unknown option: icon binary 'myicon.ico' sure doesn't smell perl source! can't locate method "maybe_command" via package "mm" the options --icon , --info have been removed latest versions of par::packer. according comments module's author on cpan bug tracker, options corrupt files, , since delegated win32::exe anyway expects people use win32::exe directly. 1 here's handy one-liner remove default camel icon , add own .ico file. noted hariboo, icon file must match attributes of original camel icon, i.e. 32x32 pixels. perl -e "use ...

Plotting surface of a sphere using 3d Delaunay triangulated panels in R -

Image
[ edit : more general solutions can seen in answers this question ] i'm wondering if can me plot approximation of surface of sphere using xyz coordinates. have tried calculating delaunay triangulated panels using package geometry , plot iwith rgl . first attempt, looks nice, unfortunately created delaunay 3d triangles cross through sphere. plot surface: generate 3d xyz data of sphere n <- 10 rho <- 1 theta <- seq(0, 2*pi,, n) # azimuthal coordinate running 0 2*pi phi <- seq(0, pi,, n) # polar coordinate running 0 pi (colatitude) grd <- expand.grid(theta=theta, phi=phi) x <- rho * cos(grd$theta) * sin(grd$phi) y <- rho * sin(grd$theta) * sin(grd$phi) z <- rho * cos(grd$phi) xyzw <- cbind(x,y,z,w=1) calculate 3d delaunay triangles , plot rgl: #install.packages("geometry") library(geometry) library(rgl) tc <- delaunayn(xyzw[,1:3]) open3d() tetramesh(tc,cbind(x,y,z), alpha=0.2, col=5) rgl.snapshot("3d_delaunay.png") ...

c# - Combobox in radgrid - Selected value is not written to the db -

this combo box in asp.net page , intention bind nvarchar(50). user select 1 of values , update db. <telerik:radcombobox id="radcombobox1" runat="server" selectedvalue='<%# bind("inbudgettt") %>'> <items> <telerik:radcomboboxitem text="in budget" /> <telerik:radcomboboxitem text="not in budget" /> </items> </telerik:radcombobox> the problem: doesn't matter select, never written in db. hint on how solve problem? use selectedindexchanged event update database: http://www.telerik.com/help/aspnet-ajax/combobox-server-side-selectedindexchanged.html . selectedvalue property indicates control should show selected item.

location - iOS xCode/Objective C - Simple - Display user's city as a label? -

alright i'm making ios app.. incredibly new @ programming apps ios... (i have experience programming, new me) i trying display user's city & state on screen.. don't know i'm doing wrong. have this: (there's warning says unused variables city , state [i don't know how fix this]).. way single view , i'm using storyboard (i wish didn't have to.. work better code) #import "voiviewcontroller.h" #import <corelocation/corelocation.h> #import <addressbook/addressbook.h> @interface voiviewcontroller () <cllocationmanagerdelegate> @property (nonatomic, strong) cllocationmanager *locationmanager; @property (weak, nonatomic) iboutlet uilabel *city; @property (weak, nonatomic) iboutlet uilabel *state; @end @implementation voiviewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. } - (void)didreceivememorywarning { [super didreceivememorywarning]; ...

javascript - range getClientRects(), getBoundingClientRect() wrong when empty anchor is in HTML paragraph -

i found possibly weird behaviour of getclientrects() [getboundingclientrect()] : look @ html code: <p>text here... word1<a id='id' class='class'/>word2 other multiline text here...</p> [note element has no text inside, tested kind of code, don't know if other arrangements give same 'bug'.] let's when user selects range in p 'estate' has anchor inside, "word1 word2", js function stores start/end elements , offsets. next time function creates range bounds. if getclientrects() called on range yields many rects other 2 expected: first , last rects of array indeed expected ones, but, between them, there many rects in fact cover entire p element. [ range.getboundingclientrect() affected too.] how avoid this?

python - How to join two models by id (without ForeignKey) and sort by linked model fields in admin -

i have problem joining 2 django models in django admin. what have , can't change? (of course changed shortcut of have) class thing(models.model): name = models.charfield() class thingrelation(models.model): related_thing1 = models.integerfield() related_thing2 = models.integerfield() where related_thing relation thing.id . now have django admin: class thingrelationadmin(admin.modeladmin): list_display = ('related_thing1', 'related_thing1_name', 'related_thing2', 'related_thing2_name') def related_thing1_name(self, obj): try: thing = thing.objects.get(id=obj.related_thing1) except objectdoesnotexist: return '' return thing.name def related_thing2_name(self, obj): try: thing = thing.objects.get(id=obj.related_thing2) except objectdoesnotexist: return '' return thing.name now point. far works fine. w...

xml - Using table attributes -

this sample xml: <recommendedaction> <table border="1" cellpadding="1" style="width:500px"><tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>f</td></tr></tbody></table> <table border="5" cellpadding="50" style="width: 300px;"><tbody><tr><td><br /></td><td><br /></td></tr><tr><td><br /></td><td><br /></td></tr><tr><td><br /></td><td><br /></td></tr></tbody></table> </recommendedaction> i have 2 questions: 1. how can use width attribute in table template? 2. how can use cellpadding attribute in td template? this sample xsl: <xsl:template match="table"> ...

javascript - jQuery Ajax, prevent the refresh button when the ajax is in progress -

hi have perform perform like, when ajax in progress, not allow user page refresh. here code have $('#submit').click(function() { $(function() { $(".col1").mask("generating csv...."); //this generate mark, here prevent user doing sort of operation. var = $('#filters_date_to').val(); var = $('#filters_date_from').val(); $.ajax({ url:"../dailytrade/createcsv?filters[date][to]="+to+"&filters[date][from]="+from,success:function(result){ if(result) { $(".col1").unmask(); //here can unlock user using refresh button. window.location = '../dailytrade/forcedownload?file='+result; settimeout('location.reload(true);',5000); } } }); }); }); any suggestions. i doubt if should that. $(window).bind('befo...

c++11 - C++ Standard doesn't say anything about operator!=() and operator==() for enum classes -

section 7.2 enumeration declarations doesn't operator!=() , operator==() scoped enumeration. code below compiles. #include <iostream> enum class month{jan = 1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov , dec}; int main() { month = month::feb; month b = month::jul; month c = a; if( != b ) std::cout << "a |= b" << '\n'; if( == c ) std::cout << "a == c" << '\n'; } the built-in operators specified in 5.10: the == (equal to) , != (not equal to) operators have same semantic restrictions, conversions, , result type relational operators except lower precedence , truth-value result. this defers specification of relational operators in 5.9; enumerations that's specified 5.9/5: if both operands (after conversions) of arithmetic or enumeration type, each of operators shall yield true if specified relationship true , false if false. so, 1 might expect, compariso...

bash - The variable is empty after inner loop `for` -

i know pipes proceeding in subshells, need little help.. got following code: #!/bin/bash first="" second="" item1 in $(ls *.o) first=`nm $item1 | grep -e '\<u\>' | awk '{print2}'` item2 in $(ls *.o) second=`nm $item2 | grep -e '\<t\>' | awk '{print3}'` if [ "$first" == "$second" ]; echo "$item1 => $item2 ($second)" else echo "error!" fi done done after script has been executed, i'm receiving empty $second (in brackets): print_recursive.o => print_recursive.o () print_recursive.o => recfun.o () print_recursive.o => recursive.o () print_recursive.o => timeout.o () would mind rewrite code in right order? in advance. always strive come minimal example . problem has nothing loops. if have problem variable, check command sets it. in case: second=`nm $item2 | grep -e '\...

javascript - Totaljs Unirest -

i have problem totaljs framework , unirest module. error: **typeerror: object function (count){var arr=[];var self=this;var length=self.length;for(var i=0;i=count)return arr}return arr} has no method 'tolowercase' typeerror: object function (count){var arr=[];var self=this;var length=self.length;for(var i=0;i=count)return arr}return arr} **has no method 'tolowercase'**** function view_homepage() { var self = this; var unirest = require('unirest'); unirest.post('http://httpbin.org/post') .headers({ 'accept': 'application/json' }) .send({ "parameter": 23, "foo": "bar" }) .end(function (response) { console.log(response.body); }); self.view('homepage'); } but don't understand error because sails.js works fine. thank you you can use built-in function: function view_homepage() { var self = this; utils.request(...

Submit form with javascript external file -

i have login page: <html> <head> <title>todo supply title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" media="screen" /> <script src="http://code.jquery.com/jquery.js"></script> <script type="text/javascript" src="js/loader.js"></script> </head> <body> <div id ="header_login"></div> <div id ="fdm_intro"></div> <div id="footer"></div> </body> </html> and fallowing header: <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> ...

Dash board icons as table android layout -

Image
how can apply design ???? these squares different icons , set on background image . it looks post code; please add more details.it looks post code; please add more details. my trial , crash , want solution . opinion ؟؟؟؟ thank in advance . <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/dashboard" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/icons_background" android:orientation="vertical" > <linearlayout style="@style/dashboard_content_vertical" > <framelayout style="@style/dashboard_space_horizontal" > </framelayout> <linearlayout style="@style/dashboard_content_horizontal" > <imageview style="@style/dashboard_imageview" android:onclick="onm...

Is there any why to create java object files with JSon string -

i want automator library take json string , generates java files. example input json = {name:"max",phone:"416465465",email:"xyx@gmail.com"} output file public class object{ public string name; public string phone; public string email; } yes there is: jsonschema2pojo . have @ demo site . it has mode generate pojos out of json schemas, out of "plain" json objects. note: json schema draft v3 only, not v4.

html - Verticle text align for multiple lines -

Image
1) wondering how can have text in 1 block aligned centerally in page (both vertically , horizontally). 2) want each line of text flush other lines of text. ideas? demo html <div class="row"> <div class="panel"> <div class="large-12 columns" id="date"><span>5th may 2014</span> </div> <div class="row"> <div class="large-12 columns" id="title"><span>highgate market & fair</span> </div> <div class="row"> <div class="large-12 columns" id="desc"><span>arts, crafts, collectables , fine foods</span> </div> <div class="row"> <div class="large-12 columns" id="address"><span>lauderdale house waterlow park highgat...

php - Can't make query work with variable -

i have query and i.state = 1 , i.language = "'.$mylang.'" , i.access in ('.implode(',', $user->getauthorisedviewlevels()).') i should content current language) strange thing php variable $mylang it's not working ( writing it-it ) content. allready checked result of $mylang , = it-it . any clues? thanks. i'm not sure 1=1 subclause in ignoring try this: $db = jfactory::getdbo(); $query = $db->query(true); $query->select('i.*') ->from($db->qutename('#__content')) ->where($db->quotename('i.state') . ' = 1') ->where($db->quotename('i.language') .' = ' $db->quote($mylanguage)) ->where($db->quotename('i.access') . ' in (' . impode(',',$user->getauthorisedviewlevels()) . ')' ) ... ; $db->set($query); .... also, if queries not working best thing echo $query->dump() see rendered query, can...

AngularJS Scope Doesn't Update After New Request -

i'm new angularjs still have been reading lot of material , started test out things learning. i'm trying write code uses service reaches last.fm api , returns list of similar artists. i'm returning result fine api , can see results if send them console. said, after 1 search subsequent searches don't update scope properly. code follows: controller .controller('lastfmcontroller', function($scope, lastfm) { $scope.search = function(artist) { lastfm.getsimilar(artist).then(function(result) { $scope.artists = result.similarartists.artist; }, function(error) { $scope.error = error; }); }; }); view <form role="form"> <div class="form-group"> <label for="artist">search music artist , see similiar artists</label> <input type="text" name="artist" class="form-control" ng-model="artist" placeholder=...

java - DHXScheduler Save/Get Custom Lightbox Fields -

i using dhxscheduler in jsp application exam timetabling. added custom lightbox own fields information exams. this eventsmanager class saves, creates , gets events. extends class dhxeventsmanager. public class eventsmanager extends dhxeventsmanager { public eventsmanager(httpservletrequest request) { super(request); } public iterable getevents() { connection conn = null; dhxeventsmanager.date_format = "yyyy-mm-dd hh:mm:ss"; list<event> events = new arraylist<event>(); try { conn = sqlhelper.getconnection(); statement statement = conn.createstatement(); stringbuffer query = new stringbuffer(); query.append("select * "); query.append(timetableevent.tbl_events); query.append(" e join "); query.append(studyunit.tbl_studyunits); query.append(" s on e."); query.append(timetableevent.fld_unitcode); query.append(" =...

python - When I try to run 'cfx run' or 'cfx test' using the Mozilla Add-On SDK, my application binaries are not found -

i installed the latest add-on sdk mozilla (version 1.15). installation successful , when execute cfx list of possible commands. made new separate empty folder, cd'd , ran cfx init . successful , necessary folders , files got created. now when try run extension or test it, following error: i can't find application binary in of default locations on system. please specify 1 using -b/--binary option. i have tried looking docs see kind of file should looking unsuccessful in solving issue. tried create empty bin folder within add-on folder , have tried initiating template in different parents , sub-folders. still same message. i'm running on mac, osx mavericks 10.9.1 what's going on here exactly? it's looking firefox binary file, not application's binaries. have install firefox because cfx run open browser add-on installed can use , test live. if firefox installed, in non-standar path, must tell cfx command find it, way: cfx run -b ...

c# - How to retrieve a variable of type GeoCoordinate from app settings? Windows Phone -

i'm trying save pushpins on map app settings loaded after app closes, i'm not sure how retrieve variable storage. know how achieve loading pushpins onto map after saved? this have tried far, save pushpins isolated storage after added map in onnavigatedto protected override void onnavigatedto(navigationeventargs e) { if (navigationcontext.querystring.containskey("geolat") && navigationcontext.querystring.containskey("geolong") && navigationcontext.querystring.containskey("pname")) { var latitude = convert.todouble(navigationcontext.querystring["geolat"]); var longtitude = convert.todouble(navigationcontext.querystring["geolong"]); var mygeoposition = new geocoordinate(latitude, longtitude); var pushpinname = navigationcontext.querystring["pname"]; drawpushpin(mygeo...

find string with regex in php -

i new regex , therefore gone through php manual regex , tried below: i have string this: c-1 c-10 c-100 , on upto c-unlimited now want confirm string coming valid string starts c- , after c- contains numbers.. to work have used preg_match $slug='c-12'; if(preg_match("/\[c-(.*?)]/",$slug,$result)){ echo "true";} else{ echo "false"; } also this: $pattern = '/^c-/'; if(preg_match($pattern, substr($slug,2), $matches, preg_offset_capture){ echo "true";} else{ echo "false"; } and this: $pattern = '/^c-/'; if(preg_match($pattern, $slug, $matches, preg_offset_capture, 3){ echo "true";} else{ echo "false"; } and 1 more thing wanted to validate string end. below: $slug="my-string-content-123"; here wanted validate string contains number @ end after - example 123 but not able work... , sorry bad english.. any or suggesstion great help.. in advance.. ...

excel - Batch file to search files in a folder -

i need bat file search excel files in folder. should following search in folder looks excel files after created date if older system date deletes excel file if not runs converter.js can 1 help. here go. remove echo's script once see output on screen. also, i'm not sure how running converter.js you'll need change line , if file dates in different format, you'll have re-arrange "%mm%/%dd%/%yyyy%" too. @echo off setlocal enabledelayedexpansion pushd "c:\location\of\files\" /f "tokens=2 delims==" %%a in ('wmic os localdatetime /value') set "dt=%%a" set "yy=%dt:~2,2%" & set "yyyy=%dt:~0,4%" & set "mm=%dt:~4,2%" & set "dd=%dt:~6,2%" /f "tokens=*" %%a in ('dir /o-d /b /tc *.xls') ( /f "tokens=1" %%b in ("%%~ta") ( if "%%b" neq "%mm%/%dd%/%yyyy%" ( echo del "%%a" ) el...

ios - sencha keeps session cookies from development version and compiles with ipa -

i have app uses sencha stores keeping users session fine , works upon building ios found other users checking app when passed ipa automatically logged in me , had access facebook seeming has stored session db emulator , packaged app. how can delete session , ensure session not passed in ipa?? this serious issue indeed

c# - Writing MemoryStream into SaveAs Dialogue Box in WInform -

i have image want write itext pdf file using c#.here code generate image chart , write itext pdf file. document pdfdoc = new document(pagesize.a4, 10f, 10f, 10f, 0f); using (memorystream stream = new memorystream()) { pdfdoc.open(); piechart.saveimage(stream, chartimageformat.png); itextsharp.text.image chartimage = itextsharp.text.image.getinstance(stream.getbuffer()); chartimage.scalepercent(75f); pdfdoc.add(chartimage); } pdfdoc.close(); now per reuirement have open pdf file using save dialogue box.here code trying open pdf file.. stream mystream; savefiledialog savefiledialog1 = new savefiledialog(); savefiledialog1.filter = "pdf files (*.pdf)|*.pdf|all files (*.*)|*.*"; savefiledialog1.filterindex = 0; savefiledialog1.restoredirectory = true; if (savefiledialog1.showdialog() == dialogresult.ok) { if ((mystream = savefiledialog1.openfile()) != null)...

Highcharts - adding a question mark where data is missing in a bar chart -

i want add question mark highcharts bar chart data in data set null, because value 0 shown in same way when data null. possible? edit mean column chart i found solution. need set point 0 formatter know draw image: var series = [8, 7, 8, null, 9] $(function () { $('#container').highcharts({ title: { text: 'example null values' }, series: [{ name: "values", data: series, type: "column", zindex: 0, color: "#55f26a" }], plotoptions: { column: { datalabels: { enabled: true, usehtml: true, formatter: function() { if(this.y == null) { this.point.update(0); return "<img src='http://placehold.it/20'/>"; ...

big o - solving recurrence T(n) = T(n/2) + T(n/2 - 1) + n/2 + 2 -

need on solving runtime recurrence, using big-oh: t(n) = t(n/2) + t(n/2 - 1) + n/2 + 2 i don't quite how use master theorem here for n big enough can assume t(n/2 - 1) == t(n/2) , can change t(n) = t(n/2) + t(n/2 - 1) + n/2 + 2 into t(n) = 2*t(n/2) + n/2 + 2 and use master theorem ( http://en.wikipedia.org/wiki/master_theorem ) for t(n) = a*t(n/b) + f(n) = 2 b = 2 f(n) = n/2 + 2 c = 1 k = 0 log(a, b) = 1 = c and have ( case 2 , since log(a, b) = c ) t(n) = o(n**c * log(n)**(k + 1)) t(n) = o(n * log(n))