Posts

Showing posts from March, 2010

How could I resize the android camera preview dynamically? -

i programming program on android mobile. want resize camera preview dynamically fail. need camera preview has size 800*800. please me! my code : @override public void surfacechanged(surfaceholder holder, int format, int width,int height) { if(camera != null) { camera.parameters myparameters = camera.getparameters(); mybestsize = getbestpreviewsize(width, height, myparameters); log.i("my best camera size parameters", string.valueof(mybestsize.width)+" "+string.valueof(mybestsize.height)); myparameters.setpreviewsize(mybestsize.width, mybestsize.height); list<string> flashmodes = myparameters.getsupportedflashmodes(); if (flashmodes.size() > 0 && flashmodes.contains(parameters.flash_mode_auto)) myparameters.setflashmode(parameters.flash_mode_auto); camera.setparameters(myparameters); camera.setdisplayorientation(90); camera.

javascript - Bootstrap Holder.js Length of "text:" string -

i using default settings holder.js. want specify place-holder image of dimension 100x110 text "image not available": <img data-src="holder.js/100x110/social/text:image not available" /> when this, text string on 1 line (centred vertically , horizontally) , ends being truncated. shows as: "nage not availab". please, there trick getting "line break" text, (space permitting , font-size being correct) text flow on multiple rows within place-holder, this: image not available or image not available thank you. there no line break support in holder yet. i'm adding feature request.

python - Beautiful Soup - inserting before extracted portion of parse tree -

i'm trying extract information large webpage using beautiful soup 4. information want contained within 1 particular div, can extract without problem: passage = soup.find("div", class_="desired_div") i want add tags before extracted part of tree - e.g. want wrap extracted div div - in preparation outputing extracted info html file. with bs4, how insert tags before extracted portion of parse tree, or wrap extracted portion of parse tree? bs4 seems allow me operate on children of extracted div (as per documentation), want insert before or wrap extracted div. beautifulsoup intended extract content out of html file. not intended build html elements. there library karrigell can used achieve trying do. related answers on stackoverflow: python html generator generating html documents in python edit : beautifulsoup 4.2.1 supports creating new tags , adding them html. beautifulsoup.new_tag() creates new html tag , insert_before() , insert_

java - How do i properly cache common objects / entities when using JPA? -

i have web app needs load rows tables in database objects re-used in various places within application. for instance, might retrieve list of locations change infrequently, want store in memory quicker access later on. next, in future request, want associate 1 of these entities entity in database; however, jpa throws errors when attempting save, because cached entity detached. how reattach cached entity can include in current transaction? i'm using apache openjpa implementation. calling entitymanager.merge() re-attach detached object. have @ informative page

android - Google Cast - Subtitles with the Styled Media Receiver? -

i'm using styled media receiver. have url webvtt subtitles video, , want give them receiver display them, can't find way in api docs. i'm using styled media receiver because javascript/html weak, haven't found way send subtitles android sender without using media player library. check out sample code own closed caption in receiver app if don't need/want use media player lib. https://github.com/googlecast/castclosedcaptioning-chrome/blob/master/closedcaptioningreceiver.html window.showtracks = function() { console.log('showtracks activetrackindex='+window.activetrackindex+' if (window.activetrackindex != undefined && window.activetrackindex >= 0 && window.activetrackindex < window.tracks.length) { var trackelement = document.createelement('track'); trackelement.src = window.tracks[window.activetrackindex]['src']; console.log('showtracks trackelement.src='+trackel

Not Able to generate OAuth 2.0 Access Token in APIGee -

i new apigee. in project using oauth 2.0 authentication.but not able generate access token. have created required policies, still getting same error time. this command using generate access token. i using postman generate access token. https://<myorgname>test.apigee.net/<myproxyname>/client_credential/accesstoken?grant_type=client_credentials&client_id=<myclient_id>&client_secret=<myclient_secret>’ i have tried curl https://<myorgname>test.apigee.net/<myproxyname>/client_credential/accesstoken?grant_type=client_credentials -x post -d 'client_id=<myclient_id>&client_secret=<myclient_secret>’ both of them give same error { "fault": { "faultstring": "classification failed host orgname-test.apigee.net", "detail": { "code": "classification_failed" } } } please help. in advance. &q

java - Android Stackoverflow Error on Listview only on selected device -

while developing native app android gone through crash on purticular htc desire s happening purticularly on listview pages . what crash on : listview view overflow span overflow issue views overflow issue other (please explain ) logcat: java.lang.stackoverflowerror @ android.text.spannablestringbuilder.checkrange(spannablestringbuilder.java:940) @ android.text.spannablestringbuilder.drawtext(spannablestringbuilder.java:1042) @ android.graphics.canvas.drawtext(canvas.java:1323) @ android.text.styled.drawuniformrun(styled.java:141) @ android.text.styled.drawdirectionalrun(styled.java:298) @ android.text.styled.drawtext(styled.java:357) @ android.text.layout.drawtext(layout.java:1797) @ android.text.layout.draw(layout.java:679) @ android.widget.textview.ondraw(textview.java:4338) @ android.view.view.draw(view.java:7014) @ android.view.viewgroup.drawchild(viewgroup.java:1732) @ android.view.viewgroup.dispatchdraw(viewgroup.java:1459) @ android.view.view.dr

Google maps directions service -

i have issue whith google maps directions service (api v3). don't know how specify origin , destination strings. example requests: http://maps.googleapis.com/maps/api/js?sensor=false&region=es&languaje=es&key=xxxxxxxxxxxxx&origin= "ejido+el,espaÑa,04700"&destination="corcolle,italia,00010" or http://maps.googleapis.com/maps/api/directions/xml?sensor=false&region=es&languaje=es&origin= "ejido+el,espaÑa,04700"&destination="corcolle,italia,00010" the response of server is: not_found, ie route not found, however if change character Ñ n, ie espaÑa espana response ok. there other places "especial characters" example: göttingen, münchen, köln, .... i have been looking information in documentation can not find about. how can specify different origins , destinations? regards, francisco request http://maps.googleapis.com/maps/api/directions/xml?sensor=false&region=es&

bitbucket - Smartgit SHA fingerprint of the certificate does not match -

i trying install smartgit , trying provide bitbucket hosting provide. provide correct credentials of bitbucket account following error: ======================================= java.security.cert.cerfiticateexception: sha fingerprint of certificate not match. expected: [some string] actual: [some other string] this may either mean server certificate has changed or spoofed. ======================================= i think related ssl certificate not know how fix it. highly appreciated. from [1]: fix smartgit 5.0.7.1 (and older) add following line smartgit.properties (in smartgit settings directory, see dialog): smartgit.hostingprovider.bitbucket.sslfingerprint=37:a8:0e:13:87:da:13:c3:b8:35:6f:84:ef:74:d2:38:b1:ac:59:9b after restarting smartgit, connection work again. [1] http://blog.syntevo.com/2014/03/09/1394361360000.html

Webdriver(Selenium2) - How to make selenium operate elements without wating for connecting to external AD links? -

environment: - selenium 2.39 standalone server - php 5.4.11 - phpunit 3.7.28 - chrome v31 & chromedriver v2.7 i'm testing website,which invokes lot of advertisement systems,such google ad. browser takes lot of time connect external ad links , elements of page has been loaded. if internet network not fast when ran tests on webpage, selenium wait long time ,since ad links responsed slowly. under condition ,selenium waits on 60 seconds, , throws timeout exception. i'm not sure how senelium works, seems selenium has wait sign of webpage's full loading, pulls dom find elements. i want make selenium operate elements without waiting connectiong external ad links. there way ? thank much. i suggest make use of proxy. browsermob integrates selenium, easy use it: // start proxy proxyserver server = new proxyserver(4444); server.start(); // selenium proxy object proxy proxy = server.seleniumproxy(); // line automatically return http.200 request goi

android - Changing . apk file using jar file -

i want change 1 class in . apk. create jar file using dex2jar , have not idea jar able change code in eclipse , recreate .apk file. i request yo go through following link.... http://code.google.com/p/dex2jar/wiki/modifyapkwithdextool

java - How can I replace the word with another in a string? -

i have following xml string, in need replace "dddomain1" "dddomain" i used code below, not working xmlstring.replaceall("dddomain1","dddomain"); you not need use replaceall method regexp. try xmlstring = xmlstring.replace("xpsystems114","xpsystems");

extjs - How to cleanup controller and views when a tab closes -

in application have main controller driving series of tab opening. each new tab created new controller created driving view represented tab. there 1 more view connected same controller, should not matter in opinion. well, tabs closable, , when tab closes want destroy controller instance too. how can reasch controller? storing somewhere in main controller violates statement controller should not have state, storing reference of in view make not sense since can have more view related controller. how mantain proper control/ views association map? well answering own question clarify. since controller must stateless, single instance obtained application.getcontroller('controllername') enough control all tabs, there not reason cleanup controller. fault using ext.create() create controllers, wrong in case, , always.

Perl - system Chinese filename -

can explain why file name display wrong , how fix it? want filename 游戏美术.txt3 i'm using debian 6, perl v5.10.1 lang=en_us.utf-8 language= lc_ctype="en_us.utf-8" lc_numeric="en_us.utf-8" lc_time="en_us.utf-8" lc_collate="en_us.utf-8" lc_monetary="en_us.utf-8" lc_messages="en_us.utf-8" lc_paper="en_us.utf-8" lc_name="en_us.utf-8" lc_address="en_us.utf-8" lc_telephone="en_us.utf-8" lc_measurement="en_us.utf-8" lc_identification="en_us.utf-8" lc_all= #!/usr/bin/perl system("echo 游戏美术 > 游戏美术.txt3"); system ("cat 游戏美术.txt3"); output: cat: 游戏美术.txt3: no such file or directory i try remove txt3 file: rm -r *.txt3 rm: remove regular file `游\346\217美术.txt3'? filename displayed 游??美术.txt3 in console. can cat it, content display correctly not filename. thanks lot. update 1

asp.net web api - Could not load type 'System.Web.Http.WebHost.HttpControllerHandler', in Mono / xsp4 -

i'm getting error when trying access web api controller, accessing via 127.0.0.1/api/mycontroller/1 could not load type 'system.web.http.webhost.httpcontrollerhandler' assembly 'system.web.http.webhost, version=5.1.0.0, culture=neutral, publickeytoken=31bf3856ad364e35'. description: http 500.error processing request. details: non-web exception. exception origin (name of application or object): system.web.http.webhost. why happening? see exists in system.web.http.webhost. the error due use of latest assemblies via nuget. turns out that, currently, mono isn't compatible webapi v5.1. i replaced mvc libraries previous (v4.0) version , worked.

fetch model from json - backbone.js -

good morning, have simple json file , need fetch data (i read thousand of other question not find solution app). have view, model json file. can fetch data can't display them. here code: calendardetails.json { "calendartitle": "webcal", "calendardescription": "hello, i'm new calendar" } headermodel.js var headermodel = backbone.model.extend({ isedit: false, url: '/assets/calendardetail.json' }); headermodel = new headermodel(); headermodel.fetch(); headerview.js var headerview = backbone.view.extend({ template: handlebarstemplates["header"], model: headermodel, initialize: function(){ this.render(); this.model.on('change', this.render, this); }, render: function(){ this.$el.html(this.template(this.model.tojson())); return this; } }); app.js $(function() { var calendarapp = backbone.view.extend({ el: $('#

cluster analysis - What algorithm could be used to fast clustering point in polyline shape? -

Image
suppose have line consisting of 2dpoints what algorithm efficiently compute clusters in line given input of active points? red here points. yellow - active points in given time. in example algorithm should find 2 clusters (blue). you following: cluster points index. can done in linear time. save cluster's bounding box in process for each pair of clusters check if bounding boxes intersect or have maximum distance t if so, check if there 2 points both clusters have maximum distance of t if so, merge clusters t distance threshold. can either static or based on cluster (e.g. maximum distance nearest neighbour of cluster's point). this algorithm has still quadratic time complexity, should fast enough due pre-clustering , bounding box test.

c# - Is it Possible to develop Windows Mobile Apps in Windows 7 and Visual Studio 2012 -

i using windows 7 enterprise 64 bit os. planning develop windows mobile apps. have visual studio 2012. possible develop windows mobile apps these resources in hand. by windows mobile , mean windows phone 7 or 8 right? website of windows phone dev center provides lot of information on this. need: developer tools : you can choose between sdk 7.1 or 8.0, note need 8.0 sdk develop windows phone 8. using 8.0 sdk can develop windows phone 7.5. visual studio: if have visual studio 2012 professional or higher, sdk templates , tools integrated existing installation of visual studio. windows: please not sdk 8.0 requires windows 8 pro 64-bit or higher, it's not possible develop apps wp8 on windows 7, stated here : windows phone sdk 8.0 requires 64-bit windows 8 pro or higher. can't develop windows phone 8 apps on windows 7, on windows server 2008, or on windows server 2012. windows phone 8 emulator has special hardware, software, , configuration r

Is empty array in the end of the structure a C standard? -

i have noticed empty array in end of structure used in open source projects: typedef struct { ...... void *arr[]; } a; i want know c standard? or ok gcc compiler? as of c99, c standard. pre-c99 compilers may not support it. old approach declare 1-element array, , adjust allocation size that. new way: typedef struct { ...... void *arr[]; } a; int slots = 3; a* mya = malloc(sizeof(a) + slots*sizeof(void*)); mya->arr[2] = foo; old way: typedef struct { ...... void *arr[1]; } a; int slots = 3; a* mya = malloc(sizeof(a) + (slots-1)*sizeof(void*)); mya->arr[2] = foo;

java - how to load animated gif to jpanel from mac -

i want load animated gif jpanel read how when run program i message: java.net.malformedurlexception: no protocol: /users/me/documents/workspace/managetimeclock/images/timeanim.gif i checked gif path , correct!! so should do? my code: url url; try { url = new url("/users/me/documents/workspace/managetimeclock/images/timeanim.gif"); icon imggif = new imageicon(url); jlabel lblgif = new jlabel(); lblgif.seticon(imggif); lblgif.setbounds(100, 100, 400, 450); switchpanel.add(lblgif); } catch (malformedurlexception e1) { // todo auto-generated catch block e1.printstacktrace(); } i solved thank anyway :) solved with: string path = "/users/me/documents/workspace/managetimeclock/images/timeanim.gif"; icon imggif = new imageicon(path); jlabel lblgif = ne

jquery - call a javascript function within dynamically created html -

Image
i have java script file you'll see in picture below . in file create html code webpage , , in html call function defined in java script file . when run function isn't defined . additional info : plus function mentioned ("cbutton") defined in function inside java script file. (function () { var thecid = 0; function cbutton (ii) { document.getelementbyid(ii).style.display = 'none'; alert('fdgfg'); } $("#subber").on("click", function () { var thelm = "#c0"+thecid; var newcommhtml = '<div id="c0' + thecid + '" class="cnew clearfix">'; var ii='c0'+thecid; newcommhtml += '<section class="c-content">'; newcommhtml += '<a href="#" onclick="cbutton(\'' + ii + '\');" style="color:black;">x</a>';

Interpret the matlab code -

i'm java programmer , have no background of matlab hence i'm clueless these lines of code matlab. when run code got error : ??? undefined function or variable 'nfile'. error in ==> texture_id @ 29 fprintf(' \nneural network processing \n',nfile); i understand 'path' variable stores string, 'demo' boolean, other lines, don't want assume does...can please me , explain each lines? here's code: path = 'c:\users\dais\documents\matlab\data sets\'; demo = true; elfile = dir('*.jpg'); [lu ri] = size(elfile); feat=zeros(lu,29); nomf=cell(lu,1); nfi = 1:lu nfile = elfile(nfi).name; fprintf(' feature extraction file: %s \n',nfile); nomf{nfi} = upper(nfile); feat(nfi,:) = feature_ex([path nfile],demo); end fprintf(' \nneural network processing \n',nfile); i guess whats happening here elfile = dir('*.jpg'); not find jpegs in local directory , hence lu em

python - How to animate using Itertools.cycle -

egg = digimon(0,2,0,0,0,0, [pygame.image.load("images/egg_1.png"), pygame.image.load("images/egg_2.png"), pygame.image.load("images/egg_3.png") ]) egg_sprites = itertools.cycle(egg.image) # cycles through egg images screen.blit((egg_sprites_next), (x_pos,y_pos)) i've done this, , loops throughout images present. how able make loop through images? use splicing list? if so, how this? also, there way limit cycle 1 time? so, it'd cycle through images, stop. thanks :)

android - Non conditional boolean to int conversion java - micro optimisation -

this question has answer here: converting boolean integer in java without if-statements 10 answers i'm new java , i'm writing android game - , there's 1 line of code in tight loop that's annoying me. targetblocksremain += letterarray[column][row].istargetblock() ? 1 : 0; i feel must possible write without conditional statement , therefore without potential branch prediction performance hit. i'll optimise out tight loop i'm not massively concerned in long run, it'd nice know if there's way resolve similar situations. edit clarify - pseudo theoretical questions - there lots of other things improve this, such store istargetblock int. i'm not interested in other suggestions, wondering if there's way resolve particular issue. edit 2 hoping @ dalvik vm doing shortly work out how handles this. i know might not avo

java - How does HashSet not allow duplicates? -

i going through add method of hashset . mentioned if set contains element, call leaves set unchanged , returns false. but add method internally saving values in hashmap public boolean add(e e) { return map.put(e, present)==null; } the put method of hashmap states associates specified value specified key in map. if map contained mapping key, old value replaced. so if put method of hashmap replaces old value, how hashset add method leaves set unchanged in case of duplicate elements? present dummy value -- set doesn't care is. set does care map's keys . logic goes this: set.add(a): map.put(a, present) // far, said key "a" in map, so... keep "a" key, map value present passed in also, return old value (which we'll call old) @ return value: it's old, != null. return false. now, fact old == present doesn't matter -- , note map.put doesn't change key, value mapped key. since map

.net - Inheritance of Form -

let me sketch situation. have bunch of forms inheritance implemented. example: form - form a1 (inheritance) - form a2 (inheritance) form b - form b1 (inheritance) - form b2 - formb21 (inheritance) - formb22 (inheritance) - form b3 (inheritance) interface 1 - form 1a (implementation) - form 1b (implementation) - form 1c (implementation) lets presume the forms a1, a2,b21 & 1a contain field 'authors' and forms 1a,1c,b3,a2 contain field named 'origin'. authors textbox , origin combobox . right want group inputcontrole single superclass (where forms inherit from). how without creating form forms inherit from? i've tried let them inherit standard class i've made error somewhere suppose: public class superclass inherits windows.forms.form public sub new() mybase.new() end sub publi

c# - Why can't I cast EntityCollection<TEntity> to ICollection<Object>? -

if try cast object of type entitycollection<mynamespace.models.myentityclass> icollection<object> invalidcastexception . okay, according docs, entitycollection<tentity> implements icollection<t> , , mynamespace.models.myentityclass must descend object , right? why on earth fail? fwiw, i'm trying in method can add , remove items might entitycollection or other ilist or iset . need preserve change tracking behavior of entitycollection, because object able commit changes if it's ec. edit okay, here's more specifics of i'm doing. i'm deserializing json, , target object can have properties collections--maybe they're entitycollection s, maybe not. sake of simplicity, lets members of collection subclasses of entityobject , whether it's entitycollection or not (if understand responses far, i'd have no better luck casting icollection<entityobject> icollection<object> …right?). part run trouble… foreach (pr

asp.net mvc - Inconsistent accessibility: property type in DbContext -

i have added dbset in context i.e. public dbset<demo> demo{ get; set; } but getting compilation error here i.e. error 1 inconsistent accessibility: property type 'system.data.entity.dbset<mvc.model.demo>' less accessible property 'mvc.model.demo' d:files/project 210 34 mvc.data here model:- class demo { [key] [display(name = "id", resourcetype = typeof(resources.resource))] public long id { get; set;} [display(name = "countryid", resourcetype = typeof(resources.resource))] public long countryid { get; set; } [display(name = "rightid", resourcetype = typeof(resources.resource))] public long rightid { get; set; } [display(name = "amount", resourcetype = typeof(resources.resource))] public double amount { get; set; } } demo has no access modifier , classes internal default, less accessible dbset demo public

alarmmanager - How to schedule alarm weekly in android ? -

i want schedule alarm according desired days e.g. sunday,tuesday,thursday. have scheduled according time not able week days. below code: private void startscheduler(context context) { calendar starttimmer = calendar.getinstance(); starttimmer.settimezone(timezone.getdefault()); starttimmer.set(calendar.hour_of_day,shour); starttimmer.set(calendar.minute,sminute); starttimmer.set(calendar.second,00); alarmmanager alarmmanager = (alarmmanager) getsystemservice(context.alarm_service); intent startalarmtime = new intent(schedule_details.this, myalaramstartreceiver.class); pendingintent pendingintent1 = pendingintent.getbroadcast(context, 0, startalarmtime, 0); alarmmanager.set(alarmmanager.rtc_wakeup, starttimmer.gettimeinmillis(),pendingintent1); log.d("<<my-start-alarm>>", "alarm set start at: " + starttimmer.gettime().tolocalestring()); }

xcode - Is it possible to "get" the h file when you're writing code in the m file -

i'm trying make plugin, , idea after write -(void)thismethodissomethingiwanttobeexposed then can press keycombo alt+c , it'll write 1 current line in .h file don't have copy paste on myself. anyone have idea on how path of file i'm writing in? can change m h, , i'll have figure out how write h file, that's thing. i found solution, think might bit hacky. in xcode plugin put in init [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(notificationlistener:) name:nil object:nil]; and made method called -(void)notificationlistener:(nsnotification *)notification{ if (![notification.name iskindofclass:[nsstring class]]) { if ([[notification name] isequaltostring:@"idesourcecodedocumentdidupdatesourcemodelnotification"] ) { nsstring *path = [ nsstring stringwithformat :@"%@",notification.object ]; path = [path substringfromindex:49]; } you'll alot of notifications, ,

type inference - OWL Intersection on class level -

Image
i have class hierarchy this: thing - classa -classc -classd - classb -classc -classe class c subclass of both, classa , classb while classd , classe subclasses of either classa or classb now specify class equivalent intersection of subclasses of classa , classb. following doesn't work: namedclass owl:class namedclass owl:equivalentclass (classa , classb) the reason sort of rule used reasoner classify individuals, i.e. had individual ind1 of type classa , classb, classified of type namedclass. not (only) want. want classc subclass of namedclass. i know achievable using rules (e.g. spin) can done without rules? let's start initial hierarchy, including f, before we've declared f equivalent intersection of , b: then add (a , b) class equivalent f. protégé smart enough render things equivalent or subclasses of intersections under each of intersected classes, see f appear in 2 places here. a reasoner can confirm relation, too.

javascript - split comma for each entry in array -

any better ideas of converting ["1","2","3,4","5","6","7,8,9"] ["1","2","3","4","5","6","7","8","9"] what want achieve create smaller amount of code while keeping simple. var arr=["1","2","3,4","5","6","7,8,9"]; var tmp=[]; for(var i=0,len=arr.length;i<len;i++){ tmp=tmp.concat(arr[i].split(",")); } http://plnkr.co/edit/ijg2apz3jafvsulxjdqe?p=preview i used simple js can use kind of library reduce code. use join() , split together. arr.join(",").split(","); fiddle

php - SQL syntax error when selecting from tables in Joomla 2.5 -

i error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'from lg3ni_k2_favorites faves, lg3ni_k2_items items, (faves.user' @ line 1 sql=select faves.item_id item_id, items.title items_name, lg3ni_k2_favorites faves, lg3ni_k2_items items, (faves.user_id='349') , (faves.item_id = items.id) from syntax: $db =& jfactory::getdbo(); $query = "select faves.item_id item_id, items.title items_name, "; $query .= "from `#__k2_favorites` faves, `#__k2_items` items, "; $query .= "where (faves.user_id='".intval($userid)."') "; $query .= "and (faves.item_id = items.id) "; $db->setquery($query); $ff = $db->loadobjectlist(); echo $db->geterrormsg(); return $ff; where problem? you have comma after items_name, ,another comma after as items $query = "select faves.item_id item_id, items.ti

High query response time with SORM on small DB -

i using sorm h2 in small scala application. normal @ first query like db.query.where(filter).fetch() to wait response 9 seconds? warm-up time or mistake? same behavior postgres. my db small, 6 items. it warm of scala's toolbox component, utilized sorm. happens on start up, don't worry.

c# - Pivot Item like animation to page -

i working on windows phone 8 app, i have 3 pages a,b , c .i want add pivot item animation these pages. i have 2 buttons in each page previous , next , when click on next button in page a, page should slide left , page b should slide right , vice versa previous button. how ? create pivot , disable hit detection on it: and when want change page, change selectedindex .

getting javax.faces.application.ViewExpiredException in jsf 1.2 with richfaces -

i'm working on application runs on (apache myfaces) jsf 1.2 richfaces 3. when try run application <h:commandbutton> triggering navigation case in faces-config.xml. i'm getting below problem severe: view state cannot reconstructed javax.faces.facesexception: javax.faces.application.viewexpiredexception @ org.apache.myfaces.shared_impl.util.stateutils.decrypt(stateutils.java:488) @ org.apache.myfaces.shared_impl.util.stateutils.reconstruct(stateutils.java:376) @ org.apache.myfaces.renderkit.html.htmlresponsestatemanager.getsavedstate(htmlresponsestatemanager.java:187) @ org.apache.myfaces.renderkit.html.htmlresponsestatemanager.gettreestructuretorestore(htmlresponsestatemanager.java:151) @ org.ajax4jsf.application.ajaxstatemanager.restoreview(ajaxstatemanager.java:219) @ org.apache.myfaces.application.jsp.jspviewhandlerimpl.restoreview(jspviewhandlerimpl.java:515) @ org.ajax4jsf.application.viewhandlerwrapper.restoreview(viewhandlerwrapper.java:116) @ org.ajax4jsf.ap

python - Which function will be called when using tastypie resource -

i want understand point. this url: repositories/api/2/repositories/?format=json this urls.py : repositories_resource = repositoriesresource() (r'^api/2/', include(repositories_resource.urls)), this api.py : class repositoriesresource(resource): fs_repositories = fields.charfield(attribute='fs_repositories') full_path = fields.charfield(attribute='full_path') path = fields.charfield(attribute='path') permissions = fields.charfield(attribute='permissions') perms_read = fields.listfield(attribute='perms_read') perms_write = fields.listfield(attribute='perms_write') perms_no_access = fields.charfield(attribute='perms_no_access') class meta: resource_name = 'repositories' authorization= authorization() def obj_get_list(self, request=none, **kwargs): request.get = request.get.copy() request.get.update({"output":"json"}) frs=svn_repositor

java - How I can display the contents of the following json -

i new in android app development. developing android app in need display list of questions 1 after other user of next button. when user clicks next button, next question appears list of options choose from. questions , options retrieved mysql database php , response in json format shown below { "questions": [ { "q_id": "18", "qtext": "the largest liability appearing in book of commercial bank is", "option_1": "cash", "option_2": "deposits", "option_3": "loans , advances", "option_4": "capital , reserves", "option_5": "treasury bills" }, { "q_id": "7", "qtext": "a commercial bank unique in institution that", "option_1": "makes loans private people , businessmen", "opti

forms - how to get a input field's name via PHP GET -

there example want do: http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_datetime in example, if change input's name, on right side of screen (after submitting code), you'll see changed name. , also, can see there no hidden input field name of input automatically. because searched answers , "use hidden input field" in this: how access form's 'name' variable php need in w3schools. of course .asp example hope there way via php also? in advance. to input field name using post method. you can use $get or $request instead of $post . $request use both , post. in php $post 1 type of associative array. <?php $temp= array(); if (isset($_post['submit']) && !empty($_post['submit'])) { foreach ($_post $key => $val) { //$key name wanted, , $val value of input $temp[] = $key; } } ?>

javascript - Collision detection on a tweened object -

i cann't work, seems tweened objects don't fire 'moved' event? i'm tweening object across screen, , need check if collided player (that flies , down keyboard events). works if append check on 'moved' player, if player stands still :-) so need check when tweened objects moves if hit player does not fire of events: // astroid crafty.e('astroid, 2d, dom, color, tween, collision') .attr({ x: 600, y: 550, w: 50, h: 200 }) .color('#8e44ad') .tween({ x: -50 }, 4000) .bind('moved', function () { console.log('moved'); if (this.hit('player1')) { console.log('player hit 1'); } }) .onhit('player', function () { console.log('player hit 2'); }); updated : i using little plugin here , collisions($div1, $

java - Timeout for active socket connection? -

how can specify timeout on active java.net.socket connection? don't mean timeout of .accept() blocks process. i'd set timeout starts count when accept method takes connection, until client connection closed/output stream returned. is possible? yes. possible socket.setsotimeout()

Svg font workaround for Firefox -

i have following svg <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 18 22"> <defs > <font horiz-adv-x="830" ><font-face font-family="one" units-per-em="1000" panose-1="2 0 5 3 0 0 0 0 0 0" ascent="707" descent="-48" alphabetic="0" /> <glyph unicode="e" glyph-name="e" horiz-adv-x="1038" d="m164 206t153 206t135 213t127 233v301q127 332 145 350t197 368h618q642 368 650 393q662 435 696 461t781 487q838 487 879 448t921 349q921 289 880 250t781 210q748 210 721 225t684 253t672 270q660 291 682 304q702 315 714 295q735 260 781 260q817 260 843 286t869 349q869 385 843 411t781 437q757 437 740 430t714 409t701 388t694 368q678 318 628 318h306v233q306 220 299 213t280 206t262 213t254 233v318h207q179 318 179 290v233q179 220 172 213z" /> </font> </defs> <text font-family=

php - ZF2 Child routes not working -

after reading numerious articels routing i'm still not able work. when i'm able go "/portal": 'portal' => array( 'type' => 'literal', 'options' => array( 'route' => '/portal', 'defaults' => array( 'controller' => 'portal\controller\activities', 'action' => 'index', ), ), ), but when add child_routes so: 'portal' => array( 'type' => 'literal', 'options' => array( 'route' => '/portal', 'defaults' => array( 'controller' => 'portal\controller\activities', 'action' => 'index', ), ), 'may_terminate' => true, 'child_routes' => array( 'default&

javascript - onblur() is not working while onclick() is working fine -

i need make notification list appear on click working fine. onblur() not working @ all. here fiddle: http://jsfiddle.net/ex2zq/ code: html:- <div class="one" onclick="hidetwo();" onblur="remove_the_notification();"> <div> <ul class="dropdown" id="notification" > <li><a href="#">kjhlkjhkjhklhjklj</a></li> <li><a href="#">kjhlkjhkjhklhjklj</a></li> <li><a href="#">kjhlkjhkjhklhjklj</a></li> <li><a href="#">see_all</a></li> </ul> </div> </div> css:- .one{ overflow: visible; width: 21px; height: 21px; background-color:black; } js:- var show=0; function hidetwo(){ if (show==0){ document.getelementbyid('notification').style.display="blo

java - In google-app-engine: How to query all entries after specific date in GQL -

i'm trying run simple query java application: select * schedule date > datetime(2013,11,10) if following error json response: 03-06 14:03:13.730: w/system.err(13272): com.google.api.client.googleapis.json.googlejsonresponseexception: 503 service unavailable 03-06 14:03:13.730: w/system.err(13272): { 03-06 14:03:13.730: w/system.err(13272): "code" : 503, 03-06 14:03:13.730: w/system.err(13272): "errors" : [ { 03-06 14:03:13.730: w/system.err(13272): "domain" : "global", 03-06 14:03:13.730: w/system.err(13272): "message" : "javax.persistence.persistenceexception: problem query <select schedule schedule date > datetime(2013,11,10)>: unsupported method <datetime> while parsing expression: invokeexpression{static.datetime(literal{2013}, literal{11}, literal{10})}", 03-06 14:03:13.730: w/system.err(13272): "reason" : "backenderror" 03-06 14:03:13.730: w/system.err(1

json - Facebook Graph - getting the Facebook ID - using PHP -

i have form in post facebook url. i process url in php script facebook id. form: <form name="input" method="post" action="<?=($_server['php_self'])?>"> <input name="url" required> <input type="submit" value="submit"> php script $url = $_request["url"]; $jsonurl = 'http://graph.facebook.com/'.$url.'.json'; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json); $fbid = ($json_output->id); echo $fbid; i've not been able pull in id. i'm echoing nothing. the url be: $jsonurl = 'http://graph.facebook.com/'.$url; ...while $url must graph api endpoint or vanity url available in public, without access token. no ".json" required. for example: $url = 'bladauhu'; $json_result = file_get_contents('http://graph.facebook.com/'.$url); $json = json_decode($json_result);

javascript - Math.pow calculations ground and power -

i want create piece of code math.pow for instance, if put ground number 2 , power level 6 want result count 0 6. 2^0 = 1 2^1 = 2 2^2 = 4 2^3 = 8 2^4 = 16 2^5 = 32 2^6 = 64 this have: (on jsfiddle) function callpow(){ var val= document.getelementbyid("txt").value; var power= document.getelementbyid("txt2").value; alert(math.pow(val,power)); } all need loop count specified power , alert each time: function callpow(){ var val= document.getelementbyid("txt").value; var power= document.getelementbyid("txt2").value; for(i=0; i<= power; i++){ alert(val+' ^ '+i+' = '+math.pow(val,i)); } } jsfiddle

c# - Compare two dates without a year -

i compare 2 dates excluding years. ex. input: fromdate: 01 march, todate: 05 march then records between these 2 dates should come whether there year. not matter. so please can me in issue. thanks in advance. if using linq , want create list querying db this? public ienumerable<item> withintimerange(datetime begin, datetime end) { var items = in context.items a.timestamp.month.equals(begin.month) && a.timestamp.day >= begin.day && a.timestamp.month.equals(end.month) && a.timestamp.day <= end.day select a; return items.tolist(); } personally create method in repository.

I'm new to scheme and I don't know what's wrong -

i'm writing function takes single list of knights fight. code running fights working(jousting-game), i'm writing tournament system , can't tournament round work. said, takes list of knights , has them fight recursively until has fought, , returns 2 lists, 1 of winners, 1 of losers. i've tried know , no matter error , code refuses work, , don't understand why. here's i've written far: (define (playtourneyround knightlist) ( (cond ((> (length knightlist) 1) (let ( (winner (jousting-game (car knightlist) (cadr knightlist))) (winners (list)) (losers (list)) (results (playtourneyround (cddr knightlist))) ) (if (= winner 1) (winners (append winners (list (car knightlist)))) (winners (append winners (list (cadr knightlist))))) (winners (append (car results))) (losers (li

javascript - CSS: Text overlay on images while hover -

i've read several tutorials , forums include , other sources on how create hover state description overlay on images. have created version of it. there 1 problem: not responsive (or breaks gracefully). <div class="section"> <ul> <li> <div> <p><b>1 unit mathematics extension</b></p> <img src="img/thumbnail.png" alt="thumbnail"> <p id="overlay">placerat massa ut est, in, .</p> </div> </li> </ul> </div> note*: reason why have in list on desktop , tablet view want 3 images appear across page. my relevant css is: .section ul{ list-style-type: none; width: 100%; margin: 0; padding: 0; } .section li{ width: 100%; padding-bottom: 30px; } .section img{ width:90%; } #overlay{ width: 90%; position: relative;

google drive sdk - Get folder in Android application, that was not created via this App -

having google drive account folders , files. want make android application adding , geting files there. class query useful, can work data making application only the android drive api works https://www.googleapis.com/auth/drive.file scope. means files user has opened or created application can matched query. help, please, how can add files folder, created via webinterface early? don't use latest google api, released few weeks ago. works drive.file scope, hasn't yet implemented number of capabilities (e.g. setting multiple parents), , in experience, contains bugs need fixed well. com.google.android.gms.common.api.googleapiclient use api instead: com.google.api.services.drive.drive try { list<string> scopes = new arraylist<string>(); scopes.add("https://www.googleapis.com/auth/drive.appdata"); scopes.add(drivescopes.drive); googleaccountcredential credential = googleaccountcredential.using