Posts

Showing posts from September, 2012

How to tell magento that I use different theme directory? -

i'm newbie magento. downloaded module created , want modify it. have problem when change theme directory. magento reads older directory. has product view. i try edit the, let's say, abcd.xml file inside layout folder from <reference name='product.info'> <action method='settemplate'><template>histheme/template/catalog/product/view.phtml</template></action> </reference> <reference name='product.info.addtocart'> <action method='settemplate'><template>histheme/template/catalog/product/view/addtocart.phtml</template></action> </reference> to line this <reference name='product.info'> <action method='settemplate'><template>default/mytheme/template/catalog/product/view.phtml</template></action> </reference> <reference name='product.info.addtocart'> <action method='settemplate'><

Getting a list of values from a list of dict in python: Without using list comprehension -

i have list of dict example, [{'id': 1l, 'name': u'library'}, {'id': 2l, 'name': u'arts'}, {'id': 3l, 'name': u'sports'}] now, have retrieve following list dict without using list comprehension [u'library', u'arts', u'sports'] is there way achieve in python? saw many similar questions, answers using list comprehension. any suggestion appreciated. in advance. you use itemgetter : from operator import itemgetter categories = map(itemgetter('name'), things) but list comprehension too. what's wrong list comprehensions?

c# - How to use Substring , to return an integer of all the values after the first char -

i have string assetnumber have following format c100200. need folloiwng:- get characters after first (e.g. 100200 using above example) convert substring integer return integer + 1 but not know how use sub-string characters after first char, , how convert string int? on appreciated. var result = int32.parse("c100200".substring(1)) + 1; if have default value, if can't parse current string: int result; if (!int32.tryparse("sdfsdf".substring(1), out result)) { result = 42; } result+=1;

response object in scrapy not complete -

sorry if question stupid couldn't find answer yet. i trying prepare script extract data website using "scrapy shell" command : using web browser entering url (e.g. " http://www.testsite.com/data_to_extract "), data extract. page contains static data + dynamic data. using command "scrapy shell http://www.testsite.com/data_to_extract " , issuing command ("view(response)"), see in web browser static data of page not dynamic data. what suspect web server serves first static data fills-in dynamic data in page. guess managed through javascript on web page. if understanding correct, needs happen scrapy needs wait little bit before returning result. could me here ? thanks ! here working example using selenium , phantomjs headless webdriver in download handler middleware. class jsdownload(object): @check_spider_middleware def process_request(self, request, spider): driver = webdriver.phantomjs(executable_path='d:

c# - PropertyChanged event not Handled properly -

i'm trying property changed event handler working, , i've checked dubugger onpropertychanged method being called, it's not invoking method expecting to. public class mainviewmodel : observableobject { public mainviewmodel() { _characterselection = new characterselectionviewmodel(); _characterselection.propertychanged += new propertychangedeventhandler(characterselection_propertychanged); } private void characterselection_propertychanged(object sender, propertychangedeventargs e) { if (e.propertyname.equals("character")) { _character = _characterselection.character; _currentview = _newcharacter; onpropertychanged("currentview"); } } } [serializable] public class observableobject : inotifypropertychanged { public event propertychangedeventhandler propertychanged; // create onpropertychanged method raise event protected void onpropertych

linux - Android Screenshot and Screencap Permissions -

i'm trying take screensshot on adb logged root , i'm getting "permission denied" error. screenshot -i /sdcard/screen.png error: writing file /sdcard/screen.png: permission denied but if use screencap works. screencap -p /sdcard/screen.png why happening ? according source code screenshot sets uid aid_shell (shell user) before writing file: /* switch non-root user , group */ gid_t groups[] = { aid_log, aid_sdcard_rw }; setgroups(sizeof(groups)/sizeof(groups[0]), groups); setuid(aid_shell); png = fopen(outfile, "w"); if (!png) { fprintf(stderr, "error: writing file %s: %s\n", outfile, strerror(errno)); exit(1); }

java - How do I prompt a user until they enter a valid integer? -

