Posts

Showing posts from January, 2015

FPS camera rotating by itself. QT 4.8 + OpenGL + C++ -

i'm trying port height map visualization program written on c++, sfml qt, can shown on widget , controlled gui elements. the problem when start application, camera starts roll around center fast(actually, looks terrain mesh flying around camera, earth around sun :), without actions side(e.g moving mouse, pressing buttons). camera should move forward, back, left, right when press w,a,s,d , around when move mouse(just typical fps camera behavior). i think problem in program's main loop, because it's no standard while(true){ //do something// } approach in qt, , it's little confusing. here's code: oglwidget class ( here i'm drawing stuff. problem somewhere here think) : class oglwidget : public qglwidget { q_object public: oglwidget(qwidget *parent = 0); ~oglwidget(void); public: void paintgl(); void initializegl(); void resizegl(); public: void updatecamera(); public slots: void mainloop(); protected: v

c++ - Simple .h file troubles -

i have simple simple simple .h file #ifndef _head #define _head void getnextmove(char playersymbol, int &row, int &col); #endif included in .cpp file #include "head.h" is included in .cpp file #include "file.cpp" . keep getting error /tmp/ccfn3b2g.o:proj1aux.cpp:(.text+0x0): multiple definition of `getnextmove(char, int&, int&)' /tmp/ccdzqlii.o:proj1.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status does know cause that? thought putting #infdef... stop repetition. including 1 .cpp file in .cpp file advanced technique that's best avoided until thoroughly understand normal use of #include . include header files now. if errors prototype not seen function declared in file, put in header file that's included both .cpp files.

html - How do I get Header in Php to work correctly? -

i trying fix why header command won't redirect main page. instead stays on php display page. here php side after submit form. php script http://img35.imageshack.us/img35/6602/a9j3.png here page when php put effect. php display http://img40.imageshack.us/img40/6649/1qk3.png here page it's suppose redirect to... html main page http://img801.imageshack.us/img801/8004/tulo.png as can see, have no spacers in header command php. i've looked multiple issues never found works. see line says: echo 'full connection<br/>'; that line ensure no headers able sent after it. can't output anything browser before header call, including whitespace, html or line. i'm surprised aren't getting error when happens, it's because error reporting levels turned down. it's idea have error reporting turned high on local machine when testing you'll see errors , can fix them straight away: error_reporting(e_all);

multithreading - Cross-thread operation not valid. C# -

this question has answer here: cross-thread operation not valid: control accessed thread other thread created on 16 answers i have class file sends integer form2 class function within class uses integer update picturebox1 image-location , form2 size. the integer id of current map in (in irrelevant game). here 2 scenarios play out. 1) now, if form2 opened prior function being executed (due not in-game yet due no id) , function executed (due being in-game) , system.invalidoperationexception @ line 'this.refresh();'. 2) now, if leave form2 unopened, enter game , open form2, picturebox1 image loaded; however, form size not updated. if hide form2 , enter new map (new id), system.invalidoperationexception @ line 'this.size...'. also, if not hide form in aforementioned sentence , enter new map, same error in scenario 1. code the following form2

box2d - Strange screen size on LibGDX DisplayMode -

i facing problems libgdx , box2d because of camera setup. while investigating, found that: gdx.graphics.getwidth() == 320 gdx.graphics.getheight() == 526 even though set stage , orthographiccamera 1080/1920 or 270/480 (i playing values). then followed documentation , looks value has nothing stage neither camera. after that, checked got 1 displaymode available: displaymode[] dms = gdx.graphics.getdisplaymodes(); (int = 0; < dms.length; i++) { log.d("myapp", "dms > " + dms[i].tostring()); } results in: dms > 320x526, bpp: 0, hz: 0 because of that, call setdisplaymode being ignored: gdx.graphics.setdisplaymode(screen_width, screen_height, true); it changes nothing. i suspecting might problem, how can change it? edit: testing in nexus 5. gdx.graphics.getwidth() , gdx.graphics.getheight() return screen dimensions. on desktop size of window (which can resize), on android cannot change them

owasp - Concept regarding authentication -

