Posts

Showing posts from September, 2010

mysql - Displaying value from one table that doesn't have an id number in another -

hi guys i've been on awhile no solutions. i've tried similar codes similar questions still no results. i have 2 tables id column link 1 another. on second table id assign product item. id column on first table doesn't necessary have every id associated items on second table. how write query display items not listed on first table i've tried select items product join shop product.productid != shop.productid; also tried select productid product productid not in (select productid shop); with no luck, using mysql guys your second solution should work . . . unless shop.productid takes on null value. try this: select productid product productid not in (select productid shop productid not null);

iphone - How can I see a list of class properties in ios8 documentation -

it seems apple trying innovate, good, makes on top effort breaking before. 1 sample of api documentation. now ios8 documentation missing section groups properties of class. before ios8, there section in left part of screen, 1 click on , see class' properties grouped. -bad- workaround found search @property inside documentation class, awful documentation design. has else found better way list properties of class other doing search @property? are talking documentation in xcode? if so, when click on key-word in right section can see need. section call "quick help" , question mark in circle. otherwise can click on key-word cmd button pressed, , xcode bring definition of word. hope help.

html - Unable to Drop draggable using jquery UI -

when drag li element mouse on over 'drop header' internal div should appear , can drop li element, reach internal drop area disapper. here jsfidle jquery(function ($) { $("#dragli > li").draggable({helper: "clone"}); $( ".reviewerslistdv > div#droppable" ).droppable({ over: function( event, ui ) { $(this).find('.parallelsectcontent').show(); }, out: function( event, ui ) { $(this).find('.parallelsectcontent').hide(); }, drop: function( event, ui ) { (ui.helper).remove(); //destroy clone $(ui.draggable).remove(); //remove list $(this).find('.parallelsectcontent').show(); $( ).find('.dropzone').empty().append( 'droped'); } }); }); demo: http://jsfiddle.net/lotus...

c# - asp.net nested views with owns controllers -

Image
i have target create nested architecture of view/controller. example: have few areas in webpage. areas managed own controller. in words need create independend pages , join them in 1 page. please see image: so possible , can read it? thanks. you can use @html.action() render child views different controllers public class firstcontroller : controller { public actionresult index() { return view(); } } public class secondcontroller : controller { [childactiononly] public actionresult method1() { return partialview(); } } public class thirdcontroller : controller { [childactiononly] public actionresult method2(int id) { return partialview(); } } index view (firstcontroller) .... @html.action("method1", "second") @html.action("method2", "third", new { id = somevalue }) you can use @{ html.renderaction(); more efficient generating lot of html.

asp.net - Server Error in '/' Application - Could not load file or assembly -

Image
can body please tell me might wrong here , how may go fixing it? thanks could not load file or assembly 'frameprocessor_dll' or 1 of dependencies. attempt made load program incorrect format. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.badimageformatexception: not load file or assembly 'frameprocessor_dll' or 1 of dependencies. attempt made load program incorrect format. source error: an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. assembly load trace: following information can helpful determine why assembly 'frameprocessor_dll' not loaded. === pre-bind state information === log: displayname = frameprocessor_dll (partial) wrn: partial bind...

Solr AnalyticsQuery API returns analytics by documents that don't match query -

solr analyticsquery api returns analytics documents don't match query. i have core named 'documents' in solr. there fields 'id', 'url', 'text', 'domain'. have resourceanalyticscollector counts how many documents belongs each resource. example of result of resource analytics is: resources:{ example.com: 456 example2.com: 123 ... } first time found problem when query 1 domain analytics returned result few domains. example: solr query: domain:example.com number of documents returned query: 1000(all documents belongs example.com ) analytics result: resources:{ example.com: 700 example2.com: 100 example3.com: 100 example4.com: 100 } i looked documents /select search handler , of documents belonged example.com domain. but when looked in analytics documents, have found there many documents don't match query. number of documents same. here analytics module: ...

vb.net - Public shared function and cookies or sessions asp.net vb -

i have implement public shared function in aspx.vb page (not in class or web service) use javascript had problem creating cookies , sessions how can create cookies or sessions in shared function? ideia! thank all. <webmethod> _ public shared sub test(text string) dim ctx httpcontext = system.web.httpcontext.current ctx.session("test") = text ctx.response.cookies("testcookie").value = text end sub

c# - NHibernate When to Use lazy loading? -

all understand lazy loading loads when object needed , should use it. please explain me scenarios have use , not use it? in advance. i put way: lazy loading essence of orm. principle of orm. (unless want load complete db in 1 shot) check article ayende: nhibernate lazy, live it small cite source: ...there reason why lazy set true default, , while sure there limited number of scenarios lazy=”false” appropriate choice, isn’t scenario... from experience: i hardly explain better post ayende. have confirm - see same way. never used non lazy setting. if should loaded in 1 shot - use projections: let orm stuff lazy adjust ad hoc queries needed

node.js - passportjs validate on signup if user already exists -

i trying create sign user if existing in db logged system, or else new user created in system. so far have come following code. //filename passport-config var config = require('./config'); var passport = require('passport'); var user = require('./models/user'); var localstrategy = require('passport-local').strategy; var isvalidpassword = function(user, password){ return bcrypt.comparesync(password, user.password); }; // generates hash using bcrypt var createhash = function(password){ return bcrypt.hashsync(password, bcrypt.gensaltsync(10), null); } // middleware quintessential call next() // if user authenticated var isauthenticated = function (req, res, next) { if (req.isauthenticated()) return next(); res.redirect('/'); } passport.use('signup', new localstrategy({ passreqtocallback : true }, function(req, email, password, done) { findorcreateuser = function(){ // find user in mong...

c# - wsHttpBinding app config for ServiceContract sessions -

hallo want user sessionmode = sessionmode.required , read wcf service must has wshttpbinding because supports sessions. make 1 app.config configuration , make 1 function in windows form start servives. when click button , call startwcfserver() exception: invalidoperationexception unhandled could not find base address matches scheme https endpoint binding wshttpbinding. registered base address schemes [http]. here codes: app.config <?xml version="1.0"?> <configuration> <system.servicemodel> <services> <service behaviorconfiguration="servicebehaviour" name="wcf_server.wcfservice"> <endpoint address="" behaviorconfiguration="web" binding="wshttpbinding" bindingconfiguration="wshttpbindings" contract="wcf_server.iwcfservice"/> </service> </services> <behaviors> <servicebehaviors> ...

ios - Is there any way I can fold all methods in Xcode project? -

Image
xcode provides method folding option current file. there way apply .m files in project ? p.s: tried xcode run scripts & xcode plugin development, failed comeup proper solution here's applescript purpose. caveat: system events required. the script needs changes if have multiple workspaces open or workspace contains multiple projects. you may need have else .m file selected in project navigator. -- collect objective-c file references given group. on handlegroup(thegroup, coderefs) tell application "xcode" set filerefs thegroup's file references repeat x in filerefs if x's file kind equal "sourcecode.c.objc" copy x end of coderefs end if end repeat set subgroups thegroup's groups repeat x in subgroups handlegroup(x, coderefs) end repeat end tell end handle...

calling a function in java without declaring a object -

i new java there possible way of calling function within same class without creating object class program public class puppy{ public pup(string name){ system.out.println("passed name :" + name ); } public static void main(string []args){ public pup( "tommy" ); } } i want call function pup without creating object ,is possible? you can declare method static: public static void pup(string name){ ... } as aside: should use standard java naming conventions , start method name lower-case letter: public static void pup(string name){ ...

java - GC stopped working when add google play service library -

Image
my project working perfect need map implementation , add google play service library. after whenever run project gc stopped working , eclipsed hanged. closed eclipse , removed google play service library , project working fine. this strange it's happening. update google play service library. updated library not working. two error dialog getting when try run project i tried approx 3 times removing , adding library same problem. edit : try library previous map sample project not working.

ios - Count of checkboxes is not showing properly -

i making app in using in form of checkboxes. want show count of checkboxes in text label trying not find possible solution.. here project link https://www.dropbox.com/s/iu8fdz4y0ps4xye/checkboxwithtableview%202.zip?dl=0 kindly review it.. below sample code - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *tableviewidentifier = @"cell"; tablecelltableviewcell *cell= [self.tblvie dequeuereusablecellwithidentifier:tableviewidentifier]; if(cell==nil) { cell = [[tablecelltableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:tableviewidentifier]; } cell.lblimage.layer.cornerradius=3.0f; cell.lblimage.layer.borderwidth=1.0f; if ([self.checkimagearray containsobject:[self.lblarray objectatindex:indexpath.row]]) { [cell.buttoncheckbox setimage:[uiimage imagenamed:@"checkbox.png"] forstate:uicontrolstatenormal]; ...

linux - Creating auto subdomains? -

i want set apache create auto subdomains so: i have domain mysite.com . in public /www/ directory if create directory /mysubdomain.mysite.com/ want apache create subdomain redirected directory, when trying access url any tips please? virtualdocumentroot want. configuration should take care of you: <virtualhost *:80> usecanonicalname off serveralias *.mysite.com virtualdocumentroot "/www/%1" <directory "/www"> options indexes followsymlinks allowoverride order allow,deny allow </directory> </virtualhost> you'll need make sure either have wildcard dns record *.mysite.com or every server name want use has record pointing @ apache instance.

python - Apply a function to a specific row using the index value -

i have following table: import pandas pd import numpy np #dataframe random numbers , a,b,c,d,e index df = pd.dataframe(np.random.randn(5,5), index = ['a','b','c','d','e']) #now name columns same df.columns = ['a','b','c','d','e'] #resulting dataframe: b c d e 2.214229 1.621352 0.083113 0.818191 -0.900224 b -0.612560 -0.028039 -0.392266 0.439679 1.596251 c 1.378928 -0.309353 -0.651817 1.499517 0.515772 d -0.061682 1.141558 -0.811471 0.242874 0.345159 e -0.714760 -0.172082 0.205638 0.220528 1.182013 how can apply function dataframes index? want round numbers every column index "c". #numbers round 2 decimals: b c d e c 1.378928 -0.309353 -0.651817 1.499517 0.515772 what best way this? for label based indexing use loc : in [22]: df = pd.dataframe(np.random.randn(5,5), index = [...

javascript - Framework.js gives error on internet explorer 8 -

i'm facing problem on internet explorer 8 while including in api. here's code, i'm not doing fancy @ all, including files. <script type="text/javascript" src="https://platform.linkedin.com/in.js"> api_key: <?php echo api_key . "\n"; ?> credentials_cookie: true authorize: true </script> <script type="in/login" data-onauth="onlinkedinauth"></script> and have onlinkedinauth function defined isn't doing right now. piece of code produces error in ie8, coming framework.js file, refering line 1070 : b.fn.apply((b.scope||window),c) has fixed before ?!

How to deal with android multiple instances? -

the launchmode "singletop": <activity android:name=".mainactivity" android:label="@string/app_name" android:launchmode="singletop"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="android.intent.category.launcher"/> </intent-filter> </activity> <activity android:name=".gridactivity"></activity> the mainactivity splash screen, when finish (authenticate server) it'll call gridactivity. the problem specific: when install app google play icon appear in 2 places: application drawer & "desktop" (launcher screen - default launcher). steps reproduce problem: open app application drawer , wait gridactivity displayed press "home" button send application background open app "desktop" (device's default launcher) the application st...

actionscript 3 - Get response status code from flash Sound object -

i have music player downloads , plays music (it should play while downloading), code looks this: sound = new sound(new urlrequest(url_stream)); sometimes server returns 404 (not found) , 429 (too many requests) status codes instead of music file, i'm looking way find out response status code in case of playback error, ideas? to response status, can use httpstatusevent event urlloader : var sound:sound var request:urlrequest = new urlrequest('http://www.example.com/file.mp3') var loader:urlloader = new urlloader() loader.addeventlistener( httpstatusevent.http_status, function(event):void { trace('http status: ' + event.status) if(event.status == 200){ sound = new sound(request) sound.play() } } ) loader.addeventlistener(ioerrorevent.io_error, function(){}) loader.load(request) this code working 100%.

php - change structure of array -

this nationality of commune. i have array multi form post array ( [pid] => array ( ) [commune] => array ( [0] => 64 [1] => 64 [2] => 64 [3] => 64 e.t.c ... ) [nationality] => array ( [0] => af [1] => al [2] => de [3] => e.t.c ... ) [female] => array ( [0] => 4 [1] => 0 [2] => 119 [3] => 13 e.t.c ... ) [male] => array ( [0] => 2 [1] => 0 [2] => 102 [3] => 16 e.t.c ... ) [send] => array ( ) ) and need change structure: array ( [0] => array ( [commune] => 64 [nationality] => af [female] => 4 [male] => 2 ) [1] =...

json - Java 6 EE Navigate to Error Page When Getting JSonParseException -

i working primefaces 5.0, java 6 ee. how can navigate error.jsf page when com.fasterxml.jackson.core.jsonparseexception occurs? it doesn't matter java class throws jsonparseexception . have handle exception in wherever occurs. create error xhtml page. in web.xml can configure error-page elements act upon error-code or exception-type. typically, might configure @ end of web.xml following: <error-page> <error-code>500</error-code> <location>/web-inf/jsfpages/errorpages/errorpage500.xhtml</location> </error-page> <error-page> <error-code>503</error-code> <location>/web-inf/jsfpages/errorpages/errorpage503.xhtml</location> </error-page> <error-page> <exception-type>java.sql.sqlexception</exception-type> <location>/web-inf/jsfpages/errorpages/errorpage500.xhtml</location> </error-page> to handle ajaxrelated exception can use omnifaces ...

railsapps - Using Rails Composer, getting error "-bash: rails: command not found" using "learn-rails" gemset -

i'm using nitrous on windows 7, , trying use railscomposer following "build ‘learn rails’ in less 5 minutes" of learn ruby on rails book. the book tells: use “learn-rails” gemset created earlier: $ rvm use ruby-2.1.3@learn-rails and then, $ rails new foobar-kadigan -m https://raw.github.com/railsapps/rails-composer/master/composer.rb i have error: -bash: rails: command not found

Python decorator with optional argument (which is function) -

note: know decorators optional argument contain 3 nested function. optional argument here function itself. please go through complete post before mark duplicate. tried tricks decorators optional argument, not found takes function argument. i having decorator wrapping error: def wrap_error(func): functools import wraps @wraps(func) def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except: import sys exc_msg = traceback.format_exception(*sys.exc_info()) raise mycustomerror(exc_msg) return wrapper if function raises exception, wraps error. wrapper used like: @wrap_error def foo(): ... now want modify wrapper additional callback function optional. , want wrapper used as: @wrap_error def foo(): ... @wrap_error(callback) def foo(): ... i know how write decorators optional arguments (in case passed argument not function, based on isfunction(func) check within wra...

Cant use tockens and extrapattern together for REST services in Yii2 -

yii2 rest query i found using custom action in controller added extrapattern mentioned in above link and working fine when search .but cant use normal actions controller 'urlmanager' => [ 'enableprettyurl' => true, 'enablestrictparsing' => true, 'showscriptname' => false, 'rules' => [ [ 'class' => 'yii\rest\urlrule', 'controller' => 'v1/country', 'extrapatterns' => [ 'get search' => 'search' ], 'tokens' => [ '{id}' => '<id:\\w+>' ] ] ], ] regards thanks all this solved problem after lots of trying.. 'rules' => [ [ 'class' => 'y...

internet explorer - Request header was not present in the Access-Control-Allow-Headers list -

Image
in api, have following code: public class customoauthprovider : oauthauthorizationserverprovider { public override task matchendpoint(oauthmatchendpointcontext context) { if (context.owincontext.request.method == "options" && context.istokenendpoint) { context.owincontext.response.headers.add("access-control-allow-methods", new[] { "post" }); context.owincontext.response.headers.add("access-control-allow-headers", new[] { "access-control-allow-origin", "accept", "x-api-applicationid", "content-type", "authorization" }); context.owincontext.response.headers.add("access-control-allow-origin", new[] { "*" }); context.owincontext.response.statuscode = (int)htt...

asp.net web api - UpdateRelatedObject method only works when the sourceProperty is not collection -

i getting following error when try update tree of object using asp.net webapi odata: "updaterelatedobject method works when sourceproperty not collection." my code provided below. got error when mehod "updaterelatedobject" called. can please advise wrong code , how update tree of objects (meaning object contains collection of child objects) using asp.net webapi odata v4. var container = new container(new uri("http://johnalbert.com/myodatatest/odata")); product product = container.products.expand(p=> p.productitems).expand(p=>p.productinvoices).where(p => p.pid == guid.parse("28c508b8-f2dc-45c2-b401-7f94e79ab347")).firstordefault(); if (product != null) { product.name = product.name + "_modified"; var pitem1 = product.productitems[0]; product.productitems.remove(pitem1); container.updaterelatedobject(product, "pr...

c++11 - Tidying up C++ operator overloads -

i have been tidying old c++ code. i've reduced pages of operator overload functions using couple of macros: .hpp // context, long , object wrap respective python primitives class long: public object {...}; #define ops( a, b ) \ bool operator == ( a, b ); \ bool operator != ( a, b ); \ bool operator > ( a, b ); \ bool operator < ( a, b ); \ bool operator >= ( a, b ); \ bool operator <= ( a, b ); #define uni( ) \ ops( a, ) #define bi_( a, b ) \ ops( a, b ) \ ops( b, ) uni( const long& ) bi_( const long& , int ) bi_( const long& , long ) uni( const float& ) bi_( const float& , double ) #undef bi_ #undef uni #undef ops #undef op .cpp #define op( op, l, r, cmpl, cmpr ) \ bool operator op( l, r ) { return cmpl op cmpr; } #define ops( ... ) \ op( != , ##__va_args__ ) \ op( == , ##__va_args__ ) \ op( > , ##__va_args__ ) \ op( >= , ##__...

redirect - Error Message in Laravel -

im using redirect::back()->witherrors($exception) not able display error message on page. here controller try{ } catch(parseexception $pex){ $error=var_dump($pex->getmessage()); return redirect::back()->withinput()->witherros(array('msg'=>$error)); } and here view { form::open(array('action' =>'userscontroller@register','class' => 'form-horizontal','id'=> 'registrationform' ,'name' => 'registrationform','method' => 'post')) }} <div class="body bg-gray"> <!--kullanicinin girmesi gereken bilgiler--> @if($errors->any()) <div class="form-group has-error"> <div class="col-sm-12"> <h4>error:{{$erros->first('code')}}</h4><br/> ...

php - Call my function instead anonymous function -

i have anonymous function running in onconnect event. how call function onconnect() instead anonymous function ? $this->server->on("connect", function (websockettransportinterface $user) { $this->logger->notice((" connected " . $user->getip())); }); and public function onconnect(websockettransportinterface $user) { $this->logger->notice((" connected " . $user->getip())); } something $this->server->on("connect", onconnect($user)); just this $this->server->on("connect", 'onconnect'); and if in same class, this: $this->server->on("connect", array($this, 'onconnect'));

ios - Swift integer type cast to enum -

i have enum declaration. enum op_code { case addition case substraction case multiplication case division } and use in method: func performoperation(operation: op_code) { } we know how can call normally self.performoperation(op_code.addition) but if have call in delegate integer value not predictable how call it. for example: func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { self.delegate.performoperation(indexpath.row) } here, compiler throws error int not convertible 'op_code' . tried here many permutations. not able figure out. you need specify raw type of enumeration enum op_code: int { case addition, substraction, multiplication, division } addition have raw value of 0 , substraction of 1 , , on. and can do if let code = op_code(rawvalue: indexpath.row) { self.delegate.performoperation(code) } else { // invalid code } more info here: https://developer.apple.c...

sql server - Linking an address table to multiple other tables -

Image
i have been asked add new address book table our database (sql server 2012). to simplify related part of database, there 3 tables each linked each other in 1 many fashion: company (has many) products (has many) projects , idea 1 or many addresses able exist @ 1 of these levels. thinking in front-end system, user able view , select specific addresses project specify , more generic addresses relating parent product , company. issue if how best model in database. i have thought of 2 possible ideas far wonder if has had similar type of relationship model , how implemented it? idea one: new address table additionally contain 3 fields: companyid, productid , projectid. these fields related relevant tables , nullable represent company , product level addresses. e.g. companyid 2, productid 1, projectid null product level address. issue storing relationship information in table if project ever changed related different product, data in table incorrect. potentially null level interest...

java - Hibernate - Exporting data into csv file using file writing -

i trying export data hibernate (using select statement in hql) text file. using simple file writing mechanism write output text file. while writing data text file, junk values getting inserted in syso values displayed properly. may small trivial error stuck in long time. any appreciated. i attaching code public class logic { @suppresswarnings({ "rawtypes", "deprecation" }) public static void main(string[] args) throws ioexception { configuration cfg = new configuration(); cfg.configure("hibernate.cfg.xml"); sessionfactory factory = cfg.buildsessionfactory(); session session = factory.opensession(); file file = new file("d:/users/output.txt"); filewriter fw = new filewriter(file); bufferedwriter bw = new bufferedwriter(fw); query qry = session.createquery("select employee_details a"); list l =(list) qry.list(); system.out.println("total number of records : "+((java.util.li...

Emulating ARM guests on a Debian GNU/Linux host. Black screen -

i trying launch arm vm using qemu-system-arm on debian gnu/linux guest (amd64/testing). i've downloaded arm-test-0.2.tar.gz provided qemu site , i've followed given insructions lauch doesn't work. i've tried following command lauch vm: qemu-system-arm -kernel zimage.integrator -initrd arm_root.img -append "console=ttyama0" -m versatilepb what black qemu window. what wrong? thank in advance help.

groovy - SoapUI change response in REST mock service -

i'm trying mock rest service in soapui 5.0. i'm using groovy script in onrequest tab: com.eviware.soapui.impl.wsdl.mock.wsdlmockresult mockresult = new com.eviware.soapui.impl.wsdl.mock.wsdlmockresult(mockrequest) def httpresponse = mockrequest.httpresponse httpresponse.setcontenttype("application/xml;charset=utf-8") httpresponse.writer << "<root><user>abc</user></root>" httpresponse.status = 200 return mockresult and getting error: could not find matching constructor for: com.eviware.soapui.impl.wsdl.mock.wsdlmockresult(com.eviware.soapui.impl.rest.mock.restmockrequest) what's wrong? :( yeah! i'm found solution soapui 5! def httpresponse = mockrequest.httpresponse mockresponse.setresponsehttpstatus(202) httpresponse.setcontenttype("application/json;charset=utf-8") mockresponse.setresponsecontent('{"a": 1}')

c# - How to delete an input based on id and value in Html agility pack -

given below html parsed agility pack <table> <tbody> <tr> <td colspan="1"> <p>name*</p> <p> <input type="text" size="24" title="name" id="name" name="name" /> </p> </td> </tr> <tr> <td colspan="1"> <p>age*</p> <p> <input type="text" size="24" title="age" id="age" name="age" /> </p> </td> </tr> <tr> <td colspan="1"> <p>date*</p> <p> <input type="text" size="24" title="date" id="date...

Android different selection spinner show different textview -

i spinner show different textview different selections choosen on spinner in android studio. drug interactions application when user chooses drug spinner different interaction appear each one. suggestions useful. below code, public class myactivity extends activity implements onitemselectedlistener { spinner spinner; textview showmed; private string[] state = {"adalimumab", "etanercept", "tacrolimus", "mycophenolic acid", "bicalutamide", "darbepoetin alfa", "ciclosporin", "interferon beta-1a", "triptorelin"}; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my); system.out.println(state.length); showmed = (textview) findviewbyid(r.id.showgender); spinne...

php - How to converting url to image in HashMap? -

this json encoded code want want show image , title both in android not able show images {"lists": [{"post_title":"kigs", "post_img":"post_img":"http://truzzinfotech.com/wp-content/uploads/2014/04/19-150x150.jpg"}, {"post_title":"lacolline", "post_img":"http://truzzinfotech.com/wp-content/uploads/2014/04/19-150x150.jpg"}, {"post_title":"cricket", "post_img":"http://truzzinfotech.com/wp-content/uploads/2014/047-150x150.jpg"}, ], "success":1} and android code getting images , title public class portfolio extends listactivity{ // progress dialog private progressdialog pdialog; imageview image; // creating json parser object jsonparser jparser = new jsonparser(); arraylist<hashmap<string, string>> portfolioslist; // url products l...

android - Insert method call in smali code -

i want add following call of method "send()" smali method: invoke-direct {p0}, x->send()v send() method of current class. x wildcard current class name. have 2 unresolved problems: why invoke-direct need register p0? thought parameter. do have take consideration p0 register? possible additional code makes entire app not compile if keep it? if so, how can find out register must used? i want add method call arbitrary method. don't know method structure , can't predict register usage. therefore need know if p0 in upper code can change , under conditions. i provide simple example emphasize intention: let's assume have method reads contacts saved on smartphone: .method private getcontacts()ljava/util/arraylist; .locals 12 .annotation system ldalvik/annotation/signature; value = { "()", "ljava/util/arraylist", "<", "ljava/lang/string;", ">;" } .end annotation .prologue const/4 v2, 0x0 .line ...

actionscript 3 - Setting a Root in File System Tree in actionscript3 -

i have filesystemtree mx control directory property set local directory(contains files , sub-directories). filesystemtree shows me folders , files in directory child root. root not snown part of tree(see image bellow)! http://prntscr.com/5amwea and set root on picture: http://prntscr.com/5amx5a there property show root setting true doesn't change anything. thanks in advance, filip.

unit testing - Advice on BDD for iOS needed -

inspired this issue on objc.io decided try out bdd on new project. here problem: want test mycredentialstorage somehow persists credentials ask store, namely next time app launched same credential. mycredentialstorage uses keychain, mock , verify secitemadd or secitemupdate functions called, not supposed test (or know of) mycredentialstorage ’s private methods, right? i’m sure i’m not 1 faced problem, i’m asking advice since i’m new bdd. thank in advance. from comments michał ciuba wrote: take @ article same objc.io issue - dependency injection: objc.io/issue-15/dependency-injection.html. can inject mock of keychain mycredentialstorage (but maybe you'll need create wrapper secitem* methods). ben flynn wrote: i agree @michałciuba - there's no generic way express item persist between executions of app. if you're going di route, i'd says. if aren't doing di, wouldn't shy mocking keychain storage or private methods. i'd explicit in na...

jquery - How to refresh product page without reloading in Magento..? -

i want product page refresh not reload when customer click on filter button.. hope doing well. as off issue quite simple required fire ajax call , must of native js of prototype easy you. now when fire ajax call or call java script function when filter clicked. example ajax call in prototype , can frame in code. document.observe("dom:loaded", function() { sdate=($$('[name="startdate"]')[0].value) edate=($$('[name="enddate"]')[0].value) pid=($$('[name="prodid"]')[0].value) new periodicalexecuter(function(pe) { new ajax.request('/index.php/productcountdown/index/timerdisplay', { method: 'post', parameters:{startdate: sdate, enddate: edate, prodid:pid}, onsuccess: successfunc, onfailure: failurefunc }); },3); }); function s...