Posts

Showing posts from March, 2013

asp.net mvc - MVC Model Error on TryUpdateModel() -

i have error (see below). @ first glance seems obvious me, however. i've checked everything: model ok; metadata class set ok , i've checked controller , @ time 'tryupdatemodel' called , object expect be. i'm thinking silly been stuck day, recommend anything? the associated metadata type type ' lms.model.paymentfrequency ' contains following unknown properties or fields: siteagreementid, paymenttypeid, paymentcategoryid, obligationstartdate, terminationdate, comments. please make sure names of these members match names of properties on main type. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidoperationexception: associated metadata type type 'lms.model.paymentfrequency' contains following unknown properties or fields: siteagreementid, paymenttypeid, paymentcategoryid, obligationstartdate, terminationda

PHP Sessions on Auto-Scaling Servers -

i'm working on php web app deployed amazon web services. have load balancers in front of auto-scaled application servers. the problem we're facing @ moment handling sessions. while sticky sessions reasonable solution, we'd persist sessions quite long time (weeks ideally). impair performance of load balancer on time. also, using auto-scaling mean that, time time, we'll remove server , lose of active sessions on it. of course, use common database store sessions, i'm bit concerned performance if every request requires round-trip db. i'd grateful if suggest solutions have worked you, or ideas try. thanks in advance help, ross i use custom session solution sessions stored in datatabase. that way webservers have access same session store , can decide self how long session should kept. you either build works php normal sessions or stand alone class handle them. i did similar share session between asp , asp.net on different serves , works. if

c# - How to install Windows Services Using Java? -

can tell how windows service can programmatically installed using java? i use code snippet "scientific article" in want show differences in solving issue using c# , java ;) thanks in advance! i used javaservice in past. can try jakarta's deamon http://commons.apache.org/daemon/ it seems best.

windows - How to update version of Python? -

i had python2.6 on windows 7 , installed python2.7. result have "c:\python26" , "c:\python27". my problem system still tries use old version. example if type python --version "python 2.6.4". or, if try install "numpy" find old version , not allow me manually change new version. i tried check system environment variables find out if there python2.6 (to replace python2.7) did not find that. you need change python path new version. http://docs.python.org/using/windows.html#excursus-setting-environment-variables

android - Using fade in animation for a view -

i want have view invisible , when press button, becomes visible fade in animation. i'm using alphaanimation fading effect. problem if make view invisible animation can't seen. thanks lot, gratzi provide animationlistener animation , make view visible animation starts. http://developer.android.com/reference/android/view/animation/animation.animationlistener.html

python - NameError - global name not defined -

i trying read data html forms , insert database. doing stuck error "nameerror @ /createemployee/ : global name 'get_post_param' not defined" ; paste code here. can me solve this. views.py def createemployee(request): if request.method == "post": username = get_post_param(request,"username") designation = get_post_param(request,"designation") employeeid = get_post_param(request,"employeeid") contactnumber = get_post_param(request,"contactnumber") project = get_post_param(request,"project") dateofjoin = get_post_param(request,"dateofjoin") employeedetails(username=username,designation=designation,employeeid=employeeid,contactnumber=contactnumber,project=project,dateofjoin=dateofjoin).save() return render_to_response('createemployee.html') else: return render_to_response('createemployee.html') temp

asp.net - Do app code support only to put one kind of file? -

do app code support put 1 kind of file, mean either c# class or vb class? because if put both sort of file , create object then, application throws error. how can make app code compatible both. within single assembly or project can have 1 kind of source code, although may reference multiple assemblies (of different languages) within same project.

silverlight - Prism MVVM - How to pass an IEventAggregator to my ViewModel -

