Posts

Showing posts from March, 2014

android - Implement list views with multiple columns -

Image
i have implement iphone application in jquery mobile , phone gap using list views can implement normal table views, nested table views. <ul data-role="listview" data-inset="true" class="ui-listview"> <li data-role="list-divider">location</li> <!-- section header --------> <li>primary</a></li> <li>primary </li> <li>secondary</a></li> <li>secondary</li> </ul> but these have 1 column, multiple in rows. now need create table (list view) multiple columns. how can create list view multiple columns? try this,i hope work...... <ul> <li> <!--first item --> <table> <tr> <td>heading1</td> <td>meaning1</td> </tr> ...

json - How can I securely (indirectly) query a postgresql database within android? -

the current solution have adopt uses jdbc , stores user/password of database inside android app. that's far i'm concerned not solution. implement mapping layer on webserver in middle. is there best practice or recommended strategy this? should use soap or json or different (because they're implemented and/or easy use in java)? there mapping tools postgresql <-> soap/json/whatever in php or need write these scripts myself? any pointers appreciated. quick version: use web service midlayer running on public host control (possibly not database host). expose public web service methods limited work want permit , nothing else. related questions: driver jdbc postgresql android how connect postgresql server via jdbc in android? implementation options personally i'd use java application server apache tomcat or jboss 7 , i'd write web service methods using jax-rs produce nice rest-style api app use. that's i'm familiar , works wel...

apache - osx Lion Web Server 403 Forbidden Error -

i need use integrated webserver in osx lion, got strange error. with files, , of them, returns me error 403 forbidden "you don't have permission access /~mattiazeni/atc.mp3 on server." i can't understand why gives me error files , not of them! example gives me error pictures .jpg , .mp3, can access other .jpg , .mp3, problem not extension type. i try set config file this, error remains. <directory "/users/user/sites/"> options indexes multiviews allowoverride order allow,deny allow </directory> presumably file permissions set such webserver isn't allowed read of files. chmod files give user apache runs permissions read them.

c# - New session is generated for every request inside FB app -

i have asp.net mvc 3 web application, publish facebook app also. when fb app visited, website's specific page (controller+action) displayed (eg. mydomain.com/facebook/index). request contains signed_request, i'm storing in session. if display link on page, points page of webapp (eg. mydomain.com/facebook/other), , link clicked, new-session generated, therefore don't know signed_request fb passed initial page! so problem session regenerated everytime page/subpage navigated user inside fb app! if urls accessed directly (not fb app), session works properly. also if website running locally (so fb app set use localhost:[port], hosted vs), session works also! my site hosted in azure currently. if website hosted in azure , accessed fb-app, session regenerated in every new request. i'm not using fb-authentication yet. any advise someone? search terms: third-party-cookies, p3p policy

java - Hibernate OneToOneToOne Mapping -

i keep getting error: error saving identity in identitydaoimpl. reason: org.hibernate.propertyvalueexception: not-null property references null or transient value: com.domain.identity.password i've mapped 3 tables on onetoonetoone mapping basis. user -> account -> identity how have now, identity extends account , account extends user. maybe i'm not mapping correctly. find bit tricky because there's 3 1 one relationships instead of 2... what's correct way of doing this? edit 1: i've changed merge() methods save() didn't fix problem. edit 2: here clean version of entity: @entity() @table(name = "`user`") @inheritance(strategy = inheritancetype.joined) @discriminatorcolumn(discriminatortype = discriminatortype.string, name = "type") @discriminatorvalue("") public class user extends actionsupport implements userdetails, serializable { private static final long serialversionuid = -7480567862246640031l; pr...

iphone - Error: Using two-stage rotation animation is not supported in iOS -

i working on bar code scan application. got sample source code . while scanning image, taking image photo gallery have saved bar code images. but not scanning , showing in console 2012-06-04 14:09:00.136 reader sample[467:207] using two-stage rotation animation not supported when rotating more 1 view controller or view controllers not window delegate what error log about, can please me. any appreciated so should do given console message, i'd shouldn't use 2 stage rotation. is, instead of using methods -[will/did]animatefirsthalfofrotationtointerfaceorientation: , -[will/did]animatesecondhalfofrotationtointerfaceorientation: , use newer one-step rotation methods -willrotatetointerfaceorientation:duration: , -didrotatefrominterfaceorientation: .

Road Maps, Java -

i'm trying implement road map in desktop java application. the idea of project allow user place points onto map specific photo taken. i going use google maps, reading t&c, noticed has used on web only. have managed implement map onto free web hosting (http://jwasley.netii.net) - won't display in java web browser created. is best way of doing it, or there api road maps. did openstreetmap couldn't find decent tutorials. cheers i suggest using jxmapkit swing framework displaying maps. includes powerful features such overlays. part of swingx project. believe supports number of different mapping repositories including openstreetmap. you can see example here: http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html if see more open source project iphoneanalyzer uses extensively. code available here: http://iphoneanalyzer.svn.sourceforge.net/viewvc/iphoneanalyzer/trunk/gui/src/main/java/com/crypticbit/ipa/ui/s...

Python time zone display -

i'm not sure if possible here's question: in python, possible variable shows timezone relative utc time? example, est shown -5, pst -8. thanks not sure asking exactly. hope may help!,you can use datetime module . adapted http://docs.python.org/library/datetime.html#datetime.tzinfo.fromutc from datetime import tzinfo, timedelta, datetime class fixedoffset(tzinfo): def __init__(self, offset): self.__offset = timedelta(hours=offset) self.__dst = timedelta(hours=offset-1) self.__name = '' def utcoffset(self, dt): return self.__offset def tzname(self, dt): return self.__name def dst(self, dt): return self.__dst print datetime.now() print datetime.now(fixedoffset(9)) gives: 2011-03-12 00:28:32.214000 2011-03-12 14:28:32.215000+09:00

windows installer - VBScript will not execute correctly from MSI file -

i have vbscript wrote needs executed msi file. script correctly executes when run within windows on own, however, when run installer following error shown in log file: microsoft vbscript runtime error: object required: 'wscript', line 3, column 2 the script below: sub shell(cmd) set objshell = wscript.createobject("wscript.shell") objshell.run("""" & cmd & """") set objshell = nothing end sub set objfso = createobject("scripting.filesystemobject") strcmd32 = "c:\path\pathtoexecutable.exe" strcmd64 = "c:\path\pathtoexecutable64.exe" if (objfso.fileexists(strcmd32)) shell(strcmd32) else shell(strcmd64) end if set objfso = nothing as stated before, script runs fine if run outside context of installer. setup project type vs2010 setup , deployment package (this client wishes use , cannot use else). ideas? in "shell" sub, removed wscript fir...

c# - WCF MSMQ fires only once -

i'e written c# wcf service that's supposed handle incoming messages, parse xml contain , transcribe data database table. when start windows service hosts wcf msmq service implementation, processes 1 message , stops. this used process messages in queue until started renaming things. i'm @ bit of loss, because invoked - once. no errors logged in event log. window service host continues run, , responds promptly service stop instruction scm. <netmsmqbinding> <binding name="binding.msmq.transportsecurity" maxreceivedmessagesize="32767"> <readerquotas maxbytesperread="32767" maxstringcontentlength="32767" maxarraylength="32767"/> <security mode="transport"> <transport msmqauthenticationmode="none" msmqencryptionalgorithm="rc4stream" msmqprotectionlevel="none" msmqsecurehashalgorithm="sha1" /> <...

How to get text() by attr() in jquery -

here's questions <div class="question"> <div class="button" data-q="1" data-a="1"><a href="javascript:void();">2002</a></div> <div class="button" data-q="1" data-a="2" data-g="true"><a href="javascript:void();">2010</a></div> <div class="button" data-q="1" data-a="3"><a href="javascript:void();">1985</a></div> <div class="button" data-q="1" data-a="4"><a href="javascript:void();">2013</a></div> </div> i have text() value attr() have data-g set. right code tried don't work $('.question .button a').click(function(){ var atext = $(this).parents('.question').find('data-g').text(); return atext; }); ...

jquery - Deferred.done callback not working in the done function -

i have been trying make work couple of days now, last attempt. and apologies posting different questions similar objective. i tried figure out best way. here thing; have data in page want use in initialize function. one member here suggested use deferred.done. it partially worked. data in other page loaded , can displayed if have alert(mapdata); in initialize function. but when try use data in initialize function actual work, mapdata.users undefined error. i dont because appears fine when loaded in alert box. please suggest! $(function checkinmap() { $.when($.ajax({ type: "get", url: "content/home/index.cs.asp?process=viewcheckinmap" })).done( function initialize(data) { var mapdata = data; var center = new google.maps.latlng(48.404840395764175, 2.6845264434814453); var map = new google.maps.map(document.getelementbyid('checkinmap'), { z...

xml - Serialize in C# - per variable attributes associated with a new XmlElelemt -

i've posted because of similar case time ago. i'm @ next port, unfortunately bit complicated. problem transform class xml in format must be: <entities> <entity name="s40"> <attributes> <attribute name="insobject">x</attribute> <attribute name="insobjecttyp">x</attribute> </attributes> </entity> <entity name="s41"> <attributes> <attribute name="insobez">x</attribute> <attribute name="/sde/cd_fdate">x</attribute> <attribute name="/sde/cd_col_form">x</attribute> <attribute name="/sde/cd_applnr">x</attribute> <attribute name="/sde/cd_polbeg">x</attribute> </attributes> </entity> the problem 1 here looks nice, each variable converted xml format @ same time needs new xmlelement name ...

rest - URL Pattern Restricting in SPRING MVC -

my spring web mvc application has following handler mapping in controller. @requestmapping(method = requestmethod.get, value = "/something") when request sent http://www.someurl.com/something , works fine , maps correct controller but, http://www.someurl.com/something.bak or http://www.someurl.com/something.abc or http://www.someurl.com/something.abc.deff.xyz works!! i want restrict http://www.someurl.com/something , not others. web.xml defines mappings :- <servlet-mapping> <servlet-name>abc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> please suggest. you can use usedefaultsuffixpattern property. <bean class="org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping"> <property name="usedefaultsuffixpattern" value="false" /> </bean>

javascript - Deadly CORS when http://localhost is the origin -

i stuck cors problem, though set server (nginx/node.js) appropriate headers. i can see in chrome network pane -> response headers: access-control-allow-origin:http://localhost which should trick. here's code use test: var xhr = new xmlhttprequest(); xhr.onload = function() { console.log('xhr loaded'); }; xhr.open('get', 'http://stackoverflow.com/'); xhr.send(); i get xmlhttprequest cannot load http://stackoverflow.com/. origin http://localhost not allowed access-control-allow-origin. i suspect it's problem in client script , not server configuration... chrome does not support localhost cors requests (an open bug since 2010). to around can use domain lvh.me (which points @ 127.0.0.1 localhost) or start chrome --disable-web-security flag (assuming you're testing).

jquery - how to combine functions for elements with consecutive IDs -

sorry if title confusing, not think of better. basically, want straight forward. code jquery('.button1').click(function() { jquery(".box1").slideup(); jquery(this).remove(); }); jquery('.button2').click(function() { jquery(".box2").slideup(); jquery(this).remove(); }); jquery('.button3').click(function() { jquery(".box3").slideup(); jquery(this).remove(); }); and on.... that's pretty mess when have more boxes. there way can combine them , let jquery id numbers? you can set class name buttons (e.g. "buttons" ) , use id: <button id="button1" class="buttons">delete</button> then, can make trick number id: $(".buttons").on("click", function() { var n = this.id.replace("button", ""); $(".box" + n).slideup(); $(this).remove(); }); demo: http://jsfiddle.net/dxzku/

c# - Anybody knows how to send SSL emails with System.Net.Mail through GoDaddy email servers -

i researched on , not find complete answer. many people, including myself, able send email through c# system.net.mail using port 25 or 587 , not using ssl. example, see here: https://stackoverflow.com/questions/1317809/sending-email-using-a-godaddy-account others have solution using system.web.mail obsolete though: how can send emails through ssl smtp .net framework? however, seems nobody has solution yet on how send emails using ssl port 465. have solution or @ least knows why ssl not working c#? here code i'm using: try { mailmessage mail = new mailmessage("sender@yourdomain.com", receivingemail, subject, body); string host = "smtpout.secureserver.net"; int port = 465; // it's 465 if using ssl, otherwise 25 or 587 smtpclient smtpserver = new smtpclient(host, port); smtpserver.credentials = new networkcredential("sender@yourdomain.com", "yourpassword"); smtpserver.enablessl = true; smtpserver.deliv...

html5 - preserving a contenteditable div selection while having the caret in an text input -

i have contenteditable div want allow user make selection click on text input field , enter value without highlighting of contenteditable selection lost. is possible? can hack in firefox looks like. i selection on mousedown , restore selection on mouseup while cursor in other input in chrome when restore selection causes focus lost in input field. not have work in ie, in ff, safari , chrome. if isn't possible route going, there other workarounds issue?

mobile - How do I develop an OAuth Authorization page which a user can interact with but not the application being authorized? -

how develop oauth authorization page user can interact not application being authorized? i'm developing api set , want allow mobile apps interact api, provided they're authorized on behalf of user. once i've authenticated user, how ensure user has clicked ok button, rather application itself? regards, yusuf you add need enter type of verification code such reentering password or typing in captcha, before sending access token.

sql - How to select a field in addition to everything else? -

in sql server had convenient ability make query this: select phone_number, last_known_location, * missing_female_pilots last_name = 'earhart' how can similar in oracle? you can use table alias : select t.phone_number, t.last_known_location, t.* missing_female_pilots t t.last_name = 'earhart' or prepend table name before * : select phone_number, last_known_location, missing_female_pilots.* missing_female_pilots last_name = 'earhart'

html - Block of text as a button bar -

Image
http://jsfiddle.net/qewfp/ style.css body { background-color: #666666; margin-left:500px; margin-right:500px; margin-top:10px; margin-bottom:20px; font-family:verdana, geneva, tahoma, sans-serif; font-size:12px; color:white; } div.header { background-color: #333333; } div.navigationbar { border:0; border-style:solid; background-color:#112211; } div.navigationbutton { border:1px; border-color:#ffffff; border-style:solid; background-color:#112211; padding:15px; width:100px; height:40px; text-transform:uppercase; overflow:hidden; font-weight:bold; text-align:center; } .navigationbar ul { list-style-type:none; padding:1px; } .navigationbar li { display:inline; float:left; } .navigationbutton { text-decoration:none; color:#eec600; display:block; } .navigationbutton a:link { text-decoration:none; } .navigationbutton a:hover { color:#ffe811...

How to get build definition from TFS and pass it to the external program -

how build definition tfs , pass external program this doing manually: 1) queue new build 2) once build completed go drop folder , exe name 3) pass exe name test automation program , run it.` i want automate these 3 steps. possible build definition programatically? create custom build template. use copy of default (or ever you're using now) starting point. in work flow builddetail.compilationstatus = buildphasestatus.succeeded. have opportunity invoke application, stub program/powershell script/any other executable process. can pass path of build completed using builddetail.droplocation.

IIS URL Rewrite root only -

i have 2 urls http://test.mysite.com (1) , http://test.mysite.com/app (2) i redirect requests (1) www.othersite.com when (2) shuld not redirected. is possible url rewrite using regex? br yes, possible url rewrite module. rule looks that: <rule name="redirect non app" stopprocessing="true"> <match url="^app(.*)" negate="true" /> <action type="redirect" url="http://www.othersite.com{request_uri}" /> </rule>

jquery - How to be sure of no problems between browsers with .submit() -

i have upload form, submit link goes confirm box. both of made jquery plugin fancybox. technically not confirm box, div. had submit button in confirm box didnt work in ie/ff used .submit() . it works in chrome, ie, , firefox i've heard can never sure javascript. there way can sure work "forever"? <form name="importform" action="<?=site_url('headquarters/importdesign')?>" method="post" enctype="multipart/form-data"> <div id="import-design"> <div id="inline2"> <div class="form-section"> <ul> <li><span class="input">file:</span><input name="userfile" size="40" type="file" /></li> <li><span class="input">file name:</span><input type="text" name="name" /></li> ...

Rails 3 - modifying an attribute of other model after model.save -

unfortunately i'm still rails beginner, so, though thought , tried different approaches, didn't work want , have ask again. i have rest comment vote mechanism thumbs , down each comment. works fine, each handled counter_cache count. now, based on these thumbs , down votes, want calculate plusminus value each comment, thumbs_up-votes - thumbs_down-votes. although i'm not sure if it's efficient way deal that, planning have plus-minus value integer attribute of comment model (whereas thumbs , down own models). so, want is, when thumbs_up saved, comment's plusminus attr automatically should += 1 , , respectively thumbs_down.save a -= 1 . how can issue such action within thumbs_up controller? need modify form_for or approach wrong? is there after_save callback deal attribute of different model? from you've given, it's hard tell. i'd if need show comment's "thumbs up" , "thumbs down" independently, store them f...

create EditText view row in Android -

Image
i've managed add edittext(s) dynamically , retrieve values in android, , got program code here (sample below) public class sample extends activity { private list<edittext> edittextlist = new arraylist<edittext>(); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); linearlayout linearlayout = new linearlayout(this); viewgroup.layoutparams params = new viewgroup.layoutparams(fill_parent, wrap_content); linearlayout.setlayoutparams(params); linearlayout.setorientation(vertical); int count = 10; linearlayout.addview(tablelayout(count)); linearlayout.addview(submitbutton()); setcontentview(linearlayout); } private button submitbutton() { button button = new button(this); button.setheight(wrap_content); button.settext("submit"); button.setonclicklistener(submitlistener); return but...

javascript - Drawing chart visualization with google fusion tables -

i trying dynamically draw chart based off click on fusion table layer/map. whenever state in mexico clicked, chart change reflect value in columns 2007, 2008, 2009, , 2010. @ moment, not working. firebug telling me 'a undefined' don't know means, have not declared variable named 'a' , assuming it's in google script. this code i'm using. click listener grabs state name column named 'column_1' , passes draw visualization function: google.maps.event.addlistener(shownlayer, 'click',function(e){ statename = e.row['column_1'].value; drawvisualization(statename); }); function drawvisualization(statename){ google.visualization.drawchart({ containerid: "textbox", datasourceurl: "http://www.google.com/fusiontables/gvizdata?tq=", query: "select '2007','2008','2009','2010' " + "from 3943497 column_1 = '...

ios - Detect app crashed during load / last time it was run? -

i app reset standard settings if crashed during startup. preferably if crashed last time run. edit: crittercism has crittercismdidcrashonlastload method, handles case of crashing during load. didn't work in version of library used, has since been fixed. suggestions? make 2 functions in appdelegate.m file: void handleexception(nsexception *exception) { nslog(@"app crashing exception: %@", exception); //save somewhere app has crashed. } void handlesignal(int signal) { nslog(@"we received signal: %d", signal); //save somewhere app has crashed. } then in -(bool)application:didfinishlaunchingwithoptions before else put: nssetuncaughtexceptionhandler(&handleexception); struct sigaction signalaction; memset(&signalaction, 0, sizeof(signalaction)); signalaction.sa_handler = &handlesignal; sigaction(sigabrt, &signalaction, null); sigaction(sigill, &signalaction, null); sigaction(sigbus, &signalaction, nu...

java - Parent child permission denied -

i having judge not running in ubuntu , think written in c , java c program written parent , child spawning process code couldnot run because of following error: ./client:permission denied ./client:permission denied how can solve problem?? chmod +x client will add execute mode application

Calling new activity after facebook login | Android -

i have 2 activities in android application. on first one, ask user login facebook. after user logs in, collect user data such email, name , call new activity passing these parameters it. below facebook authorize method: public void loginfb(final view v) { facebook.authorize(this, new string[] { "email", "read_stream" }, new dialoglistener() { @override public void oncomplete(bundle values) { this.getlogininfo(v); } private void getlogininfo(view v) { // todo auto-generated method stub logininfo(v); } @override public void onfacebookerror(facebookerror error) {} @override public void onerror(dialogerror e) {} @override public void oncancel() {} }); } below logininfo() method: public void logininfo(final view v){...

javascript - jquery menu slideshow error -

i making website includes menu navigation identical 1 found @ fotopunch.com instead of pointing down points up. anyways, wrote code using jquery/javascript menu , works there small error occurs @ fotopunch site. when move cursor 1 menu item , repeatedly messes display temporarily. there way fix this? include part of javascript file can see each menu item. $("div#menu .reps").hover(function() { //if current slide not reps if(current_slide != "reps"){ //move arrow corresponding position reps slide $(".arrow").animate({"left":"135px"});//move arrow //(test slide is.) if(current_slide == "clients"){ //fade out & hide current slide $(".clients_display").fadeout().hide();//hide current slide //show reps slide & fade in $(".reps_display").fadein().show();//show slide //the current slide reps slide ...

c# - how to bind the button content where mouse selection is start -

Image
<window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:class="storyboard.clear" x:name="window" title="clear" width="640" height="480"> <grid x:name="layoutroot"> <button x:name="btn_a" content="a" height="56" margin="208,149,0,0" verticalalignment="top" horizontalalignment="left" width="75" click="btn_a_click" /> <textbox x:name="txt_display" height="50" margin="208,57,252,0" textwrapping="wrap" verticalalignment="top"/> <button x:name="btn_b" content="b" height="56" margin="297,149,252,0" verticalalignment="top" click="btn_b_click" /> </grid> public partial class clear : window { publ...

iphone - Hiding the UINavigationController on the first .xib file only -

this may stupid question programmatically added uinavigationcontroller app. if possible, wanted add top of windows except first .xib. maybe hide on first .xib. possible that? think of first .xib file opens rest of app cover page , rather blue bar not show @ top of that. wish show pictures don't have enough reps yet. thanks! below code believe helps me provide each page of app bar: #import "mccormick_taylorviewcontroller.h" @implementation mccormick_taylorappdelegate @synthesize window = _window; @synthesize viewcontroller = _viewcontroller; - (void)dealloc { [_window release]; [_viewcontroller release]; [super dealloc]; } - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions: (nsdictionary *)launchoptions { self.window = [[[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; // override point customization after application launch. self.viewcontroller = [[[mccormick_tayl...

android - Twitpic Error - Invalid Username and Password -

i using twitpic library post image on twitter m getting - invalid twitpic username , password error. there solution this?? username , password of witpic. using twitter id , password in place of it. here's code // create file file picture = new file(environment.getexternalstoragedirectory()+"/image.jpg"); if(picture.exists()) { system.out.println("picture accesseds"); } // create twitpic object , allocate twitpicresponse object twitpic tprequest = new twitpic("gauravarora90", "gaurav"); twitpicresponse tpresponse = null; // make request , handle exceptions try { tpresponse = tprequest.uploadandpost(picture, "hello world!!!"); } catch (ioexception e) { e.printstacktrace(); } catch (twitpicexception e) { e.printstacktrace(); } // if got response back, print out response variables if(tpresponse != nu...

javascript - Backbone.js event handler not working -

i trying backbone.js examples given here , tried writing code on own. for reason event handler have attached event 'click p' not working. why 'highlight' function not executing when paragraph tag clicked? var itemview = backbone.view.extend({ tagname : 'p', events: { 'click p': 'highlight' }, initialize: function(){ console.log("an object of itemview created"); _.bindall(this, 'render', 'highlight'); this.render(); }, render: function(){ this.$el.text(this.model.get('content')); $('body').append(this.$el); return this; }, highlight: function(){ console.log('clicked'); } }); this event targeting <p> element inside root element. not targeting root element, if root element <p> element. try: events: { 'click': 'highlight' } to target r...

javascript - Is there any way to specify which 'this' I want to use in a JS anon function, similar to how Java does it? -

i've come across problem few times, , i'm wondering if can solved without having bind anon function 'this' in context of parent object. here situation: i have array-like object, lets call 'numline', implements 'each' method. contained within instance of object, lets call 'numtank'. current code looks this: function numtank(numline) { this.numline = numline; }; numtank.prototype.charforelem(elem) { return "number: " + elem; } numtank.prototype.tostring() { var str = ""; this.numline.each(function(elem) { str += this.charforelem(elem); //but 'this' called in contex of 'numline' instance, dosen't (and shouldn't) have charforelem class. }); return str; } var tank = new numtank(arbatrarynumline); tank.tostring(); //uncaught referenceerror: charfromelem not defined in numline when ask 'similar how java it', mean how java allows prepend class name 'thi...

ruby on rails - Action Controller Exception: Using GET instead of DELETE -

Image
i have following routes.rb file: hchq::application.routes.draw resources :users resources :sessions, only: [:new, :create, :destroy] match '/signup', to: 'users#new' match '/signin', to: 'sessions#new' match '/signout', to: 'sessions#destroy', via: :delete end when run rake routes get: users /users(.:format) users#index post /users(.:format) users#create new_user /users/new(.:format) users#new edit_user /users/:id/edit(.:format) users#edit user /users/:id(.:format) users#show put /users/:id(.:format) users#update delete /users/:id(.:format) users#destroy sessions post /sessions(.:format) sessions#create new_session /sessions/new(.:format) sessions#new session delete /sessions/:id(.:format) sessions#destroy signup /signup(.:format) users#new signin /signin...

root gets auto created in gwt app -

hi i wrote code in 1 of entry point class as: if(rootpanel.get("fb-root") != null) form = new blooddonorform(constants.insert, null, constants.facebook, constants.blood_donor_register_form); else form = new blooddonorform(constants.insert, null, null, constants.blood_donor_register_form); this used work fine sometime sure (don't remember when checked last time). when run page in firefox firebug enabled see message like: the "fb-root" div has not been created, auto-creating so why done if not exist? sure have tested in past , not happening earlier. this may change in gwt itself. said, isn't best way check dom element existing. instead, use document.get().getelementbyid(string) check element id, , compare null. compile down simple (probably $doc.getelementbyid(id) ), , won't create widget yet (rootpanel widget) , overhead comes that.

php - Paypal form with email and paypal -

i trying make form have fields name,email,file_upload , radio button options. need : 1) when user submit form of detail send email address , redirect paypal payment. my form code : <form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target='_blank'; return readform(this, true);" name="myform" class="payment-form "> <div class="left-section"> <input name="cmd" value="_xclick" type="hidden"> <input name="add" value="1" type="hidden"> <input name="business" value="test@gmail.com " type="hidden"> <input name="shipping" value="0.00" type="hidden"> <input name="no_shipping" value="1" type="hidden"> <input name="return" value="" type="hidden"> <...

jquery - Fill viewport with squares -

i trying dimensions of viewport , fill squares perfect cover whole viewport. there must better way current code (below). perhaps there way find divisible number denominator of line var boxwidthheight = wrapperarea / 30000; ? $(document).ready(function() { var wrapperwidth = $(window).width(); var wrapperheight = $(window).height(); $('.wrapper').css('width', wrapperwidth); $('.wrapper').css('height', wrapperheight); var wrapperarea = wrapperwidth * wrapperheight; var boxwidthheight = wrapperarea / 30000; var boxwidthheight = parseint(boxwidthheight); var boxarea = boxwidthheight * boxwidthheight; var boxcount = wrapperarea / boxarea; for(var = 0; < boxcount; i++) { $('.wrapper').append('<div class="box"></div>'); } $(".box").css({ width: boxwidthheight, height: boxwidthheight }); }); http://jsfiddle.net/iambriansreed/nwpy5/ javascri...

centering - How do I adjust similar photos to match? (automatic image registration task) -

i have set of weight loss progress photos of myself similar, white, empty background. have base photo , script(s) (of kind) correct minor variations (angle, color(white-balance), distance) betweens shots without manual intervention, shoulders, hips , cropping match when flipping though photos. requirements (all in respect base image create): non-distorting match shoulder width (resizing) rotation adjustment white-balance cropping (rough alright) (if go down knees in base image other images should remove calves or head, etc.) i'm uninformed in area i'm not sure should looking (so simple google search might need). what tools should at? c, c++, python, matlab, shell fine libs/tools. update: doing more research i've found called automatic image registration. i found basic tutorial on how in python using opencv in python. http://www.neuroforge.co.uk/index.php/image-registration this partial answer though.

objective c - Virtual and Real memory in IOS app -

does amount of memory app take physically, in, on hard drive, have relationship amount of memory takes when running? instance, say, background.caf file takes 4.9 megabytes of space on disk, when being run on iphone, 4.9 megabytes being allocated music? similarly, if graphics take 20 megabytes of space, amount of memory on iphone, being used store , access these graphics equivalent 20 megabytes? important because want know if size of files i'm working right now, have large impact on performance. thank you! does amount of memory app take physically, in, on hard drive, have relationship amount of memory takes when running? no, absolutely not. otherwise autodesk go out of business! when being run on iphone, 4.9 megabytes being allocated music? no, music not loaded memory @ once, sent in chunks, streams, or decompressed in real time, never whole thing present in memory. similarly, if graphics take 20 megabytes of space, amount of memory on iphone, being...

spring - Managed beans with custom ViewScope -

i'm doing web application using spring 3.1.0.release, jsf 2.x, jpa 2 hibernate provider. use prettyfaces 3.3.2 friendly url. application run on tomcat 6.35 . i wanted use jsf viewscope decided follow implementation found on web : http://comdynamics.net/blog/109/spring3-jsf2-view-scope/ public class viewscope implements scope { private static final logger logger = loggerfactory.getlogger(viewscope.class); @override public object get(string name, objectfactory objectfactory) { final map<string, object> viewmap = facescontext.getcurrentinstance().getviewroot().getviewmap(); object instance = viewmap.get(name); if (instance == null) { instance = objectfactory.getobject(); viewmap.put(name, instance); } return instance; } @override public object remove(string name) { logger.debug("viewscope::remove {}", name); return facescontext.getcurrentinstance().getvie...

3d - Understanding DirectX and OpenGL -

i don't concept. set of api's library accesses hardware. if possible create brand new api opengl , directx? the purpose of graphics api opengl or directx provide single graphics api use across wide range of hardware. in fact, large portion of these apis implemented in graphics drivers. if design own graphics api either have make run on entirely on cpu ("in software") or write special code each type of graphics card wanted support.

regex - RegExp (^|\\?|&) in javascript -

could please me understand javascript regexp : cbreg = new regexp('((^|\\?|&)' + cbkey + ')=([^&]+)') // cbkey string i confused (^|\\?|&) portion. mean? thanks ! well first of given regex created string literal double backslashes become single backslash in resulting regex (because that's how escaping works in string literal): (^|\?|&) the | means or, have: ^ - start of line, or \? - question mark, or & - ampersand a question mark on own has special meaning within regex, escaped question mark matches actual question mark. the parentheses means matches 1 of choices before matching next part of regex. without parens third choice include next part of expression (whatever in cbkey ).

javascript - How to setup namespaces in Jasmine for testing? -

i need add functionality javascript class want test using jasmine. class definition goes this: game.player.customplayersetup = function() { ... }; if remove game.player can write normal tests , have them pass. when try leave game.player in class definition customplayersetup, reference error game not defined. how define test? to answer charles' suggestion, if declare game , player vars in jasmine test file before the require line still gives me, in game = {}; game.player = {}; customplayersetup = require("../customplayersetup").customplayersetup; describe("custom player setup", function() { ... }); the same error points production code file, , not test file. i'm using jasmine-node run tests. most in spec-runner have whatever file instantiates game and/or player below file running spec (or didn't include @ all). if that's not case try posting spec-runner 1 of tests fails.

timeout - MBeanServerConnection.invoke hangs forever -

we have app invokes various remote methods on mbeans using mbeanserverconnection.invoke. 1 of these methods hangs. there way have timeout on call? return exception if call takes long? or have move calls separate threads don't lock ui , require killing app? see http://weblogs.java.net/blog/emcmanus/archive/2007/05/making_a_jmx_co.html ===== update ===== i thinking stuff when first responded, on mobile , can't type worth damn on it..... this rmi problem, , unless use different protocol, there's not can do, except, say, move calls separate threads don't lock ui. but.... if have option of fiddling target server , can customize connecting client, have @ least 1 option customize jmxconnectorserver on target servers. the standard jmxconnectorserver implementation rmiconnectorserver . part of it's specification when create new instance using of constructors (like rmiconnectorserver(jmxserviceurl url, map environment) ), environment map can co...