Posts

Showing posts from May, 2012

Any known solutions for Image Differencing in Actionscript? -

i'm working few programming buddies create interface kinect , 1 problem we're running image differencing. need able throw out image data doesn't change image image can pin-point things moving(i.e. people). anyone have experience or direction can go? i consider creating pixel bender shader find difference , other math or tracking. pixel bender gets own thread outside of normal flash player can more horse power setup. pixel bender shaders can applied bitmaps, vectors, or video think perfect project. luck! http://www.adobe.com/devnet/flash/articles/pixel_bender_basics.html and is full collection of shaders including difference

unicode - Visual Studio C++ Combo Box Control does not work with Multi-Byte Character Set -

i have visual studio 2005 c++ mfc project utilizes combo-box control. property type = dropdown. project in unicode , combo box control worked expected. had change character set unicode multi-byte character set compatible classes/libraries available in special engineering package, measurement studio national instruments. upon doing noticed combo box no longer work (i.e. no drop down menu). confirm finding created empty project 1 dialog , combo box control on it. no code in background. if "test dialog" in editor works expected. if run program (whether or without debugging) behavior described above. if change character set unicode runs fine. side note, noticed appearances of of buttons in original project changed after switching multi-byte did not test functionality. is there known reason why combo box control's functionality affected chosen character set? thanks. i presume you're using resource editor populate drop-down, rather code? prefilled

wpf controls - Problem with traversing WPF element tree -

i have listbox data bound collection of personcollection class. next, have defined data template objects of type person , consisted of dockpanel contains textblock person's name , button remove person list. looks nice together. the problem facing unable reach selected item (and delete it) in list box when click button defined in data template. here's handler of button: private void removepersonbutton_click(object sender, routedeventargs e) { button clickedbutton = (button)e.source; dockpanel buttonpanel = (dockpanel)clickedbutton.parent; control control = (control)button.parent; } the last created object control null , i.e. cannot progress further element tree, cannot reach list , selecteditem . important thing note here cannot go getting selected item list calling it, because have more 1 list in window , lists implement same data template, i.e. share same event handler delete button. i appreciate get. thanks. if understand question correc

ruby on rails - Text_area empty -

i'm trying display content of message class using text_area helper when load page text area blank. <div id="messages"> <% message in @channel.messages %> <h3><div class="title"><%=h message.description %></div></h3> <div class="moderator">sent by: <%=h message.moderator %><br>on <%= message.created_at.strftime('%b %d, %y') %></div> <div class="description">channel summary:<br><%= text_area("message", simple_format(message.content), :cols => 40, :disabled=> true, :rows => 10) %><!/div> <% end %> </div> </div> you should use text_area_tag helper in case. text_area meant used when using form_for . http://apidock.com/rails/actionview/helpers/formtaghelper/text_area_tag <%= text_area_tag("message", simple_format(message.content), :cols => 40, :dis

audio - applescript play random sound when pressing cmd + enter -

i'm looking play random sound set of sound clips in folder when press cmd + enter. applescript running , whenever user presses cmd + enter random sound (mp3) played without opening itunes, preferably behind scenes. thanks! i didn't know afplay , that, simple script it: property soundsdirectory : posix file "/path/to/sounds/" alias tell application "system events" ¬ set soundfile posix path of (some item of soundsdirectory alias) shell script "afplay " & quoted form of soundfile if have classic mac path of form macintosh hd:users:you:sounds: , can use property soundsdirectory : alias "macintosh hd:users:you:sounds:" instead, either work. some item of <list> command returns random item list; have promise applescript alias as alias can unix-style path out of it. quoted form of <text> command puts text in single quotes (while escaping single quotes) use in shell; afplay plays it. for ⌘↩ requ

How to trace the HTTP data received by a Apache Web Server? -

how can trace http traffic received apache web server? turning trace on not me http data. normally trace use tcp monitor tool , route calls web server via monitor tool , see messages in tool. in scenario, have third party solution don't have access or control on sending soap/http requests , want see message received as-is apache web server. i can data end java ee server apache web server forwards http request surprised see there no built-in trace mechanism allows me capture http traffic @ web server? you try mod_dumpio: http://httpd.apache.org/docs/2.2/mod/mod_dumpio.html

java - android model view presenter/controller examples -

are there examples or tutorials on how best structure android applications anywhere? am new java , android , i've built winforms apps using passive , supervising controller variants of model view presenter , model view controller in asp.net not seen examples or code on android use these sorts of patterns. how people structure decent size android apps out there in wild. there best practices or should sticking rigidly official android documentation. try following 2 examples. i've found them useful in understanding how mvp might apply android applications. http://web.archive.org/web/20120524010643/http://chicagoandroid.com/forum/topics/mvp-android-perspective http://web.archive.org/web/20130525044856/http://jamespeckham.com/blog/10-11-21/mvp_on_android.aspx

How to draw a line on top of an image when finger moves on iPhone -