recently started working prism in silverlight. want use eventaggregator subscribe , publish events between 2 viewmodels. saw on guides, viewmodel's ctor should accept ieventaggregator parameter. can't find out how hence view wants initialize viewmodel parameterless ctor. my viewmodel ctor: myviewmodel(ieventaggregator eventaggregator) { // event.... } my view: <usercontrol ....> <usercontrol.resources> <viewmodels:myviewmodel x:key="myviewmodel"/> </usercontrol.resources> <grid x:name="layoutroot" datacontext="{binding source={staticresource myviewmodel}}"> .... <grid/> </usercontrol> i can instantiate viewmodel in ctor of view, , assign datacontext, must have ieventaggregator in view, cannot get. not correct way pass ieventaggregator (or other object! - iunitycontainer example) viewmodel. can tell me i'm doing wrong? you have resolve dependen

Zend Framework: validation of hostname -

i check hostname. for exapmle: www.site.ru, site.ru, http://site.ru . these variants correct. but: http://site.ru/ zf sets not correct. how check hostname shown above via hostname validator? www.site.ru , site.ru domains while http://www.site.ru uri need manually strip protocol/scheme part, way site.ru/folder/ correct uri correct hostname. wrote filter zend framework, allow prepend http:// hostname. maybe helps

number formatting - convert numberformat (coldfusion) -

hi folks! got simple question coldfusion users, know how convert dynamic number decimals, example have code: #number# , equals to, example 10 need write 0.10 how do it? tried this: 0.#number# didnt work :) so saying values in variable "number" have 2 decimal places @ end , need display decimal places? if : <cfset actualnumber = incomingnumber/10> <cfoutput>#numberformat(actualnumber,".00")#</cfoutput> should need.

How to build the below tree with EXTJS? -

below mentioned required tree.i want use same 'img'[directory] & symbols( '+', '-') expansion & compression.i'm not familiar extjs.right i'm running extjs through html & js.can any1 me exact code ? -[img] parent -[img] first level child 1 -[img] second level child [img] third level child 1 [img] third level child 2 [img] third level child 3 +[img] first level child 2 +[img] first level child 3 have seen samples in sencha website ? there's example of how asynchronously load data. use firebug see json comes php. give idea of how structure json end. the example show how structure ext code well. in json, you'll see property called 'cls' . css class id used in tree node. leave these alone until able tree running. once source code going, edit question can more.

wpf - using Icomparer to sort with special condition -

in project have need sort datagrid column if condition holds true item should @ top(first item) of sorted list. otherwise if condition not hold item should simple sorted list. i tries using sorting event , defining icomparer not manage desired behavior. code put in icomparer can return item condition true @ top , rest item in sorted fashion. please can help it sounds want sort "certain condition" other sort critiria. should case of prepending condition list of sort descriptions in collectionview.

c# - Problem on how to update the DOM but do a check on the data with the code-behind -

this asp.net web forms .net 2.0 - i have situation not sure how fulfill requirements. need update img source on page if selections made drop down on same page. basically, drop downs 'options' item. if selection made (i.e. color: red) update img product (productid_red.jpeg) if 1 exists. the problem don't want post backs , refresh page every time selection made - if check see if image exists before swap out img src product , file doesn't exist refreshed entire page nothing. question: so have thrown javascript formulates string of image file name based on options selected. question is, options have following: submit constructed image name (i.e. productid_red_large.jpg) verify file exists either in c# or if possible in javascript. have check different possible file types (i.e. .png, .jpg...etc.). not post , refresh entire page any suggestions? submit constructed image name (i.e. productid_red_large.jpg) verify file exists either

apache - How can I clone a mercurial repo including subrepos over http without having to be authenticated for every repo? -

it preferable authenticated once. you can specify when clone: http://user:pass@url.com/repo/ or can put in global .hgrc file (note password in plain text)

c# - Strange behavior of Array.Clone() -

i have static array below static byte[] myarray = {0x01,0x02}; i read array.clone shallow copy .then execute below codes. byte[] myarray2 = myarray.clone() byte[]; myarray2[0] = 0x05; but each myarray2[0] , myarray[0] contains different values.so think array.clone() performing deep copy .can explain why? byte primitive type, not reference. there no difference between shallow , deep copy in case. try using array of mutable object type, , notice difference. update but byte[] reference type right? an array of primitive type deep down represented contiguous block of memory, physically ( by value ) containing elements. whereas array of object type contiguous block of memory, containing references actual elements (or null s). when copy array, in first case new array containing copies of elements of original. after that, modifying element in either of arrays won't change contents of other array. whereas in second case new array containing copies of refe

php - Displaying Facebook in an Iframe on my website -

i want display facebook's webpage on site ? <html> <body> <iframe src="http://www.facebook.com/" name="iframe_a"></iframe> </body> </html> this show's me image of facebook not actual content. how can ? i tried , used php , echoed content on screen how worked in case , cant understand how shall login facebook. when login get's redirected main site. this code facebook embedded in pages. if (top != self) { try { if (parent != top) { throw 1; } this code checks if embedded in iframe blocks loading other data rather loads the link can click image. <script type="text/javascript"> /* <![cdata[ */if (top != self) { try { if (parent != top) { throw 1; } var disallowed = ["apps.facebook.com","\/pages\/","apps.beta.facebook.com"]; href = top.location.href.tolowercase(); (var = 0; < disallowe

qt - Qt4 and DNS records -

does qt 4 support resolving dns records such cname, mx , srv? there's q3dns class, i'd prefer not use it. http://doc.trolltech.com/4.7/q3dns.html should have information need. edit: far can see there no low-level version except 1 above. http://doc.trolltech.com/4.7/porting4.html#qdns you code scratch mfc based example shouldn't hard port.

PHP/Ajax "Vary: X-Requested-With" does not work for me! -

i trying serve cacheable content depending on whether ajax request or not. scenario: a little php-script "/test.php" serves html-output , sets following headers: expires wed, 23 feb 2011 13:30:06 gmt cache-control public, max-age=60 vary x-requested-with,accept-encoding the output depends on $_server['http_x_requested_with'] state. when firefox points url output, , next minute same result browser-cache, not hitting server. ok, far. when request same resource via xmlhttprequest (with x-requested-with: xmlhttprequest header), firefox not request server, serves (wrong) response cache! for other way round, same. ajax-call on resource fills cache, , subsequent browser-request serves (wrong) response cache. does have experience topic? think should common enough issue - serving content depending on whether ajax or not (on same url). greetings, ilja i can reproduce this, if don't include x-requested-with header in aja

.net - EF code first inserting many rows -

i'm using ef code first , need insert many rows table, couple of thousand records, have in generic list. doing foreach loop , adding each entity table , finish savechanges() takes quite while. is there bulky way of doing ef or code first or should sqlcommand or sqlbulkcopy instead? also, there can switch off in ef code first make inserts faster? thanks help! you can call savechanges() less often. however, nothing can ef approach performance of sqlbulkcopy.

asp.net - Change the name of the radiobutton in the gridview while render -

after render group name comes in name attribute different name each radiobutton in gridview. i tried set names same. when see source in browser unique. how change name radiobutton in gridview same. protected override void render(htmltextwriter writer) { system.io.stringwriter sw = new system.io.stringwriter(); htmltextwriter htw = new htmltextwriter(sw); base.render(htw); htw.close(); string h = sw.tostring(); radiobutton first = (radiobutton)gvaddoption.rows[0].cells[3].findcontrol("rblvalue"); string uniqgroupname = first.uniqueid; uniqgroupname = uniqgroupname.replace(first.id, first.groupname); foreach (gridviewrow row in gvaddoption.rows) { radiobutton val = (radiobutton)row.cells[3].findcontrol("rblvalue"); string eachgroupname = val.uniqueid; eachgroupname = eachgroupname.replace(val.id, val.groupname); //h.replace("name=\"" + eachgroupname + "\""

c++ - How can I copy value from ostringstream to string? -

i tried : ostringstream oss; read string file , put oss; string str; str << oss.str();// error here "error: no match ‘operator>>’ in 'oss >> str' " if use str = oss.str(); instead of printing value of string, prints out "....0xbfad75c40xbfad75c40xbf...." likes memory address. can tell me why? thank you. string str = oss.str(); // should trick

DB query in for loop errors on second loop (PHP, Codeigniter) -

a simple loop loops through array , deletes database records... controller: foreach ($deletedtags $deletedtag) { $tagid = $this->tags_model->get_tag_id($deletedtag); $this->tags_model->delete_tag_association_by_tag($workid, $tagid); } $deletedtags array, example being: array ( [0] => purple [1] => trees [2] => green ) model: function get_tag_id($tag) { $this->db->where('tags.name', $tag); $query = $this->db->get(self::table); return $query->row()->id; } when there 1 value in $deletedtags works fine. when there's more 1 value model function get_tag_id($tag) breaks on second loop. errors on line return $query->row()->id; with: undefined property: stdclass::$id any idea why? i've solved it. reason it's erroring because can find first tag in array in db (even though other tags exist in db). added tag_exists check , fine... foreach ($deletedtags $deletedtag) { if

installed a jetty server. Do I need other configurations for it to run php/java code? -

i have installed xampp on remote linux server. have php pre-compiled. java also. installed jetty server. need other configuration run both php , jsp? i want use jsp , jetty server instead of php , apache scaling issues regarding notification system apply. feedback on descision apprecitied see documentation php support .

functional programming - Opt-in tail call support in the JVM on a per-language base? -

while doesn't tail call optimization ever added common optimization technique, after sun bought, wouldn't technically possible let languages running on vm decide if compiler emits tailcall instructions in byte code? e. g. java, groovy can decide not use instruction, while more functional languages scala or clojure can emit , hotspot vm optimize ones marked tailcall ? yes, technically possible -- in fact there experimental patch arnold schwaighofer openjdk that, although isn't easy apply patch , build, isn't kept date @ present. an explicit tail call instruction has advantages on transparent optimisation of function calls in tail position jvm, jvm can verify have specified tail call see tail call blog post john rose explanation of of verification can done. i think future of jvm not java, , hope time , talent pushes tail calls jvm forward.

c# - Capturing an image with Emgu - black image -

i'm newbie in emgu cv , major project i'm trying capture image webcam , show in image box, it's showing black image. what wrong following code? using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using emgu.cv; using emgu.cv.structure; using emgu.cv.ui; using emgu.util; namespace windowsformsapplication7 { public partial class form1 : form { private capture capture; public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { if (capture == null) capture = new capture(); image<bgr,byte> img=capture.queryframe(); imagebox1.image = img; } } } i think there minor mistake. use instead: declare global variable: capture capture = default(capture); put

file upload - How to modify Content-Disposition Header when using .net WebClient FileUpload -

is possible manually set 'name' attribute in multipart header when using .net webclient uploadfile? or there way solved? -----------------------8cda1896efcd67f content-disposition: form-data; name="file" ; filename="testfile.txt" content-type: application/octet-stream this testfile. -----------------------8cda1896efcd67f-- thanks suggestions!

php - Issue with symfony 1.49 and MySQL 5.5.8 -

when go generate model symfony propel:build-sql symfony generate file after each create sentece adds "type=innodb". when go insert tables in db symfony propel:insert-sql i've got error, have change manually "type=innodb" "engine=innodb" so, question: there way symfony change automatically? check out question, seems has solution — symfony 1.4 propel:build-all not working on mysql 5.5

php - Integrating TinyMCE Filebrowser/Imagebrowser with FTP Support -

has built custom tinymce mcefilemanager ftp support or tried integrate ftp mount? there many questions in forums no solutions. http://tinymce.moxiecode.com/forum/viewtopic.php?id=4987 altough spocke (the admin) responds 1 of questions: we recommend mapping ftps drives using mount points or similar since php has issues keeping connections server open. , reduce speed alot. i have no idea on how this? experienced creating mounts on ftp? how do this? here a step-by-step tutorial howto achieve unix systems. for windows may want have a @ tutorial.

php - Symfony, Doctrine Guard Plugin, generator.yml file, customizing by using another module -

i using symfony 1-4 , sfdoctrineguardplugin. my question is, on doctrine guard plugin know each module came generator.yml. , need customize generator.yml. example, need display table's (module's) column. // example @ x module , need sort according table's/module's column ... config: list: sort: [x, asc] // x not on module same thing list/display. need display column not on current module... i couldn't find on web. lot sharing idea and/or information, erman. never mind customize file directly in plugin's dir. override generator.yml copying application's module. module must same name in plugin. see "anatomy of plug-in" . symfony not provide built-in functionality sort items columns don't present in current model. have manually overriding addsortquery method in actions class. see " symfony 1.4 admin generator sort on custom column ". hope help.

cocoa - NSView | NSTextField Right Click issue -

i have nsview , inside that, there label : nstextfield control, inside nsview have show context menu on right click, working fine except few below issue, at place didn't work, i.e. if right click , doesn't open context menu, further realized have kept length/width of label big , right click happening on label, since empty area, par user experience, should allow open context menu, feel following 2 approaches solve problem 1 -- check width/length of nstextfield runtime set proper width, 2 -- pass mouse event ( or at-least right-click )from nstextfield( label ) parentview, can suggest me, how can achieve ? kind regards rohan i'm not sure if helps when click right mouse button on nstextfield in interface builder you'll see "menu" object. connecting nsmenu , have default context menu.

fieldtype - How to return field type from MySQL query? -

simple question: how can return field type of mysql table. know describe or show column want return single parameter. e.g.: select fieldtype(mycol) mytable # should return int or integer example you can use show fields tablename field ='nameoffield' this return result in format of field type null key default

jquery - MVC 3 - Render additional Editor templates for children objects -

i'm trying create form allows user create an entity 0-multiple children objects, main object being lead has 0-many beneficiary , payer objects. relation between 3 follows: lead has many beneficiaries (one many) lead has many payers (many many) joined through leadspayers in editor lead view model have loop generates editor each beneficiary , payer attached lead want able have button dynamically add beneficiary or payer lead , use editor template don't have duplicated html in javascript code. i have working bind lead when form gets posted controller don't know how reuse editor template code generate compatible html current form, has done before? there has better way ajax button renders html this helped me on right track wasn't wanted , doesn't seem supported in mvc here work around work model binding in controller. my end goal to dynamically add children objects form proper html auto bound parent when passed control method, meaning needed h

eclipse - Check opaque behavior in Acceleo -

i need check if element opaque behavior. how can that? thank you if "opaque behavior" type, can use plain ocl : element.ocliskindof(opaquebehavior)

Problem with macro behaviour in lisp -

if in repl this: (dolist (x (1 2 3)) (print x)) then error since in (1 2 3) digit 1 not symbol or lambda expr. if do: (dolist (x (list 1 2 3)) (print x)) then works ok. my question why following works: repl> (defmacro test (lst) (dolist (x lst) (print x))) => test repl> (test (1 2 3)) 1 2 3 =>nil why dolist accept (1 2 3) when inside macro definition not when directly in repl? assumption: "since test macro ,it not evaluate arguments, (1 2 3) passed dolist macro. dolist must complain when passed (1 2 3) in repl" is wrong. where? update: although answers clarify misunderstandings macros, question still stands , try explain why: we have established dolist evaluates list argument(code blocks 1, 2). well, doesnt seem case when called inside macro definition , list argument passed 1 of defined macro arguments(code block 3). more details: macro, when called, not evaluate arguments. test macro, when called, prese

GWT UiBinder: onClick event does not fire -

hallo folks, i have widget defined follow: <g:htmlpanel> <g:html ui:field="rootelement" stylename="{resources.mainstructure.widgetbox}"/> </g:htmlpanel> and in related java class there's this: @uifield html rootelement; for(int row = 0; row < 10; row ++) { rootelement.getelement().appendchild(new mywidget().getelement()); } where mywidget other: <g:htmlpanel> <table border="0" cellpadding="0" cellspacing="0" class="{resources.mainstructure.areawidget}"> <tbody class="{resources.mainstructure.workarea}"> <tr> <td ui:field="td_1"/> <td ui:field="td_2"/> <td ui:field="td_3"/> <td ui:field="td_4"/> <td ui:field="td_5"/> <td ui:field="td_6"/> <td ui:field=

java - How to clone a container (f.e. ArrayList) *easily*? Is it wrong to use .clone()? -

my, perhaps naive, solution cloning arraylist (vector replacement) is arraylist<double> albis = (arraylist<double>) aloriginal.clone(); considering because array contains immutable doubles, don't need clone them, container. as clone() returns object put there cast, -xlint complains unchecked cast. so, now? ignore supresswarnings? create new arraylist , copy orginal elements compact for? library method similar arrays.copyof()? i read unchecked cast warning accepted way incredible complex. clone() has major flaws, see this question reference. don't use it! instead, standard collections have copy constructors. use them: list<double> original = // list list<double> copy = new arraylist<double>(original); reference: arraylist<e>(collection) constructor

ubuntu - Script to update website data on cron -

i'm starting research idea had update form on website on cron schedule. the problem i'm having have dynamic ip address , server automatically update ip address via html dns provider (who doesn't support dynamic dns dyndns.org). ideally, need have script able login website, update form, , click submit button. is possible programming languages? has done via command line, i'm using ubuntu server 10.04. thanks input. very possible. place start python httplib2 module. http://code.google.com/p/httplib2/

iphone - Your idiom to avoid "potential leak" warnings with "distant" releases? -

dealing animation of large images, can this: alloc memory each of large images... nsarray *imagesforlargeanimation; #define img(x) [[uiimage alloc] \ initwithcontentsoffile:[[nsbundle mainbundle] \ pathforresource:@x oftype:@"tif"]] imagesforlargeanimation = [[nsarray alloc] initwithobjects: img("01"), // (since allocing image, of course must release eventually.) img("02"), img("03"), .... img("42"), nil]; animationarea.animationimages = imagesforlargeanimation; //blah blah... later, once animation has been stopped , no longer being shown onscreen, clean memory you'd have this: -(void) cleanupthememoryinthebiganimation { //blah blah.. // each of big images in array, release memory: (uiimage *uu in imagesforlargeanimation) [uu release]; // release array [imagesforlargeanimation releas

java - Hibernate mapping confusion -

the below definition taken hibernate association mapping tutorial here each book related 1 publisher while 1 publisher may publish many books. i'd represent above definition below way in java class book { publisher pub; } class publisher { set<book> books; } question 1. confused why tutorial says the association book publisher called “many-to-one” association. thought there "one-to-many" association between publisher , book have been right approach. question 2. below hbm book. why shouldn't declare one-to-many in publisher's hbm mapping. determines location relationship mapping? <class name="book" table="book"> <many-to-one name="publisher" class="publisher" column="publisher_id" /> </class> the association book publisher many-to-one because there can many books per publisher. irrelevant fact book aware of own publisher . association aid hibernate

use javascript to split this string "text[99][text]" -

i have input text field in form have name format: sometext[234][sometext] something <input type="text" name="user[2][city]" /> i need obtain 'user','2' , 'city' split function. thank i guess regular expression fits better here. var res = document.getelementsbytagname('input')[0].getattribute('name').match(/^(\w+)?\[(\d+)?\]\[(\w+)?\]$/); console.log(res[1]); // === "user" console.log(res[2]); // === "2" console.log(res[3]); // === "city"

php - My site doesn't show up on google chrome -

i have site , looks great on ff, sf, ie8 on google chrome shows blank page, if click on view source, there !! on js console got "failed load resource". also have same site on localhost , works great on chrome !! my site: http://grupooak.com take on chrome , if know how fix , or tool debug , find issue lmk :) thanks !! btw site developed on php (akelos framework) sometimes, if try several times can page, gets stock if click on link have tried disabling caching and/or output encoding? something similar happened me before, , related mime type. if that's case, take @ article: http://www.dyeager.org/post/2009/01/php-xhtml-mime-type-caching

ajax - BeginInvoke method and Session State -

i invoking asynchronous pagemethod call client-side. backend code [webmethod(enablesession = true)] public static string beginmethodcall() { //session accessible here string g = guid.newguid().tostring(); func<object> f = () => methodcall(); iasyncresult asynccall = f.begininvoke(null, f); lock (asyncthreadpool) asyncthreadpool[g] = asynccall; return g; } [webmethod(enablesession=true)] public static object endmethodcall(string guid) { iasyncresult callresult; lock (asyncthreadpool) { callresult = asyncthreadpool[guid]; asyncthreadpool.remove(guid); } func<object> f = (func<object>)callresult.asyncstate; callresult.asyncwaithandle.waitone(); return f.endinvoke(callresult

javascript - Markers Appearing at Random Times -

Image
i trying create map 3 different markers, each appearing @ random time. think problem asynchricity. the test url here , map shows towards bottom of page: http://www.comehike.com/hikes/hike_carpool.php?hike_id=125 does know doing wrong? thanks, alex you mean see markers drawing @ different time, e.g. @ beginning see red one, yellow, , blue one. next time load page notice blue marker showing first, yellow , red one. question right? if yes, not care :) depends on network connection, server loading etc. e.g. @ net tab of firebug, first time got: so browser started requesting smile.gif , car.jpg @ same time, after while marker_sprite requested. see maps.google.com served request faster (though request started later). server (comehike.com) processed request car.jpg (though big one, 1.3kb), , comes smile.gif (though size 174b , first requested image). next time pressed f5 , got images browser cache, browser sends requests see if not changed: notice, browser starte

web applications - Can I 'frame' a web-app in an iPhone app -

i have web app (html/js/css) , distribute via app store iphone users. am able, app store rules standpoint, create basic app has uiwebview (or via other method) points @ web-app. web-app load on web each time app opened. if not, able similar load 'web-app' local html/js/css files in native app? no, application rejected. from app store guidelines: apps web clippings, content aggregators, or collection of links, may rejected here link

Html form values not getting as typed +php -

i have php page <table width="i00%" border="0"> <tr><td>comments</td> <td><label> <textarea name="comments"></textarea> </label></td></tr</table> i typing values in comment box * first sentence second sentence but when try echo comment box value echo $_post['comments']; out put first sentence second sentence . how can out put first sentence second sentence run through nl2br() . line breaks have no meaning in html output.

Is there an Mac OX application for searching the Java API? -

is there application ingredients lets browse coco api java on os x? local: since using osx if have javadoc downloaded , expanded locally can use spotlight. online: here neat trick if use firefox.

aes - How to make Rijndael CBC mode work in vb.net -

i'm trying make rijndael work in cbc mode. i'm not sure how should it. think problem in current code stream initialized every time in beginning of encryption, no avalanche effect occurs (same data encrypted twice , output of 2 encryption same should not be). i tried initialize cryptostream once coded crashed because canwrite property of cryptostream goes false after first write cryptostream. here code have now: sub main() dim rij new rijndaelmanaged dim iv(15) byte dim key(15) byte dim secret() byte = {59, 60, 61} dim cs icryptotransform dim cstream cryptostream dim out() byte dim newrandom new rngcryptoserviceprovider() newrandom.getbytes(iv) newrandom.getbytes(key) rij = new rijndaelmanaged() rij.keysize = 128 rij.padding = paddingmode.pkcs7 rij.mode = ciphermode.cbc rij.iv = iv rij.key = key cs = rij.createencryptor()

javascript - How to achieve the Facebook Photo Albums affect in the URI? -

those use facebook have noticed recent change photo albums , viewing of photos. they allow use left , right arrow keys on keyboard change photo viewing. i know there many open source javascript scripts photo viewing different... in old facebook albums , other javascript photo albums, seem use # in uri/url id's , can make ajax call. example; http:mydomain.com/album.php?aid=12312&pid=43534#someidhereaswell the new version on facebook seems have same result/affect url's this... http://www.facebook.com/photo.php?fbid=1431582004331&set=a.1317260946376.35985.1676316284&theater http://www.facebook.com/photo.php?fbid=1304601029886&set=a.1317260946376.35985.1676316284&theater http://www.facebook.com/photo.php?fbid=1431444360890&set=a.1317260946376.35985.1676316284&theater so there no # in url javascript use, how can done? i think uses this: var stateobj = { foo: "bar" }; history.pushstate(stateobj, "page 2&qu

iphone - Why put [super init] inside of an if statement since whether or not the return is nil we return it anyway? -

on cs193p course says in init method there should if statement check if [super init] works: if (self = [super init]) { self.someproperty = parameter; } return self; i don't understand why done, if [super init] returns nil, method return nil, no matter outcome of if statement? edit: question is; why put self = [super init] inside if statement. (not: why have self = [super init] @ all) that's make sense because in cases [super init] can return nil, , in case if try access ivar you'll crash. example: -(id) init { self = [super init]; some_ivar = [[nsobject alloc] init]; //compiler treats self->some_ivar //if self == nil you'll exc_bad_access return self; }

delphi - reading 2 lines from IniFile -

trying again. on advice, adding piece of code understand. fine fact have save 4 bits of information in 2 lines so: inifile.writestring('testsection','name','country'); inifile.writestring('testsection','city','street'); my question more loading information form. if in inifile have saved example following code [testsection] john=uk london=barlystreet mike=spain madrid=eduardostrata emma=usa new york=1st avenue made information in inifile. added through code above. question is: how load example, when type in edit box mike, rest of belonging information.(spain, madrid,eduardostrata). that's not how ini file works. save name=value pairs, , have have way associate them. maybe can started: ini := tinifile.create(yourinifilename); try ini.writestring('mike', 'country', 'spain'); ini.writestring('mike', 'city', 'madrid'); ini.writestring('mike', 'stree

setting jqGrid data after the grid has been created -

the following example code load jqgrid (this code works) ... jquery(document).ready(function () { var griddata = [ { col1: 'cell11', col2: 'cell12', col3: 'cell13' }, { col1: 'cell21', col2: 'cell22', col3: 'cell23' } ]; $('#mygrid').jqgrid({ data: griddata, datatype: 'clientside', colnames: ['col1', 'col2', 'col3'], colmodel: [ { name: 'col1' }, { name: 'col2' }, { name: 'col3' } ] }) how rewrite example griddata set after jqgrid created? tried this... jquery(document).ready(function () { var griddata = [ { col1: 'cell11', col2: 'cell12', col3: 'cell13' }, { col1: 'cell21', col2: 'cell22', col3: 'cell

Javascript Question: Misunderstand either getElementbyID or innerHTML -

can tell me why, following code, when click "click here", text doesn't change "test"? <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <body> <div id="thisdiv" onclick="document.getelementbyid('thisdiv').innerhtml='test'">click here</div> </body> </html> you have lowercase b , uppercase d . //-------v------should uppercase getelementbyid //----------^---should lowercase example: http://jsfiddle.net/qsepf/ but simpler reference current element this : onclick="this.innerhtml='test'" example: http://jsfiddle.net/qsepf/1/

multithreading - python: subprocess.call threads problem -

hello people within while true processing never ends, if use q.task_done, wrong? filequeue = queue() def submit(i, q): global filespath while true: filename = q.get() retvt = subprocess.call("python abc.py -f %s" % (filespath + filename), shell=true, stdout=open('/dev/null', 'w'), stderr=subprocess.stdout) retth = subprocess.call("python def.py -a %s" % (filename), shell= true, stdout=open('/dev/null', 'w'), stderr=subprocess.stdout) q.task_done() def main(): global filequeue num_threads = filequeue.qsize() in range(num_threads): worker = thread(target=submit, args=(i, filequeue)) worker.setdaemon(true) worker.start() filequeue.join() print "done" if name == ' main ': main() thanks what program listings abc.py , def.py? sure commands executing ever end? try running 2 subprocess.call() lines commented out , see if w

how to pass an array in GET in PHP? -

$idarray = array(1,2,3,4); can write line in html? <form method='post' action='{$_server['php_self']}?arr={$idarray}'> or should write: <form method='post' action='{$_server['php_self']}?arr[]={$idarray}'> how passed? how should handle in called page? thanks !! if want pass array parameter, have add parameter each element. query string become: ?arr[]=1&arr[]=2&arr[]=3&arr[]=4 as others have written, can serialize , unserialize array. but have send data client again? looks need way persist data between requests . in case, better imo use sessions (docs) . more secure otherwise client modify data.

ajax - Javascript two submit buttons in one form almost complete -

i have form 2 submit buttons onclick events attached. form action paypal form. if make payment button pressed form emailed , redirects paypal payment. if invoice button pressed email sent form details default action of redirecting paypal stopped. it seems work fine when invoice buttin pressed still redirects paypal. if invoice button pressed want send email stop , not continue on form action. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paymentform" name="paymentform"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="currency_code" value="gbp"> <fieldset id="your_details" class=""> <legend>your details</legend> <ol> <li><label for="your_name">your name</label><input type="text" name="your_name" value="

.net - How can I create a TFS 2010 Team Project using the SDK? -

i've heard it's not possible, figured i'd ask here , definitive answer. there way use team foundation server 2010 sdk programatically create new project in collection? so far, i've seen use method of scripting vs 2010 ide: http://blogs.msdn.com/b/granth/archive/2009/09/25/scripting-team-project-creation-in-tfs2010.aspx . ugly. i'm keeping fingers crossed there's better way. ideas? you can use instead of command line: string log = @"c:\builds\tfslog.txt"; string settingsfilepath = @"c:\teamprojects\teamprojectsettings.xml"; var batchteamprojectcreator = new batchteamprojectcreator(); var succes = batchteamprojectcreator.batchcreateteamproject(settingsfilepath, out log); you'll need add reference dll: c:\program files (x86)\microsoft visual studio 10.0\common7\ide\privateassemblies\microsoft.visualstudio.teamfoundation.teamexplorer.dll you still need use xml, bit more elegant. hope looking for. :) good luck, osh

algorithm - Calculating tax owed with thresholds and rates in java -

for part of revenue program making assignment school have calculate number total tax owed citizen. given in text file number of thresholds, threshold value, , rate @ each threshold. example threshold rate $15,000 15% $29,000 20% $50,000 25% a citizen net income $55,000 pay: $15,000*0%+$14,000*15%+$21,000*20%+$5,000*25% = $7,550 i have started method here private void computetaxowed(citizen cit, taxschedule sked){ double netincome = cit.getnetincome(); double tottaxpaid = cit.gettottaxpaid(); int levels = sked.getnumlevels(); double[] threshold = sked.getthreshold(); double[] rate = sked.getrate(); double taxowd = 0; for(int = levels; i>0; i--){ taxowd = ((netincome-threshold[i])*rate[i]); } i know not give correct output , can't figure out how make algorithm work. if extract values of both arrays , save them each individual variable right output think messy , not best way it. any ideas appreciated! class main

android - Samsung Pop 5570 does not connect in Ubuntu 10.10. in development mode -

adb devices not listing samsung pop 5570 wen connected in usb debugging on in ubuntu 10.10 adb devices ?????????? no permissions i did add 51-android.rules file in /etc/udev/rules.d folder still adb devices shows devices wit ?????? no permissions. 51-android.rules file has following contents: subsystem=="usb_device", sysfs{idvendor}=="04e8", mode="0666" please let me know if missing something i resolved issue appending #samsung in 51-android.rules file , copying "adb" command /bin folder. $ restart udev $ cp adb /bin $ sudo adb kill-server $ sudo adb start-server $ sudo adb devices list of devices attached s5570e905be1c device

c# - ToolTip Question -

ok, have checkboxlist (which databounded) , i'm displaying tooltip icon next each checkbox. code displays css tooltip on hove rfor icon. want pass different message each icon: project duration, customer involvement, etc. atm, same message displayed when hover on each of icons. how can fix this? thanks! protected void agilefactors_databound(object sender, eventargs e) { var checkbox = sender checkboxlist; if (checkbox != null) { foreach (listitem listitem in checkbox.items) { listitem.text = string.format("{0} <span class='link'><a href='javascript: void(0)'><font face='verdana,arial,helvetica' size='2'><img src='{1}' height='20' width='20' /></font><span><b>project duration:</b><br/>ideally, project should close 6 months: shorter means less iterations, , longer tends towards long term planning.</span></a>

iphone - Reading and Writing to an NSDictionary? -

in app have table view user presses "add" button in nav bar , new cell added table view. data table loaded nsarray , each index in array storing nsmutabledictionary 4 key-value pairs. array saved .plist every time cell added. when user selects row in table detail view gets loaded. detail view loads data saved .plist depending on row selected. in detail view want allow user edit data in dictionary specific row. i've been trying different things , can read data dictionary , load view when try , save data dictionary app keeps terminating. can explain me proper way reading , writing data nsmutabledictionary? this how i'm writing data .plist: nsmutablearray *array = [[nsmutablearray alloc] initwithcontentsoffile:filepath]; nsmutabledictionary *dict = [[nsmutabledictionary alloc] init]; dict = [array objectatindex:selectedrow]; nsstring *tempa = [[nsstring alloc] initwithformat:@"%d pts", ivar_a]; nsstring *tempb = [[nsstring alloc] initwithformat:@&

sql, php, html table question -

i want grab data mysql database using php. data looks this: apple 3 orange 2 banana 4 i want take data , put in html table , use css make pretty, dont want deal inside <?php ?> after grab $result = mysql_query("select * table"); can reference result variable outside <? php ?> tags? no. php can done in <?php ... ?> or <?= ... ?> . use template engine such smarty if want substitution in manner.

c# - What is the Implementation of Generics for the NET Common Language Runtime -

when use generic collections in c# (or .net in general), compiler leg-work developers used have of making generic collection specific type. . . . saves work? now think it, can't right. because without generics, used have make collections used non-generic array internally, , there boxing , unboxing (if collection of value types), etc. so, how generics rendered in cil? doing impliment when want generic collection of something? don't want cil code examples (though ok), want know concepts of how compiler takes our generic collections , renders them. thanks! p.s. know use ildasm @ cil still looks chinese me, , not ready tackle that. want concepts of how c# (and other languages guess too) render in cil handle generics. forgive verbose post, topic quite broad. i'm going attempt describe c# compiler emits , how that's interpreted jit compiler @ runtime. ecma-335 (it's written design document; check out) it's @ knowing how everything, , mean ever

java - Debug takes four minutes to run -

i developed swing application communicate through serial port. using rxtx library serial port communication, hangs 5 minutes when debug application @ point. public void connect(string portname) throws exception { commportidentifier portidentifier = commportidentifier.getportidentifier(portname); if (portidentifier.iscurrentlyowned()) { system.out.println("port in use!"); } else { serialport serialport = (serialport) portidentifier.open("rs232example", 2000); serialport.setserialportparams(57600, serialport.databits_8, serialport.stopbits_1, serialport.parity_none); new commportsender(serialport.getoutputstream()); new commportreceiver(serialport.getinputstream()); } }

java ee - difference between JMX and RMI -

what purpose jmx used for? have been scanning through of tutorials on jmx, register mbeans , invoke mbeans jconsole. if purpose used for, difference between jmx , rmi(remote procedure call). in advance.. 'remote procedure call' distributed computing concept process running on 1 host can call procedure on remote host. rmi in java 1 implementation of concept. mbeans bean classes can registered jmx bus listen events arriving on bus or send events on bus or collect various sorts of data other participating mbeans etc. used health monitoring of application servers etc. can check number of active connections, amount of free memory , many other statistics analysis engine. , yes, can invoked remotely using rpc mechanism. vital functioning data collectors since in cluster of application servers data has fetched collectors , collated @ 1 place analysis.

sql - MySQL Union?? Query Help -

i have 2 tables. 1 has album information, , other actual copies of albums in inventory. these have different prices based on various factors. each row in inventory table doesn't store album information directly, id of album in "albums" table. the query want write me artist name, album name, image, etc albums table highest , lowest prices found in inventory table. i know basic mysql i'm having lot of trouble one. can expert please me here? lot! albums table: id (pk) title artist year genre inventory table: id(pk) albumid (corresponds id in albums table) price condition mono the query i've attempted looks giving me error: select albums.artist, albums.title, albums.imgurl, albums.id albums union select max(inventory.price), min(inventory.price) albums.id = inventory.albumid limit 30 select * `albums` the 2 parts of (two-part) union must have same number of columns, , types need same or treatable if same. your se