Posts

Showing posts from August, 2015

python - String variable args are treated as dict types in robot framework -

*** test cases *** log test run keyword logtype *** keyword *** logtype ${type_object}= evaluate type( ${tc_args} ) log console type object ${type_object} when run command, pybot -v tc_args:'{"a":"b"}' a.robot , robot prints, the type object <type 'dict'> but, isn't default behavior treat single quoted literals strings ? so, ideally must have printed <type 'str'> instead of <type 'dict'> . your variable string. check it, try dictionary keyword on (like "get dictionary" collections lib) , see fails. run code see it: *** settings *** library collections *** test cases *** log test # let's test proper dictionary ${dict} = create dictionary b ${value} = dictionary ${dict} should equal ${value} b log console ${\n}this real dictionary # ${tc_args} passed on command line # evaluate might let thing have dict ${type_object} = evaluate type( $...

cloudera - YARN Application exited with exitCode: -1000 Not able to initialize user directories -

i getting: application application_1427711869990_0001 failed 2 times due container appattempt_1427711869990_0001_000002 exited exitcode: -1000 due to: not able initialize user directories in of configured local directories user kailash .failing attempt.. failing application. i couldn`t find related exit code , associated reason. using hadoop 2.5.0 (cloudera 5.3.2). actually due permission issues on of yarn local directories. started using linuxcontainerexecutor (in non secure mode nonsecure-mode.local-user kailash) , made corresponding changes. due (unknown) reason nodemanager failed clean local directories users, , there still existed directories previous user (in case yarn). so solve this, first had find value of property yarn.nodemanager.local-dirs (with cloudera use search option find property yarn service, otherwise yarn-site.xml in hadoop conf directory), , delate files/directories under usercache node manager nodes. in case, used: rm -rf /yarn/nm/usercache...

ios - Save data from textField into a file when the application has closed or terminated -

in application has view controller named " home " textfield . read applicationdidenterbackground , applicationwillterminate methods in appdelegate file. know how create, save, read data file. my question is, how can nsstring " home " viewcontroller (that there store textfield data) appdelegate applicationdidenterbackground method , there things data? you use nsnotificationcenter register notification in view controller fires off whenever enter applicationdidenterbackground or applicationwillterminate. so in either of methods put like [[nsnotificationcenter defaultcenter] postnotificationname:@"somedescriptivename" object:self userinfo:@{@"key" : @"value"}]; userinfo expects nsdicitonary , can pass type of object in there, in case dont need pass here viewcontroller, using means let view controller know app closing. in view controller register notification this [[nsnotificationcenter defaultcenter] addobserv...

android - Soft keyboard hide EditText in lollipop version -

i have layout contain relativelayout root layout,relative layoout contain listview @ top , 1 edittext align @ bottom of relative layout. in pre lollipop version devices whenever soft keyboard open edittext pushed , able see editext. in lollipop soft keyboard hide editext. have set android:windowsoftinputmode="adjustpan|adjustresize" in manifest file. please me thanks valuable input. have fixed issue. what found reason behind issue application theme. application theme android:theme.light in found issue. have changed theme of edittext layout activity setting android:theme="@android:style/theme.black.notitlebar" e.g. <activity android:name=".activity.livestreamingactivity" android:label="@string/title_activity_event_performer" android:theme="@android:style/theme.black.notitlebar" android:screenorientation="portrait" /> this solved problem !!!

audio - Java - playing some of *.wav files outside of IDE fails -

i have 3 wav files 3 different sources, , 1 file working. runs fine in eclipse, whenever compile it, doesn't. short clips < 1 second. 1 of them should played, when hover on buttons. here code use playblack: static eventhandler<mouseevent> menuhover =new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { try{ clip clip = audiosystem.getclip(); file menuhover = new file("menuhover.wav"); audioinputstream inputstream = audiosystem.getaudioinputstream(menuhover.getabsolutefile()); clip.open(inputstream); clip.start(); clip.setframeposition(0); } catch (exception g) { g.printstacktrace(); } } }; the 1 working has format of (pcm_unsigned 22050.0 hz, 8 bit, mono, 1 bytes/frame) and 1 isn't (pcm_signed 48000.0 hz, 16 bit, stereo, 4 bytes/frame, little-endian) i converted not working files, same format working one, still doesn't work. checked, if file output has correct path, has. don't errors. do hav...

ios - UIImageView does not stretch to whole screen -

Image
i prototype app , navigation , uiimageview in viewcontrollers, created in storyboard (xcode 6) not stretch full screen. example, have uiimageview 640×1136 image. if run on iphone 5, shows me full screen. if run on iphone 6 or 6 plus, locates in top left corner. read many topics , articles, nothing helped. make sure uiimage in uiimageview , either add constraints or change content mode this: myimageview.contentmode = uiviewcontentmodescaleaspectfit; or change in story board in attributes inspector under view . here list of values can set property. edit : reading issue over, think need add constraints view. there lots of tutorials on how this: here apples. you add constraints clicking pin menu, , clicking on 4 red brackets , clicking "add constraints".

Pass a struct parameter to a MATLAB mcc-compiled executable on Windows -

on windows, compiled using mcc matlab script takes struct parameter , writes output file. when try call on windows' cmd using func.exe "struct('field','data')" or func.exe struct('field','data') i get attempt reference field of non-structure array. error in func (line 3) matlab:nonstrucreference passing struct uncompiled script through matlab works, e.g. matlab /nosplash /nodesktop /r "func(struct('field','data')),exit" assuming still wish pass struct , not distinct arguments (so can specify optional arguments run), there workaround? (google didn’t help!) thanks! with info daniel , navan, workaround implemented (given argument called args) is if (ischar(args)); evalc(sprintf('args=%s;',args)); end which works both in compiled executable , calling directly within matlab. assumes user has done sanity checking.

php - Laravel validation -

i have problem laravel validation when validation fails call block of code should successful... i trying check user id if admin_id field equal user wich logged. here code: $auth = auth::user()->id; $inputs = array( 'id' => input::get('id') ); $rules = array( 'id' => "required|exists:users,id,admin_id,$auth" ); $validate = validator::make($inputs,$rules); if($validate -> fails()){ return $validate -> messages() -> all(); }else{ return 'succes'; } try doing this: $rules = array( 'id' => "required|exists:users,id,admin_id," . $auth );

java - BeanNameAutoProxyCreator setBeanNames regular expression not working? -

this beannameautoproxycreator : @bean public beannameautoproxycreator beannameautoproxycreator() { beannameautoproxycreator beannameautoproxycreator = new beannameautoproxycreator(); beannameautoproxycreator.setbeannames("*service"); // if put "*service" instead, exception. beannameautoproxycreator.setinterceptornames("loggingadvice", "debuginterceptor"); return beannameautoproxycreator; } @bean public loggingadvice loggingadvice() { return new loggingadvice(); } @bean public debuginterceptor debuginterceptor() { return new debuginterceptor(); } and clientservice bean: @bean @scope(beandefinition.scope_prototype) public clientservice clientservice() { return new clientserviceimpl(this.clientdao); } so, don't know why, when call setbeannames("*service") not setting interceptors. if put "*service" exception: org.springframework.beans.factory.beancreationexception: error creating ...

openlayers 3 - Openlayers3 clicking outside feature deselects all features -

i continue using default toggle options of interaction.select, user can have 1 feature selected @ time. however, when user clicks outside of feature, not want remove selected feature. there way achieve this? thank in advance. i able solve problem following... var select = new ol.interaction.select({ style: vm.selectedfeaturestyle, condition: function (event) { if (event.type === 'singleclick') { return vm.map.foreachfeatureatpixel(event.pixel, function () { return true; }); } return false; } });

SymmetricDS Sample - wrong port being used by client -

i trying example symmetricds tutorial work. using configuration files corp-000.properties , store-001.properties found in samples directory of download zip. have placed them in engine directory , edited them corp-000 using mysql db , store-001 using h2 db, both on local machine. here registration , synch urls corp-000.properties: registration.url= sync.url= http : // localhost : 31415 / sync / corp-000 here ones in store-001: registration.url= http: // localhost : 31415 / sync / corp-000 sync.url= http : // localhost : 31415 / sync / corp-000 when run bin/sym, finds 2 databases. then, store-001 reports: [store-001] - defaultofflineclientlistener - failed connect transport: http: // localhost : 8080 / sync / corp-000 [store-001] - pushservice - not communicate corp:000:000 @ http: // localhost : 8080 / sync / corp-000 because: connection refused this mystery since port 8080 not specified anywhere in 2 properties file. note: urls above don't have spaces in prop...

How can I read Cookie through Webhook in PHP? -

i'm using selz.com process payments , can use test webhooks files. for example, have whtest.php . if(isset($_cookie['affiliate'])) { $aff_code = $_cookie['affiliate']; } file_put_contents('webhook_data.txt', $aff_code, file_append); //webhook $json = json_decode(file_get_contents('php://input'), true); file_put_contents('webhook_data.txt', $json, file_append); the cookie there. if go whtest.php , access directly browser write cookie data inside webhook_data.txt . that's fine. the problem if send test random webhook data whtest.php gets successfuly webhook_data.txt not data cookie too. how can solve this? the short answer can't use cookie in circumstance. webhook have no knowledge of cookie set user on site. i'm not familiar selz (so sorry can't more specific), you'll have find piece of data sent in webhook have access prior user making purchase. shopping cart id, transaction id, order id,...

yum - Warning: No matches found for: kernel-devel -

when i'm trying install kernel-devel yum source, got error: $ sudo yum search kernel-devel loaded plugins: fastestmirror loading mirror speeds cached hostfile * base: ftp.riken.jp * epel: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp warning: no matches found for: kernel-devel no matches found [vagrant@vagrant-centos65 ~]$ uname -r 2.6.32-431.el6.x86_64 [vagrant@vagrant-centos65 ~]$ cat /etc/centos-release centos release 6.6 (final) but in centos 6.4 machine, kernel-devel (2.6.32-358.) can found , installed normally. doubt bad things have been done os system, or kernel-devel version 2.4.32-431 not exist truly. this problem occurs in vagrant vm. you should disable versionlock plugin. edit /etc/yum/pluginconf.d/versionlock.conf set enabled = 0 , , retry yum install kernel-devel notice if upgrade kernel newer version, when reload vagrant, cause error failed mount folders in linux guest. because "vboxsf" file system not av...

How to get join results using backbeam Android SDK? -

i using backbeam back-end , implementing backbeam's android sdk . i want performing joins results. using below code documentation getting join results : backbeam.select("place") .setquery("join last 10 events") .fetch(100, 0, new fetchcallback() { @override public void success(list<backbeamobject> objects, int totalcount, boolean fromcache) { // pick place (in real code check objects.size() first) backbeamobject place = objects.get(0); joinresult join = place.getjoinresult("events"); list<backbeamobject> events = join.getresults(); int count = join.getcount(); } }); i'm getting exact count of join relationship using getcount() . issue is, join result's list size returned '0' in getresults() . please me. i'm stuck on here.

c++ - Int Array[ ] not printing good. -

here code: #include <stdio.h> void main() { int indeks, a[11], j, rezultat[50]; int n = 0; printf("unesite elemenate niza\n"); while (n < 10) { for(indeks = 0; indeks < 10; indeks++); scanf("%d", &a[indeks]); n++; } (n = 0; n < 10; n++) { printf("%d\n", a[n]); } } hello , have problem doesn't print array integer number enter in . it print out -858993460 ten times. this how looks in cmd. (sorry bad english) unesite elemenate niza: 1 /input starts here 3 5 1 0 2 3 5 7 4 /ends here -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 /output result press key continue . . . the for loop nothing, since ends ; , while loop iterates, indeks 10 . suggest following #include <stdio.h> int main() // correct function type { int indeks, ...

c# - How to create a custom clipboard format in a WinForms app -

Image
take @ image: the screenshot generated copying 1 of contacts in skype list. data contains raw bytes containing information skype apparently finds useful (in case, contact name, along size of name). i accomplish myself. here's code used in attempt copy clipboard byte[] bytes = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }; clipboard.setdata("my data", bytes); which copy clipboard. however, dataobject entry along data added it, rather raw bytes: the top half see. bottom half when take screenshot of screen. notice raw bitmap data. can done in .net? the bytes serialization headers. see note msdn documentation on clipboard class (emphasis mine): an object must serializable put on clipboard. if pass non-serializable object clipboard method, method fail without throwing exception. see system.runtime.serialization more information on serialization. if target application requires specific data format, headers added data in ...

class - How can I call this function? -

i stuck right now, have tried seams logical me make work having no luck... i got in separate swift file: import foundation import uikit class myviewcontroller: uiviewcontroller { func background() { var imageview : uiimageview imageview = uiimageview(frame:cgrectmake(0, 0, 100, 300)); imageview.image = uiimage(named:"bg.jpg") self.view.addsubview(imageview) } } i want call separate view controller file. reason doing because can call background class in view controllers , don't have same code in each one. the ways have tried calling are: myviewcontroller.background() - error missing parameter #1 in call background() - error use of unresolved identifier 'background' myviewcontroller() - don't error nothing happens. i appreciate if tell me how can call function 'viewdidload' part in view controller. thank you. you're barking wrong tree. if call background method in myviewco...

android - RecyclerView with fixed column and header, plus scrollable footer -

Image
i trying find way implement standing table sports app (like nba game time standings), fixed header, fixed first column , footer. searched bit on how it, best shot project ( https://github.com/inqbarna/tablefixheaders ) uses own view instead of recycler of gridview. knows or knows how can start (adapter or layoutmanager)? edit (adding images) after testing , searching lot, implemented own, combining listview inner horizontalscrollview s. first, extended horizontalscrollview report me scroll event, adding listener: public class myhorizontalscrollview extends horizontalscrollview { private onscrolllistener listener; @override protected void onscrollchanged(int l, int t, int oldl, int oldt) { super.onscrollchanged(l, t, oldl, oldt); if (listener != null) listener.onscroll(this, l, t); } public void setonscrolllistener(onscrolllistener listener) { this.listener = listener; } public interface onscrolllistener {...

Using Powershell to remove a user from a list of groups -

trying script remove user list of groups. not sure part of language here wrong. doesn't return error in ise. i'm admittedly rookie in writing own powershell scripts instead of modifying others. appreciated. import-module activedirectory $group = @('grouopname1','groupname2','groupname3') $user = "testa" if ($user.memberof -like $group) { foreach ($user in $group ) { remove-adprincipalgroupmembership -identity $user -memberof $group -confirm:$false } } on thing you'll need learn when using powershell it's important test kind of output , object give you. $user = "testa" | $user.memberof that give error, because string doesn't have member property "memberof" $user = get-aduser testa -properties memberof that give object containing user "testa", , since memberof property isn't retrieved default, need add in. $user.memberof this return distinguishedname of g...

mysql - PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused -

the situation this, trying use php connection connect mysql database on phpmyadmin. nothing fancy connection trying see whether connection successful or not. using mamp host database, connection trying use this: <?php $servername = "127.0.0.1"; $username = "root"; $password = "root"; try { $conn = new pdo("mysql:host=$servername;dbname=appdatabase", $username, $password); // set pdo error mode exception $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); echo "connected successfully"; } catch(pdoexception $e) { echo "connection failed: " . $e->getmessage(); } ?> i have been using postman test see if connection working, keep receiving error message: connection failed: sqlstate[hy000] [2002] connection refused before receiving error message of: connection failed: sqlstate[hy000] [2002] no such file or directory this because had set servername localhost, through cha...

Javascript canvas - intersecting circle holes in rectangle or how to merge multiple arc paths -

Image
the issue have straightforward. variation of "how can draw hole in shape?" question, classic answer "simply draw both shapes in same path, draw solid clockwise , "hole" counterclockwise." that's great "hole" need compound shape, consisting of multiple circles. visual description: http://i.imgur.com/9sumswt.png . jsfiddle: http://jsfiddle.net/d_panayotov/44d7qekw/1/ context = document.getelementsbytagname('canvas')[0].getcontext('2d'); // green background context.fillstyle = "#00ff00"; context.fillrect(0,0,context.canvas.width, context.canvas.height); context.fillstyle = "#000000"; context.globalalpha = 0.5; //rectangle context.beginpath(); context.moveto(0, 0); context.lineto(context.canvas.width, 0); context.lineto(context.canvas.width, context.canvas.height); context.lineto(0, context.canvas.height); //first circle context.moveto(context.canvas.width / 2 + 20, context.canvas.height / 2); context...

Haskell: ScopedTypeVariables needed in pattern matching type annotations -

why code require scopedtypevariables extension? {-# language scopedtypevariables #-} char = case '3' of (x :: char) -> x nothing -> '?' when read documentation on scopedtypevariables , seems mean unifying type variables in function body parent function signature. code snippet isn't unifying type variables though! also effect of loading scopedtypevariables without loading explicitforall ? other usecases of scopedtypevariables seem require explicitforall work. in above snippet, there's no explicitforall . scopedtypevariables enables explicitforall automatically sake of sanity suggest using scopedtypevariables when using other type system extensions (except possibly ones dealing classes/instances/contexts) , never using explicitforall directly. the reason scopedtypevariables required pattern variable signatures such signatures part of extension. among other uses, give way bring type variable scope. example: f...

ruby on rails - PaperclipOpenURI::HTTPError (403 Forbidden) with Amazon S3 Storage -

i have images stored in s3 paperclip , error intermittenly showing up. had resolved few weeks ago upgrading ruby 2.1.5, it's now. here's controller code: def download extension = file.extname(@gallery_photo.image_file_name) send_data open("#{@gallery_photo.image.expiring_url(10, :original)}").read, filename: "original_#{@gallery_photo.id}#{extension}", type: @gallery_photo.image_content_type end here's error: openuri::httperror (403 forbidden): rails 4 & ruby 2.1.5 i had extend expiring_url 10000.

java - How to findAll entires(posts) which contain at least one specified tag. Spring Data -

i`m trying retrieve entries(posts) possess specific tag. 1 entry can have many tags, use list of objects. don't know how construct proper command in controller class, i'm afraid i’m lost here. entry entity looks this: @entity public class blogentry { @id @generatedvalue private integer id; private string title; @column(name = "published_date") private date publisheddate; @manytomany @jointable private list<tagblog> blogtags; /* multiple tags 1 entry */ and tag entity: @entity public class tagblog { @id @generatedvalue private integer id; private string tag; @manytomany(mappedby="blogtags") private list<blogentry> entries; in entryservice class wanted perform kind of sort "findbytagblogin" wish return list of posts possess specific tag. public list<blogentry> findallbytags(list<tagblog> tag){ list<blogentry> blogentry = entryrepository.findbytagblogin(tag); re...

Android: What’s the best way to implement the BaseAdapter if item content in ListView is dynamic? -

Image
in case, need implement baseadapter’s getitemviewtype() , getviewtypecount() dynamic item content of listview, this post says. think solution suitable finite number , knowing beforehand, such listview item sending layout , receving layout. what case listview item content impossible knowing beforehand? example, need show contact list server, contact list size several thousand. each item, need show, example, hobby “list”. small range of 0 tens of string. in case: the item types relatively bigger normal case using “getitemviewtype” though each item may different, similar degree: item content different in number of views, common in view type. item different item b because have more textviews. for each time in getview, convertview hard reuse because different, if create new textview , added convertview, impact scrolling of listview. don't think it's appropriate such way. should in such case? unfortunately cannot change number of item view types on fly. getv...

netty - Interrupting an HTTP session with a forbidden error -

in netty server application receive httprequest must processed if cookie particular content present , valid (a kind of authentication). in pipeline have following objects: httprequestdecoder mycookiehandler myrequesthandler what want that, if cookie not present or not valid, no further elaboration occurs , forbidden error returned. this i've done inside 'mycookiehandler' : public void channelread(channelhandlercontext ctx, object msg) throws exception { ... if (!isvalid(cookie)) { ctx.writeandflush( new defaultfullhttpresponse(http_1_1, forbidden)) .addlistener(channelfuturelistener.close); return; } } however, 'writeandflush' called client receives error 'empty reply server'. what's wrong in code? thanks, massimiliano i found error. adding future listener channelfuture returned writeandflush , discovered problem httpresponseencoder needed pipeline encode answer bytebuf . so, solve problem, cha...

asp.net mvc - Bootstrap datepicker not popping out in MVC -

i saw lot of post regarding not able solve. in view bootstrap datepicker popping out input tag eg: <input class="span2 datepicker" size="16" type="text" value="12-02-2012"> when run page iam able change date through datepicker. $(document).ready(function () { $('.datepicker').datepicker(); }); but same not working below code <div class="control-group">@html.labelfor(model => model.dob, htmlattributes: new { @class = "control-label " }) <div class="controls"> @html.editorfor(model => model.dob, new { htmlattributes = new {@class = "datepicker" } }) @html.validationmessagefor(model => model.dob, "", new { @class = "field-validation-error text-danger" }) </div> </div> please me. it sorted out. <div class="control-group">@html.labelfor(mode...

php - City name, County name returning in other languages not in English -

when search using below fq api : https://api.foursquare.com/v2/venues/search?ll=19.346523,-99.191292&query=gimn&oauth_token=z1nasaz5ieusdjajg1vmqo5yx410djxukbkahxn0fyib15bq&v=20150401 in browser got city name "mexico city". but, when used api call in file_get_contents or curl, city name returning "ciudad de méxico" in spanish language. need city name in english, pls provide me steps fix issue. thanks, suhanya.m it's defaulting spanish, it's popular locale. can specify locale=en english: https://developer.foursquare.com/overview/versioning here's new link like; note additional parameter @ end: https://api.foursquare.com/v2/venues/search?ll=19.346523,-99.191292&query=gimn&oauth_token=z1nasaz5ieusdjajg1vmqo5yx410djxukbkahxn0fyib15bq&v=20150401&locale=en

php - Get Client Ip in Symfony2 -

i have searched, cannot seem find answer simple question: how force symfony give me ipv4 version of user's ip, or missing ? can both ipv4 , ipv6 ? thanks edit: question different, because not trying ip, know of function getclientip ( that's why in title ), want function return ipv4 , ipv6 version of ip. ( or function, way both, ipv4 , ipv6 ) edit2: how ip right now: public function getuserip() { return $this->request->getclientip(); } and returns ipv6 exclusively. ( function ran inside of own usermanager, checks , updates current user on every call, plugging event controller enter part symfony pipeline ) if user connected ipv6 there no ipv4 address display , vice versa. 1 version of ip.

grails - Q: Grails2.4, CAS and the infamous redirect loop -

i have several grails applications running in production , interfacing cas server (cas 3.3.5) via spring-security , "grails cas plugin". these applications supported various versions of grails version 1.3.7 2.2.4 i moving 1 of them 2.4.4 , have never ending problems authentication. @ end of exercise have notorious: "this webpage has redirect loop" (in chrome). @ server side have usual (!) error: error [org.jasig.cas.web.servicevalidatecontroller] - <ticketexception generating ticket for: [callbackurl: https://casclient.mydomain.com:9043/testcas/secure/receptor]> org.jasig.cas.ticket.invalidticketexception @ org.jasig.cas.centralauthenticationserviceimpl.delegateticketgrantingticket(centralauthenticationserviceimpl.java:268) here steps made reproduce problem: grails create-app testcas grails create-controller showsecure add action showsecurepage in controller grails generate-views create page showsecurepage under view/showsecure add urlmap...

javascript - understanding transition function by ALEX MACCAW -

hey guys new js , reading article provided referance in bootstrap.js transitions : css transitions using jquery now if go part says programmatic transitions, thats part tried implementing . fiddle here . but somehow code famious article does't work . why ? code below : $(document).ready(function () { var defaults = { duration: 4000, easing: '' }; $.fn.transition = function (properties, options) { options = $.extend({}, defaults, options); properties['webkittransition'] = 'all ' + options.duration + 'ms ' + options.easing; console.log(properties); $(this).css(properties); }; $('.element').transition({ background: 'red' }); }); found solution in transition.js i need have code below : var transendeventnames = { webkittransition : 'webkittransitionend', moztransition : 'transitionend', otransition ...

windows - CasperJS script never exits -

my casperjs script never stops executing. var casper = require('casper').create(); casper.useragent('mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36(khtml, gecko) chrome/41.0.2272.101 safari/537.36'); casper.start('https://www.google.co.in/',function(){ casper.wait(3000,function(){ this.echo(this.gettitle()); }); }); casper.run(); it looks if casperjs never exits. issue on windows. see this: c:\> casperjs script.js c:\> script output more script output _ it has how casperjs installed , invoked. happens when have cygwin installed , install casperjs through npm. npm detect have cygwin , create special batch file start casperjs with. there somewhere bug how whole situation handled, doesn't affect functionality of casperjs. if press enter, see prompt again: c:\> casperjs script.js c:\> script output more script output c:\> _ if use casperjs master branch on github, proper exe file executes without i...

php - How to use function in_array with CodeIgneter -

i trying use php function in_array within view using codeigneter. this method class user_details extends ci_model { public function checkid(){ $query = $this->db->query("select id users"); return $query->result_array(); } this controller $this->load->model('user_details'); $data['alluserid'] = $this->user_details->checkid(); $this->load->view('user_details/content',$data); this script trying use in view $id = $this->uri->segment(4);//user's id example: 218 if(in_array($id,$alluserid)){ echo 'exists'; } else { echo 'does not exist'; } unfortunately script not work expected. if check array using print_r($alluserid) following result: array ( [0] => array ( [id] => 217 ) [1] => array ( [id] => 218 ... ...and on... last week started learning codeigneter , did not understand approach yet. in_array() accept single dimensional array , passing 2 dimension...

javascript - How to replaceByImage() instead of drawImage() on html canvas (ignore opacity)? -

i draw image (which can have transparent parts) on canvas, totally replacing canvas content sourve image (unlike in source-over composition operation). the resulting canvas have exact same values source image. can't find composition operation perform this. i can clear canvas before calling drawimage() wondering if there faster/better way. you can use copy mode if want replace (as seem text in question): ctx.globalcompositeoperation = "copy"; if want remove parts of canvas, ie. area content drawn to, clearrect can used: ctx.clearrect(x, y, width, height); // replace values

rest - Check if RESTful server is available on Android -

i'm developping android rest-api oriented application. i need create method check whether server available or not. problem if use url.openstream() method, there's no way determine whether request successful or not. is there way without need operate of performing full httpurlconnection , read return code? you can use tcp sockets socketaddress socketaddress = new inetsocketaddress(address, port); try { int timeout = 2000; socket.connect(socketaddress, timeout); } catch (ioexception e) { return false; } { if (socket.isconnected()) { try { socket.close(); } catch (ioexception e) { e.printstacktrace(); } } }

rssi - Trying to use the AT command with an Huawei E3531 -

i want read rssi of huawei e3531. found documentations show easy way informations using @ command. problem can't connect huawei e3531. mean, works modem. have connection. when looking device in dev, find 2 devices ("sdb" , "sgm") seem 2 disc, nothing serial port. so tried somethin found: -after plugged huawei, find idvendor , idproduct doing lsusb. -they sudo modprobe usbserial vendor=0x"idvendor" product=0x"idproduct" -and when dmesg can read: [ 1038.498282] usbcore: registered new interface driver usbserial [ 1038.498299] usbcore: registered new interface driver usbserial_generic [ 1038.498312] usbserial: usb serial support registered generic normally should have like: usb 1-1: generic converter attached ttyusb0 i think have not possible see sdb , sgm mac, doing ubuntu. , if enable wifi, modem cannot connect ( not see sdb , sgm) if need here first part of dmesg: [ 742.756888] usb 3-1: usb disconnect, device number 6 [ 74...

Tomcat web app with ActiveMQ broker over TCP -

i trying set activemq broker within context of web app hosted in tomcat. additionally, connector want use tcp broker should accessible remote applications. so far, have done create simple web app local jndi context.xml configuration following: <resource auth="container" name="jms/connectionfactory" type="org.apache.activemq.activemqconnectionfactory" description="jmsconnection" factory="org.apache.activemq.jndi.jndireferencefactory" brokerurl="tcp://localhost:61616" brokername="mqbroker"/> <resource auth="container" name="jms/mqueue" type="org.apache.activemq.command.activemqqueue" description="jms queue" factory="org.apache.activemq.jndi.jndireferencefactory" physicalname="some.queue"/> i have updated web.xml file accordingly , called connection factory servletcontextlistener implementing...

plsql - Anonymous PL/SQL block checked exception -

i'm trying catch exception within anonymous pl/sql block declare ... begin herstell_row in ( ... ) loop ... declare table_does_not_exists exception; pragma exception_init( table_does_not_exists, -942 ); begin insert smart_monitoring_machine_nav_b ( machine, navigation_level_id ) select old_binding.machine, pv_id smart_machine_nav_binding old_binding old_binding.navigation_level_id = herstell_row.hename1; exception when table_does_not_exists null; end; end loop; end; i know table smart_machine_nav_binding doesn't exist in case, need nested anonymous block ignore code. error: error report - ora-06550: line 41, column 14: pl/sql: ora-00942: table or view not exist ora-06550: line 33, column 10: pl/sql: sql statement ignored you can't compile code non-existent table, can try e...

java - Type mismatch: cannot convert from element type Object to Parent -

i'm trying develop e4 application have error : in part "error:type mismatch: cannot convert element type object parent" please in advance :) @creatable @singleton public class treecontrol { parentsholder parentholder = new parentsholder(); public parent parentexists(string str) { (parent p : parentholder.getparents()) if (p.gettag().equals(str)) return p; return null; } public child childexists(string p, string c) { parent parent = parentexists(p); if (parent != null) (child child : parent.getchildren()) if (child.gettag().equals(c)) return child; return null; } } this parent holder class public class parentsholder extends model { list parents = new arraylist(); public list getparents() { return parents; } public void setparents(list parents) { firepropertychange("parents", this.pare...

Ionic and angularjs Cannot read property 'scrollWidth' of null -

i have following problem. have 2 same list views, directives inside (i use angularjs). 1 of them runs without issues, other 1 throws following error: typeerror: cannot read property 'scrollwidth' of null @ object.ionic.views.scroll.ionic.views.view.inherit.initialize.options.getcontentwidth (ionic.bundle.js:4081) @ ionic.views.scroll.ionic.views.view.inherit.resize (ionic.bundle.js:4835) @ ionic.views.scroll.ionic.views.view.inherit.run (ionic.bundle.js:4147) @ ionic.bundle.js:39888 @ ionic.bundle.js:21929 @ completeoutstandingrequest (ionic.bundle.js:12022) @ ionic.bundle.js:12330ionic.bundle.js:17696 (anonymous function)ionic.bundle.js:14989 $getionic.bundle.js:21932 (anonymous function)ionic.bundle.js:12022 completeoutstandingrequestionic.bundle.js:12330 (anonymous function) my code pretty long, not posting yet - if there need so, :) hint: i've tested app on phone, , seems cant scroll on error occurs. suggestions? thanks ok, figured out. didnt have d...

plugins - Looking for an Eclipse Code Formatter -

i know built in codeformatter in eclipse there 1 problem it. i work in team of 20 developers , confirmed codeformatting not like. e.g. wrap lines after 80 characters or opening braces on same line, etc. so want formatter formats code in 2 ways: when work on class, want formatter make me happy , when push svn should format other wont bothered. i hope have settings done in machine. if so, can export preference via file -> export -> general/preferences , ask colleagues import it. if not, try this... https://code.google.com/p/google-styleguide/source/browse/trunk/eclipse-java-google-style.xml moreover not idea format while checking svn might bother fellow developers might not feel comfortable when lots of formatting changes minor 1 line bug fix.

java - Maven wagon error when trying to copy artifact -

i trying use maven wagon plugin copy artifacts server. i have set follows: <build> <extensions> <extension> <groupid>org.apache.maven.wagon</groupid> <artifactid>wagon-ssh</artifactid> <version>${maven.wagon.version}</version> </extension> </extensions> <plugins> <plugin> <groupid>org.apache.maven.wagon</groupid> <artifactid>wagon-maven-plugin</artifactid> <version>${maven.wagon.version}</version> <!-- <dependencies> <dependency> <groupid>org.apache.maven.wagon</groupid> <artifactid>wagon-ssh</artifactid> <version>${maven.wagon.version}</version> </dependency> </dependencies> --> ...