Posts

Showing posts from May, 2010

ssh session as python subprocess takes input but does not print it to stdout -

i'm trying use python's cmd library create shell limited commands. 1 requirement have able run command executes existing shell script opens ssh session on remote machine , there allows user interact remote shell if regular ssh session. simply using subprocess.popen('[/path/to/connect.sh]') works @ least starting point except 1 issue. can interact remote shell input type not shown on stdout...so example see prompt on stdout when type 'ls' don't see being typed when hit return works expected. i'm trying wrap head around how print input stdout , still send along remote ssh session. edit: actual code without using cmd 1 line: ssh_session = subprocess.popen(['connect.sh']) it fired do_* method in class extended cmd.cmd. think may end using paramiko still interested in anyone's input on this. assuming using unix system, ssh detects if on terminal or not. when detects not on terminal, when using subprocess, not echo charac...

java - I can't call the repaint() method in my main method -

everytime try call repaint() method says non static method cannot reference static method. btw, it's in same class paintcomponent method. tried create object out of class first, reference object name didn't work. please help. public class p extends jpanel { p g = new p(); boolean change = true; static int x = 0; static int y = 0; static color circlec = new color(0, 0, 0); static string position = ""; p p = new p(); public void paintcomponent(graphics g) { g.setcolor(circlec); g.filloval(x, y, 50, 50); g.setcolor(color.white); g.drawstring(position, x, y + 25); } public static void main(string[] args) throws interruptedexception { p.repaint(); } } the main method static. p object not: instance field of p class. try this: public static void main(string[] args) throw interruptedexception { eventqueue.invokelater( new runnable() { public void run() { p p = new p(); p.repaint(); } } );...

jQuery UI Remove Dropped Object -

i'm working on simple jquery ui project. i'm dragging image inside "blue" div empty "red" div. i can insert image code "red" div, well. want is, after dragging completed, remove first item. in summary, drag picture div. stick top-left no matter user drops. <script> var imgcode = '<img src="42.jpg" id="dragpic" alt="42" width="100" height="100">'; //this image code $(function() { $( "#dragpic" ).draggable(); //image draggable $( "#red" ).droppable({ //image has dragged "red" div drop: function( event, ui ) { $( ) .addclass( "reddrop" ) //custom css .html(imgcode); //insert image inside div /* need remove image user dragged. */ } }); }); </script> you can access item that's b...

javascript - jquery Cannot read property 'getAttribute' of undefined -

the javascript i'm using works fine in firefox , ie has error when run on chrome , safari. i'm not entirely sure why it's failing. var response = asyncresult.value; if (window.domparser) { var parser = new domparser(); xmldoc = parser.parsefromstring(response, "text/xml"); } else { xmldoc = new activexobject("microsoft.xmldom"); xmldoc.async = false; xmldoc.loadxml(response); } console.log(xmldoc); var changekey = xmldoc.getelementsbyid("t:itemid")[0].getattribute("changekey"); the console shows message outputs xmldoc fine when have set console.log() uncaught typeerror: cannot read property 'getattribute' of undefined r.js soaptogetitemdatacallback r.js r.onreadystatechange outlookwebapp-15.js:21 $h.ewsrequest.$1x_1 outlookwebapp-15.js:21 (anonymous function) outlookwe...

How to move text output of php in html -

i have php code block related account login logout etc. however, when log in without valid password echos "please enter valid username/password" however, when text appear, covered html scripts, dont know if can position it? or have convert html scripts, please enligten me thanx x this output coming <!d0ctype html> <html> <head> <style> #lions { position:absolute; top:15px; left:1200px; z-index:9; } </style> </head> </html> <?php if (isset($_post['username'])&&isset($_post['password'])){ $username = $_post['username']; $password = $_post['password']; $password_hash = md5($password); if(!empty($username)&&!empty($password)){ $query = "select `id` `users` `username`='".mysql_real_escape_string($user...

angularjs - Enabling CORS in an API gateway -

i making cordova application. need make simple request angular. i keep getting message: "cross-origin request blocked: same origin policy disallows reading remote resource @ http://myserver/authenticateme . can fixed moving resource same domain or enabling cors." i thought added necessary headers response. here full header: "access-control-allow-headers: origin, x-requested-with, content-type, accept access-control-allow-origin: * content-encoding: gzip content-length: 76 content-type: application/json;charset=utf-8 date: mon, 16 mar 2015 21:37:56 gmt server: apache-coyote/1.1" i tried in firefox , chrome. this extremely annoying because never had problem server when doing native ios , android requests. am missing here??? did try jsonp? something like: $http.jsonp(api_url + "/?callback=json_callback") .success(function(data) { // blah blah }) .error(function() { console.log("couldn't fetch."); }) .fi...

restangular - capturing full URL of a GET request in AngularJS including query params -

i'm using http interceptor. see values when make restangular request. here code request interceptor. request: function (config) { // see link below see value of config console.log('config', config); // below returns full url except query string console.log('location', $location.absurl()); // $rootscope.cachedata $cachefactory console.log('$rootscope', $rootscope.cachedata); // returns {id: "http", size: 3} console.log('cache info', $rootscope.cachedata.info()); // below returns undefined console.log('cache get', $rootscope.cachedata.get('http')); // other codes removed since it's not related // ........ // ........ // return config or wrap in promise if blank. return config || $q.when(config); }, config value : http://i.imgur.com/l0isxbj.png unfortunately, preparing params captured manually not 100% guaranteed match has been cached. noticed cachef...

javascript - Angularjs routing throws 404 without # -

i creating website angularjs , using ngroute module handle page requests. in app.config function have setup routing follows: app.config(function($routeprovider, $locationprovider, $httpprovider){ $locationprovider.html5mode(true); $routeprovider.when('/', { templateurl: 'pages/index.html', controller: 'maincontroller' }).when('/testpage', { templateurl: 'pages/test.html', controller: 'testcontroller' }).otherwise({ redirectto: '/' }); }); when try access test page, on mamp local server, adding # before page name this: http://dev.mysite.com:8888/#testpage works fine. however, if don't add # before page name, this: http://dev.mysite.com:8888/testpage 404 error. i have added <base href="/"> <head> of index.html page contains <div ng-view> tag. i appreciate if explain doing wrong. angular looks # symbol handle r...

aspectj - Spring Boot load time weaving doesn't work in embedded tomcat -

i can't ltw work in spring boot 1.2.2 w/ embedded tomcat. my application war file, not .jar file. when run in debug, never stops in aspect hitting calls should match pointcuts, how figure not working... my run script this: -javaagent:path/to/spring-instrument-xxx.jar -javaagent:path/to/aspectjweaver-1.2.8.jar in spring boot, load aop config applicationinitializer, in parent applicationcontext right away , should there rest of embedded tomcat web application context thereafter. @enableloadtimeweaving(aspectjweaving=aspectjweaving.enabled) @configuration public class aopconfig { private log log = logfactory.getlog(aopconfig.class); public aopconfig() { log.info("creating aopconfig"); } @bean public loadtimeweaver loadtimeweaver() { log.info("creating instrumentationloadtimeweaver"); return new instrumentationloadtimeweaver(); } } my aspect looks this: package my.aop.profiler.methodtimeraspect; @...

Changing polygons' colors in Maya via Python -

the way know use slider: import maya.cmds cmds cmds.colorslidergrp( 'polygoncolour', label = "colour", hsv = ( 1, 1, 1 ) ) then taking rgb value that: rgb = cmds.colorslidergrp( 'polygoncolour', query = true, rgbvalue = true ) and assigning material polygon , giving material color: myshader = cmds.shadingnode( 'lambert', asshader = true, name = "polygonmaterial" ) cmds.setattr( 'polygon1' + ":blockmaterial.color", rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], type = 'double3' ) is there easier approach without using slider and/or without assigning material? if want assign new color existing shader(s), it's simple setattr() . every shader has it's own attribute set, exact values need set depend on type of shader want, common cases (lambert, phong, , blinn) it's .color attribute. setting color simple passing in rgb values want: cmds.setattr(shader + '.color', 0, 1, 0) # green getti...

qt - QTcpServer - how to multi-thread - example is bad -

i'm trying make qtcpserver start separate thread each connection. there's example code available that: http://doc.qt.io/qt-5/qtnetwork-threadedfortuneserver-example.html this code works subclassing qthread. if build code based on example, i'm pretty running "qobject: cannot create children parent in different thread." warnings. there documentation qt advises against subclassing qthread, because "doing wrong": http://blog.qt.io/blog/2010/06/17/youre-doing-it-wrong/ so, question is, if qt provided example code directly in violation of qt recommended practice, there example of correct way it? example i've found far subclasses qthread. qt developing product. and, seem, subclassing qthread still considered legal practice. older technique, old examples use it. your problem seems wrong usage of qobject(s) across different threads, rather qthread subclassing. first try find code issues warnings.

Booking system search using solr -

i working on booking system in booking done based on dates selected start time till end time , maintain inventory table availability slot datetime column gives me value of availability of inventory time slot. we range query in sql have inventory data indexed in solr faster range query searches. the problem see whenever booking done inventory data has updated , won't constant update affect solrs performance? this solr's near real time search has been built for. need fine tune this, should not face performance impediments, if used right. near real time (nrt) search means documents available search after being indexed: additions , updates documents seen in 'near' real time. solr not block updates while commit in progress. nor wait background merges complete before opening new search of indexes , returning. with nrt, can modify commit command soft commit, avoids parts of standard commit can costly. still want standard commits ensure documents in...

powershell - Point of Write-Error in Catch block -

if catching exceptions display error in more user friendly way, there point in using write-error on write-host? write-error show exception same way if didn't catch right? one reason you'd want use write-error on write-host written powershell error stream, , can redirected if wanted later (e.g. running script scheduled task, , want capture output log file).

r - changing colour or thickness of one point of data set in ggplot2 -

Image
i currrently plotting effects of data set. i added column (bp) dataset , able colorise graph boat phase. boatphs fit se lower upper bp 1 before 3.685875 0.3287521 3.038621 4.333130 before 2 after0-20nta 3.317189 0.6254079 2.085872 4.548506 after0-20 3 after0-20taa 5.579384 0.5696270 4.457890 6.700878 after0-20 4 after0-20tap 3.932360 0.4304098 3.084960 4.779760 after0-20 5 after20-40nta 4.522714 0.7771793 2.992586 6.052842 after20-40 6 after20-40taa 4.505207 0.5500699 3.422217 5.588196 after20-40 7 after20-40tap 3.602183 0.3880538 2.838174 4.366192 after20-40 8 approachnta 4.039599 0.5688482 2.919638 5.159560 approach 9 approachtaa 4.421112 0.5176408 3.401969 5.440255 approach 10 approachtap 4.497809 0.3978328 3.714547 5.281071 approach # speed plot spdplot <- ggplot(y, aes(x=boatphs, y=fit, colour=bp, ymax=max(fit)*1.05)) + geom_point(position = position_dodge(width = 0.5, height = 0), size = 2) + geom_e...

cognos - Geting prompt values from another query through functions -

i beginner in cognos 10. want know how value of prompt query1 , use on query2. requirement want prompt ask year want data in query1 , in query2 want data relevant previous year entered in prompt. how that? you can use same parameter (tied prompt) in filters in both queries. if parameter parameter1 , contains four-digit year, , data item in filter [year] query1 filter might this: [year] = ?parameter1? your query2 filter be: [year] = ?parameter1? - 1 depending on data source may have cast string parameter integer before doing subtraction though sql implementations implicitly convert string parameter integer you.

How to use BouncyCastle's Diffie-Hellman in C#? -

i'm writing app that'll exchange data between phone , windows pc, , want protect data sent key generated diffie-hellman exchange. i'm trying use bouncycastle that, non-existant documentation c# implementation has me stumped. what want know is: what's workflow generating dh key , computing shared key when other side's key received? (i'm assuming can send key string , can work other side's key string.) objects/methods use in c# that? alright, after lot of trial, got working. posting answer in case else needs it. i'll assume reader (1) knows diffie-hellman , it's useful (read here details) , (2) imported bouncycastle .net project via nuget. imports you'll need: using org.bouncycastle.crypto; using org.bouncycastle.crypto.generators; using org.bouncycastle.crypto.parameters; using org.bouncycastle.security; how generate g , p: public dhparameters generateparameters() { var generator = new dhparametersgenerator(); ...

AngularJs Memory Leak : scope $$watchers increase even if the watched elements are removed -

i've got big issue angularjs application... i load html content server (custom forms). of course, loaded html contains ng-show , ng-click etc... so, $compile before append in page. that's works fine. but, each time $compile loaded html, adds more $$watchers in scope (certainly ng-show watchers). here little demo/simulation : http://plnkr.co/edit/6ssazsfaugze5xmcyks7 my problem : that $$watchers won't never decrease , cause memory leak if click hundreds time on "load some". i've tried remove() , empty() , unbind() elements (the links) $$watchers array keep growing , never cleaned. how can resolve issue ? how can clean useless $$watchers or "uncompile" ? thanks !!! since new elements compiled same scope , on same element, watchers never removed. all watchers removed when scope destroyed ( scope.$destroy() ) happens automatically when element removed. element never removed, keep replacing html new nodes. a ...

how link menu to new page in android -

this code, crashes: public boolean oncreateoptionsmenu(menu menu) { submenu sub = menu.addsubmenu(0, 1, 1, "register"); sub.add(0, 3, 1, "register book"); sub.add(0, 4, 2, "register new book"); menu.add(0, 2, 2, "report"); return super.oncreateoptionsmenu(menu); } public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()){ case 4: intent intent = new intent(bookactivity.this, newbookactivity.class); bookactivity.this.startactivity(intent); break; return super.onoptionsitemselected(item); } }

VirtualHost on Apache 2.4 with PHP-FPM Getting proxy_fcgi:error -

i trying make virtualhost wordpress project that's being hosted on ec2 instance apache 2.4 php-fpm. of resources being loaded (mostly scripts , other php) getting 404 error , when in error log virtual host, following errors [tue mar 17 01:01:56.026492 2015] [proxy_fcgi:error] [pid 3382] (22)invalid argument: [client 173.79.19.155:61617] ah01075: error dispatching request : (passing brigade output filters), referer: http://52.21.23.15/project/ [tue mar 17 01:01:56.816915 2015] [proxy_fcgi:error] [pid 2895] [client 173.79.19.155:61618] ah01068: got bogus version 116, referer: http://52.21.23.15/project/ below virtual host portion of conf <virtualhost *:80> servername project.com serveralias www.project.com documentroot /var/www/html/project proxypassmatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/project/$1 <directory /var/www/html/project> options indexes followsymlinks allowo...

python - monitor Core utilization in Solaris Sparc -

i trying read sparc hw counter using following command: cpustat -c instr_cnt .1 this command running forever (for time until interrupted user). sample output is: time cpu event pic1 1.011 0 tick 6450 1.011 1 tick 9681 1.011 2 tick 2015 1.012 3 tick 535 1.012 4 tick 615 1.012 5 tick 7513 1.012 6 tick 615 1.013 7 tick 5187 1.013 8 tick 615 1.013 9 tick 615 1.013 10 tick 615 1.014 11 tick 60077 1.014 12 tick 438 1.014 13 tick 615 1.014 14 tick 615 1.015 15 tick 615 1.015 16 tick 615 1.015 17 tick 438 1.016 18 tick 615 1.016 19 tick 615 ^c now trying every 4 cpu's in core (each core has 4 cpus), add number in pic1 , average them. once average reaches threshold number, want load balancing. i think logic is: put elements line 2 in array, , add ...

WSO2 DSS appends timezone information to mysql date result -

so i'm trying use dates mysql on wso2 dss. simple code <query id="testdates" useconfig="portfolios_ds"> <sql> select date(date) date datetest </sql> <result element="jsonobject" rowname="jsonarray"> <element column="date" name="testdate" xsdtype="date"/> </result> </query> so returns "2015-03-10-04:00" isn't considered valid date many libraries (momentjs in particular) , fair strange format, why care timezone without time. does know why appending timezone, how can prevent appending of timezone dates leave on datetimes? i able reproduce issue dss 3.5.0 version. have created public jira ticket [1]. , once fixed notify you. in meantime workaround, suggest use xslt transformation trip off timezone information. more information how use xslt inside dss server please refer [2] [1]. https://wso2.org/jira/browse/ds-1191 [2]. https://docs...

javascript - ClearInterval() does not work on existing interval -

i have written following function school project, clearinterval() not working. have looked @ several questions same problem , problem scope of time. however, think function uses global variable, should work. doesn't, , have no idea why. please enlighten me. html (actually part of table similiar rows) <tr id="row35" data-uitval="1" class=""> <td> <button type="button" id="knopje" class="tabeluur" data-uur="35" onclick="check(this)"> <p>✕</p> </button> </td> <td> other cells... </td> </tr> code (javascript, in <head> -tag) var fadingfunc; var busy = false; function check(uurid) { if(busy) { $('#foutmelding').html('uw vorige bewerking loopt nog. wacht totdat deze afgelopen.') } else { uitval(uurid); }; }; function uitval(uurid) { // makes...

Link eBay and PayPal Sandbox accounts -

i trying link ebay sandbox account paypal sandbox account can end end testing. i've followed instructions here: http://developer.ebay.com/devzone/guides/ebayfeatures/development/paypal-sandbox.html however, clicking on "link paypal account" correctly takes paypal account sandbox log in - after log in sandbox user account, nothing happens , no link established. not right. i've reported ebay, far no response , wonder if know of way achieve this? have tried other way around? log in paypal sandbox account @ http://sandbox.paypal.com , , link ebay account paypal account profile.

java - Implementing a deadlock detection algorithm; issue with the loops -

i have been looking past 3 hours, , can't find problem code. user inputs number of processes , number of types of resources , algorithm determines if there deadlock or not. problem in steptwo() method have checked in first block of code, , fine. here pseudocode: https://www.dropbox.com/s/dt9cvk5h3ij7wqz/deadlockdetection.jpg?dl=0 here main, variables, etc.: public class assignmentiii { public static int numprocesses; // represents number of processes public static int numresources; // represents number of different types of resources public static int[] available; // create matrix available processes public static int[][] allocation; // create allocation matrix public static int[][] request; // create request matrix public static int[] work; // create work matrix public static boolean[] finish; // create finish matrix public static void main(string[] args) throws filenotfoundexception { try { scanner scan = new scanner(system.in); scanner ...

ios - Making a method -

how make method accepts object of type nsarray called objects , can called different view controllers such last method called savecontext ? //save core data coredatastack *coredatastack = [coredatastack defaultstack]; leanmessage *message = [nsentitydescription insertnewobjectforentityforname:@"leanmessage" inmanagedobjectcontext:coredatastack.managedobjectcontext]; (nsdictionary *lean in objects) { [message setvalue:[lean objectforkey:@"objectid"] forkey:@"objectid"]; [message setvalue:[lean objectforkey:@"senderid"] forkey:@"senderid"]; [message setvalue:[lean objectforkey:@"recipientid"] forkey:@"recipientid"]; [message setvalue:[lean objectforkey:@"messagebody"] forkey:@"body"]; [message setvalue:[lean objectforkey:@"timestamp"] forkey:@"timestamp"]; } [coredatastack savecontext]; .h file @interface ... ... - (void)myme...

javascript - Why can't I pass a json array as data when doing GET request with jquery ajax? -

if run request this: $.ajax({ url: 'http://localhost:8000/api/points/', contenttype:"application/json", datatype: "json", data: json.stringify({"content_type":content_type,"object_id":object_id}), type: 'get', }).error(function(r){ $(output).text('error') }) .success(function(r){ $(output).text(r.count); }) its request goes to: http://localhost:8000/api/points/ ?{%22content_type%22:8,%22object_id%22:40} obviously that's bad. works okay if don't json.stringify() , why that? curiously if post request it's opposite! have stringify data or won't work. why difference? first of let's fix request: var req = $.ajax({ method: "get", url: "http://localhost:8000/api/points/", datatype: "json", // telling jquery kind of response expect. data : {id : '12345'} }); req.done(function(data){ // data }...

Vim: Delete from cursor to next period -

is there shortcut in vim delete current cursor end of sentence? cursor v half sentence. cursor here, delete period. not want delete part. ^ delete cursor here imagine cursor somewhere on text says my cursor here, . how can delete line way (and including) next . ? though there's no exact motion that, there several possibilities: the ) motion deletes remainder of sentence, includes whitespace after period. if there no hard line break, use useful f motion (which works in current line, unless install plugin): f. useful if want keep period: t. the general motion search via / . need search literal period ( \. ), , include it, move end ( /e ) of it: /\./e<enter> . all of these have appended d "delete" command, takes {motion} . learn how commands , navigate built-in :help (here, :help motion.txt in particular); comprehe...

wrapper - How to wrap 1-2 or more of the same class using JQuery but not getting to wrap it with a different class in between? -

to make visually understandable, want this: <div class="wrap"> <input type="hidden" /> <input type="hidden" /> <div class="a">content</div> <input type="hidden" /> <input type="hidden" /> <input type="hidden" /> <div class="a"></div> <input type="hidden" /> <div class="a"></div> <input type="hidden" /> <input type="hidden" /> <div class="bee"></div> <input type="hidden" /> <input type="hidden" /> <div class="a"></div> <input type="hidden" /> <input type="hidden" /> <div class="cee"></div> <input type="hidden" /> <input type="hidden" /> ...

ios - Gps map is working in iphone but not working in ipad? -

i developing universal app. here developing gps map concept working fine in iphone not working in ipad. requirements getting current location using gps & gave 1 destination place, have 1 marker line current location destination places (ex:banglore(current location) mumbai (destination location)). this working in iphone in ipad not working showing google map. need implement requirements ipad code base. could please me resolve issues. - (nsstring *)stringwithdistance:(double)distance { nslog(@"%f",distance); nsstring *format; if (distance < meters_cutoff) { format = @"%@ metres"; } else { format = @"%@ km"; distance = distance / 1000; } return [nsstring stringwithformat:format, [self stringwithdouble:distance]]; } // return string of number 1 decimal place , commas & periods based on locale. - (nsstring *)stringwithdouble:(double)value { nsnumberformatter *numberformatter = [[n...

wpf - DrawingContext.PushOpacityMask() with BitmapImage does not work -

Image
i want take given bitmapimage , use grayscale/black-and-white representation opacity mask on drawingcontext. i got far enough color conversion, ended follwing state of demo application: method on viewmodel: public void demo() { var width = 400; var height = 400; var target = new rendertargetbitmap(width, height, 96, 96, pixelformats.pbgra32); var target2 = new rendertargetbitmap(width, height, 96, 96, pixelformats.pbgra32); var drawingvisual = new drawingvisual(); var drawingvisual2 = new drawingvisual(); using (var drawingcontext = drawingvisual.renderopen()) { var bitmapimage = new bitmapimage(new uri(@"pack://application:,,,/warningfilled.png")); using (var drawingcontext2 = drawingvisual2.renderopen()) { drawingcontext2.drawimage(bitmapimage, new rect(0, 0, width, height)); } target2.render(drawingvisual2); ...

ios - Open application directly when NSLocalNotification is recieved -

as question states, possible open application, without interaction user, whenever local notification or repeat received or being fired phone? no. there no way since ios don't allow that.

html - Can't get image to center when I change the browser size -

i've created image using gimp , have imported website creating. reason not want center when resize browser. in addition, unless set it's position absolute, moves middle of page( want center, top). believe has size of image. 1920x1080 , used size because of quality, think background getting used when import it. i've tried in gimp cut out background. suggestion on code or how fix in gimp great. <div id="logo"> <img src="dtw logo\dtw2_logo_colombianflagcolortopcropped.png" > </div> body{ margin: 0px; padding: 0px; height: 100%; width: 100%; } #logo{ margin: -368px 450px 0px 0px; position: absolute; width: 100%; } use css width property in percentage measurement, , margin set auto on both side left , right, css #logo{ margin:0px auto; top:0px; width:100%; text-align: center; } view demo jsfiddle set image width on percentage: img{ width: 15%; /*width: 75px */ } view jsfiddle ...

git - How to merge latest changes from a base repo to a forked repo -

2 years ago had forked git repository. after made changes on our side not have changed little things in many files. now there fixes+features in base git repo had forked. since want include changes our forked one, keeping our local changes constant. is there way merge latest repo changes our forked repo keeping our local changes is? if changes isolated onto own branch, can pull changes in upstream repository. git pull mind you, equivalent git fetch && git merge operation. if want include these new changes specific branch, you'll have merge them in via git merge . bear in mind, changes code base on 2 years old, you'll run merge conflicts. @ point, you'll want figure out what's changed old api new api , determine best way move forward.

linux - Extract string between two / from right -

extract string between 2 / right command preparation: input:- [directories name not constant] example 1:- /dir1/dir2/ example 2:- /dir1/dir2/dir3/dir4/ i want output below example 1 output:- nohup dsmc arch /dir1/dir2/ -subdir=yes > /tsm/backuplogs/dir2_`date +%d%m%y_%h_%m`.log & example 2 output:- nohup dsmc arch /dir1/dir2/dir3/dir4/ -subdir=yes > /tsm/backuplogs/dir4_`date +%d%m%y_%h_%m`.log & use basename program extract last dir paths, this: path=/dir1/dir2/dir3/dir4/ echo "nohup dsmc arch $path -subdir=yes > /tsm/backuplogs/$(basename $path)_\`date +%d%m%y_%h_%m\`.log &" the above line output: nohup dsmc arch /dir1/dir2/dir3/dir4/ -subdir=yes > /tsm/backuplogs/dir4_`date +%d%m%y_%h_%m`.log &

sapui5 - Sap UI 5 css on button -

i trying implement css on button. not working. <core:view controllername="sap.hcm.address" xmlns="sap.ui.commons" xmlns:core="sap.ui.core" xmlns:html="http://www.w3.org/1999/xhtml"> <html:style> .mysuperredbutton { color: red; } </html:style> <panel> <button class="mysuperredbutton" text="press me!"/> </panel> <core:view> reference link: http://www.spyvee.com/saphtml5_demokit/docs/guide/mvc.html the button consists of multiple html/dom elements. there might styles applied on of inner control elements well. happened in case: .sapmbtninner { color: #333333; } overrides css. can overcome either using !important (the less-preferable way): .mysuperredbutton { color: red !important; } or referencing inner class: .mysuperredbutton .sapmbtninner { color: red; } if more interested in inner html of control can either chec...

multithreading - "Cross-thread operation not valid" - Except, I'm not performing a cross-thread operation. C# -

i've seen lot of suggestions resolving error: "an exception of type 'system.invalidoperationexception' occurred in system.windows.forms.dll not handled in user code additional information: cross-thread operation not valid: control 'picturebox4' accessed thread other thread created on." the problem is, issue doesn't apply solutions i've seen. not cross-thread operation. here's code: private void green() { // declare initial variables int xgreen = 64; // bitmap picturebox bitmap bmp = (bitmap)picturebox4.image; // search through each pixel via x, y coordinates, examine , make changes. dont let values exceed 255 or fall under 0. (int y = 0; y < bmp.height; y++) (int x = 0; x < bmp.width; x++) { color c = bmp.getpixel(x, y); int myred = c.r, mygreen = c.g, myblue = c.b; mygreen += xgreen; ...

html - Selected color in Yellow using webview -

Image
i'm displaying text in uiwebview.now if select of text selected color in blue. want display selected color in yellow. , if deselect selected text in normal color. can 1 out???

Haskell types [Integer->Integer] -

y = [\a->a+3, \b->1 , \c->c*c] i recognize function y has type of [integer->integer] , implies return list of function , each function takes integer return integer. however, have trouble figure out input of function , give me example? there isn't input. y not expect parameter, provides list of function of type integer -> integer (or more precisely: num => -> a ). how can useful? well, can use in many ways, examples: >>> let y = [\a->a+3, \b->1 , \c->c*c] >>> map (\f -> f 3) y [6,1,9] >>> sequence y 4 [7,1,16] >>> head y 10 13

How to stop overriding the files in module's config.xml in magento? -

actually module overriding 2 files. module overriding default search. here code :- <models> <catalogsearch> <rewrite> <indexer_fulltext>wy_searchindex_model_catalogsearch_indexer_fulltext</indexer_fulltext> <layer>wy_searchindex_model_catalogsearch_layer</layer> </rewrite> </catalogsearch> ... now want doing module enable/disable admin & suppose disabled admin should not override 2 files above & default search run. now can't put ifconfig in config.xml right? :- <models> <catalogsearch ifconfig="searchsphinx/general/enabledornot"> so can done? did right - put condition in 1 of file i.e. module's layer.php file - if(!mage::getstoreconfig('searchsphinx/general/enabledornot')) { //this call default module's search...there no method inside below class class wy_searchindex_model_catalogsearch_layer extends wy_searchindex_model_catalogsearch_layer_extends { } } e...

c++ - How to install headers while no library is present (A header-only lib)? -

i need install headers ( .hpp ) in standard include dir. how tell automake install them while there no object compiled? put lines in makefile.am : lib_ltlibraries = libfoo.la libfoo_la_sources = \ foo.cpp \ bar.cpp foo_includedir = $(includedir)/foo foo_include_headers = \ foo.hpp \ bar.hpp \ ../config.h you can use _data primary: foodir = $(includedir)/foo foo_data = foo.hpp bar.hpp ../config.h

java - Rotate an imageView at an angle using Seekbar -

Image
i want rotate an image min max . have used multiple images show progress . can 1 suggest me way use single image. can rotate @ angle min max. i know there 2 possible ways achieve it. using animation classes custom view i want rotate image using seekbar in number of steps . how can achieve this? to roate image private void rotate(float degree) { final rotateanimation rotateanim = new rotateanimation(0.0f, degree, rotateanimation.relative_to_self, 0.5f, rotateanimation.relative_to_self, 0.5f); rotateanim.setduration(0); rotateanim.setfillafter(true); imgview.startanimation(rotateanim); } second approach imageview.setrotation(angle); // requires api >= 11 i can use matrix matrix matrix = new matrix(); imageview.setscaletype(scaletype.matrix); //required matrix.postrotate((float) angle, pivx, pivy); imageview.setimagematrix(matrix); how can set start , end angle seekbar min , max respectively. approach better , w...

Android: populating Linear Layout programmatically, It gets extra space -

Image
i'm trying populate linearlayout horizontally imageviews programmatically. in horizontal directon, works well, reserves space vertically don't want. here xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="es.uam.dadm.jacopo_grassi_connecta4.settings" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/your_color" /> <linearlayout android:layout_wi...

ios - UIPickerView is not working -

i have question how use uipickerview. have 2 vc connected between push segue, in 1 put uipickerview 5 names of colours , in other have tableview, question is, want change colour on cell background when select pickerview, down here have code how tried do. please if have idea how glad. in advance!!!! -(void)pickerview:(uipickerview *)pickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component { switch (row) { case 0: self.color.text = @"blue #0000ff"; self.table.vi.backgroundcolor= [uicolor colorwithred:0.0f/255.0f green: 0.0f/255.0f blue:255.0f/255.0f alpha:255.0f/255.0f]; break; case 1: self.color.text = @"green #00ff00"; self.view.backgroundcolor = [uicolor colorwithred:0.0f/255.0f green: 255.0f/255.0f blue:0.0f/255.0f alpha:255.0f/255.0f]; break; case 2: self.color.text = @"orange #ff681f"; self.view.backgroundcol...

javascript - Dynamically change Dojo multiselect values -

i want add multiselect widget form set values. , when user clicks on button, values inside multiselect widget changes. when form crashes. this sample code issue: <script type="text/javascript" > function test(){ var msobj = dijit.byid('ms1'); msobj.set('label', ['val1', 'val2']); } </script> </head> <body class="claro"> <h2>multiselect test</h2> <h3>click on test button see new data loaded in multiselect widget</h3> <div data-dojo-type="dijit/form/form" enctype="multipart/form-data" action="" method="post"> <div data-dojo-type="dojox/layout/tablecontainer" data-dojo-props="cols:1"> <select id="ms1" data-dojo-type="dijit/form/multiselect" title="multiselect123:" name="multi_sele...

ios - Apple watch app entry point -

in xcode need specify initial interface controller watch app, entry point of watch app, shown first when open it. but shown every time open watch app? example open watch app, navigate page, close it, , open again. open on page last time (like on ios), or again on first interface controller? according apple documentation : normally, watchkit displays first interface controller in sequence initially. well, not every time. looked through watch app videos watch presentation event, there wasn't case when opened app twice. that's great question! main entry point first off, can avoid showing maininterfacecontroller each time. see thread more information detail how use entry point launch appropriate set of interfacecontroller objects. watch extension lifecycle it important understand expected lifecycle of watch extension is. run while user has watch , running app. 1-5 seconds (opinionated value). user lowers wrist, watch extension terminated complet...

java - Regular Expression negate whole regex -

i want parse string regular expression groups: {4: :35b:isin de000xxxxxxx disc.z 11.11.11 xxxx90 1234 (hsbc t r.? b.) /f:12345/r:n/w:n/c:n/s:n/g:n/a:n/f:n /xx/any word :16s:confdet :16r:setdet :22f::setr//trad :11a::fxib//eur :16r:amt :19a::deal//eur222, :16s:amt :16r:amt :19a::loco//eur555 :16s:amt :16r:amt :19a::othr//eur444 :16s:amt :16r:amt :19a::sett//eur333,33 :16s:amt :16s:setdet -} i created regex (:\d\d[a-za-z]:*(\w*\/\/)?|:\d\d:)([^:]+) matches in of cases, not in one. want extract groups this: :35b: => isin de000xxxxxxx disc.z 11.11.11 xxxx90 1234 (xxxx t r.? b.) /f:12345/r:n/w:n/c:n/s:n/g:n/a:n/f:n /xx/any word :16s: => confdet :16r: => setdet ... i expected there no ':' in second group. maybe can me. need extact whole sting until next :\d\d\w: block. edit: input string has key-value structure. example :35b: key , behind until next key value (in case of example value 'isin de000xxxxxxx disc.z 11.11.11 xxxx90 1234 (xxxx t r.? b.) /f:1...