i need security validation on program, , 1 of things need answer, related authentication is" verify authentication decisions logged, including linear offs , soft-locks." does knows linear off , soft-locks mean? thank in advance, thais. i doing research on owasp asvs. linear back-of , soft-lock authentication controls used prevent brute force attacks , can against dos. linear back-of can implemented through algorithm blocking user/ip particular time , after every failed login attempt time increase exponentially e.g. first failed login block 5 minute, second failed login block 25 minute 3rd 125 min , on. per understanding have seen in articles , implemented in application oracle weblogic soft lock easier implement, ip address (which think helpful protect against dos , brute force using automated tools) or user name logged in database every failed login attempt , when threshold number of failed login attempts (e.g. 5) block ip address permanently. once accou

Set-ADObject error in PowerShell -

i created script copy existing user when new 1 starts. i went on leave 2 weeks, come , not working - , no-ones touched script get-aduser -ldapfilter "(userprincipalname=copy_me@test.com)" -properties description, physicaldeliveryofficename, streetaddress, postofficebox, state, st, l, postalcode, co, c, pager, department, company, manager, memberof | foreach-object {set-adobject -identity "cn=new user,ou=our-users,dc=test,dc=com" -replace @{description="$($_.description)";physicaldeliveryofficename="$($_.physicaldeliveryofficename)"; streetaddress="$($_.streetaddress)"; postofficebox="$($_.postofficebox)"; st="$($_.st)"; l="$($_.l)"; postalcode="$($_.postalcode)"; co="$($_.co)"; c="$($_.c)"; pager="$($_.pager)"; department="$($_.department)"; company="$($_.company)"; manager="$($_.manager)"; othertelephone=" 8823"}} th

How to limit user to only put in octal number in Java or loop until they do? -

so trying make user give me octal number or loop until do. cannot figure out. please help! thanks! scanner keyboard = new scanner (system.in); boolean valid = false; while (!valid) //first loop unitl uers inputs correct value { // starts main loop system.out.print("\n \ninput octal number: "); string octatl = keyboard.next(); if((ocatal.contains("8") || ocatal.contains("9"))) // invalid input tester {// starts second loop user input correct value system.out.print("incorrect octal input...re-enter number."); system.out.print("\ninput octal number: "); string octatl = keyboard.next(); }// ends loop valid = true; // end user input loop } you might simplify logic doing following (pseudo-code): boolean isvalid = false; system.out.println("describe input should like") string line; while (!isvalid) { line = keyboard.next(); if (line contains 012345678) {

rounded edges for cells of cell renderer Java Swing -

i have used cell renderer display data in table format entries displayed in each cell in java swing. have got put desired color each cell. i there way can change of cell? want there way can have curved edges each cell in table? the responsibility fall tablecellrenderer , you'd have set border in renderers. you have turn off grid drawing, using jtable#setshowgrid

html - How to format submenu so that it stretches across the screen -

i'm trying menus formatted correctly. top menu submenu vertical, , i'd prefer more gooddata.com . the site jobcreatr.com , , i'm trying make skeleton of site gooddata.com. my html follows: <ul id="superfish-2" class="menu sf-menu sf-main-menu sf-horizontal sf-style-whiteshadow sf-total-items-3 sf-parent-items-1 sf-single-items-2 superfish-processed sf-js-enabled sf-shadow"> <li id="menu-1299-2" class="first odd sf-item-1 sf-depth-1 sf-no-children"> <a class="sf-depth-1" title="" href="http://jobcreatr.com/activity">activity feed</a> </li> <li id="menu-1300-2" class="middle sf-item-2 sf-depth-1 sf-no-children"> <a class="sf-depth-1" title="" href="http://jobcreatr.com/course-categories">course categories</a> </li> <li id="menu-1301-2" class="last odd sf-item-3 sf-depth-1 sf-to

winforms - how to pass a values from one form to another form without creating new instance of a form in c#? -