valid integer being letter. don't know command make check strings, nor know find it. appreciated. import java.util.scanner; public class stringtest{ public static void main(string[] args) { scanner input = new scanner(system.in); int test = 10; while (test>0){ system.out.println("input maximum temperature."); string maxtemp = input.nextline(); system.out.println("input minimum temperature."); string mintemp = input.nextline(); } } } use nextint() next integer value. should try/catch in case user types non-integer value. here's example: scanner input = new scanner(system.in); // infinite loop while (true){ system.out.println("input maximum temperature."); try { int maxtemp = input.nextint(); // todo whatever need max temp } catch (throwable t) { // todo handle better t.printstacktrace(); break;

html - Border radius and the wonderful cross browser issues - simple fix? -

i'm, putting border radius around image , around div. i'm testing in safari , firefox @ moment. both yield different results. for image have: margin:0; border-style: solid; border-color: #fff; border-width: 6px; border-radius: 46px; -webkit-border-radius: 46px; -moz-border-radius: 46px; result in firefox - beautiful. safari - left side radius not smooth, looks corner has been chopped off little bit. for div have: border-right-style: groove; border-right-color: #eee; border-right-width: 6px; border-bottom-left-radius: 46px; -webkit-border-bottom-left-radius: 46px; -moz-border-bottom-left-radius: 46px; border-top-right-radius: 46px; -webkit-border-bottom-right-radius: 46px; -moz-border-bottom-right-radius: 46px; result in safari - beautiful. firefox - bottom corner radius doesn't display. top 1 does. is there obvious i'm missing? there fix or way of solving type of issue? edit: i've updated order in specified per http://css-tricks.com/alman

python - Django how to update more than a row field at once -

the code below fine updating row field: t = theform.objects.get(id=1) t.value = 1 t.save() but if need update 5-6 fields @ once? there direct way? like update (value=1,value2=2) edit i know can do: t.value1 = 1 t.value2 = 1 t.value3 = 1 but looking single line command insert 1 instance. ( theform(value1=1,value2=2,value3=3) ) sure! t.value1 = 1 t.value2 = 2 t.save() alternatively, theform.objects.filter(id=1).update(value=1, value2=2) (and use **kwargs here)

ruby - core dump when gem install rails -

i've been trying install rails on server running gentoo 2.2 somehow "core dumped" message when trying sudo gem install rails . compiled both ruby 1.9.3 , 2.0.0 , tried using rbenv end following error /usr/local/lib/ruby/2.0.0/psych.rb:205: [bug] bus error ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux] -- control frame information ----------------------------------------------- c:0035 p:---- s:0165 e:000164 cfunc :parse c:0034 p:0050 s:0160 e:000159 method /usr/local/lib/ruby/2.0.0/psych.rb:205 c:0033 p:0014 s:0153 e:ffffff34 method /usr/local/lib/ruby/2.0.0/psych.rb:153 c:0032 p:0014 s:0148 e:000147 method /usr/local/lib/ruby/2.0.0/psych.rb:129 c:0031 p:0036 s:0142 e:000141 method /usr/local/lib/ruby/2.0.0/rubygems/specification.rb:897 c:0030 p:0019 s:0137 e:000136 block /usr/local/lib/ruby/2.0.0/rubygems/package.rb:398 [finish] ...follows 20 lines of similar message i tried sudo gem install psych , deleting /usr/local/lib/ruby/* , compiling latest ru

performance - How to efficiently count the number of keys/properties of an object in JavaScript? -

what's fastest way count number of keys/properties of object? it possible without iterating on object? i.e. without doing var count = 0; (k in myobj) if (myobj.hasownproperty(k)) count++; (firefox did provide magic __count__ property, removed somewhere around version 4.) to in es5-compatible environment, such node , chrome, ie 9+, ff 4+, or safari 5+: object.keys(obj).length browser compatibility object.keys documentation (includes method can add non-ecma5 browsers)

my security q in Facebook does not exist -

