Posts

Showing posts from April, 2013

search engine - searchable database based web application design -

search engine - searchable database based web application design - i new web application development. want develop java/mysql/tomcat web application. want create application info within database can searchable search engine. how implement that? search engines don't read database. read web pages. create info want searchable accessible next non-ajax links outside. if hide info behind login form, or search form, search engines won't able access information. database search-engine

visual studio - Does a "VS 10 x64" program work well on x86 OSs? -

visual studio - Does a "VS 10 x64" program work well on x86 OSs? - i start programming using visual studio 10 (64 bit) don't know : vs 64 bit programme work on 32 bit operating system? i'm sorry if asked question. didn't find that. @in silico right work, there no 64-bit version of visual studio 2010. visual studio run on x86 , x64 systems, , capable of generating 32-bit , 64-bit programs regardless of os platform. there "any cpu" build alternative allow same executable run on both x86 , x64 systems, there may cases not alternative you. visual-studio x86

android - Why does my ListView not filter text anymore after calling setContentView? -

android - Why does my ListView not filter text anymore after calling setContentView? - full code activity: package com.stevovo.myactivity; import java.util.arraylist; import java.util.emptystackexception; import android.app.activity; import android.content.context; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.view.viewgroup; import android.view.viewgroup.layoutparams; import android.widget.arrayadapter; import android.widget.button; import android.widget.checkedtextview; import android.widget.expandablelistview; import android.widget.linearlayout; import android.widget.listview; public class myactivityselect extends activity { arraylist<string> mcheckeditems; mylistview lv; expandablelistview elv; activity a; button tv, back1, back2; mysimpleexpandablelist simplelist; //custom expandable list view adapter mysimplegroup grp; //just class manage parents , children boolean firstrun; public void oncreate(bun...

apache - RewriteRule containing dots does not work -

apache - RewriteRule containing dots does not work - i have simple rewrite rule right 404s on site work on, redirect not functioning correctly. trying redirect www.site.com/eve.. www.site.com/ below (each tried separately): rewriterule ^eve..$ http://www.site.com/ [r=301,l] rewriterule ^eve.. http://www.site.com/ [r=301,l] rewriterule ^eve\.\.$ http://www.site.com/ [r=301,l] rewriterule ^eve\.\. http://www.site.com/ [r=301,l] rewriterule ^eve\.\./?$ http://www.site.com/ [r=301,l,nc] none successful. next work: rewriterule ^eve http://www.site.com/ [r=301,l] but rule generic , want match redirects prevent future issues. wrong attempts redirect exact url? thank you escape dots this: rewriterule ^eve\.\./?$ http://www.site.com/ [r=301,l,nc] dot . means character , string eve.. can match every or eve11 well. apache .htaccess mod-rewrite

osx - Install php pear on mac os -

osx - Install php pear on mac os - how right instal pear php. store web server in /opt/local. pear want installed /users/. how alter folder. c8-bc-c8-d8-eb-65:tmp macbookpro$ sudo php -d detect_unicode=0 go-pear.phar below suggested file layout new pear installation. alter individual locations, type number in front end of directory. type 'all' alter of them or press come in take these locations. 1. installation base of operations ($prefix) : /users/macbookpro/pear 2. temporary directory processing : /tmp/pear/install 3. temporary directory downloads : /tmp/pear/install 4. binaries directory : /users/macbookpro/pear/bin 5. php code directory ($php_dir) : /users/macbookpro/pear/share/pear 6. documentation directory : /users/macbookpro/pear/docs 7. info directory : /users/...

jsf 2 - Why hidden input causes ClassCastException -

jsf 2 - Why hidden input causes ClassCastException - consider example. web page: <h:form> <h:outputlabel value="enter text:"/> <h:inputtext value="#{testcontroller.vo.teststring}" /> <h:inputhidden id="test" value="#{testcontroller.vo.id}" /> <h:commandbutton value="click me" action="#{testcontroller.submitform}"/> </h:form> controller: @named @sessionscoped public class testcontroller implements serializable { private static final long serialversionuid = 1l; private valueobject vo = new valueobject(); public string submitform() { homecoming null; } public valueobject getvo() { homecoming vo; } public void setvo(valueobject vo) { this.vo = vo; } } valueobject: public class valueobject { private long id; private string teststring; public string getteststring() { homecom...

php - How can I use docblock hints with classes for $this variables? -

php - How can I use docblock hints with classes for $this variables? - i'm using netbeans ide. whenever have code uses function (usually factory) homecoming object, typically can next help hinting: /* @var $object fooclass */ $object = $somefunction->get('barcontext.fooclass'); $object-> // produce property , function hints fooclass. however, when utilize object's property store class, i'm @ bit of loss how same, trying utilize @var $this->foo or @var foo not carry hinting through: use path\to\fooclass; class bar { protected $foo; public function bat() { $this->foo = factoryclass::get('foo'); // returns instance of fooclass $this->foo //does not have hinting in ide } } i have tried in docblock class, or using inline comments above protected $foo or foo set instance. the workaround have found far to: public function bat() { $this->foo = factoryclass::get('foo'); ...

jquery thermometer not cover the area between 0 - 100% -

jquery thermometer not cover the area between 0 - 100% - i trying create thermometer but have problem it's background. utilize next jquery script <script type="text/javascript"> $(document).ready(function () { var bkcolor; $('#slider').slider({ range: "min", min : 36.6, max : 43, value: 36.6, step: 0.1, slide: function(event, ui) { if(ui.value<=36.8){ bkcolor='#0f0';}; if(ui.value>36.8 && ui.value<=37.5){bkcolor='#ff0';}; if(ui.value>37.5 && ui.value<=39){bkcolor='#f6931f';}; if (ui.value > 39) { bkcolor = '#f00'; } $('.progressbar-cover').css('bottom' , ui.value + '%'); // line 1 $('.progressbar-value').css('backgroundcolor' , bkcolor ); $( "#amount" ).val($( "#slider" ).slider( "value" )); } }); }); </script> but element.style 0 - 100% now, 3...

facebook graph api - Really basic questions about the PHP SDK -

facebook graph api - Really basic questions about the PHP SDK - suppose had logged in user through facebook php sdk, , had permission fetch bio (user_about_me) , education (user_education_history). if wanted fetch data, how go doing that? know if wanna user interests, run $facebook->api("/me/interests"); however, not work bio , education history. using php sdk, how can data? thanks. edit: here's image of app permissions, code used request permissions. $login_url = $facebook->getloginurl(array( 'scope' => 'email, publish_stream, user_about_me, user_interests, user_education_history')); you can't $facebook->api("/me/about") ; or $facebook->api("/me/bio") ; throw fatal error: fatal error: uncaught oauthexception: unknown path components: /about thrown in [...]/base_facebook.php on line 1028 if want user_about_me , user_education_history can like: $user = $facebook->api("/me...

php - Equal Fields validation in Symfony 2 -

php - Equal Fields validation in Symfony 2 - i'm trying implement alter password functionality in symfony 2 project. have entity user validation rules in validation.yml file. in user entity have field " password " validation constraints in validation.yml . created form 2 field ' password ' , ' confirmpasswod '. want utilize entity validation constraints 'password' field , check equality between ' passwod ' , ' confirmpassword ' fields. in contronller write $form = $this->createform(new symfonyform\changepasswordtype(), new entity\user()); if ($form->isvalid()) {..............} in 'user' entity don't have 'confirmpasswod' field. error: neither property "confirmpassword" nor method "getconfirmpassword()" nor method "isconfirmpassword()" exists in class is there way utilize entity-based form validation form fields , not entity-based validation other? in...

svn - Using version control to keep multiple code branches up to date -

svn - Using version control to keep multiple code branches up to date - i'm hoping able help me improve understand version command in scenario. we're thinking of either implementing visualsvn or mercurial, want our strategy figured-out first. i'm part of 2 man development team working on porting , maintaining bespoke cms system. we're looking maintain "stable" branch, , each have our own dev branches required. where we're not sure each client requires own customisations (templates, stylesheets, etc). i'd expect these branches stable. ideally we'd way ensure changes made stable (such merging dev branch in or adding hot-fix) pushed out client branches. is there way ensure these client branches automatically brought forwards recent changeset ? can take exclude files (such *.css) getting pushed client branches after initial branch operation ? looking @ you'd able go each client branch , pull stable, merging latest changes i...

audio - Arduino Piezo Knock Sensor Play Tones -

audio - Arduino Piezo Knock Sensor Play Tones - i hook several piezos arduino that, when activated each piezo plays/triggers separate tone. instance, i'll have 5 piezos connected arduino - when apply pressure level each 1 play separate note, either through software interface on computer or piezos themselves. arduino synth using piezos keys. i'm not quite sure how go doing this. i'm sure possible need force in right direction. ideas? thanks! the practical difficulty of using 1 device both input sensor , output device, 1 time activated output (a sound) have disable using input fixed time. more responsive utilize separate sensors keys, , 1 speaker sounds. folks came arduino tutorials have 3 key sensor player illustration here: http://arduino.cc/en/tutorial/tone3 and illustration of using piezo sound sensor here: http://www.arduino.cc/en/tutorial/knocksensor audio keyboard arduino synthesizer sound-synthesis

Can OpenLayers parse GPX data which is stored as a string in a javascript variable? -

Can OpenLayers parse GPX data which is stored as a string in a javascript variable? - i have map site using openlayers, imports , displays gpx info using next code: var lgpx = new openlayers.layer.gml(gpxtracktitle, gpxfileaddress, { format: openlayers.format.gpx, style: {strokecolor: plmapvars.colourarray[i%7], strokewidth: 5, strokeopacity: 0.7}, projection: new openlayers.projection("epsg:4326") }); map.addlayer(lgpx); i'm looking way display gpx info which, rather beingness stored file, saved string in javascript variable: var gpxstring ="<?xml ... </gpx>" i've tried passing string code above info uri, without success. openlayers capable of parsing gpx string in way i'm attempting it? thanks in advance help. maybe there easier way, here go: you know openlayers.format.gpx [docs]. has read method, accepts xml document , returns array of features. can add together feature layer. how parse xml ...

xcode - Why won't my image update in an iOS control? -

xcode - Why won't my image update in an iOS control? - i have bundle images in buttons. changed number of these files, still showing old image when build , deploy device or simulator. there can build or device realize these images have changed? when view image in xcode, shows new image (same file name, updated image). when deploy it, shows old image. sometimes xcode has caching issues build artifacts. seek doing clean first, build. ios xcode

asp.net - Convert a webmethod from c# to vb.net -

asp.net - Convert a webmethod from c# to vb.net - i did web method below using c#. i'm tryin convert vb.net, i'm missing something. i'm using ajax calling, paginator/sorter table plugin. [webmethod( enablesession = true )] public static object listapessoas(int jtstartindex = 0, int jtpagesize = 0, string jtsorting = null) { homecoming new { result = "ok", records = persons.tolist(), totalrecordcount = persons.count }; } first, error in vb - can't leave parameters optional("attribute webmethod cannot applied method optional parameters"): <webmethod()> _ public function listapessoas(optional byval jtstartindex integer = 0, optional byval jtpagesize integer = 0, optional byval jtsorting string = nothing) second, don't know how homecoming message "ok...

objective c - Using an NSXMLParser to parse HTML -

objective c - Using an NSXMLParser to parse HTML - i'm working on app aggregates feeds net , reformats content. i'm looking way parse html. given xml , html similar in construction thinking "maybe should utilize nsxmlparser" i'm using parse rss feeds , i've become comfortable using it, i'm running problem. the parser not recognize <p> element. has no problem extracting elements <title> , or <img> , doesn't <p> . has tried doing this, , if have suggestion or work arounds issue? think xmlparser i'm doing , utilize it, obviously, if can't text in <p> elements it's useless me. any suggestions welcome, ones suggesting different method entirely. i've looked 3rd party libraries doing i've read have bugs , much prefer utilize provided apple. there's absolutely nil special "p" name of element. while hard sure because haven't provided illustration of html parsing, probl...

iphone - Database delete issue -

iphone - Database delete issue - i have type of info stored bookmark in bookmarks table.....this type of info (which having ' in between string) not removed database.... else other info removed. then solution of type of issue. query:--> delete bookmarks name='bimbo's 365 club' delete bookmarks name='slim's' it gives me:--> near "s": syntax error both of above examples problem occurs. please suggest me appropriate solution of issue. you have utilize backslash in front end of single quote \' indicate single quote in value. i.e. delete bookmarks name='bimbo\'s 365 club' iphone

c# - Difficulty Concerning EF Code First Fluent API, TPH, and Foreign Keys -

c# - Difficulty Concerning EF Code First Fluent API, TPH, and Foreign Keys - i have 2 tables in database. 1 called users , , other called widgets . widgets table represents 3 entities in code model. 1 of entities, widget , parent class other 2 entities, widgettypea , widgettypeb . both widgettypea , widgettypeb have navigation properties user entity, persisted users table in database. i'm having problem getting code first utilize same foreign key both widgettypea , widgettypeb entities ( userid ). know how this? seems should mutual problem table per hierarchy mapping. my entity classes follows: public class widget { public int id { get; set; } public string name { get; set; } } class widgetmap : entitytypeconfiguration<widget> { public widgetmap() { totable("widgets"); haskey(w => w.id); property(w => w.id) .hasdatabasegeneratedoption(databasegeneratedoption.identity); prope...

python - Prevent PyDev from moving specific imports -

python - Prevent PyDev from moving specific imports - while programming under eclipse+pydev , using flask framework, noticed auto-organizing imports feature ide (invoked ctrl+o) gets in way. this related way flask deals need of splitting views code multiple modules, or packages. basically, if have views.py module contains request handlers: from myapp import app @app.route('/') def root(): homecoming "hello world" and flask app defined in __init__.py : from flask import flask app = flask('myapp') app.config.from_pyfile('config.py') @app.before_request def before_request(): pass # omitted brevity @app.teardown_request def teardown_request(): pass # omitted brevity you need import views at end of latter file view functions added flask's routing table. since views.py imports __init__.py access app variable, results in circular import. works fine, though, , in fact established practice, suggested documentation. unfortu...

php - WP touch widgets -

php - WP touch widgets - hi guys i'm using wp touch develop mobile wordpress site, when seek dynamic_sidebar('sidebar') homecoming false in main theme can utilize widgets, want them available in wp touch thought if can done? wordpress couldn't find sidebar sidebar on mobile theme because it's not defined in mobile themes functions.php (in wp-content/plugins/wptouch/themes/themename/) . so have add together : if ( function_exists('register_sidebar') ) { register_sidebar(array( 'name' => 'sidebar', 'id' => 'sidebar', 'before_widget' => '<div class="sidepanel">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); } php html ios wordpress

Running Python/Numpy/Pandas on older secure computer -

Running Python/Numpy/Pandas on older secure computer - i'm trying run script @ work uses python labeled array module pandas built on top of numpy python crashes every time "unhandled exception" error pointing numpy/core/multiarray.pyc. happens when execute code through idle, python, or pythonw. wasn't doing complicated or working much info so, test, took code home , ran on personal computer same versions of python/numpy/pandas installed , works fine. have older , extremely secure computer @ work , i'm wondering if knows tips numpy may cause crash if running in type of environment. i'm using python 2.6.2 numpy 1.6.1 , pandas 0.7.0. @ work have dell running 32bit windows xp sp3 intel duo 2 e8400. are there firewall settings, registry settings or else might not set cause of problem? python numpy pandas

ruby - Is there a wiki gem for Rails? -

ruby - Is there a wiki gem for Rails? - is there wiki gem adds bulk of functionality of wiki rails app? perhaps few gems it? remember acts_as_paranoid in day, can bring me speed how they'd in fastest fashion? doesn't have robust. shared editing , rollbacks. here go https://www.ruby-toolbox.com/categories/wiki_apps ruby-on-rails ruby rubygems wiki

c# - Sharepoint Toolpart Values Not Being Retrieved -

c# - Sharepoint Toolpart Values Not Being Retrieved - i looking add together custom properties tool part. i've been able add together textbox desired. i've been able come in values , display in webpart. the problem when edit webpart - panel pops command added not populated entered value. see below: i have followed instructions on website written - neither myself nor more experienced sharepoint developer co-worker able figure out what's going on here. we thought overriding syncchanges() method allow - seems doesn't, unless our implementation isn't correct? public override void syncchanges() { demowebpart wp = (demowebpart)this.parenttoolpane.selectedwebpart; urls.text = wp.listvalue; } we have prefixed urls property of demowebpart.cs class following, no avail: [browsable(true), category("miscellaneous"), defaultvalue("site names"), webpartstorage(storage.shared / personal / none)...

ahah - 'Http error 0' when loading dynamic form elements in drupal 6, when an upload field has a file selected -

ahah - 'Http error 0' when loading dynamic form elements in drupal 6, when an upload field has a file selected - i have custom form implemented in custom module in drupal 6. form contains upload field, textfield , select dropdown. when dropdown fires alter event, 2 textfields loaded dynamically below dropdown through drupal ahah. based largely on: http://drupal.org/node/331941 form functions correctly. however, if happen browse file upload field , alter dropdown, nasty 'http 0 error'. note: not submitting form. selecting file upload , changing dropdown fire alter event. problem much like: http://drupal.org/node/399676 solution provided in same thread: http://drupal.org/node/399676#comment-1438662 doesn't work me. i changed drupal_json phone call drupal_get_js phone call mentioned in solution comment above, error alert containing json. i believe problem headers set drupal_json seen in definition here: http://api.drupal.org/api/drupal/includes--common...

c# - How to compile cs files into separate dll -

c# - How to compile cs files into separate dll - i have class library , cs files different objectives. 1 extension class, other windows form command other asp.net control, etc. i want compile these cs files different dll. ps: of them need more 1 class files maybe. you may seek command line compilation. (working c# 2.0 command line compiler) csc /target:library /out:something.xyz *.cs c# class class-library

Odd CSS float and clear bug? -

Odd CSS float and clear bug? - i have odd problem while working on little site. i can't wrapper wrap around of other divs correctly. code looks this: <body> <div id="wrapper"> <div id="header"> <div id="menu"> </div> </div> <div id="content"> <div id="text"> <form></form> </div> <div id="contact"><img /> <map name="map" id="map"> </map> </div> </div> <div class="clear"></div> </div> </body> and css: body { margin: 0px; background-image: url(../images/bg.jpg); background-repeat: repeat-x; } #wrapper { margin-right: auto; margin-left: auto; margin-top: 0px; } #header { height: 560px; width: 1190px; margin-right: auto;...

ssh - VI freezes putty session whenever I try to edit a file even though no swap or processing using the file -

ssh - VI freezes putty session whenever I try to edit a file even though no swap or processing using the file - so have file i've been editing, lets phone call evilconfig.xml. there no processes running using yet. have edit before, today reason when seek vi evilconfig.xml putty session freezes. vi doesn't come up. i can cat file fine. what i've tried , has not worked: check swap files (there 1 other session, deleted it) cat file test. rm evilconfig.xml; vi test works!; mv test evilconfig.xml doesnt!! pray vi god forgiveness of sins any other ideas? why can cat evilconfig.xml > test; vi test; when mv test evilconfig.xml , seek vi evilconfig.xml, line break , ssh session stops responding. i don't see funky characters when cat either. thanks guys (and gals), try run vi (actually vim) -x option. its old post ran in similar problem. putty freezes when starting vim. sitting in front end of windows 7 pc x-server running , x11 forwarding ...

.net - NuGet: include .pdb files and exclude the "Content" folder -

.net - NuGet: include .pdb files and exclude the "Content" folder - i've incorporated next line in ci-build create private nuget bundle on each build: nuget pack c:\projects\test\test.vbproj -outputdirectory \\nas1\nuget the assemblyinfo read (including version number) , nuget bundle created. i'd bundle include .pdb files , not contain "content" folder (so 'lib'). how can change command that? unfortunately, don't think you'll able both exclude content files and include .pdb files while packing via project. 1 or other. first, create nuspec file (the nuget spec command makes quick) , set in same location project. when pack project, nuget.exe treat spec supplement project's info. to eliminate content folder, when packing project has .nuspec file, empty <files /> node in spec indicate don't want content files, if exist in project. to include debug files, add together spec: <files> ...

Perl LWP::UserAgent get no answer -

Perl LWP::UserAgent get no answer - i'm sending post request http server , got no answer. code is my $req = http::request->new(post => $url); $req->content_type('application/html'); $req->content($text); $response = $browser->request($req); and application hangs in request till timeout. server, standalone application, sending reply script didn't receive it. server receive data. thought root cause? how more details if received, discarded, etc. wrong formatting, etc.? full code added: #!/usr/bin/perl -w utilize strict; utilize lwp; utilize http::request::common; $browser = lwp::useragent->new( ); $browser->env_proxy( ); # if we're behind firewall $path =$argv[0]; #'file send'; $url = $argv[1]; #'http://127.0.0.1:9000'; open (myfile, $path) or die "can't open $path\n"; $text = { local $/; <myfile> }; close (myfile) or die "can't close $path\n";; $req = http::r...

What is the best way to pass an array from php to MySQL stored procedure? -

What is the best way to pass an array from php to MySQL stored procedure? - i looking pass list of id's php mysql stored procedure can bring together list. know don't want pass array csv list sp, i'm not sure best practice do. with sql server i've built xml object pass sp , bring together this. seems bit overkill, , i've never been sure idea. is there simple, efficient way of taking list of id's in array in php , passing mysql sp can utilize in join? i've read through related question, haven't found reply looking for: parameterizing sql in clause? a related question solve problem one: php array input stored procedure but looking utilize stored procedure rather building sql code within php. what best practice in case? pass array string parameter, build query , run using prepared statements. php mysql

python - how to pass a foreignkey attribute from django admin change_form.html to a javascript -

python - how to pass a foreignkey attribute from django admin change_form.html to a javascript - consider models class definition: in models.py, class classroom(models.model): subject1 = models.charfield(max_length=80) subject2 = models.charfield(max_length=80) class student(models.model): name = models.charfield(max_length=80) classroom = models.foreignkey(classroom) i inheriting django's admin change_form.html template pupil model. need access subject1 , subject2 attributes can {{ adminform.form.instance.classroom.subject1 }} , same subject2. how access these values in javascript of form? based on value want hide/show value. don't want utilize custom view/template this, pass context variables. can achieved? your template can contain javascript code html. set (js) variable value of template variable <script...> myjsvar = "{{ mydjangovar }}" </script> python django

ios - Set sprite to default color -

ios - Set sprite to default color - i have sprite , set color , want set old color(default color) how can it here simple code sprite = [[ccsprite alloc] initwithfile:@"zero.png"]; sprite.color = ccc3(255, 223, 0); .... how set default color sprite.color = ??????? or have find out default color find old color rgb code? sprite.color = ccwhite; and have add together text here so take answer. :) ccwhite same ccc3(255, 255, 255) ios xcode cocos2d-iphone

browser - CSS Firefox expands parent div but not IE or Chrome, bug? -

browser - CSS Firefox expands parent div but not IE or Chrome, bug? - i'm trying blog stylish design "date block" left of parenting div. works in ie , chrome in firefox top-parent div expands. html <div class="post_bg"> <div class="post_inner"> <div class="blue">date</div> text <br /><br /> </div> </div> css .post_bg { width: 700px; background-color: #f0f0f0; outline: 1px solid #d8d8d8; border-top: 1px solid #fff; padding: 5px 5px 5px 5px; } .post_inner { clear: both; background-color: #fdfdfd; border: 1px solid #d8d8d8; } .blue { overflow: visible; width: 40px; height: 40px; background-color: #55a4cc; position: relative; bottom: -5px; right: 40px; } here image showing problem: and while i'm @ it, how "text" top of box? to outline work in firefox replace: cla...

iphone - Create UIButton on substring with help of NSRange -

iphone - Create UIButton on substring with help of NSRange - i stuck @ point unable proceed in application. have text coming server. may single line or multiline text. have display text on uilabel, no problem me. problem is, have display uibutton on finding particular substring of same text. illustration text nitish\n435-234-6543\nindia beingness displayed follows : nitish 435-234-6543 republic of india so, when find 435-234-6543 have display uibutton on 435-234-6543. important : 1. text dynamic - coming server. above example. 2. uibutton subview of uilabel. i tried different ways ohattributedlabel, rectforletteratindex , this too. not getting success. thought is, create button when substring found , set frame of button based on nsrange of substring. possibility? how can done? or there other way this? posting code won't problem me. guess approach worried here about. please allow me know if more clarification required. thanks, nitish -->i have ...

iphone - Simplest way to encapsulate multiple method arguments? -

iphone - Simplest way to encapsulate multiple method arguments? - + (planet *)createplanetincontext:(nsmanagedobjectcontext *)context withname:(nsstring *)name type:(nsstring *)type group:(nsstring *)group anddiameter:(nsnumber *)diameter { if wanted encapsulate arguments "name", "type", "group" , "diameter" single entity passing above method best type utilize encapsulation? above method quick illustration argue fine presented, if there many more arguments needed passed. need bundle info before calling method solution needs quick , simple setup. + (planet *)createplanetwithdata:(data *)data incontext:(nsmanagedobjectcontext *)context { or more inline objective-c practices (more readable) individually list arguments? i'd want individually list arguments, clarity. sample method you've posted above isn't ...

javascript - Convert a number (of days) to days, months and years with jQuery -

javascript - Convert a number (of days) to days, months and years with jQuery - i have calculation function , part of shows number of days take accomplish goal. rather show number of days want calculate days & months or days, months , years depending on number. have if statement splitting can't seem work out maths go illustration 132 days x days x months... suggestions? // goal var timetogoal = math.round(goal / costperday); // if more year if ( timetogoal >= 365 ) { alert('days + months + years'); // if more month less year } else if ( timetogoal >= 30 && timetogoal <=365 ) { alert('days + months'); } else { alert('days'); $('#savings-goal span').text(timetogoal+' days'); } try this; function humanise (diff) { // string we're working create representation var str = ''; // map lengths of `diff` different time periods var values = [[' year', ...

jquery - fancybox on IE8: property o method not supported. line:2479 -

jquery - fancybox on IE8: property o method not supported. line:2479 - i using fancybox next error: property or method not supported... (i translating italian) jquery-last-version.js line:2479 character:4 it works fine firefox, chrome, safari , ie9... ie8, not. what can be? this code: $("#select_customer").click(function () { var url = $(this).attr("href"); $.fancybox({ 'type' : 'iframe', 'href' : "customer.php?mode=select_customer_box", 'zoomopacity' : true, 'overlayshow' : true, 'width' : 350, 'height' : 250, 'zoomspeedin' : 500, 'zoomspeedout' : 500, 'autoscale' : true, 'onclosed' : function () { if ($("#search"...

merge - How resolve this Mercurial conflict? -

merge - How resolve this Mercurial conflict? - i'm frustrated mercurial , python since makes easy things difficult. have trivial conflict , since mercurial not give suggestion don't know how resolve trivial file conflict: the conflict trivial if can't resolve can't resolve complicated either. can edit file way want , commit 1 time again anywhere? should run hg merge ? why can't mercurial allow me take version keep? why trivial near impossible without digging through 1000 poorly written manpages? you need @ kdiff3 documentation, in particular section on merging , output window. resolve conflict, need decide if live or january right selection line. decision yours make, no tool can know if meant 1 or other. in kdiff3, press ctrl + 2 select live , press ctrl + 3 select january or right-click in margin of bottom window , select line want. can click in bottom window , edit line manually. mercurial let's configure merge tool way like. tortoi...

java - Convert String to date (complex timezone) -

java - Convert String to date (complex timezone) - i have irregular dates like: mon, 9 jan 2012 14:18:32 -0800 (gmt) 18 oct 2006 00:32:03 -0000 sat, 18 nov 2006 19:52:23 ut i made complex function done, works purpose of learning want 1 time again using seek , catch. question is, how can deal timezone? can see timezone's in function, have sometime (... timezone illustration , don't want store cases in string array. also want utilize joda-time, (it can localdate or datetime, doesn't matter much me). public localdate handledate(string date) { string[] days = { "mon", "tue", "wed", "thu", "fri", "sat", "sun" }; string[] months = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; string[] year...

ASP.NET MVC 3 Error and Exception Handling with 404 -

ASP.NET MVC 3 Error and Exception Handling with 404 - what best way log exception , give user error code logged. along how 404 errors handled. have seen many solutions both not in way fits nicely mvc model. have illustration too? 404's there way 404 if user hasn't logged in app? is elmah should used in production? there nuget bundle people suggest using? yes, utilize elmah, create sure access log viewer controlled. the bundle elmah.mvc, , create sure read these: http://www.hanselman.com/blog/elmaherrorloggingmodulesandhandlersforaspnetandmvctoo.aspx http://dotnetdarren.wordpress.com/2010/07/27/logging-on-mvc-part-1/ asp.net-mvc-3 exception error-handling elmah

python - Google App Engine: Implementing a collection of ordered lists -

python - Google App Engine: Implementing a collection of ordered lists - i want implement simple hi-score service in app engine. here 2 model classes: class hiscore(db.model): time = db.datetimeproperty() playername = db.stringproperty() score = db.integerproperty() class hiscoretable(db.model): countrycode = db.stringproperty() scores = db.listproperty(???) question 1: how utilize 'listproperty'? it's hard find examples. question 2: there way ensure hiscoretables ordered 'score' property of each fellow member score? , can automatically limit list to, say, 100 entries? many thanks, reuben the listproperty list of python objects, plain , simple. if understand question correctly describing list of hiscores within hiscoretable scores = db.listproperty(hiscore) for sorting have utilize sorted sort list score before writing hiscoretable entity. doing equivalent of pickling whatever hiscore objects add together li...

typo3 plugin with non-editable tables -

typo3 plugin with non-editable tables - i want create typo3 plugin can used content type on pages (i.e. fe plugin), without user input. plugin generate content additional tables in typo3 database. content these tables inserted outside of typo3. from understand, have following: ext_tables.php : tca configuration used configuring how fields can edited in end. since user must not come in data, not need this ext_tables.sql : write create statements tables. update typo3 database , maintain in synch definition on updates are there other configuration files have edit? what views? typo3 understand create view statements in ext_table.sql? thanks hints! if don't need create table extension don't need worry linking them on ext_tables.php. write code pi1.php file, querying desired table , outputting result. the file code sits on pi1/class.tx_myextension_pi1.php typo3

ruby on rails - Factory Girl with implicit has_many association -

ruby on rails - Factory Girl with implicit has_many association - i'm trying test model has implicit has_many association, , having difficulties. i have table a, column b_id, b foreign key - except there no table b in database, or active record class associated object b. there table c has column b_id. in model table c have: # implicit has_many :alphas def alphas alpha.where(:b_id => b_id).order(:xyz) end this database construction makes sense info have, , non-test code works fine. my test code works, , hope missing simple. i have factories defined , c, , have test: a1 = factory(:alpha, :b_id => 123, :xyz => 100) a2 = factory(:alpha, :b_id => 123, :xyz => 200) c1 = factory(:c, :b_id => 123) puts c1.alphas.count puts c1.alphas.first c1.alphas.first.should == a1 the output is: 2 nil <test fails> changing number of objects share b_id result in c1.alphas.count changing, can't seem within implicit association , object - ...

php - doctrine 2.2 and codeigniter 2.1 -

php - doctrine 2.2 and codeigniter 2.1 - i have searched lot online configuring doctrine 2.2 , codeigniter 2.1, not find appropriate tutorial latest version of doctrine , codeigniter. of tutorials outdated. appreciated if have links tutorials. looks can utilize https://github.com/wildlyinaccurate/codeigniter-2-with-doctrine-2 base, prefer datamapper on doctrine php codeigniter orm doctrine2

php - Do I need to encode my $_GET URL? -

php - Do I need to encode my $_GET URL? - when first submit search form via $_get returns results expected when using pagination , submitting 1 time again page x see converts portion of url , fails. here before , after url portion changing: // before min_score=1&max_score=10&not_scored=1 // after min_score=1&max_score=10%ac_scored=1 it's encoding 10& how can prevent happening? the reason &not gets intepreted browser &not; . strict mode or doctype might help. and &not; gets substituted ¬ then. in turn becomes %ac in request urls. besides urlencode() on individual values should additionally apply htmlspecialchars() on whole url before add together <a> tag. php html

jquery - JavaScript ternary operator into full if/else statement issue -

jquery - JavaScript ternary operator into full if/else statement issue - i have next ternary statement: $.history.init(function(url) { load(url == "" ? "#some-page" : url); }); which have rewrote into: $.history.init(function(url) { load( if( url == ""){ url = "#some-page" } else { url = url } ); }); i error on line 3 if(url == "") , don't understand error. suggestion much appreciated. in javascript, if not expression. not homecoming value , cannot set within function call. is, not valid: func(if (a) { ... } else { ... }); this main difference between if , ?: --the operator look , returns value; if statement, not homecoming value , cannot used everywhere. your best bet if have avoid ternary operator like: if (url == "") { url = "#some-page"; } load(url); you can accomplish same effect using || : functi...

Persisting SCSS variables in rails asset pipeline? -

Persisting SCSS variables in rails asset pipeline? - i'm upgrading rails app lots of scss stylesheets utilize asset pipeline, , need include global variables , mixins each file. adding several @import directives @ top of every file isn't dry, i'd this: # application.css /* *= require variables *= require mixins *= require_tree . */ this doesn't work of course, because variables not persisted across files. know how accomplish this? the default manifest syntax isn't powerful plenty give useful sass features shared variables, mixins, etc. instead, should: rename application.css application.css.scss instead of using /* *= require variables *= require mixins *= require_tree . */ nonsense, should use @import "variables"; @import "mixins"; @import "blah"; // import each scss file in project this. this ensure have total benefit of variables , mixins throughout project, , kept dry sass allows. ...

API design ensuring backward compatibility -

API design ensuring backward compatibility - are there best practices maintain in mind while designing api's ensures backward compatibility , new version releases. links articles/blogs appreciated. you should check out presentation api design. it's google , pretty good. addresses backward compatibility , new releases. how design api , why matters api design backwards-compatibility

php - Create an array in smarty template? -

php - Create an array in smarty template? - this question has reply here: how assign array within smarty template file? 5 answers i need create new array other 1 dimensional array in smarty template. so, best possibilities create array in template file. thanks, sachin smarty3 allows {$var = ['foo' => 'bar', 'sub' => [1, 2, 3]]} , {$var.foo = 'other'} if options don't suffice, write plugin function. php smarty

javascript - how to pass Bound value (asp.net control ) to a jquery -

javascript - how to pass Bound value (asp.net control ) to a jquery - let me explain trying do. i have asp.net gridview , 1 of bound columns label field showing count, 100, in code behind have spilt of how got value. on hover on label want show labor = 30, material = 50, cost = 20 this aspx code <asp:templatefield headertext="total cost" itemstyle-horizontalalign=center itemstyle-verticalalign=middle> <itemtemplate> <asp:label id="label2" text='<%# eval("totalcost")%>' runat=server></asp:label> </itemtemplate> </asp:templatefield> question 1: can override tooltip template wpf/silverlight show infromation question 2 if need utilize jquery show little window tooltip on hover over, how pass details labor = 30, material = 50, cost = 20 jquery question 3 can in javascript <asp:label id="label2" text=myjavascriptfunction('<%# eval("totalcost")%...

geolocation - Google API: Find the complete address using civic number & postal code -

geolocation - Google API: Find the complete address using civic number & postal code - on many authorities sites in canada, have feature can know address postal code , street name. when search postal code on google map, area covered postal code covered. but looking @ google map api, can't find way finish address based on postal code , civic number. i'm afraid there no such feature in google geocoding api. if search (full precision) postal code in canada or uk, can tell result pretty precise downwards 1 building (maybe few) little size of bounds field in result. examples (red box bounds): m6g 1c5 (canada) http://gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/v3-geocoder-tool.html#q%3dm6g%201c5 sw1v 4eb (uk) http://gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/v3-geocoder-tool.html#q%3dsw1v%204eb the result postal code, api won't "translate" street address (e.g. 750 college st, toronto, on m6g 1c5). if think work great in who...

asp.net - Is this the right way to handle javascript alert dialogs using WebDriver? -

asp.net - Is this the right way to handle javascript alert dialogs using WebDriver? - it seems in asp.net webdriver api, executing next when there no javascript alert nowadays results in exception: browser.switchto().alert(); ie , ff both throw webdriverexception, chrome throws invalidoperationexception. so far, code seems work: try { var alert = browser.switchto().alert(); if (alert != null) alert.dismiss(); } grab (webdriverexception) { // alert not nowadays in ie or ff } grab (invalidoperationexception) { // alert not nowadays in chrome } is there way check alert dialog present, without having grab exception? the actual reply here no, must grab exception. logic behind design of api should aware of browser state expect. if expect alert appear, should able utilize switchto() switch , handle it. if expect alert appear, , utilize switchto() , not present, exceptional condition, , exception thrown. normal (non-exceptional) ca...

jsf 2 - Action link and download link in one -

jsf 2 - Action link and download link in one - i need show link download file on page in jsf 2 application. now, issue file contains info depends on fresh looks database @ time of creation. want create , give user link download in 1 action. this simple in 2 actions: have button generate file, , replace link download file 1 time it's generated. so question 1 time again can done in 1 click on commandlink? edit, next balusc's comment below. here's specifics of trying do, , have done far. have in xhtml: <h:panelgroup rendered="#{!bean.showlinktoexcelfile()}"> <h:form> <td><h:commandbutton value="generate list of bids download" action="#{bean.createbidslist()}"/></td> </h:form> </h:panelgroup> <h:panelgroup rendered="#{bean.showlinktoexcelfile()}"> <td><a href="#{bean.findbidslistfilename()}">download bids</a></td...

assembly - Difference between ADDNES and ADDSNE -

assembly - Difference between ADDNES and ADDSNE - i having problem understanding difference between addnes , addsne in arm assembly. please can help me, examples? they're different spellings same instruction. clang, example, can handle addnes format, otool outputs addsne when disassembling it. example: $ cat example.s addnes r0, r0, #1 $ clang -arch arm -c -o example.o example.s $ otool -tv example.o example.o: (__text,__text) section 00000000 12900001 addsne r0, r0, #1 @ 0x1 but if trying utilize addnse spelling in clang: $ cat example.s addsne r0, r0, #1 $ clang -arch arm -c -o example.o example.s example.s:1:bad instruction `addsne r0,r0,#1' clang: error: assembler command failed exit code 1 (use -v see invocation) assembly arm

jsf 2 - How to execute JavaScript after page load? -

jsf 2 - How to execute JavaScript after page load? - i execute javascript function after page loaded. @ moment have commandbutton , works fine. more comfortable if user not supposed nail button. i have tried f:event, not have listener, have javascript function. body onload not work me utilize high level components. <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:pm="http://primefaces.org/mobile" contenttype="text/html"> <ui:composition template="/resources/master.xhtml"> <ui:define name="content"> <pm:content> <h:inputhidden id="address" value="#{pathfinderbean.address}" /> <div id="map" style="width: 100%; height: 285p...

How to manage SQLite database via (S)FTP? -

How to manage SQLite database via (S)FTP? - i'm looking tool manage sqlite database. there firefox plugin out there, need open , view contents of sqlite database via ftp (or improve sftp/scp). have re-create database everytime there alter in database. there improve ways doing that? you can create virtual disk via sftp (eg. using our free sftp net drive tool) , manage remotely located db file using sqlite tool accesses database files. database sqlite ftp

c++ - Image scaling (KeepAspectRatioByExpanding) through OpenGL -

c++ - Image scaling (KeepAspectRatioByExpanding) through OpenGL - i'm trying implement image scaling in opengl using gltexcoord2f() , glvertex2f() . let me explain: after loading qimage , sending gpu glteximage2d() have perform image scaling operations based on qt's specification. qt defines these 3 operations (see image below): i think way since application qt plugin , task needs done within paint() method of class. ignoreaspectratio operation pretty straight forwards , it's working right now. keepaspectratio gave me problem it's working. unfortunally, keepaspectratiobyexpanding giving me headaches. i'm sharing i've done far , appreciate help on issue: main.cpp: #include "oglwindow.h" #include <qtgui/qapplication> int main(int argc, char *argv[]) { qapplication a(argc, argv); oglwindow w; w.show(); homecoming a.exec(); } oglwindow.cpp: #include "oglwindow.h" #include "glwidget.h...