i trying draw line on top of background image in uiview tracing movements of user's finger. can accomplish drawing uiimage background , doing line drawing in drawrect have load image each time drawrect called , makes performance sluggish. alternatively, if use uiimageview background image (just adding view in ib or programatically) lines disappear when dragged on image. there way tell lines draw on top of uiimageview. help. here code using uiimage method: - (void)drawrect:(cgrect)rect { uiimage *imagefield = [uiimage imagenamed:@"field.jpg"]; cgrect rectforimage=cgrectmake(0,0,200,200); [imagefield drawinrect:rectforimage]; cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextmovetopoint(context, x1, y1); cgcontextaddlinetopoint(context, x2, y2); cgcontextstrokepath(context); } adding image background view correct way it. problem lies in fact added image directly view. subviews displayed on top of view,

Android : Is it better to choose ViewwGroup then ListView for below case in android? -

i application need list of items , each item contains textview progressbar download button cancel button when ever click on download button progressbar starts , running fine. . have binded each row view data object . in download task i.e; asynctask using view update. when scrolling list , progress visible @ differnt row actual row.i dont know reason ? so, decided avoid listview , go creating viewgroup , adding views linearly these views. (but donno how handle onclicklistens download , button , cancel button ) way or other possible way ? performance role ? can 1 me out these please ? thanking , srinivas how long list? if < 10 items (round about, need check). switch listview scrollview linearlayout item 1 item 2 item 3 where each of items contain items etc. , it's still scrollable. then, attach tag each item , use tag in onclick handler: public void handleclick(view v) { // use v.gettag(); } tag can define in xml via android

vim - Vimrc customization for googlecl use -

i've started using google docs collaborating others can't/won't break down , learn standard vim/latex/git workflow writing , collaborating. google has command line interface called googlecl allows call like: $ googlecl docs edit --title "some document" --editor vim which allows me edit google docs in vim. what i'd though able change vim settings if file i'm working on google docs file. easiest example here changing line wrapping. there way use augroup type of construct googlecl documents? possible currently, or require me poking around in source? how creating simple bash script in ~/bin looks this? #!/bin/sh vim -c 'set ft=google_docs' $@ save ~/bin/google_vim , chmod +x ~/bin/google_vim . create file: ~/.vim/ftplugin/google_docs.vim with settings need (e.g. set nowrap or whatever) , start editor with: googlecl docs edit --title "some document" --editor google_vim (assuming ~/bin in path: if not --

javascript - How come my simple JQuery code doesn't work? -

<script src="http://code.jquery.com/jquery-1.4.3.js" type="text/javascript"></script> <script src="https://github.com/tobia/crossslide/raw/master/jquery.cross-slide.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $(".imagedivholder").each(function(e){ $(this).crossslide({ speed:45, fade:1 },[ {src: $(this).attr("rel"), dir:'up' }, {src: $(this).attr("rel"), dir:'down' }, ] }); }); }); </script> and these divs... <div class="awallpost"> <div class="imagedivholder" rel="http://farm4.static.flickr.com/3458/3889274600_f381d280

Touchable area of HTML buttons is too large in Android browser -

Image
we having problem html buttons in android browser stealing touch events surrounding area. seems browser, or native ui, gives html buttons larger click area size of button displayed on screen , button steals touch events should captured nearby areas. problem occurs on android emulator various hardware platforms. here's example web page: below, div1 top darker rectangle (with text) , div2 bottom lighter rectangle (with button). we click in div1 (red dot indicator) the touch event delivered div1 the mouse events delivered button , div2 we have expected events delivered div1 here example using same page. we clicked in div2 @ red dot the touch event delivered div2 the mouse events delivered div1 we expected events delivered div2 we have examined source code android , android browser(including webkit) looking explanation behavior, haven't found it. we've been searching web else reporting problem , have not found mention of it! we looking type

ZenCoding in Vim expands css-properties incorrectly -