i searched many times of sites says in settings / security tab, it's not there! why? i created facebook account. it looks fb not using security questions. fb: if there ever comes time can’t log facebook account, need ways in touch , make sure account yours. here things can make sure never locked out of account: add email address account have backup. make sure , can access email addresses listed on facebook account. access 1 of email addresses listed on account can request new password facebook account. if lose access 1 of email addresses, sure remove facebook account. add mobile number account. can send things (ex: code reset password) mobile phone. use real name , date of birth on account can find timeline if ever loose access it. you can find more details on security features page .

c# - Multi-targeting .NET assembly to use async/await on .NET 4.5 and .NET 4 -

i trying build small portable library need use async/await. goal want able use library on both .net 4, .net 4.5 runtime. ideally use microsoft.bcl.async pack when targeting .net 4, whereas .net 4.5 want use built-in async/await support without including bcl pack. that said, have bcl.async dll excluded project when compiling .net 4.5, gives me warnings ambigous references between built-in async of c# 5 in .net 4.5 , bcl.async pack. is possible, if how, else better way of going problem? i ended using answer @stephencleary, whereas targeted pcl .net 4.0, , used bcl.async pack. thanks!

operating system - Ways to select a process from a ready queue -

i came across multiple-choice question in interview answered answer option a: n! . but, i'am still not sure answer. question was: in ready queue containing n process, new process can selected in how many ways? a. n! b. n*n c. log n d. n cfs, has complexity of o(log n), since uses rb tree internally. http://en.wikipedia.org/wiki/completely_fair_scheduler

forum - Set a:link / a:visited colors within another css call -

