Posts

Showing posts from August, 2014

how to show the alert box when half of the time finished in online exam using javascript -

i doing online exam. set timer exam using javascript. working perfect.i have little knowledge in javascript. don't know how show alert box when half of test over. please give solution me. my code timer: function countdown() { sec--; if (sec == -01) { sec = 59; min = min - 1; if(min==-01) { min=59; hour=hour-1; }else { hour=hour; } } else { min = min; } if (sec<=9) { sec = "0" + sec; } time = (hour<=9 ? "0" + hour : hour) + " : " + (min<=9 ? "0" + min : min) + " : " + sec + ""; if (document.getelementbyid) { document.getelementbyid('timer').innerhtml = time; } sd=window.settimeout("countdown();", 1000); if (hour=='00'&& min == '00' && sec == '00') { sec = "00";min="00"; window.cleartimeout(sd); window.location=document.f

Avoid instantiating new objects inside loops in java -

i avoid crating new instance of selectitem in side loop. please me how can avoid it. public list<selectitem> createlocales() { final list<selectitem> enabledlocales = new arraylist<selectitem>(); final list<string> langcodes = labeldbservice.getenabledlocales(); logger.debug("getenabledlocales: size={0}", langcodes); (final string langcode : langcodes) { enabledlocales.add(new selectitem(langcode, localeutils.tolocale(langcode).getdisplayname())); } return enabledlocales; } public list<selectitem> createlocales() { final list<selectitem> enabledlocales = new arraylist<selectitem>(); final list<string> langcodes = labeldbservice.getenabledlocales(); final selectitem sitem = new selectitem(); logger.debug("getenabledlocales: size={0}", langcodes); (final string langcode : langcodes) { sitem.setvalue(langcode); sitem.setlabel(localeutils.

paraview python scripting equivalent of File->save Data -

i automate exporting csv files vtk/vtu files. right now, steps take are: open paraview load in pvd file stores information vtu files (one each time steps in pde simulation) goto properties tab on left, hit 'apply' file->save data... provide base file name, select 'points' , 'write timesteps' this writes csv file each timesteps name basefilename#timestepno#.csv is there way commandline (there's no x server on computer that's doing computations), eg using python interface? try following in either python shell in ui or using pvpython or pvbatch python executables. from paraview import simple reader = simple.opendatafile("..../foo.pvd") writer = simple.createwriter("..../foo.csv", reader) writer.writealltimesteps = 1 writer.fieldassociation = "points" writer.updatepipeline()

extjs - Sencha Ext JS 4 Chart: Customize xField (Category) label position -

Image
i trying port application flex 3 sencha ext js 4 . application has dashboard having column chart (pleasee see first image below). value xfield long text. as possible, don't want label rotated. well, think it's kinda messy. if possible, want label positioned alternately if doesn't fit. label : { rotate : {degrees:45} } below image sencha custom chart. of category label not shown. i thinking of customizing onplacelabel function don't know how so. how gonna achieve needed? that's ext.chart.axis.axis#drawhoriztontallabels need override. onplacelabel stuff written in chart itself. labels @ top of bar, see mean? the clean way override class , implement jolly options. i'll let explore full code i've put @ end of post if want understand implementation... ext.define('ext.ux.chart.axis.axis.overlappinglabeloptions', { override: 'ext.chart.axis.axis' ,labelrows: 1 ,hideoverlappinglabels: true

Can Selenium be run on a server to automate tasks, or does it need a browser to run the task inside of -

i reading on selenium docs , couldn't quite work out whether run on server - part of larger web app. ie. happens in web app triggers automated selenium script run, returns result web app. is possible use of selenium or need actual browser run tasks inside of, or can run virtual browser ? selenium need instance of browser control. luckily, there browsers out there aren't heavy usual browsers know. don't have open ie / firefox / chrome / opera. can use htmlunitdriver controls htmlunit - headless java browser not have ui. or phantomjsdriver drives phantomjs - headless browser running on webkit. those headless browsers less memory-heavy, faster (since don't have render anything), don't require graphical interface available computer run @ , therefore usable server-side.

c# - Secure Login Or Login check in asp.net -

i new in asp, here question have website pages home, about, contact, , login . in website user can login , access home page, on home page there grid view master page. problem user can access home page without login , edit path in address bar. example login page path is http://lolhost:54515/mastergridvie/login.aspx and user edit it http://localhost:54515/mastergridvie/home.aspx so user can go on home page without login, how can prevent this? i know there use session, have no idea how , create session :( please can me? create session in login page this. session["userid"]="something"; and after check in every page load this. if(session["userid"] == null) { response.redirect("login.aspx"); }

I created an event in 1 viewmodel and want another to subscribe to it, how do I find it? WPF MVVM -

as title states... how can find different viewmodel.... my first guess search usercontrol it's bying used , go through that... seems lot of work must easy find.... you can make use of messenger class. when want execute method present in 1 viewmodel in other viewmodel .. can send message viewmodel (which holds event want execute) viewmodel (from want acess) , can execute event. register message in constructor of class in event declared. send message viewmodel (in want access) @ point want use event.

Image slider in android using library -

i using library androidtouchgallery but want image width , screen width match. can manage height giving specific size width displayed less screen size. please me in this...

android - Out of memory error while parsing a large json response -

i have large json response . storing in string. getting out of memory error while parsing json. here parsing this public arraylist<string> parsing() { system.out.println("parsing start"); arraylist<string> urls=new arraylist<string>(); smusicname=null;smoviename=null; sbookname=null;stelevisionname=null; int position=0; try { jsonobject node1=new jsonobject(response); jsonarray array1=node1.getjsonarray("data"); int length=array1.length(); for(int i=0;i<length;i++){ if(array1.getjsonobject(i).getstring("id").equals(friendid.tostring())){ position=i; } } jsonobject node2 = array1.getjsonobject(position); try{ if(node2.has("music")) { jsonarray array2=node2.getjsonobject("music").getjsonarray("data"); jsonobject node4=array2.getjsonobject(0);

android - Nexus 7 takes styling of landscape mode when the device is oriented from landscape to portrait after some idle time -

i facing strange issue nexus 7 regarding css media queries. media query runs fine on orientation change, if keep device in landscape mode , keep idle time , on orientation change viewport takes styling of landscape mode other portrait mode styling. here code have written <!doctype html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="css/css.css" rel="stylesheet" type="text/css" /> </head> <body> <div></div> </body> </html> and in css file styling below. div {height: 500px; width: 500px;} @media screen , (min-width:480px) { div {background: red;} } @media screen , (min-width:768px) { div {background: green;} } for other devices ipad, iphone, s3 etc media queries runs fine if these devices kept idle , on orientation takes respective viewport styling, on nexus 7 div colour remains green when o

ios - IBM Worklight - Is it possible to deploy an app on iPhone device without a Mac and Xcode? -

i don't have macbook pro have iphone 4s. can deploy worklight app on iphone without using mac , xcode? you cannot deploy worklight application on ios device without first going through xcode (the ios ide), can used on mac. the worklight studio plug-in eclipse generates xcode project used. next step open in xcode. so again, w/out mac , xcode, cannot proceed deploying application (unless want use 3rd party provider , give him developer signing identity , private key, highly insecure(!)). the answer no.

AngularJS + Jersey RESTful backend: Authentication & Authorization -

i'm building angularjs web-app uses jersey restful ws provider. want users able login , perform operations. should use oauth this? i've seen people mentioning oauth lot in context of offering third parties opportunity access data in backend belongs users (e.g facebook login), in case me, frontend making calls backend. before, used jsf , cdi, decided switch angular, backend , frontend not "glued-together" used be. should use oauth use case? there better way it? if want have loosely coupled api might used other frontends and/or services oauth way go in opinion. can save lot of cross domain headaches (ie9 won't allow cookies, authentication etc. included in cross domain requests instance). if you're absolutely sure it's going own frontend, i'd consider placing api in same web application, solve authentication using same frontend.

r - error when specifying latitute dimension when reading Netcdf files -

i want read 2 netcdf files (climate data 2 years) , combine data of 1 single grid (lon [15] , lat[15]) array (named prec_year), script below. i got error: "error in r_nc_get_vara_double: netcdf: index exceeds dimension bound var: precip ndims: 3 start: 0,4294967284,59count: 366,1,1error in get.var.ncdf (ex.nc, "precip", start = c(lon[1], lat[15], 1), : c function r_nc_get_vara_double returned error" but when dont specify lat[], example "start = c(lon[1], 1,1)", works fine. please (1) why got error, , (2) how fix it? many thanks! -------------------- setwd ("d://historic climate data/aphrodyte/prec_025/join 2 years") prec_origin <- c(1:2) filenames <- list.files(pattern = null, all.files = false) for(i in filenames){ filepath <- file.path("d://historic climate data/aphrodyte/prec_025/join 2 years/",paste (i,sep="")) ex.nc = open.ncdf (filepath, readunlim=false) lon = get.var.ncdf(

android - Delete a single phone type number from a contact -

when 1 of contact have multiple numbers, example: display name: guesswho type = home number = homenumber type = mobile number = mobilenumber type = other number = othernumber ... in conclusion ... 1 those . how can remove type number contact ( let's "mobile" )? have update using userid acquired previous query, or how? need delete single type number, other field of contact must remain intact. i using piece of code obtaining contact : int indexname = c.getcolumnindex(contactscontract.commondatakinds.phone.display_name); int indexnumber = c .getcolumnindex(contactscontract.commondatakinds.phone.number); int indextype = c.getcolumnindex(contactscontract.commondatakinds.phone.type); int indexid = c.getcolumnindex(contactscontract.commondatakinds.phone._id); string name = c.getstring(indexname); string number = c.getstring(indexnumber); string type = c.getstring(indextype); string typestored = (string

tomcat7 - Error while deploying application in tomcat 7 -

hi getting following error while deplying application in tomcat: jul 25, 2013 5:04:43 pm org.apache.catalina.deploy.namingresources cleanup warning: failed retrieve jndi naming context container [standardengine[catalina].standardhost[localhost].standardcontext[/oms-inter-web]] no cleanup performed container javax.naming.namenotfoundexception: name [comp/env] not bound in context. unable find [comp]. @ org.apache.naming.namingcontext.lookup(namingcontext.java:820) @ org.apache.naming.namingcontext.lookup(namingcontext.java:168) @ org.apache.catalina.deploy.namingresources.cleanup(namingresources.java:988) @ org.apache.catalina.deploy.namingresources.stopinternal(namingresources.java:970) @ org.apache.catalina.util.lifecyclebase.stop(lifecyclebase.java:232) @ org.apache.catalina.core.standardcontext.stopinternal(standardcontext.java:5494) @ org.apache.catalina.util.lifecyclebase.stop(lifecyclebase.java:232) @ org.apache.catalina.util.lifecyclebase.st

how to get mobile number automatically in android application resistration like whatsapp -

how can mobile number automatically after user installs android application. when registered in application without entering manually. using following code. telephonymanager manager =(telephonymanager)getsystemservice(context.telephony_service); string phonenumber = manager.getline1number(); make sure have permission read_phone_state in manifest also please here more information!

android - AutoCompleteTextView Items not Clickable when containing ToggleButton -

i ran strange problem when dealing autocompletetextviews. i've got following layout items: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:minheight="48dp" android:orientation="horizontal" android:padding="8dp" > <textview android:id="@+id/name" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="some place visited" android:textappearance="?android:attr/textappearancemedium" /> <togglebutton android:id="@+id/starred" android:layout_width="32dp" android:layout_height="32dp" android:layout_gravity="ce

c# - Autofiltering records in grid in asp.net according to keywords -

i want search items in grid in asp.net c#. while search records want don't want hit search button , grid filtered. want grid should filtered records match keyword entering. guess can done using html5 or j query. not able phrase search google. pleas help. in advance. have @ datatables use lot custom filtering & sorting , it's doddle use

Google Apps Script, OAuth requiring Login with Anonymous -

i'm trying pull revision history document own. when debug it, receive 401 error requiring login. however, i'm trying use anonymous consumerkey/consumersecret pass login , when debug it, urlfetch comes undefined. here's code have far: //get revison history //fileid id of resource google docs function getrevisionhistory(fileid){ //scope var scope = 'https://www.googleapis.com/auth/drive'; //get google oauth arguments var fetchargs = googleoauth_('docs', scope); //set fetch method fetchargs.method = 'list'; //feed url var url = 'https://www.googleapis.com/drive/v2/files/' + fileid + '/revisionsv=3&alt=json'; var urlfetch = urlfetchapp.fetch(url); //get json of revision history entry var jsonfeed = utilities.jsonparse(urlfetch.getcontenttext()).feed.entry; //return revison history feed return jsonfeed } //google oauth //used getrevisionhistory function googleoauth_(name, scope) { var oauthconfig = urlfetchapp.addoauths

mysql - Select where sum less than value -

i working on php/mysql timesheet system, , report want create selects employees have worked less required amount of time between 2 dates. employee's time stored in hours , minutes (int), concerned hours. the employee table looks like: id | name 1 | george 2 | fred the timesheet_entry table: id | employeeid | hour | date 1 | 1 | 2 | 2013-07-25 2 | 2 | 4 | 2013-07-25 3 | 1 | 3 | 2013-07-25 so if select employees have worked less 5 hours (php variable hrslimit) on 2013-07-25, should return 2 fred, george has worked total of 5 hours on date. have html form user can set variables query. i have tried: select employeeid, employeename employee join timesheet_entry tse on tse.tse_employeeid = employeeid , sum(tse.hour) < $hrslimit i have not worried date yet. the confusing bit here joining 2 tables. perhaps should select hours , put sum clause @ end in instead? you need group da

gps - Auto enable Wi-fi Location in Android 4.2.x -

i trying enable wi-fi & mobile location setting using code not got proper solution. i able check if enable or disable using below code. string provider = settings.secure.getstring(getcontentresolver(), settings.secure.location_providers_allowed); if provider having "network" string wifi location enable otherwise disable. but can pragmatically directly enable without prompt dialog? is posible? startactivityforresult(new intent(android.provider.settings.action_location_source_settings), 0); i know can open setting screen directly don't want open directly enable, same gps. below link work gps satelitte option. how wi-fi location? how can enable or disable gps programmatically on android? i using android 4.2 version. but can pragmatically directly enable without prompt dialog? fortunately, no, obvious privacy , security reasons. below link work gps satelitte option fortunately, android devices not affected security flaw.

Get the hosts for an hadoop job -

i need hosts (so actual machines) differente tasks (mapper , reducer) of hadoop job run. got long running job , need retrieve hosts tasks running. need information in external programm, not inside actual jobs. i know can use hadoop job -list-attempt-ids job_201307251119_0004 map running task attempts, not show me hosts. i know can use jobclient retrieve host of finished task. in case, task still running. the solution came mind parse job-tracker-http-interface html page contains host in urls point log-files. not seem right way go, alternatives? since want hostname mapper/reducer running, write few additional java lines inside mapper/reducer find it. perhaps : string hostname = java.net.inetaddress.getlocalhost().gethostname(); idk if need.

ios - Shake doesn't work when alert is shown -

i implemented shake gesture event. when shake occurs stuff. however if alert shown don't event. here have: - (void)viewdidappear:(bool)animated{ [super viewdidappear:yes]; // register shake detection [self becomefirstresponder]; } - (bool) canbecomefirstresponder{ return yes; } - (void)motionended:(uieventsubtype)motion withevent:(uievent *)event { if (motion == uieventsubtypemotionshake){ dlog(@"shake ended"); } } is possible shake gesture when alert shown ? try - (void)motionended:(uieventsubtype)motion withevent:(uievent *)event { if ( event.subtype == uieventsubtypemotionshake ) { // put in code here handle shake } if ( [super respondstoselector:@selector(motionended:withevent:)] ) [super motionended:motion withevent:event]; } - (bool)canbecomefirstresponder { return yes; }

c# - Image to string -

Image
i have news list, contain thumbnails: i'm getting json server, means pictures - links my code inserting pictures: foreach (article article in newslist.result.articles) { newslistboxitem nlbi = new newslistboxitem(); nlbi.title.text = article.title; nlbi.date.text = us.unixdatetonormal(article.date.tostring()); nlbi.id.text = article.id.tostring(); if (article.imageurl != null) { bitmapimage image = new bitmapimage(new uri(article.imageurl)); nlbi.thumbnail.source = image; } newslistbox.items.add(nlbi); } if enter application in offline mode - wont show up, need save them, prefered method - string! which means need convert them base64: bitmapimage image = new bitmapimage(new uri(article.imageurl)); byte[] bytearray = null; using (memorystream ms = new memorystream()) { writeablebitmap wbitmp = new writeablebitmap(image ); wbitmp .savejpeg(ms, wbitmp.pixelwidth, wbitmp.pixelheight, 0, 100); ms.seek(0, seeko

c# - Read serialized file associated with a program upon open -

i have finished program, serialized saving , created fileopen system open file saved application. have created file association innosetup on registry, works fine. all want achieve is, whenever user double click on saved file program, program should read , deserialize it. for example, when double click or open .docx or .doc file, microsoft word opened , file read , opened. presently program open, don't know how detect when opened file can start deserialization. note: deserializing not problem, it's detecting whether or not should so. when start program double clicking on associated file, filename passed in command line argument. specify argument occur in file extension association setup. if set association as: program.exe %1 double clicking file result in: program.exe c:\folder\file.ext this can accessed using environment.getcommandlineargs() or main(string[] args) method: static void main(string[] args)     {         if (args.length >

R- plot numbers instead of points -

i have made scatterplot, different symbols each data series. want make same scatterplot point show numbers. not value of each point, assigned number. as of right now, have 3 depths plotting (0, 3, 6cm). have 0cm triangles, etc. want 0cm points character 0, 3cm points show 3, , 6cm points show 6. is possible? sure, pass pch parameter character. dat <- data.frame(x=rnorm(100), y1=rnorm(100)-1, y2=rnorm(100), y3=rnorm(100)+1) plot(y1 ~ x, data=dat, pch="0", ylim=c(-4, 4)) points(y2 ~ x, data=dat, pch="3") points(y3 ~ x, data=dat, pch="6") eta: 1 nice thing pch parameter, many base graphics parameters, vectorised. can (which works agstudy's answer). dat <- data.frame(x=rnorm(300), y=rnorm(300) + c(0,3,6), depth=rep(c(0,3,6), 100)) plot(x ~ y, data=dat, pch=as.character(dat$depth))

sql - PHP Variable within bind-parameter -

i have following php variable: $qstr1; this, when printed or echoed, shows following: $q1, $q2, $q3, $q4, $q5 i have bind-parm code: mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $q1, $q2, $q3, $q4, $q5); this works fine , saves correctly database, however, when replace individual parts variable (see below), doesn't work, doing wrong? mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $qstr1); vardump follows: string(49) "$q1, $q2, $q3, $q4, $q5, $q6, $q7, $q8, $q9, $q10" it doesn't work that. method wants several parameters. no give one, holds string. there possibilities this, eval , advise different approach. pdo example can bind using names can called in loop.

asp.net - Error building empty website in VS2012 -

i using visual studio 2012 update 3 , whenever create new asp.net empty website , build first time compilation successful server error when accessing site of "could not load file or assembly 'system.web.extensions, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. module expected contain assembly manifest." if go , build website again single error of "object reference not set instance of object" no line number. this error occurs whichever framework targeting , whether using c# or vb. can point me in right direction please? thanks, richard. possibly ajaxcontrol toolkit issue. depending on framework version( 4.5, 4.0, 3.5 ),, install correct version of ajaxcontrol toolkit here: http://ajaxcontroltoolkit.codeplex.com/releases/view/94873 . another solution found place system.web.extensions.dll , system.web.extensions.design.dll directly in bin folder of web application.

vbscript - php-cgi keeps shutting down on windows -

i running windows 8 nginx web server, , php language. created vbs script start php-cgi , , looks this: set objshell = wscript.createobject("wscript.shell") objshell.run("c:\php\php-cgi.exe -b 127.0.0.1:9000"), 0, true the script works, php works, issue having time time php stop or shut down. not sure if has script or php settings. why php-cgi keep stopping time time? don't having restart constantly. linux boxes don't seem have issue, have run php months without shutting down.

tornado - Should Celery sub-processes show up on ps aux | less -

i'm using supervisord celery on tornado server (note: not tcelery, since server isn't using async features yet) 3 workers: w1, w2, , w3. each has concurrency of 10. via supervisor adding following /etc/supervisord.conf: [program:sendgrid_gateway_server] command=sudo python main.py -o runserver numprocs=1 directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/server_log.txt autostart=true autorestart=true user=root [program:sendgrid_gateway_server_w1] command=celery worker -a tasks --loglevel=info --concurrency=10 -n w1 numprocs=1 directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/w1_log.txt autostart=true autorestart=true user=root [program:sendgrid_gateway_server_w2] command=celery worker -a tasks --loglevel=info --concurrency=10 -n w2 numprocs=1 directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway stdout_logfile=/home/ubun

java - Data in the gridview does not change upon update in realtime -

i facing problem regards grid view update.. grid view contain words found user.. records shown when exit app.. when open app, contains updated list view... should here... looking possibility of using notifydatasetchanged() , don't know how , put it... knows this? here code of showing data in gridview.. //sliding menu onchange @override public void oncontentchanged() { super.oncontentchanged(); mopenbutton = (button) findviewbyid( r.id.button_open ); mdrawer = (multidirectionslidingdrawer) findviewbyid( r.id.drawer); gridview gridview = (gridview) findviewbyid(r.id.gridview1); wordguessedhandler guessed = new wordguessedhandler(this); list <wordguessed> guessedlist = guessed.getallwordguessed(); list<string> wordslist = new arraylist<string>(); for(wordguessed wg:guessedlist){ wordslist.add(wg.getword()); } arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple

android - Want to avoid the issue when clicked on home button -

i had develop 1 android app in there lot of activities.now problem in when press home button activity & again click on app launcher icon launcher activity launched.actually want launch activity pressed home button.please me out issue.

Issue with HTML displayed in email sent from PHP -

i'm using pear php mail library send html emails (mainly hotmail). i'm having issues css functioning correctly. @ moment when message received css in body of message , styles not applied. the code follows: $message = "<!doctype html> <html> <head> <style> body { font:12px/1.4em verdana, sans-serif; color:#333; background-color:#fff; width:700px; margin:50px auto; padding:0; } { color:#326ea1; text-decoration:underline; padding:0 1px; } a:hover { background-color:#333; color:#fff; text-decoration:none; } div.header { border-bottom:1px solid #999; } div.item { padding:5px 0; border-bottom:1px solid #999; } </style> </head> </body>"; // parse $limit = 9; for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' &amp; ', $news[$x]['title']); $link = $news[$x]['link'];

purpose of defn in Clojure -

i'm little puzzled role of defn. if fn produced anonymous functions, understand need construct combines functionality of def , fn, fn can create named functions. @ least in repl, don't see how usage differs defn. when provide name symbol fn , it's only bound within function definition function object itself . allow anonymous functions call ( clojure - special forms ). so create function fn bound global accessible name, have use (def somename (fn ...body... and defn shortcut this. (defn somename ...body... in response comment, fresh repl: give me clojure: > (fn foo [] (+ 1 3)) #<sandbox31764$eval31779$foo__31780 sandbox31764$eval31779$foo__31780@12eae8eb> > (foo) java.lang.runtimeexception: unable resolve symbol: foo in context > (defn foo [] (+ 1 3)) #'sandbox31764/foo > (foo) 4 > as can see, can't call foo function created fn , because it's not bound var.

ios - Adding a navigation controller to a tab bar application -

Image
i have 2 questions one. first, have navigation controller put in storyboard , linked tabs , working how want to. except 1 thing. when try add code such this [self.navigationcontroller poptoviewcontroller:vc animated:yes] error property 'navigationcontroller' not found on object of type 'appdelegate *' is because put in wrong place? or becasue tabbar application , aint right. it sounds you're trying make call navigation controller appdelegate. unless you've setup appdelegate work navigation controller (it'd need subclass of uiviewcontroller ), you'll error because there no navigation controller on appdelegate class (by default). therefore, when make call - navigation controller can't found. notice how appdelegate subclass of uiresponder , not uiviewcontroller : @interface appdelegate : uiresponder <uiapplicationdelegate> instead, create , / or connect navigation controller uiviewcontroller subclass - can make calls subclass

visual studio 2012 - Coded ui test result mdf not generated -

i have visual studio ultimate 2012 update 3 installed i created coded ui project , ran tests testresult folder contains html results of these tests. require mdf database file keep track of results. is ther way can mdf test result file appear? need create settings file or change value in qtagent file? the problem update 3 of visual studio, removed update , repaired visual studio 2012 , file being generated correctly. will reporting problem microsoft.

php - Styling an active link targeting an iframe -

i have html code links' target iframe. want add style, highlighted links. want make active link highlighted css( or/with php), i'm trying avoid javascript. here code: <ul> <li><a href="http://en.wikipedia.org/wiki/rhenium" target="box">rhenium</a></li> <li><a href="http://en.wikipedia.org/wiki/tellurium" target="box">tellurium</a></li> <li><a href="http://en.wikipedia.org/wiki/tin" target="box">tin</a></li> </ul> <iframe name="box" src="http://en.wikipedia.org/wiki/rhenium"></iframe> best view: http://jsfiddle.net/wb8e8/ i've tried lot of css tricks, including non displayed iframe , combined different selectors (~ + >) < li >, goes messy , make css size big. i've tried php conditions too, i've couldn't manage accomplish result. so, how make work? how make highli

VB.net BackgroundWorker Pause/Resume -

i want create 2 buttons pause , resume backgroundworker don't know start code, have started learning vb.net , wanted learn pause , resume function of backgroundworker. here existing backgroundworker code wish pause , resume public resetevent new manualresetevent(false) dim boo nullable(of boolean) = true private sub button3_click(sender object, e eventargs) handles button3.click try if backgroundworker2.isbusy <> true backgroundworker2.runworkerasync() resetevent.set() end if catch ex exception end try end sub private sub backgroundworker2_dowork(sender system.object, e system.componentmodel.doworkeventargs) handles backgroundworker2.dowork dim worker2 system.componentmodel.backgroundworker = ctype(sender, system.componentmodel.backgroundworker) try dim stream new system.io.filestream("sample.txt", io.filemode.open) dim sreader new system.io.streamreader(stream) dim inde

linq to xml - XML async entity causes validation problems -- how do I escape it? -

i generate static html pages , i've found far best way using xml linq, makes manipulating document quite similar javascript/jquery. it has worked far, except added addthis button website , following line has caused xmlexception: <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51f1474f46ee2d87&async=1&domready=1"></script> the exception is: '=' unexpected token. expected token ';'. line 69, position 114. i ran line on http://www.xmlvalidation.com , got following result: 110 reference entity "async" must end ';' delimiter. i've searched google several minutes trying find information on "async" entity or how can around it, many documents claim there 5 entities in xml, such page: http://www.quackit.com/xml/tutorial/xml_entities.cfm how can escape entity? bonus question: async entity , why hardly documented anywhere online?

python - Using selenium webdriver, how to click on multiple random links in webpage one after another continuously to detect broken links? -

i'm trying write test script test visible links randomly rather explicitly specifying them, in webpage upon login. possible in selenium ide/webdriver, , if how can this? links = driver.find_element_by_tag_name("a") list = links[randint(0, len(links)-1)] the above fetch links in first page how go testing or many links possible without manually adding above code each link/page? suppose i'm trying find broken links result in 500/404s . productive way of doing this? thanks. currently, can't status code legitimately selenium. use selenium crawl urls, , other library requests check link's status (or use solution title check proposed @mrti): import requests def find_broken_links(root, driver): visited = set() broken = set() # use queue bfs, list / stack dfs. elements = [root] session = requests.session() while len(elements): el = elements.pop() if el in visited: continue visited.add(el

php - javascript function will not fire - cannot determine why -

i trying create search system users can return made search. in order using php sessions recreate search whenever return search page. because function search in javascript, having use ajax post appropriate variables session in php , return javascript variables refire search function. however, when try use session variables (passed javascript) re fire search function (and present same results again) function not fire, same function fire i.e. original search. have checked , variables same cannot tell why function not fire. i know it's not problem function original search works no problem. here code. please help. javascript var sesssubj = '<?php echo $_session['subject'];?>'; var sesslevel = '<?php echo $_session['level'];?>'; var sesstopic = '<?php echo $_session['topic'];?>'; var sessaddress = '<?php echo $_session['address'];?>'; var sesssort = '<?php echo $_session['sort

removing whitespace - Slider causing white space on right hand side -

i'm developing website , there white space on right hand side of home page. know it's image slider happens on home page slider is. see here: home page the issue noticeable on iphone's , desktop browsers add scroll bar. on browsers notice when hover on slider scroll bar disappears. the slider has been customized images background images can centered on page. any appreciated sorted now! it .flexslider:hover .flex-next , .flexslider:hover .flex-prev had css applied them: left:-38px; , right:-38px;

jquery - position tooltip caret at the center -

i have following tooltip: .tooltip { position: relative; margin-bottom: 0.5em; padding: 10px 10px; border-radius: 5px; bottom: 100%; min-width: 10em; width: 25%; font-size: 12px; line-height: 15px; font-size: 0.75rem; line-height: 0.9375rem; } complete code available here: http://jsbin.com/aqewiv/2/edit i having lot of trouble placing caret of tooltip @ center of box. if @ right box ('test data 2') displays caret @ center of box want. if @ left box ('test data 1') caret symbol moves bottom. there way can alwyas position caret @ center when box bigger? for this. can add ":after" .test-box demo here .test-box:hover:after { content: ""; display: block; height: 1em; width: 1em; right: -0.6em; margin-left: 0; margin-top: -0.5em; background: #fff; position: absolute; top: 50%; border-width: 0 2px 2px 0; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: r

html - Create responsive sub navigation items with CSS -

Image
i have create navigation based on mockup design created in photoshop. mockup looks this: i managed create main navigation points , facing problems sub navigation. should responsive, means maximal number of items in sub navigation should 4, minimal number of items should 2. possible css position single elements next each other automatically? this have: <div id="topnavigation"> <ul> <li><a href="#">portrait</a></li> <li id="restaurants"><a href="#" class="active">restaurants</a></li> <li id="restaurants_sub"> <div class="wrapper_boxes"><div id="restaurants_sub_content" class="sub_boxes"><span>lövenstube</span><br>master deanse bes-<br>poke brooklyn, wiliams-<br>burg minim id wayfa</div></div> <div class="wrapper_boxes&qu

matlab - How to textscan with multiple delimiters -

i trying read in file contains thousands of lines of format: aaaaaaaa 2013.99.2314.029 0 off n which tab delimited file. last column don't care. 2 columns before variable, read them strings. main problem second column. number divided several parts 2013.99.2314.029 is year 2013, day 99, second 2314.029. i want use textscan read in whole file @ once, somehow split complicated date string read in. currently have scan string: scan_str = '%s\t%f.%f\t%s\t%s\t%*s' which reads date string 2 floats. i'd read 2 ints , float. using scan_str = '%s\t%d.%d.%f\t%s\t%s\t%*s' truncates 2013 , 2314 , messes rest of line. tried escaping '.' '.' pops error. any suggestions? i'd it's scanned in due large size of file. memory runs low when start trying change types of large data sets. edit: really need scan string 2013.99.2314.029 return 2 integers , float. '%d.%d.%f' doesn't work. nor using delimiter &

wpf - Unexplained error: "Unexpected Token after end of Markup Extensions" -

having converted application wpf silverlight, visual studio indicating strange compiler error in 1 of xaml files: error 11 unexpected token after end of markup extension. there no indication line causing error, offending code seems this: <datatemplate x:key="tooltiptemplate"> <stackpanel orientation="horizontal"> <textblock text="{binding datapoint.dataitem.date,stringformat={}{0:mm/dd/yyyy}}" foreground="{staticresource resourcekey=othercolor}" /> <textblock text="{binding datapoint.dataitem.price,stringformat={}{0:0.00#}}" foreground="{staticresource resourcekey=othercolor}"/> </stackpanel> </datatemplate> what cause of error? the problem stringformat value -- wpf can tolerate not being wrapped in single-quotes, apparently silverlight cannot. changing this: <textblock text="

Using spring integration and soap/rest as inbounds, can generate completely automatic their wsdl/wadl? -

(maybe, there hope) if have spring integration , inbound soap or rest (http) possible dynamically generate wsdl , wadl in classical approach? (i have seen can expose wsdl based on given xsd - interested in api on own generating these 2 'contracts'...) spring integration uses spring webservices under covers can use generate wsdl schema described in spring webservices documentation .

Time difference for random number generation implementation in Java vs. C++ -

i'm writing monte carlo simulation in java involves generating lot of random integers. thinking native code faster random number generation, should write code in c++ , return output via jni. when wrote same method in c++, takes longer execute java version. here code samples: random rand = new random(); int threshold = 5; int[] composition = {10, 10, 10, 10, 10}; (int j = 0; j < 100000000; j++) { rand.setseed(system.nanotime()); double sum = 0; (int = 0; < composition[0]; i++) sum += carbon(rand); (int = 0; < composition[1]; i++) sum += hydrogen(rand); (int = 0; < composition[2]; i++) sum += nitrogen(rand); (int = 0; < composition[3]; i++) sum += oxygen(rand); (int = 0; < composition[4]; i++) sum += sulfur(rand); if (sum < threshold) {}//execute code else {}//execute other code } and equivalent code in c++: int threshold = 5; int composition [5] = {10, 10, 10, 10, 10}; (int = 0; < 100000000; i++) { srand(time(

wamp - PHP Code will not read on Network Server -

i have database running on network server (ex. if open documents, @ bottom on left navigation bar, can access networks). my network server called \\server. i have downloaded wamp \\server can upload .php files server can act web server address file://server/wamp/[path]/[file].php. php connects database users on web go address. i have database set, php files complete , uploaded, , port 80 clear wamp used on server. .php files still not read! can figure out wrong? have fact not real address (file://)? any appreciated. thanks i'm guessing problem file: scheme you're trying use, wamp listening on port 80 (http). try using http: in address.

android - Is is better to add fragments to an activity by <fragment> tags in xml or by FragmentManager in a code? -

i've started developing android apps , wondering way better in case of adding fragments activity. let's assume view activity contain 3 fragments. won't changed. same. better add them tags or include them in activity code? and second question issue: let's have activity fragment list. when clicked on item want show new view. can replace list fragment new different fragment? if answer yes better creating new activity? thanks replies which way better in case of adding fragments activity one approach not 'better' other - both serve own purposes, static vs. dynamic comparison. for example, fragments declared in layout cannot given arguments using setarguments() . such fragment can not replaced fragment: if it's part of layout, it'll there. of course can still show/hide instance, attempting remove through fragmenttransaction not work. static elements easier work though, because have well-defined lifetime , behaviour. regarding seco

c# - Getting results from a database query in SQL and displaying them in a datagrid view -

my problem dont know enought linking sql databases c# code im trying send search query sql database , display results onto data grid view. problem lay within returning , displaying data. below search method created in search button click event method: // takes 1 of parameters , searches data base rows match parameter , argument private void searchbtn_click(object sender, eventargs e) { switch(searchcb.selectedindex) { case 0: selecteditem = "haulername"; break; case 1: selecteditem = "ticketnumber"; break; case 2: selecteditem = "leasename"; break; case 3: selecteditem = "ticketdate"; break; case 4: selecteditem = "customername"; break; case 5: selecteditem = "leaseoperator"; break; case 6: selecteditem