Posts

c# - Why is autofac registering all instances of apicontroller instead of just the one i specify -

im having trouble understand why classes derived apicontroller registered , accessible. have 2 apicontrollers: mastercontroller : apicontroller slavecontroller : apicontroller and here how setup server container action<iappbuilder> appbuilderaction = appbuilder => { var httpconf = new httpconfiguration(); httpconf.dependencyresolver = new autofacwebapidependencyresolver(container); httpconf.routes.maphttproute("defaultapi", "api/v1/{controller}/{action}", new { action = "get" }); appbuilder.usewebapi(httpconf); }; return webapp.start(baseaddress, appbuilderaction); the problem im having when creating nunit test though try register single controller, both of them accessible during test. if register mastercontroller instance, expect url valid (master) var response = await client.getasync(new uri(http://localhost:8080, "api/v1/master/mytest...

vbscript - Calling one vb script to another Vb script file wont run in task scheduler -

hello , trying run vb script file in schedule task, works fine when set run administrator privileges in schedule task. when trying call second script, runs first script, second script wont run. tried run through batch file, runs first script, second script not getting call. following code first script. dim objshell set objshell = wscript.createobject("wscript.shell") objshell.run "testscript.vbs" not working when run through scheduler task. could make reply. solution appreciated here.. try specifying full path testscript.vbs . when scripts run scheduler, current directory windows system folder, not folder script being run from. alternatively, can set current directory before calling script. set objshell = createobject("wscript.shell") objshell.currentdirectory = "c:\scripts" objshell.run "testscript.vbs"

apache - How can we make a redirect in .htaccess for the “git” project? -

there project on “git”. there hosting service , document_root refers http_public. have no possible way change it. i clone repository http_public, web-tool located @ http_public/zzz. redirect htaccess: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri} !^zzz rewriterule ^(.*)$ zzz/$1 [l] </ifmodule> when refer website example.com, web-tool being opened. how can make website work referring example.com not working directly example.com/zzz/?

ios - Removing the text background of a label in a cell -

Image
noticed cell label got background around text, cell got bigger text others (probably because of background). there way remove kind of behaviour ? try use this: [cell.textlabel setbackgroundcolor:[uicolor clearcolor]];

Using PHP what is the best way to get multiple rows in one MySQL query? -

this question has answer here: mysql php - select id = array()? [duplicate] 6 answers which best way multiple rows in 1 mysql query. i have array of ids: $id_array = array('34','341','342','334','344','354','3234','33234','3234','3234'); i get title associated id's mysql database . i have 2 approaches: 1) example : foreach($id_array $id){ $query = mysqli_query($con, "select title content id = '$id'"); $id_db = mysqli_fetch_row($query); echo $id_db['title']; } 2) example : $query = mysqli_query($con, "select title content id = '$id_array[1]' , id = '$id_array[2]' , id = '$id_array[3]' , 'id = $id_array[4]' , id = '$id_array[5]'"); while($result = mysqli_fetch_assoc($query)){ ech...

amazon web services - Elastic Beanstalk .ebextensions config file not getting deployed with git aws.push -

i've linked git branch elastic beanstalk environment , using git aws.push deploys correctly. i've added .extensions directory contains config script should creating couple of directories. however, nothing appears happening. i understand .extensions directory should copied across ec2 instance i'm not seeing it. i've checked eb-tools.log , it's not mentioned in upload. is there additional that's required? the script contains: commands: cache: command: mkdir /tmp/cache items: command: mkdir /tmp/cache/items chmod: command: chmod -r 644 /tmp you can find run logs @ /var/log/cfn-init.log . in here see mkdir commands had worked subsequently failed directory existed. turns out eb extensions run commands in alphabetical order had change commands to: 01command1: 02command2: etc. point on worked fine. something else confusing me .ebextensions directory in local git repo not appearing on target instance directory. beca...

android - How set my ACTION BAR to support right to left -

this question has answer here: how handle rtl languages on pre 4.2 versions of android? 2 answers i new on android , want write application support rtl languages. wrote android:supportsrtl="true" on application part of manifest file , call forcerighttoleft on oncreate method of android. method have following body: @targetapi(build.version_codes.jelly_bean_mr1) private void forcertlifsupported() { if (build.version.sdk_int >= build.version_codes.jelly_bean_mr1) { getwindow().getdecorview().setlayoutdirection( view.layout_direction_rtl); } } but understand on sdk api 16(android 4.1) , version before didn't supported , action bar show left right. search couldn't find solution. please don't minus code let me know , delete if not true question. try bidi class see answer also.