Posts

Showing posts from September, 2012

python - How to type in arguments in the middle of the code? -

we can thing type in arguments: from sys import argv script, argument_1, argument_2 = argv is possible type in arguments in middle of code, not in beginning? i want smth same: print "la-la-la" print "any string" # , here want program take file name argument work file have @ argparse python class command line parsing

hadoop - Removal Double Quote(") from CSV file using PIG -

i trying remove double quotes(") file.some of field has data "newyork,ny". please advice me do?i have tried delete (") csv.but not happening.stepwise codes given below: i opening pig using pig -x local 1st step: test4 = load '/home/hduser/desktop/flight_data.csv' using pigstorage(',') ( year: chararray, quarter: chararray, month: chararray, day_of_month: chararray, day_of_week: chararray, fl_date: chararray, unique_carrier: chararray, airline_id: chararray, carrier: chararray, tail_num: chararray, fl_num: chararray, origin: chararray, origin_city_name: chararray, origin_state_abr: chararray, origin_state_fips: chararray, origin_state_nm: chararray, origin_wac: chararray, dest: chararray, dest_city_name: chararray, dest_state_abr: chararray, dest_state_fips: chararray, dest_state_nm: chararray, dest_wac: chararray, crs_dep_time: chararray, dep_time: chararray, dep_delay: chararray, dep_delay_new: chararray, dep_del15: chararray, dep_

Regex - Not null parameter -

i use expression check if paramater is null or not null : ^$ but opposite want. how can check if not null ? how can check if not null? use regex make sure @ least 1 character there in input (non-empty): /./

ios - Working with the AppDelegate file to create a single shared iAd banner in Swift -

Image
i trying follow steps here create shared iad banner view controllers in application. couldn't understand how do in app delegate since i've never touched app delegate before. the instructions were: has worked before?

c# - MVC Model binding issue - list of objects -

the scenario shopping basket - user update text box quantity , hit update button. currently, upon hitting update button, action hit model properties null. my first thoughts there issue binding because ids of controls changed each row. are thoughts correct? if so, how can resolve this? edit: tried use loop, rather foreach didn't work either. code below: <table class="order-table order-table-nomargin order-table-noborder hidden-xs hidden-sm"> <thead> <tr><th>products</th><th></th><th>price</th><th>qty.</th><th>total</th></tr> </thead> <tbody> @foreach (nop.web.models.custom.customorderline ol in model.cart.orderlines) { @html.displayfor(m => ol) } </tbody> </table> this displayfor template: @model nop.web.models.custom.customorderline <tr> <td> <img alt="book image" src=&q

javascript - Convert dd-mm-yyyy string to date -

i trying convert string in format dd-mm-yyyy date object in javascript using following: var = $("#datepicker").val(); var = $("#datepickertwo").val(); var f = new date(from); var t = new date(to); ("#datepicker").val() contains date in format dd-mm-yyyy. when following, "invalid date": alert(f); is because of '-' symbol? how can overcome this? parse string parts need: var = $("#datepicker").val().split("-"); var f = new date(from[2], from[1] - 1, from[0]); why not use regex? because know you'll working on string made of 3 parts, separated hyphens. however, if looking same string within string, regex way go. reuse because you're doing more once in sample code, , maybe elsewhere in code base, wrap in function: function todate(datestr) { var parts = datestr.split("-"); return new date(parts[2], parts[1] - 1, parts[0]); } using as: var = $("#datepi

c# - Error in my XAML Project -

i made windows app , done changes when start debug(run) app, following error occurred can please. error 1 not write output file 'c:\users\muhammadashbal\documents\visual studio 2012\projects\hotel\hotel\obj\debug\intermediatexaml\hotel.exe' -- 'access denied. ' c:\users\muhammadashbal\documents\visual studio 2012\projects\hotel\hotel\csc hotel i tried many ways in vain. try below: a) open vs administrator , build , run. b) open project folder, check property of folder, un-check read option , try building solution.

Creating charts in java or javascript without images -

one of project requirements new java web project have dynamic charts load fast. while in discussion , asked if implement charts without using images ie without loading jpg, png files etc. files pdf cannot used. basically question can charts implemented in jsp/javascript without using images,pdf etc ? ie api's used should not provide end result image,or pdf etc. i did not no right away , have implemented charts in console applications in c on screen. can on webpage ? ie show graph drawing on screen dots,lines,circles etc.but should possible inside div ? ps : comments , answer lucien stals helped understand technology looking svg. i looking nudging in right direction of experienced java , javascript programmers in so. a simple bar chart easy enough create divs , css. more complicated , think talking svg, drawn using http://raphaeljs.com/ , or maybe http://d3js.org/ . @ html5 canvas element.

XFS CEN not update printer status of ATM -

i want atm journal printer status using wfsgetinfo() xf api function. returns status not updated. hresult resultexec= wfsgetinfo( hser,wfs_inf_ptr_status,null,wfs_indefinite_wait,&lp); printf("\n printer result deviceasync===> %d \n", ((lpwfsptrstatus)lp->lpbuffer)->fwdevice); switch(((lpwfsptrstatus)lp->lpbuffer)->fwdevice) { case wfs_ptr_devonline : printf("\n printer result wfs_ptr_devonline : device online. \n"); break; case wfs_stat_devhwerror: printf("\n printer result wfs_stat_devhwerror : device inoperable due hardware error.\n"); break; case wfs_ptr_devnodevice: printf("\n printer result wfs_ptr_devnodevice : there no device intended there; e.g. type of self service machine not contain such device or internally not configured.\n"); break; case wfs_ptr_devoffline:

vagrant - Setting "Paravirtualization Interface" in Vagrantfile -

virtualbox 5 exposes setting called "paravirtualization interface" can improve performance specific guest operating systems. is there way set option in vagrantfile? and in general: there documentation on how set acceleration settings via vagrantfile? found it. vboxmanage (the virtualbox cli tool) has optional argument called --paravirtprovider . can add vb.customize call: vagrant.configure(2) |config| config.vm.box = "ubuntu/trusty64" config.vm.provider "virtualbox" |vb| vb.customize [ "modifyvm", :id, "--memory", "1024", "--paravirtprovider", "kvm", # linux guest "--cpus", "2" ] end end the other cpu settings available way, vb.customize accepts same argument vboxmanage . refer vboxmanage --help list of options.

python - Hiding lines after showing a pyplot figure -

Image
i'm using pyplot display line graph of 30 lines. add way show , hide individual lines on graph. pyplot have menu can edit line properties change color or style, rather clunky when want hide lines isolate 1 you're interested in. ideally, i'd use checkboxes on legend show , hide lines. (similar showing , hiding layers in image editors paint.net) i'm not sure if possible pyplot, open other modules long they're easy distribute. if you'd like, can hook callback legend show/hide lines when they're clicked. there's simple example here: http://matplotlib.org/examples/event_handling/legend_picking.html here's "fancier" example should work without needing manually specify relationship of lines , legend markers (also has few more features). import numpy np import matplotlib.pyplot plt def main(): x = np.arange(10) fig, ax = plt.subplots() in range(1, 31): ax.plot(x, * x, label=r'$y={}x$'.format(i)

json - Error getting Object from NSDictionary -

i have array below ( ( "id:19", "name:virgin club house heathrow", "address:heathrow airport, 234 bath road, hayes, middlesex", "postcode:ub3 5ap", "latitude:51.48127", "longitude:-0.448696" ), ( "id:20", "name:le bilboquet", "address:20 e 60th st, new york, united states", "postcode:ny 10022", "latitude:40.764072", "longitude:-73.970834" ) ) which enumerating through using [venuesarray enumerateobjectsusingblock:^(nsdictionary* obj, nsuinteger index, bool *stop) { nsstring* tmpstr; tmpstr = [obj objectforkey:@"id"]; }]; however i'm getting error -[__nscfarray objectforkey:]: unrecognized selector sent instance 0x7ff26866a690. like said, have array. though block calling objects getting nsdictionary , being gi

excel - VBA updating data series forumla changing formatting -

i'm having unexpected issue code. it's suppose update 2 data series of chart object dynamically. i've added series collection(a total of 3 series now). data series update problem formatting 3 series swap around between each other every time update occurs. here code below updating occurs: dim wrksheet string wrksheet = application.worksheets(x).name if background > 0 'update background data series application.worksheets(x).chartobjects("main chart").chart.seriescollection(2).formula = _ "=series(""background"",('" & wrksheet & "'!$j$32:$j$" & (32 + background - 1) & ",'" & wrksheet & "'!$j$" & backgroundstart2 & ":$j$" & (backgroundstart2 + background - 1) & ")," _ & "('" & wrksheet & "'!$k$32:$k$" & (32 + background - 1) & ",'" & wrkshe

ipv6 - Find and set IP version within nginx configuration -

from can tell from list , there no dedicated nginx variable check if client connecting via ipv4 or ipv6, since server supports both. i'd set variable pass php within fastcgi.conf so: fastcgi_param ip_version $ip_version is there way determine ip version without using evil ifs , pass along? i'm aware can perform check within php, we'd use nginx if possible, while still maintaining stellar performance.

android - Display 3 buttons in a row IN a scroll view -

at moment have list of buttons showing in scrollview buttons on left hand side , go down in 1 column. i these buttons shown in columns of 3, 3 buttons in 1 row when add row dynamically here current code have display these buttons // find scrollview scrollview scrollview = (scrollview) findviewbyid(r.id.scrollview); // create linearlayout element linearlayout linearlayout = new linearlayout(this); linearlayout.setorientation(linearlayout.vertical); // add buttons (int = 0; < 3; i++) { linearlayout.setlayoutparams(new viewgroup.layoutparams(viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content)); (int j = 0; j < 20; j++) { button button = new button(this); button.settext("some text"); linearlayout.addview(button); } } // add linearlayout element scrollview scrollview.addview(linearlayout); } i tried setting layout parameters buttons d

php - How to call a function inside the bootstrap from a model in Zend? -

i have function on bootstrap.php like: function test() { echo "hello"; } i want call model. know can controller using $this->getfrontcontroller()->getparam('bootstrap')->test(); no clue on how model. help? i know it's not best have function on bootstrap , better have elsewhere, can't happen. you can front controller anywhere in application using zend.controller.front.methods.primary.getinstance $front = zend_controller_front::getinstance(); so think give result $front = zend_controller_front::getinstance(); $front->getparam('bootstrap')->test();

java - Using two LocalDateTime instances to calculate a duration -

i trying calculate duration between 2 instances of localdatetime . special thing here each instance of localdatetime anywhere in world: localdatetime start nevada , localdatetime end tokyo . each "time" associated localdatetime is, enough, local location. so if said... localdatetime start = localdatetime.parse("2015-07-14t10:00:00"); , said start represented chicago, mean 10:00 in chicago time. say... localdatetime end = localdatetime.parse("2015-07-14t03:00:00"); , end represents moscow, 3:00am in moscow time. can create robust enough solution allow start , end represent any cities in world , still correctly calculate duration between two? "localdatetime" not mean particular locality i think misunderstand purpose of localdatetime . "local" means any locality, not specific locality . in "christmas starts @ midnight on december 25, 2015" mean any locality’s midnight. christmas starts in pa

php mysql video upload not successfully functioning -

i getting following errors: warning: mysql_connect() [function.mysql-connect]: access denied user 'a5467268_andrew'@'10.1.1.19' (using password: yes) in /home/a5467268/public_html/andrew/fileupload.php on line 2 warning: mysql_select_db(): supplied argument not valid mysql-link resource in /home/a5467268/public_html/andrew/fileupload.php on line 3 <?php $con=mysql_connect("","",""); mysql_select_db("login",$con); extract($_post); $target_dir = "test_upload/"; $target_file = $target_dir . basename($_files["filetoupload"]["name"]); if($upd) { //$imagefiletype = pathinfo($target_file,pathinfo_extension); $imagefiletype= $_files["filetoupload"]["type"]; if($imagefiletype != "video/mp4" && $imagefiletype != "video/avi" && $imagefiletype != "video/mov" && $imagefiletype != "video/3gp" && $i

ruby - Real time data Rails- socket -

since rails 5 shipped action cable real time data transmission, i'm curious know more web sockets in ruby. i never worked socket in ruby know rails 4+ shipped actionlive real time data use case. but people using pusher-app real time data rails... could give brief idea actionlive vs pusher vs upcoming actioncable ? why pusher better actionlive? , how can take advantage that?

Relationships in Ruby on Rails: what is the proper model building method for a list? -

i'm trying figure out proper way setup model , database if have list under itineraries... database table `users` id `itinerary` id user_id items model class user < activerecord::base has_many :itineraries end class itinerary < activerecord::base belongs_to :user end this basics, if want have users input multiple items within itinerary? should have separate model , table that? under itinerary database table instead of items , should item_id ? `itinerary` id user_id item_id # change here and have separate items table: database table items id itinerary_id # relationship id name model class item < activerecord::base belongs_to :user belongs_to :itinerary end class itinerary < activerecord::base belongs_to :user has_man :items end or if isn't correct way, how display list of items within itinerary database table? thanks! adding answer of puce, has_many relationship, need not have column item_id under itinerary

objective c - iOS silent notification internet connection -

i know how implement silent notifications load app , reschedule local notifications if user not have internet connection? possible or silent notifications won't received unless there internet connection? silent push notification won't received unless there internet connection. silent push notification send server.

javascript - Plotting coordinates dynamically from XML file and refresh Markers only -

i'm trying plot markers on google maps coordinates xml file , below working script. xml dynamically updating. goal plot coordinates refreshing markers alone instead of whole page (currently achieving using auto refresh in 5 seconds). <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>work</title> <style> html, body { height: 100%; width: 100%; margin: 20; padding: 0; } #map_canvas { height: 100%;} </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=aizasyd5athizrrp1xlfheuvfcwz2kc4ogirbcw&sensor=false"></script> <script type="text/javascript" src="scripts/downloadxml.js"></script> <script> var infowindow; var map; function initialize() { var mapoptions = { zoom: 2, center: new

How to make two different packages access each other's classes without allowing any other third package to access it in java? -

i making project in netbeans , facing problem similar 1 asked on site - how share package private data between 2 packages in java? , slight difference of let's application developer can see codebase. thought make public class in package b 'communicator class' contructor having default package access , passing instance in constructor of classes of package a. stopping developer (using package c) instantiating classes inside package a. work not approach se-wise guess. besides question asked 3 years ago. there better approach/technique available neat and/or involves less coupling between packages , b. ps: new java. appreciated. you can introduce module has reference of other 2 packages , make module act bridge. 1 thing can done till java 8

c# - how i Fetch text from files on server? -

have web application cv uploading want fetch text during uploading have 2 types of cvs (word & pdf ) using itextsharp && microsoft.office.interop.word , works fine on server not working string mainer(string pathfile) { microsoft.office.interop.word.application word = new microsoft.office.interop.word.application(); string totaltext = ""; try { object miss = system.reflection.missing.value; // object truee = true; object otrue = false; object path = pathfile; object readonly = true; object pass = ""; microsoft.office.interop.word.document docs = word.documents.open(ref path, ref miss, ref readonly, ref miss, pass, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref otrue, ref miss, ref miss, ref miss, ref miss); (int = 0; < docs.paragraphs.count; i++) { totaltext

java - JavaFX doesn't change the font of its components -

i specified font in style .css file: -fx-background-color: #1e1c1e; -fx-font-family: "segoe ui", helvetica, arial, sans-serif; but idea underlines second line: "mismatched property value null". tried set font in following way: inputfield.setfont(font.font("segoe ui")); all same. font won't change. i'd ask because i'm stucked issue.

jquery - Datatables server side data response error -

i getting following error when try fetch data server side script datatables warning: table id=example - requested unknown parameter '0' row 0. more information error, please see http://datatables.net/tn/4 what doing wrong ? here's html <script> $(document).ready(function(){ $('#example').datatable({ serverside: true, "columndefs": [ { "title": "sr.", "name": "sr", "width": "5%", "targets": 0 }, { "title": "ecode", "name": "code", "width": "5%", "targets": 1 }, { "title": "employee name", "name": "name", "width": "25%", "targets": 2 }, { "title": "guardian", "name": "guardia

git - V8.NET trouble when building 3rd party tools -

i'm trying install v8.net https://v8dotnet.codeplex.com/ . it provides program downloads v8 , 3rd party tools( gyp,...). prerequisites installed git , subversion, , added path. have done both. when trying download 3rd party tools, 'build' not recognized internal or external command, operable program or batch file. *** previous step failed *** i suppose don't have program or batch file installed or added path, can't figure out program "build" cannot find anywhere. in v8.update.cmd there line echo downloading gyp ... git clone https://chromium.googlesource.com/external/gyp build/gyp >getgyp.log (line 56), can see, there build/gyp in new line, that's why windows recognizes command. delete new line , works.

php - Laravel 5 - why is input empty when returning with errors? -

i have form submits controller, validates data. if validation fails redirects input , errors. method deals form submission: <?php namespace app\http\controllers; use illuminate\http\request; use app\models\user; class usercontroller extends controller { /** * create new user. * * @param reqeust $request * * @return void */ public function postcreate(request $request) { $user = new user; $rules = $user->rules(); $rules['password'] = 'required|confirmed|min:8'; $v = \validator::make($request->except('_token', 'roles'), $rules); if ($v->fails()) { return redirect()->back()->withinput($request->except('_token', 'password', 'password_confirmation'))->witherrors($v); } $user->fill($request->except('_token', 'password', 'password_confirmation'));

Facebook app token not working, but access token works -

i have weird situation here, , i've looked everywhere through facebook's documentation no answers. i'm trying get recent posts multiple facebook pages. 1 of them keeps crashing. won't work when i'm using app token. works if i'm using access tokens, expire, it'd better not use that. https://graph.facebook.com/norgeshushonefoss/posts?access_token=myapptoken gives result: { "error": { "message": "unsupported request. please read graph api documentation @ https://developers.facebook.com/docs/graph-api", "type": "graphmethodexception", "code": 100 } } while url gives me recent posts: https://graph.facebook.com/norgeshus/posts?access_token=myapptoken i can't see difference in two. there page settings may cause app token not authorize reason? if page has access restrictions in place (age, location, alcohol-related content), can not access of info

Array of strings in Java NULL pointer exception -

i want make array of strings i not have fixed size it as must initialized, intialize null .. give java null pointer exception ??? in part of code , loop on array print contents.. how on error without having fixed size public static string[] suggest(string query, file file) throws filenotfoundexception { scanner sc2 = new scanner(file); longestcommonsubsequence obj = new longestcommonsubsequence(); string result=null; string matchedlist[]=null; int k=0; while (sc2.hasnextline()) { scanner s2 = new scanner(sc2.nextline()); while (s2.hasnext()) { string s = s2.next(); //system.out.println(s); result = obj.lcs(query, s); if(!result.equals("no match")) {matchedlist[k].equals(result); k++;} } return matchedlist; } return matchedlist; } if don't know size, list better. to avoid npe, have initialize

Javascript: Add HTML to string - make a link and add it to output -

new javascript, how fix problem i'm having? i want add a tag string variable i'm creating using function. the whole message (eg - "your tutor john doe. contact them here: contact form") added dom function (which works). when run script outputs browser second part ( makelink() ) doesnt work. this get: "your tutor john doe. contact them here http://www.example.com " - instead of url want word contact form should link. how do this? i tried using link() method, didnt work , had similar output. i'll include relevant script below, rest works fine... function makemessage(){ for(i in msgarr){ stringmsg += msgarr[i]; //do not add comma after last item if(i < msgarr.length - 1){ stringmsg += ', '; } } var highriskmsg = "your tutor " + stringmsg + ". contact them here" + makelink(); return highriskmsg; } function makelink() { var contact

intellij idea - LESSC to compile to a custom path using environment variable -

bottom line i need lessc compile main.less file $catalina_ec_tmp/main.css i'm working on project, need generate multiple output css files originating same source (less file) using lessc. so jet brain's (webstorm or intellij idea) file watcher, don't of options save output files custom path using environment variable. the reason why use environment variable because of outputted files in temporary path (it changes whenever deploy ant) that said ... this environment variable: $catalina_ec_tmp = '/foo/bar/' and it's changing in next deployment, won't /foo/bar/ anymore. and command line that's being executed ide compile less files /usr/local/bin/lessc --no-color main.less i need lessc compile main.less file $catalina_ec_tmp/main.css so resulting file in case /foo/bar/main.css or wherever $catalina_ec_tmp value is. i hope there's solution this, anyway if doesn't exist think i'll use fswatcher copy generated css fil

c# - How to check null collection? -

i have algorithm select data collection of reportdata private idictionary<guid, jobstatistic> getagentsstatistics(ilist<guid> agentids) { var agentreportitems = data in reportdata agentid in data.agentids agentids.contains(agentid) group data agentid; ... } but if agentids empty collection? how check situation? var agentreportitems = data in reportdata agentid in data.agentids agentids != null && agentids.contains(agentid) group data agentid; just check if it's null, , if it's not, use did.

magento got invalid login or password error for customer -

i added 1 customer programmatically , send mail customer new password , in admin side found customer when customer try login email id , password got error 'invalid login or password' here code problem this? define('magento_root', getcwd()); $magefilename = magento_root . '/app/mage.php'; require_once $magefilename; mage::init(); mage::setisdevelopermode(true); ini_set('memory_limit', '-1'); //for unlimited memory being more trickey ini_set('display_errors', 1); varien_profiler::enable(); umask(0); mage::app('default'); $customer_email = 'test@testemail.com'; // email adress pass questionaire $customer_fname = 'test_firstname'; // can set tempory firstname here $customer_lname = 'test_lastname'; // can set tempory lastname here $passwordlength = 10; // lenght of autogenerated password $customer = mage::getmodel('customer/customer'); $customer->setwebsite

Dropkick dropdown display image associated with default select value -

i'm passing default value dropdown on page load following code not display image associated selected value on load. if choose value dropdown after page loads, associated image displays intended. how image display when default value passed initially? ideas? $(document).ready(function(){ $('form .primary_choices').dropkick({ change: function (value, label){ $('#firstchoice').html(<image src=@imagepath' + '/' + label.replace(' ', '_').replace(' ', '_') + '.jpg" />'); } }); });

javascript - pass the object to function but can not recognize -

my code <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript"> function process(e) { alert("hello! alert box1!!"); e.hide(); }; $(document).ready(function() { var p = $("#id1"); //jquery object p.click(function() { process(this); //line }); }); </script> </head> <body> <p id=id1>if click on me, disappear.</p> </body> </html> the text dies not disappear when click, console reports error: typeerror: e.hide not function but if change code @ line below <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script&

How to turn off tooltips in wxpython -

i have tried: wx.tooltip.enable(false) wx.tooltip_enable(false) and wx.tooltip.enable(flag=false) none of theses instructions rejected , yet none of them work i'm using linux mint 17 wx.python 2.8.12.1 (gtk2-unicode) python 2.7 according wxpython docs , tooltip.enable seems to, enable or disable tooltips globally. note may not supported on platforms (eg. cocoa). which assume includes platform... instead, may need set tooltips window itself. there isn't tooltop_enable method can see window setting tooltip empty string seems trick me, import wx app = wx.app() frame = wx.frame(none, -1, '') frame.settooltip(wx.tooltip('')) frame.setsize(wx.size(300,250)) frame.show() app.mainloop() edit: define child tooltip class can enabled/disabled , defaults based on global value. import wx enabletooltips = false class tooltip(wx.tooltip): '''a subclass of wx.tooltip can disabled'''

How do I design a ruby equivalent objects for this json structure -

i have json structure need build based on url parameters provided client. i've been building json structure out using jbuilder.encode it's getting pretty hairy. self.query = jbuilder.encode |json| json.query json.filtered json.filter json.bool if(search_term && username) json.array!(should) ........ how can build ruby objects convert them json based on how initialized? below full json structure i'd capture in ruby models/poros (plain old ruby objects). { "query": { "filtered": { "filter": { "bool": { "should": [ { "query": { "query_string": { &q

android - ADB in decrypt stage of boot of touchless tablet -

current situation: i have asus tablet touchscreen broken broken touchscreen (the screen displays fine) inits in decrypt stage of boot (asks password, know, in order decrypt , boot real android) it has, probably, debugging mode disabled a mac with: adb utility (no full sdk) downloaded here . what need: access tablet via usb (like adb shell input text my_password ). what happens: i recognition of usb system_profiler spusbdatatype : usb: usb high-speed bus: host controller location: built-in usb host controller driver: appleusbehci pci device id: 0x0d9d pci revision id: 0x00a2 pci vendor id: 0x10de bus number: 0x24 android: product id: 0x4ce0 vendor id: 0x0b05 (asustek computer inc.) version: 2.24 serial number: e7okbc3***** speed: 480 mb/sec manufacturer: android location id: 0x24100000 / 3 current available (ma): 500 current required (ma): 500 i don't recognition adb d

php - Error inserting image in CKEditor -

i using ckeditor in php , trying store data ckeditor mysql table. when try store data works fine on localhost problem when put online. i inserting path in ckeditor image tool , path www.xxx.com/myfolder/abc.jpg shows image in ckeditor when click on submit gives \"\" when try print variable. try this, remove slashes add ckeditor fix issue, stripslashes($_post['content']);

vba - Automating Actions in Outlook 2013 -

i have folder of emails in outlook, , want able apply same action each email within folder, notice there no macro recorder within outlook's developer options. the process undertaking involves opening each email (as contains html content , want print in document quality image) selecting "view in browser" "actions" tab, , printing internet explorer. is there way iterate action within outlook each email within folder? have no clue how set without way of recording actions idea of how refer things within outlook module... you need learn little bit outlook's object model getting started vba in outlook 2010 . here little code started. macro loop through items in folder , check email address of recipient , set flag sub setflagicon() dim mpfinbox outlook.folder dim obj outlook.mailitem dim integer set mpfinbox = application.getnamespace("mapi").folders("jeanno").folders("sent mail") ' loop ite

javascript - Bootstrap not switching back and forth repeatedly between the same tabs -

recently i've come across ( http://bootsnipp.com/snippets/featured/e-mail-interface ) snippet , started experiment noticed there odd behaviour regarding switching , forth tabs. essentionally expierence when user switches tabs different hash location, switching works expected (#inbox -> #compose -> #trash -> #inbox). in event user switches repeatedly between same tabs i.e. #inbox -> #compose -> #inbox doesn't perform switch. is there in particulair causes behaviour? the structure of dom isn't supported bootstrap tab stuff . the 'compose' button should part of navbar ul . <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li style="padding-right:20px;border-right:1px solid #ccc;"> <p> <a type="button" class="btn btn-danger navbar-btn" style="height: 3

facebook javaScript sdk event invited not working properly -

i'm trying invited event via javascript. i've done log in, , have access event, have problem when request people invited. result, length of invited array 25 , should more. noticed people haves rsvp_status = "attending" fb.api( "/"+id+"/invited", function (response) { if (response && !response.error) { $scope.attending = response.data; $scope.$digest(); } } ); the count of people invited event should 103 , participants 51 25 standard limit of results returned graph api. either have implement paging (that preferred way, via paging object's next property), or increase limit of results via limit parameter. note limit can't set large number (like 10000), because graph api truncete results. afaik there's no documented maximum size. fb.api( "/"+id+"/invited?limit=200",

osx - How can I set an alias for a command in bash that works in any folder? -

so, have created bash_profile , set aliases, work in home folder (cd/). there way can use aliases whenever in? using bash in mac os x. thanks brothers. edit: it appears these aliases cd commands folders in home folder or scripts in home folder. example: alias jobs2015='cd documents/erickjones/_aotopo/_jobs/2015 i presume aliases either cd commands folders in home folder or run scripts in home folder. your options are: prefix command or cd-directories $home/ when define aliases. for commands, include home folder (or other folder scripts are) in path. for cd , include home folder in cdpath variable. path list of folders searched find command executed. can add directories it, careful not delete existing ones. see here: path cdpath list of folders cd folder search. see here cdpath

python - Block output window from an executable converted from .pyw using pyinstaller -

i converted python program executable (.exe) still see output window when launched executable. don't want output window because program background process. tried using .pyw extension before converting executable no success... i'm using pyinstaller convert executables. oh nevermind, know how. using --noconsole when converting .pyw i think works .py extension too sorry bad english..

scala - Spark running Liblinear unable to load JBLAS jar -

i'm running spark 1.4.0, hadoop 2.7.0, , jdk 7. i'm trying run example code of liblinear presented here. the liblinear jar works, when training model can't find jblas library. i've tried including jblas library in --jars option when launching spark, installing jar maven (although must add newbie spark maven did wrong). the specific error thrown this: java.lang.noclassdeffounderror: org/jblas/doublematrix @ tw.edu.ntu.csie.liblinear.tron.tron(tron.scala:323) @ tw.edu.ntu.csie.liblinear.sparkliblinear$.tw$edu$ntu$csie$liblinear$sparkliblinear$$train_one(sparkliblinear.scala:32)` when running line: val model = sparkliblinear.train(data, "-s 0 -c 1.0 -e 1e-2")` thanks. java.lang.noclassdeffounderror: org/jblas/doublematrix it seems did not add jblas jar. solution be: $ export spark_classpath=$spark_classpath:/path/to/jblas-1.2.3.jar after that, work fine. hope helps, le quoc do

xml - Parse a SOAP message with namespace in Python -

i trying parse following soap response using xpath , elementtree no luck. not sure if best way this? if it's not happy hear other suggestions. i have have cut down xml keep readable. <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soapenv:body> <ns1:selectcmdeviceresponse soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://ccm.cisco.com/serviceability/soap/risport70/"> <selectcmdeviceresult xsi:type="ns1:selectcmdeviceresult"> <totaldevicesfound xsi:type="xsd:unsignedint">24</totaldevicesfound> <cmnodes soapenc:arraytype="ns1:cmnode[4]" xsi:type="soapenc:array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item xsi:type="

javascript - How to debug background/event page suspended state -

i debug background script (non persistent) when goes sleep , wakes (and goes sleep again). clicking on "background page" prevent background script going suspended state, if kill page , open after while, fresh logs displayed, not ones printed before opening background page (from extensions page). so wondering how debug suspended/wake states of event page? edit : moved backstory own question here how prevent/detect race condition between processing , restoring store data when waking event page you log console , non-volatile storage @ same time. you can either use custom logging function, or overload console.log : console._log = console.log; console.log = function() { var args = arguments; console._log.apply(console, args); chrome.storage.local.get({consolelog : []}, function(data) { data.consolelog.push(args); chrome.storage.local.set({consolelog: data.consolelog}); }); } of course, should used while you're actively debugging.

python - How to go through files in a directory and delete them depending on if the "time" column is less than local time -

i new python , right trying go through directory of 8 "train" text files in which, example 1 says: paris - london 19.10 what want create code (probably sort of loop) automatically go through , delete files in time column less local time. in case, when train has left. want happen when start code. have manage happen when give input try open file, not manage make happen without input given user. def read_from_file(textfile): try: infile = open(textfile + '.txt', 'r') infotrain = infile.readline().rstrip().split(' ') localtime = time.asctime(time.localtime(time.time())) localtime = localtime.split(' ') if infotrain[2] < localtime[3]: os.remove(textfile + '.txt') print('this train has left station.') return none, none except: pass (be aware not whole function long , contains code not relate question) have solution? os.lis

Is there any Spark GraphX constructor with merge function for duplicate Vertices -

i have graph many duplicate vertices, different attributes(long). val vertices: rdd[(vertexid, long)] ... val edges: rdd[edge[long]] ... val graph = graph(vertices, edges, 0l) by default graphx merge duplicate vertices` attributes default function vertexrdd(vertices, edges, defaultval, (a, b) => a) so depends on order of vertices attribute stay in final graph. i wonder there way set merge func? becase example need merge duplicate vertices following function (a,b) => min(a,b) i did not find public constructor or else. do need create graph following code val edgerdd = edgerdd.fromedges(edges)(classtag[ed], classtag[vd]) .withtargetstoragelevel(edgestoragelevel).cache() val vertexrdd = vertexrdd(vertices, edgerdd, defaultvertexattr, (a,b)=>min(a,b)) .withtargetstoragelevel(vertexstoragelevel).cache() graphimpl(vertexrdd, edgerdd) you've answered of own question, if looking way control merge , otherwise still use existing

python - Ctypes - basic explanation -

i'm trying speed integration (scipy.integrate.quad) using ctypes. have never used c , don't understand ctypes documentation. give basic explanation of ctypes doing using few computing terms possible. please explain i'm 5! thanks a computer runs program following simple steps, known machine code or native code. @ level, number of handful of widths, , there millions of memory slots store them in. when writing program, higher level of abstraction desired, allowing name variables , subroutines, keep track of memory holds value, , on. native code not reveal information, stored program files (whether libraries or executables) have clues, such subroutine names. c source code supplies information in declarations, , libraries scipy have wrappers preserve information layer up, in case python. python objects hold information on types, unlike c variables. ctypes permits names , describe missing type information, native variables , subroutines can accessed python. in scip