i using vim zencoding have found problem occured when expanding abbreviature css-property in documentation said that: .foo{pos:a might expanded to: .foo{position:absolute; while in real life result is: <foo></foo> position:absolute; so plugin expands elements start of line, seems must start either { symbol when write first rule of selector, either ; in other case. what's problem? the real/actual zen coding have no official support vim, afaik. use vim zencoding mattn > http://mattn.github.com/zencoding-vim . 1 works great!

ruby on rails 3 - Conflict of two javascript files -

i’m playing html5 leanback player , works when on page javascritpts. if add these javascript files rails 3 project error in leanback player's javascript file: uncaught typeerror: object function each(iterator, context) { var index = 0; try { this._each(function(value) { iterator.call(context, value, index++); }); } catch (e) { if (e != $break) throw e; } return this; } has no method ‘split’ in function lbplayer.prototype.resolvetextplainsubs. i guessed that’s because of conflict native prototype in rails don’t know how resolve it. thanks indeed it's conflict prototypes extending of array.prototype : // leanbackplayer.js @941 srt = srt.split('\n\n'); var = 0; var issub = false; this.vars.subs[lang] = {}; this.vars.subs[lang].label = {}; this.vars.subs[lang].label = label; this.vars.subs[lang].track = {}; // error: using in on array stupid // not using hasownproperty outright pitiful for(var s in srt) { // yie

WPF/Silverlight : Templating Custom Control PARTIALLY -

. hello guys, can write our custom controls in such way later on can re-template partially ? means, without replacing entire controltemplate , want change/override some of it's , feel? one way, of course, : copy controltemplate code generic.xaml, modify it's , feel partially, , use in xaml, shown below: <mycustomcontrol> <mycustomcontrol.template> <controltemplate> <!-- paste copied , modified code generic.xaml here--> </controltemplate> </mycustomcontrol.template> <!--other code--> </mycustomcontrol> but problem approach that, make our xaml too verbose . , don't it. i'm looking solution may save me polluting xaml i'm using custom control. thanks in anticipation! . i agree of martin says controltemplates being pretty or nothing thing in wpf , pretty frustrated myself when came conclusion. if writing own custom contr

c# - Why don't number types share a common interface? -

i ran across problem, wanted function work on both doubles , integers , wondered, why there no common interface number types (containing arithmetic operators , comparisons). it make writing functions math.min (which exist in gazillion overloads) way more convenient. would introducing additional interface breaking change? edit: think using like public t add<t>(t a, t b) t: inumber { return a+b; } or public t range<t>(t x, t min, t max) t:inumber { return max(x, min(x, max), min); } if want such kind of "generic" arithmetics option in strongly-typed language such c# quite limited. marc gravell described problem follows : .net 2.0 introduced generics .net world, opened door many elegant solutions existing problems. generic constraints can used restrict type-arguments known interfaces etc, ensure access functionality - or simple equality/inequality tests comparer<t>.default , equalitycomparer<t>.default singletons

basic rails question -

class person < activerecord::base validates_uniqueness_of :user_name, :scope => :account_id end my question above 3 lines of code. way i'm c++ programmer , new ruby , rails. i'm very confused line: validates_... what's that? variable definition? function call? or eles. me, it's weird line whithin class definition. it's function call. the function defined in module (activerecord::validations). modules in ruby objects , can have functions , variables attached them. you can include module , it's members. here it's done in parent class: activerecord::base. if @ it's definition starts like: module activerecord class base include activerecord::naming # ... include activerecord::validations #... end end there noticeable differences in way c++ , ruby handles class declaration. firstly, there no compilation in ruby. class definition can changed during runtime. , it's default way of declaring class. in

How to add draggable markers to a Google Map using jQuery -

i'm playing google maps , need directions :-) i'd map draggable marker. if user drags marker formfields need updated coordinates of marker. is there jquery-plugin can using v3 of google maps api? you dont need jquery, won't make easier. first create map , add draggable marker. var mylatlng = new google.maps.latlng(-25.363882,131.044922); var marker = new google.maps.marker({ position: mylatlng, map: map, // handle of map draggable:true }); then need add event listener map listens marker drag event , updates textboxes. google.maps.event.addlistener( marker, 'drag', function() { document.getelementbyid('lat').value = marker.position.lat(); document.getelementbyid('lng').value = marker.position.lng(); } ); http://jsfiddle.net/xth5u/

amazon ec2 - How can I get a list reserved instances (reserved in advance) from a AWS account using API -

i trying build report list instances particular account has have been reserved in advance 1 time upfront fee. this c# code give list of reserved instances have: amazonec2 ec2 = awsclientfactory.createamazonec2client( accesskey, secretaccesskey ); describereservedinstancesrequest request = new describereservedinstancesrequest(); try { describereservedinstancesresponse response = ec2.describereservedinstances(request); foreach (reservedinstances ri in response.describereservedinstancesresult.reservedinstances) { console.writeline(ri.reservedinstancesid + "\t" + ri.instancetype + "\t" + ri.instancecount.tostring() + "\t" + ri.purchasestate); } } catch (amazonec2exception ex) { console.writeline("caught exception: " + ex.message); console.writeline("response status code: " + ex.statuscode); console.writeline("error code: " + ex.errorcode); console.writeline(&quo

How to get the mac_ip_address of iphone device present in setting>general>about/wi-Fi address? -

i want print mac_ip_address of iphone device present in setting>general>about/wi-fi address. how can address, please let me know if 1 know. iphone sdk getting device id or mac address how can programmatically mac address of iphone

osx - How do I get ImageMagick installed -

i decided download source , compile locally , run sudo make install . however, when try run command 'which imagemagick' don't see path returned command line. i trying imagemagick , paperclip (for rails 3) play nicely, without being able install - paperclip doesn't seem work. error keep getting rails, when following has_attached_file :image, :styles => { :thumb => "64x64" } image paperclip::commandnotfounderror the output sudo make install large, posted on github here: https://gist.github.com/723339 imagemagick doesn't provide binary named imagemagick instead has 12 binarys named: animate , compare , composite , conjure , convert , display , identify , import , mogrify , montage , stream which install log installed, important one: convert installed @ /usr/local/bin/convert convert 1 paperclip uses , expect on path line 61 of https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/thumbnail.rb reads replacing c

asp.net - Get the Session info from Request.GetResponse() -

i have aplication loads many asp.net pages , in every loop need take information sesion of loaded page. how can that? example: webrequest request = httpwebrequest.create(url); webresponse response = request.getresponse(); //how session response??? you can't. session state object on server.

java - How can a Swing JWindow be resized without flickering? -

Image
i trying make custom ui based on jwindow purpose of selecting area of screen shared. have extended jwindow , added code make resizable , 'cut out' centre of window using awtutilities.setwindowshape() . when running code experiencing flicker window resized in negative x , y directions, i.e. , left. appears happening window resized , drawn before components updated. below simplified version of code. when run top panel can used resize window , left. background of window set green make clear pixels not want showing are. edit: improved code shape window correctly using componentlistener , added dummy component @ bottom further illustrate flicker (also updated screenshots). import java.awt.borderlayout; import java.awt.color; import java.awt.graphics; import java.awt.rectangle; import java.awt.event.componentadapter; import java.awt.event.componentevent; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; imp

How to assign C# variable to asp element using javascript -

i want assign csharp variable element of asp page using javascript. seems assignement not working in code. here is: document.getelementbyid('lbaccessories').innerhtml = '<%#selectlabel%>'; in asp code use: <asp:linkbutton id="lbaccessories" runat="server" />' i can't assign value directly linkbutton using text='<%#selectlabel%>' because want make more intelligent. does knows how that? thanks edit: here code, i've tried use <%=lbaccessories.clientid%> , generates error : lbaccessories not exist in context. <script type="text/javascript"> function function(ref) { if ('<%=textboxclientid%>' == 'txtlink') { document.getelementbyid('lbaccessories').innerhtml = '<%#selectlabel%>'; } else if ('<%=textboxclientid%>' == 'btnsearch') { document.gete

php - Using facebook graph api, fetching users tagged in photo and realted photos -

we have got requirement facebook based application, wherein we need fetch given photo. identify users tagged in photo , then... fetch photos in of tagged user appearing. can please suggest how achieve using facebook's graph api? thanks , regards you can access photo properties, including tags, per graph api documentation (http://developers.facebook.com/docs/reference/api/photo). to fetch photos of given user, need request user_photo_video_tags extended permission them when authorize application. if photos/users involved in process belong to/have authorized application should work. otherwise, fraught problems, e.g. if said "given photo" isn't public (i.e. visible "everyone"), need identify owner , request user_photos permission them. similarly, friends can tag friends in photos, can't assume you'll able access photos of tagged user. good luck! :)

atl - QueryInterface of out-of-proc COM server on interface imported from TLB -

i define interfaces in a.idl file, compile a.tlb in vs2005 atl project "b" use importlib(a.tlb) in b.idl , #import "a.tlb" in stdafx.h , implement interface ia a.tlb in atl com class. project outputs b.dll , b.tlb i add b.tlb refererences of c# application , within code instantiate com object. the instantiation works without problems if use either type.gettypefromclsid(); activator.createinstance(...); or [dllimport("ole32.dll", ...)] cocreateinstance(...) both work fine, object instantiates , i can cast ia interface defined in a.tlb (actually rcw generated tlb) , invoke methods. still no problems. then use oleview enable com object activation using default dllhost.exe surrogate. the instantiation of com object within surrogate (parameter clsctx_local_server in cocreateinstance) still without problems, when try cast object ia interface defined in a.tlb e_nointerface , message saying queryinterface failed because "no such inter

transparency - How to change opacity of a Xul element at runtime? -

i've tried document.getelementbyid("myid").style = "opacity: 0.5"; but didn't work: error: setting property has getter also looks there's no "opacity" attribute or parameter (in box or window element). any idea? try setting style attribute document.getelementbyid("myid").setattribute("style", "opacity: 0.5");

telephonymanager - Android Handle phone call -

i have audio recording, when phone call come need stop recording, how can this? you have use phonestatelistener : telephonymanager tm = (telephonymanager)getsystemservice(telephony_service); tm.listen(mphonelistener, phonestatelistener.listen_call_state); // somewhere else private phonestatelistener mphonelistener = new phonestatelistener() { public void oncallstatechanged(int state, string incomingnumber) { try { switch (state) { case telephonymanager.call_state_ringing: // something... break; case telephonymanager.call_state_offhook: // something... break; case telephonymanager.call_state_idle: // something... break; default: log.d(tag, "unknown phone state=" + state); } } catch (remoteexception e) {} } }; make sure include permission in manifest:

recursion - TSQL A recursive update? -

i'm wondering if exists recursive update in tsql (cte) id parentid value -- -------- ----- 1 null 0 2 1 0 3 2 0 4 3 0 5 4 0 6 5 0 i possible update column value recursively using e.g cte id = 6 top row ? yes, should be. msdn gives example : use adventureworks; go directreports(employeeid, newvacationhours, employeelevel) (select e.employeeid, e.vacationhours, 1 humanresources.employee e e.managerid = 12 union select e.employeeid, e.vacationhours, employeelevel + 1 humanresources.employee e join directreports d on e.managerid = d.employeeid ) update humanresources.employee set vacationhours = vacationhours * 1.25 humanresources.employee e join directreports d on e.employeeid = d.employeeid;

Java Hibernate Mapping Exception! (Could not determine type for: java.util.Map) -

i have made class name of movie folowing fields: @id @generatedvalue private long id; private string name; @elementcollection(targetclass = string.class) private map<string, string> properties; private double rate; private integer voterscount; private date releasedate; private integer runtime; @manytomany @jointable(name = "movie_director") @indexcolumn(name = "directorindex") private list<person> directors; @manytomany @jointable(name = "movie_writer") @indexcolumn(name = "writerindex") private list<person> writers; @onetomany @indexcolumn(name = "roleindex") private list<movierole> movieroles; @manytomany @jointable(name = "movie_genre") @indexcolumn(name = "genreindex") private list<genre> genres; as can see, have used hibernate annotation , object bean. when try open hibernate session following code... session = hibernatesessionfactory.getsessionfactory().opensession();

html5 - HTML 5, what should I tell my clients? -

more of clients lately asking me html 5 , i'm trying sense of tell them. how long until major browsers have standard support it? how long until leave html 4 behind , code new projects in html 5? telling clients? you've gotten answers, i'll chime in well. wouldn't give client blanket "yes" or "no" on html5. i'd take @ what has changed , break down sections based on how it's supported . the doctype: nothing stopping switching html5 doctype today. browsers don't understand html5's new tags (most notably ie 6-8) recognize <!doctype html> valid doctype , not switch quirks mode . after declaring document html5 document, you're free use (or not use) html5's new tags heart's content. personally, i've started using html5 doctype on websites -- if have no immediate plans use html5's new features -- because there isn't negative side effect, , bonus don't have try remember correct way writ

iphone - touchesbegan with multiple UIImageView detects incorrect UIImageView -

i'm having problem touch detection on ipad. i subclassed uiimageview this: @interface myuiimageview : uiimageview { bool _dragactive; cgpoint originallocation; } @end @implementation myuiimageview - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { _dragactive = yes; originallocation = self.center; } - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event { if (_dragactive) { uitouch* touch = [touches anyobject]; self.center = [touch locationinview:self.superview]; } } - (void)touchesended:(nsset *)touches withevent:(uievent *)event { if (_dragactive) { self.center = originallocation; } _dragactive = no; } - (void)touchescancelled:(nsset *)touches withevent:(uievent *)event { if (_dragactive) { self.center = originallocation; } _dragactive = no; } @end i have multiple imageview(myuiimageview) controls on controller view side side touchesbe

hash - ActionScript 3 - Using Associative Array to count occurrences -

hey everyone, in many programming languages there great idiom lets use hash count occurrences of items. eg in perl, suppose have list of students , want see how many of each name have (2 bobs, 1 jeremy, 22 aidans etc): my %uniquenames; (@studentnames){ $uniquenames{$_}++; } # print out (keys %uniquenames){ print "$_ : $uniquenames{$_}\n"; } so can in actionscript 3 of course, using object. the problem nan. if try autocreate , autoincrement key @ same time, nan, , whole thing breaks down. sure, can use conditional test whether key exists, , autoincrement it, or set 1 if not, that's ugly. studentnames[name] = studentnames[name] ? studentnames[name] + 1 : 1; // shudder what's correct idiom as3? there idiom? you're idiom. -- t your answer correct can same in shorter way : studentnames[name] = (studentnames[name] || 0) + 1;

svn commit to trigger google analytics annotation? -

i wondering if there way create script triggered svn commit, , add annotation in google analytics profile? this handy changes in web app, have impact in analytics of app eventually. there no way create annotations via either of google analytics apis (data export api , management api). both apis read-only operations. there popular ( 95 , 129 , 157 , 176 , 189 , 253 , 383 supporters) feature request, " add annotations update api " on official google analytics issues page, there's no known progress on this. appears way create annotations @ moment manually, within google analytics account.

html - How well-supported is <base>? Should I be using it? -

so found out today can use <base href=""/> specify base url relative urls. seems awesomely convenient, , i'm surprised why it's not mentioned more often. there reason not use it? it's not new, right? it's part of html 4.01 specification (and latest draft of html 5 spec ). you're go. from section 12.4 of html 4.01 spec: this attribute specifies absolute uri acts base uri resolving relative uris.

javascript - Can I detect a leftclick from mouse? Or Ctrl+Right Click? -

i'm trying detect if user pressed left mouse button or right button + ctrl key, i'm not sure how this. i know detect click, use <li onclick=\"dosomething()\"> is there function <li onleftclick=\"dosomething()\"> ? with jquery 1 like $(document).click(function(e) { if (e.button == 0) { // left button alert('clicked'); } }); and normal javascript there should kind of event variable accessible in onclick function perhaps this'll yet don't know if still accurate http://www.javascripter.net/faq/leftvsri.htm

asp.net - background-image not working -

i have in html works except background-image: 'images/header.jpg'; instead see grey color in header not image.. tried removing grey color still dont see image... #outerwrapper #header { border-bottom: solid 1px #628152; font-size: 18px; font-weight: bold; line-height: 15px; height: 115px; background-color: grey; background-image: url('images/header.jpg'); how can make work.. please help.. thanks have @ page firebug firefox. may not loading image properly. able play css on fly if that's issue.

php - Custom User Fields in MODx Evolution 1.0- OnWUsrFormRender -

i'm trying add custom user fields web users manager area in modx evolution 1.0 via custom plugin. i'm in stages , can't 'onwusrformrender' hook anything. ideas? here's test plugin code: <?php $e = &$modx->event; switch($e->name){ case "onwusrformrender": $fields = ' test info: <input type="text" name="test"/> '; $e->output($fields); //this doesn't show echo 'testing'; //this doesn't show break; } ?> (ps- i've tried webuserpe , ppp, neither of them situation...) you must not include <?php ?> tags in plugins besides code works fine.

javascript - How can I use dojo.destroy and dojo.create in a phone validation scenario? -

i have problem have phone input field connected dojo dropdown widget. can select phone type or international phone type. if select type can enter 10 characters in input field. if select international type can put 15 characters in input field. working correctly in firefox , internet explorer 8 not working correctly in internet explorer 7. here html code: <input id="tphone" type="text" name="tphone" class="iscompleted phone-number" tabindex="0" maxlength="10" rel="i13"/> i figure can working right in dojo if dynamically alter or destroy dom node , replace based on selection user makes. how can dojo? here dojo code have now: this.phonetypedrop = new widget.styleddropdown(dojo.byid("sphonetype"),function(){ if(_this.phonetypedrop.getselectedindex() == 0){ phone.pnfield.regex = validation.regexps.phone; dojo.attr(dojo.byid(phone.pnfield.id),"maxlength"

zend framework - Database expression not used in query -

can tell me why expression not used in query below? select accountreset .* accountreset (reset_id = '34') limit 1 public function findbyresetid($resetid, $model = null) { $result = null; if (isset($resetid)) { $select = $this->getdao()->select( array('expiration' => new zend_db_expr('unix_timestamp(expiration)')) ); $select->where('reset_id = ?', $resetid); $row = $this->getdao()->fetchrow($select); if (null != $row) { if (!($model instanceof stage5_model_passwordresetter)) { $model = new stage5_model_passwordresetter(); } // vul het model object $model->setresetid($row->reset_id); $model->setuserid($row->user_id); $model->setexpiration($row->expiration); $result = $model; } } return $result; } your zend_db_

vba - MS Access - Is there a limit to Public Functions/Routines in MS Access? RTE #7? -

so have number of forms (unbound) load , save data through calls class modules-public function save() & public function load(). got brand new error today when trying add form, shows when event handler fires call load. run time #7 "out of memory"...after reading ms number of suggestions offer, 1 pops out applicable reason seems "too many public functions/routine"....but not sure because have never run before. any ideas? in advance guys! justin much more form doing.. such databound listbox loading lot of data table.

wxpython button held down event -

hey all, im looking way of catching button held down event in wxpython cant seem find anything. theres wx.evt_button isnt quite want. want event continue processing long button down. appreciated james i think catch evt_left_down , evt_left_up. start wx.timer run process on evt_left_down until evt_left_up fired. alternatively, use togglebutton.

jpa - eclipselink PersistenceUnitLoadingEception in executable JAR -

i developing stand-alone java application uses eclipselink. fine when execute app eclipse ide. i've exported executable jar file, , since can not make eclipselink work. have found similar issue in eclipse community forum here , yet not handy: please help, my exception following: 01 dec. 2010 22:47:31,199 info configuration:97 - iniciate database exception in thread "main" java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.eclipse.jdt.internal.jarinjarloader.jarrsrcloader.main(jarrsrcloa der.java:56) caused by: exception [eclipselink-30005] (eclipse persistence services - 2.0.2.v 20100323-r6872): org.eclipse.persistence.exceptions.persistenceunitloadingexcept ion exception description: e

Rails 3 app, How to get GIT version and update website? -

i deploying rails 3 app using capistrano, , want git version (and date information) , update website's footer this. how can this? based on david's direction, solved creating initializer "git_info.rb". place file in rails initializers directory the contents of git_info.rb are: git_branch = `git status | sed -n 1p`.split(" ").last git_commit = `git log | sed -n 1p`.split(" ").last then in footer, can use output (haml syntax): #rev_info = "branch: #{git_branch} | commit: #{git_commit}" you may want set font color of #rev_info same background color, text visible when highlight cursor. i tried this, , while works in development mode, seems branch gets over-written "deploy" post capistrano deploy. capistrano must creating it's own local branch called "deploy" on deploy?

iphone - MBProgressHUD altering data output? -

i'm trying use mbprogresshud show loading animation while i'm accessing information smooth out process of going uitableview listing uiwebview has detailed information of item selected. if call [self fetchplayer]; without using mbprogresshud have no issues , works fine albeit without animation. if call [self loadinganimation]; half works. first time select uitableview loads correctly every time, if go , select same or different item quite null values playerdetails items. i'm not sure mbprogresshud method doing cause here code. nslog displaying correct information - main class calling 2 methods not output correctly. - (void)loadinganimation { // hud dispable input on view (use higest view possible in view hierarchy) hud = [[mbprogresshud alloc] initwithview:self.navigationcontroller.view]; // add hud screen [self.navigationcontroller.view addsubview:hud]; hud.labeltext = @"loading"; // show hud while provided method executes in new thre

mysql - One query join with multiple rows from one table -

ok, have 2 tables in mysql. 1 table holds customer information, other holds phone numbers. need join these tables in 1 query select 2 phone numbers phones table customer information. right query is: select customers.name, phones.phone, phones2.phone customers left join phones on phones.customerid=customers.id left join phones phones2 on phones2.customerid=customers.id group customers.id; however, returns same phone number phone 1 , phone 2. need offset phones2 1, don't know how syntactically. the phones in separate table because it's 1 many relationship. i need in 1 query because i'm exporting directly csv. help appreciated. in advance. to avoid getting same phone number twice change this: left join phones phones2 on phones2.customerid=customers.id to this: left join phones phones2 on phones2.customerid=customers.id , phones2.phone <> phones.phone

Circular parent/child relationship in database -

i have parent many children, fine. against each parent trying store default_child. want make default_child mandatory can not think how this. creating parent first mean violating mandatory default_child condition. creating child first mean violating it's fk condition. how others deal this? thanks! constraints can typically marked "deferrable", means can ask database defer checking them until commit time. lets resolve situations 1 constraint needs violated temporarily while building transaction, satisfied again time you're ready commit.

c# - Task continuation on UI thread -

is there 'standard' way specify task continuation should run on thread initial task created? currently have code below - working keeping track of dispatcher , creating second action seems unnecessary overhead. dispatcher = dispatcher.currentdispatcher; task task = task.factory.startnew(() => { dolongrunningwork(); }); task uitask= task.continuewith(() => { dispatcher.invoke(new action(() => { this.textblock1.text = "complete"; } }); call continuation taskscheduler.fromcurrentsynchronizationcontext() : task uitask= task.continuewith(() => { this.textblock1.text = "complete"; }, taskscheduler.fromcurrentsynchronizationcontext()); this suitable if current execution context on ui thread.

gcc - cross compiler d-bus -

i want corss_compiler d-bus arm. toolchain: arm-linux-gcc-3.4.1 configure option: cc=arm-linux-gcc ./configure --prefix=/opt/dbus/ --host=arm-linux --enable-abstract-sockets -with-xml=expat sourecode : d-bus-1.2.24 d-bus-1.3.1 d-bus-1.4.0 make[2]: entering directory `/home/mandy/desktop/apps/d-bus/remotec/dbus-1.4.0/bus' ccld dbus-daemon /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: warning: gc-sections option ignored dbus_daemon-bus.o(.text.process_config_postinit+0x120): in function `bus_context_check_security_policy': /home/mandy/desktop/apps/d-bus/remotec/dbus-1.4.0/bus/bus.c:1638: undefined reference `bus_set_watched_dirs' /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.os)(.text+0x44): in function `__libc_csu_init': : undefined reference `__init_array_end' /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.os)(.text+0x48)

javascript - Set time delay between two frames on mouseover -

i have display 2 images single mouseover . when mouseover image, first, image displayed time delay of 5000, image needed display same hover. on mouseout display original image. i not familiar javascript , jquery. can please give me idea how this. what did is, $('.image1').mouseover(function() { setinterval($(this).removeclass(.image1).addclass('image-over1'),5000); $(this).removeclass(.image1).addclass('image-over2'); }); $('.image1').mouseout(function() { $(this).removeclass('image-over1'); $(this).removeclass('image-over2').addclass(item); }); $('.image1').click(function(){ document.location='index.php?page='index.php'; }) the .hover() function lets specify both mouseover/mouseout @ same time, , need make function setinterval : $('.image1').hover(function(evt) { // mouse on function. // dom element got mouseover. var target = evt.t

php - Recover Magento checkout details where customer goes to Paypal and never returns -

when using paypal standard or paypal express, customers directed paypal website either complete sale, or sign in paypal accounts verify payment, respectively. there significant percentage of customers not complete sale point. magento reserves order increment id these abandoned carts, , sales_flat_quote_address table contains address details, these don't appear in abandoned carts report or anywhere else can see in admin. it helpful able display order details customer has entered contact information in shipping/billing steps of checkout, , hence should open being contacted reactivate checkout. i'm looking architectural suggestions on how display these details , reduce order leakage? new report best, or module adds node under sales menu. don't have experience in writing new reports, , sales grid/views quite complex... thanks, jonathan you can customize abodoned cart report display these carts. collection method responsible report called mage_reports_m

xamarin.ios - Monotouch - Use of Application class as storage of common objects -

to communicate between views , objects persistant information, example username , choice of font size display, considered form put these onto application object, or more efficient put them static singletons? for example: public class application { static void main (string[] args) { uiapplication.main (args); } public static username {get;set;} } i don't think there's difference performance-wise between putting static objects application vs singletons vs static classes. for things colors , fonts, prefer create static classes hold each type of object, example write this: public static class colors { public static color toolbarcolor = color.black; .. } this makes easier change colors around entire app without having searching around everywhere. same thing fonts, images, etc.

recursion - Recursive function behavior in c++ -

i know basic definition of recursive function.....but want know impact on memory?? why not chosen on loop or iteration? c++ not mandate tail call optimization, recursive functions can trivially converted loops may still take space linear in call depth (storing frame). additionally, c/c++ not necessarily detect stack overflow, that's problem potentially deep calls. edited have more qualified language ("necessarily") edit some people seem hung on fact specific compilers such gcc , clang perform tail call optimization and/or stack overflow detection. point is, if not mandated, unsafe. example, gcc performs tail call optimization @ -o2, -o3 , -os. so, if program depends on tail call optimization being performed, program mysteriously die when compiles without optimization flag (on gcc). if programming practice, then, means, can continue write programs depend on compiler flags. or ones depend on compilers. optimization not optional.

mysql - SELECT & UPDATE according to status in one sql -

i wondering how this: at moment have this, can see selecting status 0 & 2 , later in code updating status 0 97 , status 2 99 select id_queue, status table status in (0,2) order status, id_queue asc update; update table set status = 97 id_queue= " + id_sms + "; update table set status = 99 id_queue= " + id_sms + "; i want select & update , , row ids of id_queue later use can help? much appreciated. update table set status = case status when 0 97 when 2 98 end status in (0, 2) if want save id_queue values, you'll either need create temp table, or store them in program outside database. i'd second reasonably sized set - lot less housekeeping if can keep them in scope in program.

java me - send email through j2me application -

i having application build using j2me lwuit. need send e-mail app. to make application smaller, i'd suggest implement smpt on socketconnection . small e-mails shall pretty straightforward: socketconnection connection = (socketconnection)connector.open("socket://your.smtp.server:25"); datainputstream = sc.opendatainputstream(); dataoutputstream os = sc.opendataoutputstream(); //now smtp chat server using approach may allow make application depend on midp/cldc profiles, easier portable other phones (at least in theory).

c# - Assign event handling delegate in static factory method -

i suspect shouldn't using static factory method here, mean time @ loss how implement this. following code gives compile error on line in createopenport assigns _currentport_datareceived because delegate method isn't static. how can resolve this, preferably using non-static factory method? public static serialportservice createopenport(string portname, int baudrate, parity parity, int databits, stopbits stopbits) { var service = new serialportservice { _currentport = new serialport(portname, baudrate, parity, databits, stopbits) }; service._currentport.datareceived += currentportcharsreceived; service._currentport.open(); return service; } void currentportcharsreceived(object sender, serialdatareceivedeventargs e) { var port = (serialport) sender; var chars = new char[port.bytestoread]; var x = port.read(chars, 0, chars.length);

security - request and access tokens in oauth -

can explain why request tokens must exchanged access tokens after user approval? why not pretend request token access token once user has approved access? short answer : authenticate application. refer youtube's oauth process flow diagram oauth 3-legged protocol. in particular case, youtube needs authenticate 2 different entities - a) user , b) application needs accss. now, after user grants access (step 10 in diagram), youtube knows "user x wants grant application y access youtube". hasn't yet verified application y. rogue application can perform steps step 10 pretending valid, known application - , such action must prevented. in last 3 steps, application verifies youtube signing request. once done, youtube can safely provide access token application.

java - What does this strange Jersey warning mean? -

what warning mean in jersey 1.4: warning: sub-resource method, public final java.lang.string com.xxx.render(), uri template, "/", treated resource method this how method looks: @get @produces(mediatype.application_xml) @path("/") public final string render() { return "test"; } why need specify such path method? @get enough tell jersey default method entire class (i'm assuming class has @path("/myres") annotation).

Move the Program Counter in Delphi Debugging -

in visual studio, when you're debugging breakpoints can change line of code next execute dragging execution cursor line; lets skip if statements , like. i idly wondering if there similar feature in delphi knew about? i've been having around in cpu window (delphi 2006) seem able run through instructions in order, not skip them. in cpu view can right-click , choose "new eip (ctrl + n)" set instruction pointer.

java - HtmlUnit accessing an element without id or Name -

how can access element: <input type="submit" value="save xml" onclick="some code goes here"> more info: have access programmatically web page , simulate clicking on button on it, generate xml file hope able save on local machine. trying using htmlunit libraries, examples find use getelementbyid() or getelementbyname() methods. unfortunately, exact element doesn't have name or id, failed miserably. supposed thing have use getbyxpath() method got lost xpath documentation(this matter new me). have been stuck on couple of hours need can get. in advance. there several options xpath select input element. below 1 option, looks throughout document input element has attribute named type value "submit" , attribute named value value "save xml". //input[@type='submit' , @value='save xml'] if provide little bit more structure, more specific (and efficient) xpath created. instance, might wor

sockets - Problems receiving UPD Package with AsyncUdpSocket on Iphone SDK -

i have small app test sockethandling on iphone , use asyncsocket/asyncudpsocket lib. opening socket , sending not problem receiving is. //called when state received - (bool)onudpsocket:(asyncudpsocket *)sock didreceivedata:(nsdata *)data withtag:(long)tag fromhost:(nsstring *)host port:(uint16)port { nslog(@"incoming data"); [sock receivewithtimeout:-1 tag:0]; return yes; } as said, not anything, question is, method gets called when upd package complete ? how package needs end? 0 byte? thanks you should call receive method (i think positive timeout) after sending out packet. when response received delegate method called , can process received data. -raliz