not sure if semantics correct. on forum, have way links looks in regular post, doesn't when quoted in post, text shrunk down smaller font , doesn't good. so tried this, had no effect @ all. blockquote { border: 1px solid #ccc; margin: 0; background: #fff; padding: 4px; font-size: 11px; a:link {color:#00ff00;} } blockquote cite { font-weight: bold; border-bottom: 1px solid #ccc; font-style: normal; display: block; margin: 4px 0; font-size: 11px; a:link {color:#00ff00;} } is there can change link properties here? because way i'm trying doesn't seem work @ all. you cannot nest css rules this: blockquote cite { a:link { } } you use this: blockquote cite { } blockquote cite a:link { /* rules links within 'blockquote cite' */ } with invalid css of other rules may not work, , can cause other unexpected formatting issues.

Remove floor plans from Google Maps Android API v2 -

i creating android application uses google maps api. i've set maptype satellite not show labels, still shows google maps floor plans when zoom area has them. there way make sure don't appear , satellite image? the options have removing labels using setmaptype(map_type_satellite) or setmaptype(map_type_none) . indoor plans can removed setindoorenabled(false) .

Java: binary tree recursion methods -

i'm quite new java , 1 of our assignments requires me create binary tree containing nodes int values. professor wants use 1 class containing main method. applied 2 recursive methods, 1 insert node , 1 display existing nodes. whenever run code however, console displays recent node entered. there wrong methods used? have far: import java.util.scanner; public class node { private int value; static node root; public node leftlink; public node rightlink; public node(int v) { this.value = v; } public int getvalue() { return value; } static void traverseshow() { if(root.leftlink != null){ root = root.leftlink; traverseshow(); } system.out.println(root.getvalue()); if(root.rightlink != null) { root = root.rightlink; traverseshow(); } return; } static void addnode(node n) { if(root==null) { root = n; } else { if(root.getvalue()>n.getvalue()) { root = r

jQuery - How to make .on event work for dynamically created HTML? -

reading on new specs newest jquery 1.x library, says use .on attach events work dynamically created jquery elements, however, can't seem work @ all. in $(document).ready function have following: jquery: $(".dropdown").on("click", function(event) { event.preventdefault(); var type = $(this).text() == '[ read more... ]' ? 'expand' : 'collapse'; var thediv = type == 'expand' ? $(this).parent().next("div") : $(this).parent().prev("div"); var theid = $(this).attr("id"); $(this).parent().remove(); var vtext = theid == 'reqmat' ? 'every candidate required submit headshot , candidate statement.' : 'to strengthen candidacy , let people know you\'re about, invite create campaign video.'; thediv.animate({height: 'toggle'}, 500, function(){ if (type == 'expand') thediv.after('<p class="desc">

Rails: Article.all works, class method therein does not -

how possible? article.all works in console, method called self.retirement_collection therein not. ideas? class article < activerecord::base ... def self.retirement_collection articles = articles.all articles.each |article| if article.retirement_at < time.now article.retire end end end ... end i nameerror when type article.retirement_collection console: nameerror: uninitialized constant article::articles . it looks mistyped article class when doing article.all , def self.retirement_collection articles = article.all # here articles.each |article| if article.retirement_at < time.now article.retire end end end

IDE for Go (golang) with deployment/upload -

is there ide go language can deploy/upload files server? ideally looking ide can automatically upload files server each time decide run app, can pycharm python you use intellij idea , has working go plugin , build latest plugin, visit tutorial .

javascript - How can I make the resizers draggable? -

if @ demo resizers draggable: http://layout.jquery-dev.net/demos/simple.html <head> <title>summation</title> <script src="jquery-latest.js"></script> <script src="jquery.layout-latest.js"></script> <script src="rotaercz.layout.js"></script> <script> $(document).ready(function () { $('body').layout({ applydefaultstyles: true }); $('#inner').layout({ applydefaultstyles: true }); }); </script> </head> <body> <div class="ui-layout-north">north</div> <div class="ui-layout-center" id="inner"> <div class="ui-layout-center">inner center</div> <div class="ui-layout-south">inner south</div> </div> <div class="ui

integration - Android Add PinIt Button using Pinterest Jar NoClassDefFoundError -

i trying add pinit button android app. have downloaded sdk , copied pinit-sdk-1.0.jar project/libs folder. i'm able make necessary pinitbutton import code. whatever reason, xml isn't finding button widget, , tried add using java code: linearlayout ll = (linearlayout)findviewbyid(r.id.pinterest_layout); pinitbutton pinit = new pinitbutton(this); ll.addview(pinit); i know correct way add using code because tested adding generic button first. run project then, , crashes on line set pinitbutton. error logcat spat @ me: 07-22 01:19:52.160: e/androidruntime(32367): java.lang.noclassdeffounderror: com.pinterest.pinit.pinitbutton i believe i'm understand telling me, else should attempting create pinit button? great. thank you! it @kai helped me figure out problem. needed check libraries. did going project --> properties --> java build path --> order , export tab, checking library , clicking ok. problem solved!

mobile - clarification needed on phonegap vs sencha touch -

phonegap allows access native features, camera, address book, etc. has no built-in ui elements, else needed (jqm example) (anything else?) phonegap build allows cross-compiling of app, sencha, phonegap, etc. sencha touch 2 has ui elements display natively on each os has own build allows cross-compiling can supplemented phonegap if access native features if required? is of information correct? if not please clarify. phonegap (cordova) generates app uses web browser internally run webapp. webapp runs can made wish make it, number of frameworks. sencha touch 1 of frameworks can used. st can also, however, used generate native apps, not allow access native functionality packaging st app cordova app. fwiw, made public last week new version of st (2.3) have easier integration cordova, allowing cordova build using sencha cmd tool.

Python Mechanize: Web Forms with Javascript -

i trying upload information through form using python. share form password protected (i have permission access though). have been using mechanize have encountered problem. the page uploading consists of number of forms, accessed tabs @ top of page. these tabs set using javascript. when access url of page, can see form first tab using mechanize, not know how change tabs. this snippet got firebug: <form id="frmentityedit" enctype="multipart/form-data" onsubmit="javascript:return webform_onsubmit();" action="entityeditproducts.aspx? entityfilterid=239&entityname=category&iden=6751" method="post" name="frmentityedit"> also, when change tabs, value "tabstrip1_selectednode" cycles through "p0", "p1", "p2", etc. <input id="tabstrip1_data" type="hidden" name="tabstrip1_data"> <input id="tabstrip1_properties" type=&

MS Excel do not copy the color theme automatically -

i using ms excel 2010 company uses set of standard color scheme / theme ms excel 2010 .i gave name (companycolor). have template contains color scheme , macro in perform tasks. when press macro button makes copy of activesheet,protect , email intended recipient.problem when macro makes copy of activesheet new workbook doesn't copy color scheme / theme template have, mean company color scheme (companycolor) due cells color, color of charts , shapes disturbed , changed according excel default color scheme seems odd. have way forward overcome issue or suggestion in regards here link of snap shot! , understand problem better * >>here vba code makes copy of active worksheet active workbook new workbook, protect , email it. *** private sub commandbutton2_click() dim fileextstr string dim fileformatnum long dim sourcewb workbook dim destwb workbook dim tempfilepath string dim tempfilename string dim outapp object dim outmail object if (range("aq5") <>

PHP two Dimensional array in to file -

can please tell me how can save 2 dimensional array in text file if have array unknown number of elements in index value: $two_darray[unknown][unknown]; actually, @brad's , @hilmi's answers correct, i'm not sure using json advice. you can choose json write: file_put_contents('somefile.json', json_encode($two_darray)); read: $two_darray = json_decode(file_get_contents('somefile.txt')); xml look this answer serialized data write: file_put_contents('somefile.txt', serialize($two_darray)); read: $two_darray = unserialize(file_get_contents('somefile.txt')); csv (to use ms excel or db) $handler = fopen('somefile.csv', 'w+'); foreach ($two_darray $one_darray) { fputcsv($handler, $one_darray); } read fgetcsv and sqlite $db = new sqlitedatabase('somefile.sqlite'); foreach ($two_darray $one_darray) { $db->query("insert `mytable` values (".implode(',', $on

php - Effectively Firing a multiple query -

Image
i practicing drawing graphs on various statistics purpose of data analysis. not able figure out efficient way fire multiple mysql query @ back-end. i trying draw period vs no of visitors graph. please note: period here refers week,month,3 months,6 months,1 year,2 years. period selected user select box. example: when user selects 3 week, need construct no of visitors per 3 week graph. my database contains 2 column: each of site hit, records: (1) timestamp and (2) user id . if fire query multiple times each select option, performance quite poor.so, how efficiently? upd: when user select stats per 3 month: then firing mysql query as: select count(*) stats_tab timestamp between jan , mar; select count(*) stats_tab timestamp between apr , jun; select count(*) stats_tab timestamp between jul , sep; ............ each count returned each of query y-axis value graph when user select stats per year: firing mysql query as: select count(*) stats_tab timestamp b

css - stylesheets : 1 big one or a few bigones or several smaller ones? -

i building asp.net website several style sheets. each style sheet focused on different page / pages. better performance-wise have styles merged 1 or bundling solve anyway? personally, find several style sheets handier because gives better overview of rules available. instead suggest merge stylesheets in single file , comment out blocks accordingly, because approach seems unfriendly, also, huge performance hit, stylesheets requested everytime user navigates new page, increasing in http requests. also of core styles repeated on every page resets, font sizes , families etc, must having 2 on each page, 1 handle base styles , other applied per page, instead merge them in one. particularly follow convention.. /* core styles */ * { margin: 0; padding: 0; } html { height: 100%; } body { min-height: 100%; /* other stuffs */ } /* core styles ends */ /* header styles */ /* header styles here */ /* header styles ends */ /* home page styles starts */ /

c# - Using ref - Good programming practice or not -

is using ref bad programming practice? doing refactoring of old code uses ref lot. have turned on code analysis microsoft rules set , rules "do not pass types reference" cause : public or protected method in public type has ref parameter takes primitive type, reference type, or value type not 1 of built-in types. why bad? can use them in private methods or internal methods? using ref in private/internal methods programming practice or nor? edit: here samples, public void doautoscrollreverse(rectangle rectangle, int xposition, int yposition, ref int deltax, ref int deltay) { } public bool getpointcoords(graphics g, point pmouse, displayblock2d ablock, ref point3md pt, ref displaypoint2d 2dpoint, ref double gappos) { } what happening inside these function being initialized, set, or whatever. update: why using ref? not. old code need refactor. got rid of of methods, complex functions in second example given cannot. there function returns bool (tells op

javascript - Nested Routing Behavior for Ember.js -

Image
can explain behavior of router , nested routes in ember.js? what resulting url, routename, controller, route, , template? app.router.map(function(){ this.resource('profile'); // url: /profile // routename: profile // controller: profilecontroller // route: profileroute // template: profile this.resource('artists', function(){ // url: /artists // routename: artists or artists.index // controller: artistscontroller or artistsindexcontroller // route: artistsroute or artistsindexroute // template: artists or artists/index this.resource('artists.artist', { path: ':artist_id' }, function(){ // url: /artists/:artist_id // routename: artists.index or artist.index // controller: artistsindexcontroller or artistindexcontroller // route: artistsindexroute or artistindexroute // template: artists/index or artist/index

How can I configure swagger-ui to emit camelcase json variables instead of underscores when using with ServiceStack? -

i using servicestack.api.swagger. working , can see api docs fine. have configured servicestack emit camel case name jsconfig.emitcamelcasenames = true; , servicestack emitting variables expected (e.g trainstation). when view request/response schemas in swagger output/screen, of variables servicestack emits camel case displayed underscore separator (e.g. train-station). there way configure swagger-ui emit camel case instead of underscores? or, configure servicestack , swagger-ui consistent? there properties on swaggerfeature class. in apphost, after configuring jsconfig: plugins.add(new swaggerfeature { usecamelcasemodelpropertynames = jsconfig.emitcamelcasenames });

bundle - block in replace_gem can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1 -

i've looked @ several answers regarding problem , none seem trick. on windows , lost ideas. help! c:/ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in require': cannot load such fil e -- 2.0/bcrypt_ext (loaderror) c:/ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in ' c:/ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt.rb:12:in `require' c:/ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt.rb:12:in `<top (required)>' c:/ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' c:/ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require ' c:/ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in each' c:/ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in block

c++ - Linux draw on screen independent of windows manager -

this more of vocabulary question else. introduction i'm using point cloud library face tracking data. using data want track user facing on screen. not problem. problem to give user-feedback, draw estimation of user's face-direction red circle on screen, seen here (they create tiny window). circle able go everywhere on screen , want visible. not want covered active window. if impedes interaction window, i'm fine that. my problem not know start. i control cursor, less ideal, because still able move cursor while i'm using face detection. i think need use opengl, examples i've seen have been inside x windows. example, code found here after getting hint here , give me nice permanent window, window still captures mouse clicks. how draw on screen opengl x-window independent? am approaching wrong direction completely? if so, should googling? i accept answer gives me starting point. platform i using ubuntu 12.04 unity desktop. create regu

ASP.Net membership store group concept -

this question has been asked before in forum. more input regarding this. are there pre-existing solutions out there extend built in sql membership provider & sql role providers in .net concept of group membership. right roles relationship looks like users ====> userroles <=====roles i'd extend like users ====> usergroups <==== groups ====> grouproles <==== roles. by default, membership provider doesn't support feature. however, can override membership provider , role provider extend feature. look @ answer - custom membership provider , membershipuser http://www.asp.net/general/videos/how-do-i-create-a-custom-membership-provider http://www.davidhayden.com/blog/dave/archive/2007/10/11/createcustommembershipprovideraspnetwebsitesecurity.aspx http://www.shiningstar.net/aspnet_articles/customprovider/customprovider.aspx http://www.devx.com/asp/article/29256/0/page/3 http://www.15seconds.com/issue/050216.htm http://www.codeproje

Amazon Web Services Arfchitecture and Costing -

i extremely new amazon web services. sincerely appreciate on finalising architecture , arriving @ costing schedule. working on designing aws based solution dynamic website designing. begin need have 2 high cpu medium utilisation ec2 instances (both act web servers), 1 high cpu medium utilisation ec2 instance database postgre sql , 1 high cpu medium utilisation ec2 instance serve read replica database. having considerable volume of static content images, videos or .doc files contemplating using s3 bucket. so, website dynamic + static kind of website. expecting rapid exponential scale of users 0 example 1 million in year. hence need scale ec2 combos (as described earlier) according traffic. contemplatng using cloudformation stack rapidly scaling deployment. also, efficiently route traffic using single elb start with. also, want vertically partition database based on user id's. example, user id 1 - 2000 on 1 ec2 database instance users 2001 4000 on second ec2 database instance et

cocoa touch - Use of first responders and first responder vs. target-action -

i understand use , need of target-actions . encountered concept of "first responder". can explain why needed? can can't done using target-actions? in app, responder object first receives many kinds of events known first responder. receives key events, motion events, , action messages, among others. (mouse events , multitouch events first go view under mouse pointer or finger; view might or might not first responder.) first responder typically view in window app deems best suited handling event. receive event, responder must indicate willingness become first responder; in different ways each platform when design app, it’s want respond events dynamically. example, touch can occur in many different objects onscreen, , have decide object want respond given event , understand how object receives event. when user-generated event occurs, uikit creates event object containing information needed process event. places event object in active app’s event queue. touch

increase images sizes loads in carousel view android -

i created app display images internet in carousel view. loaded images carousel view using imageview. following way. public view getview(int position, view convertview, viewgroup parent) { view vi=convertview; if(convertview==null) vi = inflater.inflate(r.layout.showsmain, null); imageview image=(imageview)vi.findviewbyid(r.id.imageview1); // relativelayout rlayout=(relativelayout)vi.findviewbyid(r.id.rlayouts); image.setimageresource(r.drawable.black); orgwidth = image.getdrawable().getintrinsicwidth(); orgheight = image.getdrawable().getintrinsicheight(); imageloader.displayimage(data[position], image); imageloader.getdimension(widthscreen, heightscreen); relativelayout.layoutparams params = new relativelayout.layoutparams( widthscreen, heightscreen/3); params.width=widthscreen; image.setlayoutparams(params); image.setscaletype(imageview.scal

Edit a file name in Dropbox API -

how edit file or folder name using dropbox api? i using reference: https://www.dropbox.com/developers/core/docs is there else? possible? your question title , body seem ask different questions, i'll answer both: you can edit file (i.e., contents) uploading new version of it, e.g., using /files_put call: https://www.dropbox.com/developers/core/docs#files_put you can rename file or folder using /filesops/move endpoint: https://www.dropbox.com/developers/core/docs#fileops-move

Twitter OAuth library for iOS with Twitter api version 1.1 -

i'm using twitter+oauth ios app shows http 410 error sharing post. can receive authorization token. when try share post shows above said http error. on searching found out twitter has stopped functioning of api version 1.0. twitter+oauth library yet using api 1.0 ,hence there available updated version of library fix above issue. or there way fix without waiting updated library. i hope above makes sense , appreciated. thanks!

image - Can we share multiple photos on Twitter at once through Twitter API for iOS? -

can share multiple photos on twitter in 1 request or can upload 1 image @ time using twitter api in ios? had in documentation of twitter api didn't find such information. you can share 1 image @ time.so share multiple images have loop it. i have done below share 3 images switch (indeximage) { case 0: img = imgbar;// image name break; case 1: img = [self captureview:graphview insize:graphview.frame.size]; break; case 2: img = [self captureview:othergraphview insize:othergraphview.frame.size]; break; default: break; }

ios - When we open pdf in iPhone then how to save this pdf in iphone -

Image
i new ios. create pdf , load pdf on uiwebview time want save or download pdf in iphone when tapped download button exits pdf supporter show open ibook ,open in chrome. type of option show when tap 1 application closed. -(void)show_button { nsarray *docdirectories = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docdirectory = [docdirectories objectatindex:0]; nsstring *filepath = [docdirectory stringbyappendingpathcomponent:@"mypdf.pdf"]; nslog(@"filepath = %@", filepath); nsurl *url2 = [nsurl fileurlwithpath:filepath]; nslog(@"url2 = %@", url2); uidocumentinteractioncontroller *doccontr = [uidocumentinteractioncontroller interactioncontrollerwithurl:url2]; doccontr.delegate=self; [doccontr presentopeninmenufromrect:cgrectzero inview:self.view animated:yes]; } so how save or download pdf in iphone please solve proble

css3 - How to adjust the height of a series of DIVs by CSS -

in series of divs placed in row float:left ( see example ) <div class="row"> <div class="box"> line<br />line<br />line </div> <div class="box"> line </div> <div class="box"> line<br /><br /><br />line<br />line<br /> </div> </div> is possible adjust height of child div s tallest child div , indeed actual height of parent div . in other words, want make height of children equal, without knowing length of content. i know preferred way use js , curious if possible css only. think should possible considering parent height, defined tallest child. you put divs in containers. if need div of equal height, containers height of tallest. add bit more complexity it, avoids js, think might want. if not can delete answer. http://jsfiddle.net/zjsck/1/ html <div class="row"> <

php - NetBeans debug not working for phpunit tests -

i followed rafael dohms's article use netbeans debugging tools phpunit tests. the problem when start debugging in netbeans , run test using command line, netbeans switches "waiting connection" state "netbeans-xdebug runnig". program stops @ command line after "cofiguration read ..." , none of debug actions(step over, step etc) active. i tried disable "stop @ first line" option , using debug file debuging, none of them worked. did miss in configuration or using netbeans tools? update i tried fix problem using netbeans didn't work. used phpstrom debug code, although got same result, succeed debug normal cli program , tracking phpunit test program. realized debugging freezes in "pear\phpunit\util\php.php" file, in following line: $stdout = stream_get_contents($pipes[1]); i'm using windows 7 , php-v5.3 found post when searching line $stdout = stream_get_contents($pipes[1]); in combination keyword

web services - java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String -

created web service returns list of custom objects in netbeans 7.3, using jax-ws 2.2, tomcat-6.0, jdk 1.6 - on calling service client gives exception - java.lang.nosuchmethoderror: javax.xml.ws.webfault.messagename()ljava/lang/string; com.sun.xml.ws.model.runtimemodeler.processexceptions(runtimemodeler.java:1213) com.sun.xml.ws.model.runtimemodeler.processdocwrappedmethod(runtimemodeler.java:943) com.sun.xml.ws.model.runtimemodeler.processmethod(runtimemodeler.java:711) com.sun.xml.ws.model.runtimemodeler.processclass(runtimemodeler.java:472) com.sun.xml.ws.model.runtimemodeler.buildruntimemodel(runtimemodeler.java:314) com.sun.xml.ws.db.databindingimpl.<init>(databindingimpl.java:99) com.sun.xml.ws.db.databindingproviderimpl.create(databindingproviderimpl.java:74) com.sun.xml.ws.db.databindingproviderimpl.create(databindingproviderimpl.java:58) com.sun.xml.ws.db.databindingfactoryimpl.createruntime(databindingfactoryimpl.java:130) com.sun.xml.ws.client.wsservicedelegate.b

c++ - How to parse text for a DSL at compile time? -

yes. that's right. want able paste expression like: "a && b || c" directly source code string: const std::string expression_text("a && b || c"); create lazily evaluated structure it: expr expr(magical_function(expression_text)); then later on evaluate substituting in known values: evaluate(expr, a, b, c); i'd want expand little dsl later little more complicated using non-c++ syntax can't hardcode expression simple way. use case i'll able copy , paste same logic module used in different development area language rather have adapt each time follow c++ syntax. if can me started on @ least how above simple concept of 1 expression , 2 boolean operators appreciated. note: posted question due feedback question posted: how parse dsl input high performance expression template . here wanted answer different problem, comments provoked specific question thought worth posting potential answers worth documenting. di