ya aware calling form quite common requirement using form3 f3 = new form3(); f3.showdialog(); difficulty facing don't want create new instance of form3 every time , can't create constructor globally passing parameters it. requirement form1 textbox value should passed form3 datagrid . how that? form1 code is string l=null; string m= null; decimal n=0; string o=null; private void form1_mouseup(object sender, mouseeventargs e) { this.cursor = cursors.default; class1 = new class1(mold, mcur, mshape, mwidth, mcolor); ds.add(a); int c = (mold.x > mcur.x ? mcur.x : mold.x); int b = (mold.y > mcur.y ? mcur.y : mold.y); int w = math.abs(mold.x - mcur.x); int h = math.abs(mold.y - mcur.y); string line = layername.text + "\t" + material.text+ "\t" + w.tostring() + "\t" + h.tostring() + "\t" + c.tostring() + "

html - CSS background-image slideshow -

i pretty new css , html, learning ropes. right now, have background image on header section , trying turn slideshow 3-4 images shuffling through on timer. i have seen tutorials use images through html, way have set have css property background-image set image. if doesnt make sense, here css .global-header { min-height:600px; background-image: url("assets/bgimages/head_sandwichman.jpg"); background-size: cover; text-align: center; } and html <header class="container global-header"> <div class="inner-w"> <div class='rmm' data-menu-style = "minimal"> <ul> <li><a href="index.html">home</a></li> <li><a href="menu.html">menu</a></li> <li><a href="findus.html">find us</a></li> <li><a href="ab

imagemagick - Fitting images by specifying the new aspect ratio -

can imagemagick's convert append white or black bars maintain aspect ratio after specifying just aspect ratio? more concretely suppose have 2000x1000 widescope image , compute new image has aspect ratio of 4:3 fit, tv. can do convert input.png -background black -extent 2000x1500 -gravity center output.jpg but here have manually chosen 2000x1500 produce 250x2 pixels of blakc. can ask convert to: change aspect ratio 4:3 not lose pixels; not interpolate pixels center image ? if it's possible chose background color dominant color in image (as in itunes 11), mention how. convert not have built-in capability pad image out given aspect ratio, need script this. here how might done in bash: #!/bin/bash -e im="$1" targetaspect="$2" read w h <<< $(identify -ping -format "%w %h" "$im") curaspect=$(bc <<< "scale=10; $w / $h") echo "current-aspect: $curaspect; target-aspect: $targ

Does Dart provide an easy-to-use Linked List? -

i have algorithm that, performance reasons, should use linked list . want constant time appending , removal of elements list, , i'll never need find specific element index. i see dart has linkedlist ( api docs ) in dart:collection , requires entries subclass linkedlistentry . don't control elements need put list, , don't want create wrappers. what options in core dart sdk? if want add , remove @ both ends, want queue . can either use listqueue (which default when using new queue() ) or doublelinkedqueue . former guarantees amortized constant time operations adding , removing @ ends, while latter has absolute guarantees. listqueue need grow backing-store on add, takes linear time, happens when list full, , traditional growing-by-doubling guarantee amortized constant operation. if want add , remove @ end (a stack, basically), normal list should fine.

how to calculate distance while walking in android? -

i developing demo app, in there 2 buttons named "start" , "stop". when user taps on "start" start walking. want make when users tap "stop" demo calculate distance between "start" , "stop". if user pressed "start" , pressed "stop" without taking single step, must show 0km or 0m. don't have idea how should start this; please make suggestion. one way go using accelerometer data. app should continuously record accelerometer data after user presses start button. observe peak in data whenever user takes step. apply filter on data, , shall able detect number of steps taken reasonable accuracy. multiply step length , should approximation of distance travelled. take height of user input argument. step length around 0.45*height of person. since approach independent of gps, work indoors. edit: you'll need use accelerometer values 3 axes make independent of device orientation.you can go x^2 + y^2 +

c++ - Create Multiple Queues at Once -

is there way can create multiple queues @ once? for example program ask. how many queues user wants, if submits 3 create 3 queues this. queue<int> queue1; queue<int> queue2; queue<int> queue3; do create loop this? or there way so? for (int = 0; i<userinput; i++) { queue<int> queue[i]; } would above work? ask user how many queues want created, , create them based on input. vector<queue<int>> queues(n);

c# - Show notification Form at NotifyIcon's position as Dropbox -

Image
i writting application uses notifyicon in c#. want when user clicks on notifyicon on system tray (bottom-right of screen) notification form (this not mainform, it's minor form used show notification) show @ location of notifyicon dropbox do: i have used event mouseclick of notifyicon , wrote follows: private void notifyicon_mouseclick(object sender, mouseeventargs e) { form2 form = new form2(); form.setdesktoplocation(mouseposition.x - form.width/2,mouseposition.y-form.height-20); form.show(); form.focus(); } but not work expected, notification form show @ location of main form not @ location of notifyicon. can can me:| go form2 design, select properties of form2 . startposition in properties of form2 , set startposition manual or can as form2 form = new form2(); form.startposition = system.windows.forms.formstartposition.manual; form.setdesktoplocation(mouseposition.x - form.width/2,mouseposition.y-form.height-20); form.show(); form.focu

C program to print combination of 3 letter word -

i want print combination of 3 letters without using nested loop in c programming ? following code combination of 3 letters "abc". can execute program using 3 loops. dont want that. want 1 loop , in non-recursive way.but not getting logic. #include <stdio.h> #include <stdlib.h> int main() { int i=0,j=0; char b[10],a[] = "abc"; strcpy(b,a); while(i < 3) { b[j]=a[i]; if(i==0) { b[j+1]=a[i+1]; b[j+2]=a[i+2]; printf("\n%s",b); b[j+1]=a[i+2]; b[j+2]=a[i+1]; printf("\n%s",b); }else if(i==1) { b[j+1]=a[i+1]; b[j+2]=a[i-1]; printf("\n%s",b); b[j+1]=a[i-1]; b[j+2]=a[i+1]; printf("\n%s",b); }else { b[j+1]=a[i-1]; b[j+2]=a[i-2]; printf("\n%s",b);

glassfish 4 - java.util.concurrent.TimeoutException how to solve? -

when display image using com.jsos.image.imageservlet glassfish 4.0 server fire error please give me solution. this working in java 6 , glassfish 3 my stacktrash : [2014-03-07t08:32:38.465-0500] [glassfish 4.0] [warning] [] [javax.enterprise.web] [tid: _threadid=20 _threadname=http-listener-1(2)] [timemillis: 1394199158465] [levelvalue: 900] [[ standardwrappervalve[fileservlet]: servlet.service() servlet fileservlet threw exception java.io.ioexception: java.util.concurrent.timeoutexception @ org.glassfish.grizzly.utils.exceptions.makeioexception(exceptions.java:81) @ org.glassfish.grizzly.http.io.outputbuffer.blockafterwriteifneeded(outputbuffer.java:958) @ org.glassfish.grizzly.http.io.outputbuffer.write(outputbuffer.java:682) @ org.apache.catalina.connector.outputbuffer.writebytes(outputbuffer.java:355) @ org.apache.catalina.connector.outputbuffer.write(outputbuffer.java:342) @ org.apache.catalina.connector.

date - PHP: Help on this code for getting all the days in a week of a month -

my code needs weeks along first , last day in month, code working in months, first , last day of last week becomes combination of first day of next month , last day of current month. start of week sunday. input date in y-m-d format e.g.(2014-01-05) , the day won't matter because converted first day of month anyway . this output when month january has problem : 2014-01-01 2014-01-04 2014-01-05 2014-01-11 2014-01-12 2014-01-18 2014-01-19 2014-01-25 2014-01-26 2014-01-31 2014-02-02 2014-01-31 // here lies problem this output when month february correct : 2014-02-01 2014-02-01 2014-02-02 2014-02-08 2014-02-09 2014-02-15 2014-02-16 2014-02-22 2014-02-23 2014-02-28 the functions i'm using: function getweeks($from) { $array = array(); $from = date("y-m-d", strtotime($from)); $start_date = date('y-m-01', strtotime($from)); $end_date = date('y-m-t', strtotime($from)); $end_date1 = date('y-m-d

c# - How to know when a method in a class is being executed -

i'm trying write log monitor execution time of method our application. possible know when method in class being executed without using aspect-oriented programming. i don't want go every method write log there hope faced issue , can give me suggestion. updated: i'm writing sharepoint application using .net 3.5 afaik, without aop or directly logging code injections way profiling api . wouldn't choose way one-time task, isn't easy.

ruby - Rails 4 asset not found -

in application.rb config.assets.enabled = false my route: 'products/:category_id' => 'products#index', :as => 'products' 'products/:category_id/:product_id' => 'products#show', :as => 'product' when go first route, assets found in proper location in public folder. in second route products/:category_id/:product_id' prepended in asset route , no route matches. eg: products/:category_id/:product_id/img/arrow-down.gif but localhost:3000/img/arrow-down.gif finds asset. please put me in right path. have been searching reason hours. addpointer:function(target, imgclass, imginfo, beforeorafter){ var pointer=document.createelement("img") pointer.src=imginfo[0] **this line gives error pointer.style.width=imginfo[1]+"px" pointer.style.height=imginfo[2]+"px" if(imgclass=="rightarrowpointer"){ pointer.style.left=target.offsetwidth-imginfo[2]-2+

python - pythonanywhere flask how to start programing? -

from tab files, mysite/ , flask_app.py . change program, save it, , reload web, change print on flask_app.py not response on web page. it's still same have never edited file. pythonanywhere dev here. should work, long you're hitting "reload" button on "web" tab. what's pythonanywhere username?

Getting payment and payer id dynamically in django using python Paypal REST SDK -

i new django , python. developing website using paypal transaction. have integrated python paypal rest sdk project. here views.py integration. def subscribe_plan(request): exact_plan = plan.objects.get(id = request.post['subscribe']) exact_validity = exact_plan.validity_period exp_date = datetime.datetime.now()+datetime.timedelta(exact_validity) plan = plan.objects.get(id = request.post['subscribe']) subs_plan = subscribeplan(plan = plan,user = request.user,expiriary_date = exp_date) subs_plan.save() logging.basicconfig(level=logging.info) paypalrestsdk.configure({ "mode": "sandbox", # sandbox or live "client_id": "aqkqubdf1zctjowgkwuetkxm6qvhueuemvxo_-mci4dqq4-lwvkdlin2fgsd", "client_secret": "el1tvxajht7cjimnz5-nsx9k2retksvfernqf-cmrwjgxrtylkgtklu4rvrx" }) payment = payment({ "intent": "sale", # ###payer

linux - using gcc -m32 flag cannot find -lgcc and -lgcc_s -

i'm trying compile 32 bit assembly code(nasm) on 64 bit linux, can't, have tried others tutorials , installed ia32-libs... when try run as: gcc asm1.o -o asm1 i386 of file input `asm1.o' incompatible output i386:x86-64 and when try run as: gcc -m32 asm1.o -o asm1 /usr/bin/ld: cannot find -lgcc /usr/bin/ld: connot find -lgcc_s collect2: error: ld returned 1 exit status thanks helps. obs: sorry english, i'm not us.

Need to take variables from user input (Javascript ) -

if user gives input this: xxx yy zz. need , detect xxx variable , take yy xxx1(variable1) & zz xxx2(variable2).the values of xxx1 , xxx2 used in someother files. this code using: var str = prompt("enter values") ; var array = str.split(' '); var x = array[0], x1 = array[1], x2 = array[2]; but if input given like: stack 12 3 overflow 13 4 i need 12 stack1 ,3 stack2 , 13 overflow1 , 4 overflow2. hope information enough. i new javascript, detailed description helpful. get input input element , split input element value using string.split() method. separate in array. so, using array index, array values in separate variable. declare variables globally value anywhere , other js file want. created simple demo you... html markup <!doctype html> <html> <head> <meta charset="utf-8"> <title>js bin</title> </head> <body> <input type="text" id="gettxt" /&g

ibm mobilefirst - IBM Worklight - Unable to invoke adapter procedure from client application -

i trying invoke adapter procedure client application. adapter procedure working on isolated mode, showing error when invoking application. this javascript file: function wlcommoninit(){ try{ wl.client.invokeprocedure({ adapter : 'userdb', procedure : 'getuser', parameter : ['demo', 'demo'] }, { onsuccess : function(res){alert("login success");}, onfailure : function(res){alert("login failure");}, }); } catch(e) { alert("error::"+e); } } i put code in easy way show actual error easy understanding ,this showing error of catch block: error::error:invalid invocation of method wl.client.invokeprocedure;invalid option attribute 'parameter',... like error message implies, option attribute parameter invalid. should parameters , s . function wlcommoninit(){ try{ wl.client.invokeprocedur

android - Retrieve zipped dependency from ivy using gradle -

i'm starting moving android project gradle build system, , struggling dependencies. using ant , ivy before, , 1 particular problem keeps me going forward. this have in ivy.xml : <dependency org="com.my-org" name="my-dep" rev="1.0.+"> <artifact name="my-dep-sdk" type="jar" ext="zip" /> </dependency> as can see, zipped dependency. zip file contains jar , directory native libraries, both should unpacked in same directory. ivy works fine, can't reproduce same behavior gradle. ideas how approach this? for direct download can try this: ivy-setting.xml: <?xml version="1.0"?> <ivysettings> <settings defaultresolver="central"/> <resolvers> <chain name="central"> ... <url name="google_download" m2compatible="true"> <artifact pattern="[ur

autocomplete input show value even value is empty -

i have input autocomplete. <input type="text" class="form-control input-sm isfieldvalueempty tooltip" style="width:779px;" id="searchk" name="keywords" value=''> everything works good, set value of autocomplete , after add value autocomplete hidden input (user can choose many value autocomplete). when add value , try set empty value of autocomplete input: $("#searchk").attr("value",""); in input field still have text, value od input empty (checking firebug). any idea how delete text? i found solution $(this).val(''); return false; and input clear. don't use attr() change value, use val() $("#searchk").val("");

lua - How to: Communicate with a subprocess -

i have go program starts c/lua process. i'd communicate between two. example, in middle of run of child (the c/lua process), i'd ask parent (the go program) calculations , wait result. not keen use stdin/stdout communication, used regular output. thinking of using sockets communication, don't want reinvent wheel. what obvious choices kind of communication? is there (more or less) simple standard way pass objects between lua , go? if not, text blobs suffice. are protocol buffers suitable this? looks overkill, have no experience here. besides usual ipc methods you've mentioned (yeah, unix socket protobuf should it, , stdin/stdout well), if run c/lua code embedded in program, , not start process, can communicate between languages directly. using cgo module, go code can call c functions, , embedded c code can call go functions. see here: http://golang.org/cmd/cgo/#hdr-c_references_to_go also, have couple embeddable lua binding libraries go can try,

Create array from objects php -

i have json result file decoded array of objects. using foreach find correct player , wish create array information under correct player. this snippet of array of objects: object(stdclass)#3 (1) { ["result"]=> object(stdclass)#4 (18) { ["players"]=> array(10) { [0]=> object(stdclass)#5 (24) { ["account_id"]=> int(72775718) ["player_slot"]=> int(0) ["hero_id"]=> int(46) ["item_0"]=> int(50) ["item_1"]=> int(139) ["item_2"]=> int(149) ["item_3"]=> int(147) ["item_4"]=> int(168) ["item_5"]=> int(116) ["kills"]=> int(26) ["deaths"]=> int(10) ["assists"]=> int(9) ["leaver_sta

android - passing context to fragment -

well doing small android project involving fragments.. log cat showing null pointer exception context value null.. this code public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.syllabusselection, container, false); main(rootview); return rootview; } public void main(view rootview) { textview textyear,textsubject,textschema,textpowered ; final context context = getactivity(); typeface roboto = typeface.createfromasset(context.getassets(), "fonts/roboto/roboto-light.ttf"); typeface nexa = typeface.createfromasset(context.getassets(),"fonts/nexa/nexa_light.ttf");//nexa_light.ttf nexa_bold.ttf textsubject = (textview)rootview.findviewbyid(r.id.textsubject); textschema = (textview)rootview.findviewbyid(r.id.textscheme); textpowered = (textview)rootview.findviewbyid(r.id.textpowered); well final

sql server - need the sql query format for previous 11 months data -

i running report pass paramater 'jan-13' or 'may-13' or 'jun-12' may thing. select cardname,cardcode ,dln1.quantity odln inner join dln1 on odln.docentry = odln.docentry odln.docdate = 'jan-13' (this doc date datetime format) in report chose jan-13 i need output past 11 months of quantity current month jan-13 cardname cardcode jan-13 dec-12 nov-12 oct-12 sep-12 aug-12 jul-12 jun-12 may-12 apr -12 mar-12 feb-12 efiglobal a2 12 10 12 10 8 12 3 2 12 11 4 6 this work sqlserver-2008+ create test table first create table test(cardname varchar(20),cardcode int, quantity int, docdate datetime) insert test values('ab', 1, 2, '2013-01-01 20:30') insert test values('ab', 1, 2, '2012-05-01 20:30') insert test values('abc', 3, 4, '2012-03-01 20:30') go this script: -- @a input declare @a char(6) = 'jan-13

windows phone 8 - Add fixed MapLayer once -

in application have map first thing (on launching) add custom maplayer (which populate many mapoverlays/pushpins). when browse page of app , return map page, (ie maplayer drawn on map) gone. it takes time add on again each time user navigates map page fixed, drawn/added once. any suggestions? edit, added code [i removed details, structure remains same]: private async void drawstations() { sqliteasyncconnection conn = new sqliteasyncconnection("stasy.sqlite"); list<line1_stations> lines = await conn.queryasync<line1_stations>("select *..."); microsoft.phone.maps.controls.maplayer layer = new microsoft.phone.maps.controls.maplayer(); pushpin p; foreach (line1_stations in lines) { double slat = convert.todouble(a.lat); double slon = convert.todouble(a.lon); p = new pushpin(); p.location = new geo

java - Multiple inheritance while we have Object class -

this question has answer here: multiple inheritance , class object 5 answers multiple inheritance not allowed in java class create has parent class "object". when extend other class, thats multiple inheritance. n't it?? bit confusing.any body can explain please? multiple inheritance means 1 class has multiple direct parent classes inherits from. long 1 class has 1 direct parent class inherits from, not multiple inheritance. multiple inheritance: c ---> b | |--> single inheritance: c ---> b --->

ios - Never getting out of while loop -

i have method needs wait method finish loading objects datastore. i'm using while loop this: -(void) findagoodcar { [self.indicator startanimating]; while(appdelegate.availablecars == nil || [appdelegate.availablecars count] < 1) { sleep(0.01); } // stuff } while starts working other process, loading cars, has started. now, indicator never starts animating. loading of objects never finishes. loop never ends. why? edit: loadcars method. called appdelegate when app starts, (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions , doing query parse.com's cloud asynchronously: +(void) loadcars { pfquery *query = [pfquery querywithclassname:kcarobjectkey]; [query wherekey:kactivekey equalto:[nsnumber numberwithinteger:kactivenumber]]; nssortdescriptor *sortbyprice = [[nssortdescriptor alloc] initwithkey:kpricekey ascending:yes]; [query orderbysortdescriptors:[nsarray arrayw

jquery - Get coordinates of a table and store in a database using PHP -

i have created page , has tables. have made these tables draggable , need store coordinates of table moved on provided area using php. please me out in doing this, couldn't figure out. code of html page is: <table class="smssecond"><!--bgcolor="#4ab54d"><class="smssecond"-- td bgcolor: bgcolor="#4ab54d"--> <tr style="background-color: #3c3c3c;" > <td colspan="2" width="auto" align="center">ticket info<img id="delete" src="icons/delete.png" height="10" width="10" style="float: right;"/></td> </tr> <!--odd row--> <tr class="oddrow" align="center"><!-- style="color: #000000; font-size: 12px;"--> <td> ticket number </td> <td>

c# - Grid View - Binding Data with Data Source at Button Click But Grid is not appearing -

i have gridview in updatepanel . on button click event binding data grid view. data being binded grid not showing. protected void page_load(object sender, eventargs e) { if (!ispostback) { binddata(); } } protected void binddata() { // dv data view have rows , columns gridview1.datasource = dv; gridview1.databind(); updatepanel.update(); } } on button click event :- protected void btnupdateextensions_click(object sender, eventargs e) { // dv data view have data columns , rows gridview1.datasource = dv; gridview1.databind(); updatepanel.update(); } at page load binding data ad showing gridview @ button click event not showing gridview while data source same source. your button inside of updatepanel call <asp:updatepanel id="updatepan

android - Hotword detection disabled with accessibly service -

Image
i've created accessibly service saving every toast message, hotword detection in google disabled, if activate service. logcat shows: w/hotwordstate﹕ suspended: 11001001000000 and on google can see different mic-icon. what cause behavior? edit: source code on github now: https://github.com/mars3142/toaster to prevent false positives, hotword detection disabled when spoken feedback service enabled. have defined service providing possible types of feedback, includes spoken. android:accessibilityfeedbacktype="feedbackallmask" you should change reflect type of feedback service provides. example: android:accessibilityfeedbacktype="feedbackgeneric"

c++ - Windows Service failes to start with "Path '.' not found" -

disclaimer: error message translated swedish (and it's pain find exact corresponding error message in english, microsoft take note...) error message "path ' ' not found" or "path not found". it's bit unclear due swedish message not enclosing path in ' '. this similar question, not exactly: new windows service installed, fails start: "system error 2 ... system cannot find file specified" i have written service myself. exe written in unmanaged c++ , using following external code: libntlm - loaded dynamic library (libntlm-0.dll placed in same location executable) openssl - loaded static library pugixml - compiled directly code the problem i'm having doesn't start when windows starts, start if manually start it! stumped wrong. thing can think of if perhaps dll can't found, don't know why wouldn't. environment variables being different perhaps? what have tried: checked registry, path correct path

python - Performance of Pypy's islower(), isupper() -

i have program in str.isupper() called in tight loop, , takes around 25% of running time. it strikes me isupper , islower slower other isx methods, such isalnum , isalpha , isdigit , on. (note: in cpython methods equally slow.) $ pypy -mtimeit "'a'.islower()" - 0.0158 usec per loop $ pypy -mtimeit "'a'.isalpha()" - 0.00251 usec per loop $ pypy -mtimeit "'a'.isupper()" - 0.0164 usec per loop $ pypy -mtimeit "'a'.isdigit()" - 0.00236 usec per loop i can make faster isupper method myself by isupper = lambda c: 'a' <= c <= 'z' which runs in reasonable 0.00393 usec per loop . of course version doesn't 'work' unicode strings, strings 8bit ascii. my question if there way 'tell' python skip fancy unicode tests when working simple 'a-z'? i don't know reason difference, know benchmarks flawed. expression "a&

What does stride mean in OpenGL|ES -

i going through signature of method glvertexpointer void glvertexpointer(glint size, glenum type, glsizei stride, const glvoid * pointer) can me understand third argument stride do. i got definition stride after googling it amount of bytes beginning of 1 element beginning of following element. if pass 0 stride, means tightly packed. if have array of floats, contains vertices this, x1,y1,z1,x2,y2,z2... , on, can set stride either 0 (as tightly packed), or 12 (3 floats*4 bytes each beginning of vertex 1 beginning of vertex two). i not able mean ? helpful if explains of example. thanks. the simple case when array contains vertex coordinate data. have 2 coordinates, hence 6 floats: {x1,y1,z1, x2,y2,y2} the pointer (4th parameter) points beginning of first vertex in array (i.e. zero, pointing x1). stride should 12, meaning move 1 vertex next, opengl needs move along 12 bytes (since each of 3 coordinates in each vertex takes 4 bytes). moving 12 bytes, x2 is, b

firefox - Opening a select2 in Imacro -

not sure if possible though i'm trying open select2 , wanting input text can filter , select item. version build=8810214 recorder=fx tab t=1 url goto=http://ivaynberg.github.io/select2/ ' selecting select2 here ' whenever try select field doesn't show on imacro's. tried out here: example ' basic ' didn't show. any idea's? i'm using firefox. thanks in advance kind regards event type=click selector="html>body>div:nth-of-type(2)>section:nth-of-type(3)>article>div>p:nth-of-type(4)>div>a>span:nth-of-type(2)>b" button=0 event type=click selector="html>body>div:nth-of-type(4)>ul>li:nth-of-type(3)>ul>li>div" button=0 this code click arizona on link posted. to make changeable use javascript scripting , make last digit in brackets changeable. event type=click selector="html>body>div:nth-of-type(2)>section:nth-of-type(3)>article>div&g