Posts

Showing posts from September, 2011

ios7 - Notification not coming on Device but terminal showing Sent Successfully in iOS -

i have added apns app using ray wenderlich tutorial i followed exact steps mentioned in tutorial when sent notification terminal using simplepush.php,i got message connected apns. message delivered no notification has been received @ end.i have added token id , phass-phrase. please help.

css - Change text color of selected option item in php -

i want change background color of selected option item in php coulnd that. add indicator(*) begining of selected option bellow code not need that. need change text color of selected form item in php. adding style="background-color:red" $a works.! <select name="dest"> <?php $a=''; $sql2 = "select evaperiod evaluationperiod"; $query2 = mysql_query($sql2); if(mysql_num_rows($query2)>0) { $x='20'; $guncel=''; while($result=mysql_fetch_array($query2)) { $period = $result['evaperiod']; if($period==$donemm) $a=...

c# - Retrieving Building Blocks from user generated Word document -

i've searched far , wide, , haven't found proper solution yet. first off, winforms application using .net 4.0 , devexpress. i've been attempting retrieve building blocks (watermarks, cover pages etc) word documents (.docx), or @ least user generated template files (.dotx), user uploads application, saved database. i must able retrieve building blocks used in file. i have tried lot of different ways of retrieving them, can retrieve them built-in building blocks.dotx file, located in: c:\users\<username>\appdata\roaming\microsoft\document building blocks\1033\14\built-in building blocks.dotx i haven't figured out how extract them user generated file. here work in progress code i've been using (many iterations can debug it): private void savebuildingblock(string savedfile) { try { microsoft.office.interop.word.applicationclass wordapplication = null; wordapplication = new microsoft.office.interop.word.applicationclass(); micros...

php - Wordpress - save filter settings into cookie -

i have custom post type in wordpress, custom filters. i able save user's filter cookie, when comes posts lists, last filter set automatically. i have code saving cookie: function set_newuser_cookie() { if ( is_admin() && $_get['post_type'] == 'tickets') { setcookie('bs_tickets_filter', $_server['query_string'], time()+3600*24*100, cookiepath, cookie_domain, false); } } add_action( 'init', 'set_newuser_cookie'); this code saves whole query string cookie, like: orderby=status&order=asc&s&post_status=all&post_type=tickets&action=-1&m=0&status=0&type=0&priority=0&state=2135&author&paged=1&mode=list&action2=-1 how can set filter again, when user comes posts listing? i think solved this: function bs_set_filter_cookie() { if ( is_admin() && $_get['post_type'] == 'tickets' ) { // if theres filter requ...

django - A model with a defined field throws an AttributeError when accessing it -

i have django 1.5 app custom user model. has following field (among bunch of others): class user(models.model): ... reporting_period = models.charfield( max_length=20, choices=reporting_periods, null=true, blank=true, default=none ) company = models.foreignkey( company, null=true, blank=true, default=none ) this model has following function defined: def get_reporting_period(self, company_reporting_period=none): if not self.reporting_period: if not hasattr(self, '_company_reporting_period'): if company_reporting_period: self._company_reporting_period = company_reporting_period else: self._company_reporting_period = self.company.reporting_period return self._company_reporting_period else: return self.reporting_period occasionally, get_reporting_period function throws attributeerror (...

css - word break a long sentence by word -

"subject 10% service charge per room per night. cancellation or amendments can made 2 days prior arrival. otherwise, 1 nights’ room rate levied. first night guarantee required @ time of reservation , 1 night room rental charged credit card provided in event of no show, late cancellation or amendment. if dispute arises, hotel rainbow hong kong reserves final decision." i use css properties "word-break:break-all", did not well. there still word being break up. ** need 'word-wrap' property ** use one word-wrap:break-word;

php - Timezones and summer time in different states -

i have problem php imap timezones. i have server download emails users accounts. , users can view email on website. i set php timezone of server utc 0 , want users see receiving time of emails timezones. problem summer time because timezone change of 1 hour. example: gmail give me email received time in utc (0) @ 7:00. in italy, timezone utc +1 can add 1 hour time, 8:00. but in italy have summer timezone utc must +2 not +1 not countries have this. ask if exists maybe online service can give me correct offset must add hour showing correct time. thank in advance. in italy time zone swaps between cet , cest cannot hard-code using names not reflect fact. need use geographical identifiers europe/rome : <?php $utc = new datetimezone('utc'); $rome = new datetimezone('europe/rome'); $winter = new datetime('2013-12-31', $utc); $summer = new datetime('2013-08-31', $utc); $winter->settimezone($rome); $summer->settimezone($ro...

how to create event columnwidthchanging in usercontrol winform C#? -

i create form1 contain 1 usercontrol name myusercontrol and myusercontrol contains 1 listview have 4 columns name column(default,id,name,position) i want fire event columwidthchanging of listview no allow change width column listview so how do ? please, me!!! my code in myusercontrol: public event eventhandler columnwidthchanginglistviewcategoryclick; private void listview_category_columnwidthchanging(object sender, columnwidthchangingeventargs e) { if (columnwidthchanginglistviewcategoryclick != null) { columnwidthchanginglistviewcategoryclick(sender, e); } if (e.columnindex == 1 || e.columnindex == 3) { e.newwidth = 0; e.cancel = true; } } my code in form1: my_uc.columnwidthchanginglistviewcategoryclick += new eventhandler(columnwidthchanginglistviewcategoryclick_myuc); private void columnwidthchanginglistviewcategoryclick_myuc(object sender, eventargs e) { } ...

javascript - Self-executing function in object initialiser can't see object's properties -

i know function scope, self-executing functions, hoisting , other cool words, totally of-base following. var o = { : 1, f : (function(){ console.log(this.a); })() }; why gives me undefined ? function self-executed right when object initialized, therefore expect assign 1. not doing this. because you're not calling via o , this not o . additionally never assing function either - f set return value ( undefined ).

asp.net mvc - How to display labels and textboxes with the help of model properties in MVC5 razor view with html helpers? -

i not able create labels , textboxes using model in view html helpers. my view syntax: @using (ajax.beginform("roomsavail",new ajaxoptions { updatetargetid = "roomsavaildata", insertionmode ="insertionmode.replace" })) { <input type='text' id="checkin" class="form-control datepicker" /> <input type='text' id="checkout" class="form-control datepicker" /> <button type="submit" value="search"></button> } @model ienumerable<roomavailabilitysummary> <div> @html.labelfor(model=>model.arrdat) </div> <div> @html.editorfor(model=>model.name) </div> my mode...

Talend parse date: unable to parse -

i'm trying insert data in database, input string, representing date in format: yyyymmdd ("20140525") i try in talend : talenddate.parsedate("yyyymmdd",row1.date_pre_contrat) but @ runtime not work... i've tried talenddate.parsedate("yyyy-mm-dd",row1.date_pre_contrat) but result same. does have clue on problem is? solution found: it because didn't tell talend not analyse first line contains title. sorry this

Databaseless Laravel +Codeception - turn off database connection completely? -

i building api calling app needs no database. in trying register new class, updated composer , updated lots of packages including laravel (now 4.1.25). when run tests (codeception) break asking database connection. can't see in laraval config options or looking @ db connection code how turn off database not connection.

javascript - How to do two validation checks on an array without looping two times -

i have got array of js objects on want few validation checks. should following checks priority in order given. check if value correct. (obj.value == 'valid') only 1 object should have value. other should empty. value of objects empty invalid option. based on these checks, invalid objects should have msg property gets added proper message. have created function this. however, doesn't seem solution. looping through array 2 times correct msg. there way? please note that, should compatible ie8. array methods every not work. please see jsfiddle http://jsfiddle.net/k2y7f/ var arr = [{ value: 'valid' }, { value: '' }, { value: 'someinvalid value' }]; function validate() { var counter = 0, morethanoneitemselected = false, noitemselected = true; (var = 0; < arr.length; i++) { arr[i].msg = ''; if (arr[i].value.length > 0) { if (arr[i].value != 'valid') { ...

Widget update via remoteview Android -

i want activity "but1" update text on widget button through button in but1 activity. i've tried , shows no error still widget doesn't updates. im missing in manifest file?moreover log cat doesnt show problem following code in but1.class et1.setonclicklistener(new onclicklistener() { intent in=new intent(); bundle extras=in.getextras(); if(extras!=null) { awid=extras.getint(appwidgetmanager.extra_appwidget_id,appwidgetmanager.invalid_appwidget_id); } aw=appwidgetmanager.getinstance(context); @override public void onclick(view arg0) { // todo auto-generated method stub remoteviews rv=new remoteviews(context.getpackagename(),r.layout.activity_main); rv.settextviewtext(r.id.button1, "mughazf,f,jvnl"); aw.updateappwidget(awid, rv); intent...

jquery - bootstrap button and panel -

i want use bootstrap panel , button in application. using jquery. when add bootstrap.css in page see jquery dialog box , date picker don't display correctly. think there css conflict between bootstrap , jquery css. question jquery css provide panel , button css ? want create bootstrap panel , button. if want use still twitter bootstrap can use remove jquery datepicker css, js , use bootstrap datepicker here . there no conflict then

qt - QTQuick design: how to have a global class available from both C++ and QML? -

i'm converting project made borland c++builder. there have class manages messages , electronic device. class (call msgmanager) encapsulate both serial port , tcpsocket, provides unified method , events no matter kind of connection used long properties, , handle whole protocol checks. i want class "global": each of other classes have pointer msgmanager, qml pages needs use methods , properties. thing qml pages not use various "events" (like datareceived events or error timouts etc) 1) bad design qt applications? seems old habits sometime wrong in new enviroment... 2)if no (or @ least not bad) how can obtain this? tried using qmlregistertype<cmessagemanager>("phase.messagemanager", 1, 0, "messagemanager"); in main.cpp , then messagemanager { id: msgman; } in mainform.qml i'm not able "point" class c++... , i'm not able view class qml when create in c++ thanks. -edit- adding code , asking cl...

postgresql 9.3 - I can't insert data from text boxes into postgre sql table using C# -

and here code public partial class form2 : form { npgsqlconnection conn; npgsqlcommand cmd; string connstring = configurationmanager.connectionstrings["employeedata"].connectionstring; private dataset ds = new dataset(); private datatable dt = new datatable(); public form2() { initializecomponent(); lblerrormessage.visible = false; } string employee = "insert vsp_employee values ('" + txtempid.text + "','" + txtempname.text + "','" + txtemailid.text + "','" + txtphnum.text + "','" + txtdob.text + "','" + txtdoj.text + "','" + txtnod.text + "','" + txtsalary.text + "','" + txtleavestaken.text + "','" + txtleavesbalance.text + "')"; npgsqldataadapter da = new npgsqldataadapter...

go - How to copy a map? -

i'm trying copy contents of map ( amap ) inside 1 ( asupermap ) , clear amap can take new values on next iteration/loop. issue can't clear map without clear reference in supermap well. here pseudo code. for := range fruits{ amap := make(map[string]astruct) asupermap := make(map[string]map[string]astruct) x := range something{ amap[x] = adata asupermap[y] = amap delete(amap, x) } //save asupermap saveasupermap(something) } i've tried dynamic stuff throws error (cannot assign nil) asupermap[y][x] = adata the question how can create associative map ? in php use asupermap[y][x] = adata. seems golang doesn't have obvious method. if delete delete(amap, x) reference super map deleted well. if don't delete supermap ends duplicate data. on each loop gets amap new value plus old values. you not copying map, reference map. delete modifies values in both original map , super m...

jquery - jssor-how to stop sliders at the lastslide automatically when autoplay is on? -

i used jssor plugin sliders. have added 3 slides. want end slideshow @ last slide. me in finding solution. <script> jquery(document).ready(function ($) { var options = { $autoplay: true, $dragorientation: 3 //[optional] orientation drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value 1 (note $dragorientation should same $playorientation when $displaypieces greater 1, or parking position not 0) }; var jssor_slider1 = new $jssorslider$("slider1_container", options); function onsliderpark(slideindex, fromindex) { if (slideindex == 2) jssor_slider1.$pause(); } jssor_slider1.$on($jssorslider$.$evt_park, onsliderpark); }); </script>

java - Is it considered correct to omit curly braces strictly on one-liners? -

i against omitting curly braces if-else-statements , see why should avoided. however right i've come accross interesting use case, example code here: public <e extends runtimeexception> void throwonfail(final boolean result, final supplier<e> exceptionsupplier) throws e { objects.requirenonnull(exceptionsupplier); if (result) return; throw exceptionsupplier.get(); } i think code is: as concise can get, show other variants below. not vulnerable issue adding line change logic of code. i set personal rule myself only use on control-flow statements. practically means, return , break , continue . two alternative versions of code shown below. alternative 1 public <e extends runtimeexception> void throwonfail(final boolean result, final supplier<e> exceptionsupplier) throws e { objects.requirenonnull(exceptionsupplier); if (result) { return; } throw exceptionsupplier.get(); } alternative 2 public ...

sql server - SQL find records with duplicate email and date of birth -

i'm trying write query find duplicate records in database. want find records (not count) emailaddress , dateofbirth (both columns) exist on record. account tbl contains emailaddress. user tbl contains dateofbirth join on accountid the following query selects records emailaddress exists in record or dateofbirth exists in record, i'm unable combine 2 conditions. if i'm correct far, 'and' on line 7 acts more 'or' in case..? select a.accountname, a.emailaddress, u.dateofbirth account join [user] u on a.accountid = u.accountid a.emailaddress in ( select emailaddress account group emailaddress having count(*) > 1 ) , dateofbirth in( select dateofbirth [user] group dateofbirth having count(*) > 1 ) order u.dateofbirth, a.emailaddress for example, may produce 50 records. if through them, find 5 records matching emailaddress, 4 of them have same dateofbirth. 5th record displaying due record in database same dateofbirth different emailaddr...

javascript - Check if css or js file on already opened page was loaded from cache or from the server? -

is there way check google chrome console if css or js file loaded server or cache (because loaded) on web page loaded already ? if have access code, add version number linked js/css file: <link rel="stylesheet" href="css/style.css?v=1.0"> ?v=1.0 this way can see if version 1.0, 1.x or ever has been load in browser.

iphone - iOS 7 Ranging beacons: Sometimes ranging is Unavailable, and the only solution is reboot the device -

i'm working beacons on ios 7.x, works fine when call startranging... , device launch me error kclrangingunavailable, after check wifi disabled, restart bluetooth, , start , stop airplain mode, solution of problem reboot phone. this sourcecode: @interface rbtmainviewcontroller () @property (nonatomic, retain) cllocationmanager* locationmanager; @end @implementation rbtmainviewcontroller - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { _locationmanager=[[cllocationmanager alloc] init]; _locationmanager.delegate=self; nsuuid *estimoteuuid = [[nsuuid alloc] initwithuuidstring:@"00001111-2222-3333-4444-555566667777"]; clbeaconregion *region = [[clbeaconregion alloc] initwithproximityuuid:estimoteuuid identifier:@"proves range...

android animation crash caused by NullPointerException -

i've been trying run animation , crashes reason can't understand. in log cat writes because nullpointerexception. don't understand should do\change it. how can fix this? thanx! mainactivity: package nir.rauch.again; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.animation.animation; import android.view.animation.animationutils; import android.widget.imageview; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); animation anim = animationutils.loadanimation(getbasecontext(), r.anim.correctanim); imageview duck = (imageview) findviewbyid(r.drawable.duckwithswaves); duck.startanimation(anim); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if presen...

jquery - External HTML file in Bootstrap Popover content -

when use iframe load external html file in popover content, restricting popup height. want popup height auto. 1 me out .! $(document).ready(function(){ $('.pop-right').popover({ title : 'loading external file', html : true, placement : "right", content: function () { return '<iframe src="popover-content.html" style="border:none"></iframe>'; }); } }); }); when not cross-domaining', i.e. not loading google.com or similar iframe, relatively easy. declare below function, takes popover element ( .pop-right ) , popover content <iframe> parameters : function adjustpopover(popover, iframe) { var height = iframe.contentwindow.document.body.scrollheight + 'px', popovercontent = $(popover).next('.popover-content'); iframe.style.height = height; popovercontent.css('height', height); } 1) scrollheight of iframe (the real height) 2...

html - Change order of images when switching to landscape -

currently working on mobile website client can't following work. homepage of mobile site gets divided 2 large images users make choice. portrait mode works stacking images on homepage following code. <p><a href="/female"><img alt="" src="image1.jpg" style="width: 100%; height: 51%; position: absolute; margin-top:0; left:0; right:0;" /></a> <a href="/male"><img alt="" src="image2.jpg" style="width: 100%; height: 49%; position: absolute; bottom:0; left:0; right:0;" /></a></p> this works fine on devices whilst in portrait mode, problem these devices used in portrait mode, images stretched much. of course because of 100% width. in ideal situation; when switching landscape 2 entirely different images aren't on top of 1 side side. example; ___ ________ | 1 | | 1 2 | |_2_| |________| po...

Permission error when trying to read a file using python -

Image
i trying read file using python, gives me 'permission denied' reason. the user using has privileges read file, tested using cat command on file name. worked fine. i not able read same file python program. solaris server.

node.js - The Node Beginner Book TypeError: Cannot call method 'writeHead' of undefined -

i follow the node beginner book on http://www.nodebeginner.org/ while encounder typeerror 。 i've searched no 1 can solve error. error shows follows d:\delbert\nodejs\proj\requesthandlers.js:7 response.writehead(200, {"content-type":"text/plain"}); ^ typeerror: cannot call method 'writehead' of undefined @ d:\delbert\nodejs\proj\requesthandlers.js:7:14 @ childprocess.exithandler (child_process.js:635:7) @ childprocess.eventemitter.emit (events.js:98:17) @ maybeclose (child_process.js:743:16) @ socket.<anonymous> (child_process.js:956:11) @ socket.eventemitter.emit (events.js:95:17) @ pipe.close (net.js:465:12) and source code: //---------// //server.js// //---------// var http = require("http"); var url = require("url"); function start(route, handle) { function onrequest(request, response) { var pathname = url.parse(request.url).pathname; console.log("re...

Two questions about XSLT -

i have 2 questions xslt. first, want describe of elements without attribute. like <element id="p0" attribute="a1"/> <element id="p1"/> <element id="p2"/> i need group of elements without attribute="a1", need p1 , p2. xslt, should write <xsl:if test="element[@attribute]=''"> ? because when test it, found doesn't work. please me. the second is, want make output result not in same line. like right: t11 t22 t33 wrong: t11t22t33 which xslt word should write? bunch. all relative paths in xsl:template evaluated against node matched template. <xsl:if test="element[@attribute]=''"> testing presence of child of current node called element matches condition. if test located in template matches element nodes, it's not going work. should use . refer current node. the boolean expression element[@attribute]='' looking element nod...

google play - Licence Key Android -

i must publish android application on google play store, have 1 question. when created new account developer, after insert information relative application, received "licence key base64 ", licence? must licence? suggested use ? can tell me how implement ? i have read google developer documentation dont understand how can implement licence. everything need can found here and purpose of licensing here short summary: unless have paid app or in-app billing, don't need it

entity framework - Oracle UDT with EntityFramework Support -

is there support oracle user defined data types entityframework 5 or 6 (devart dotconnect or odp.net) ? entity framework supports primitive types ( http://msdn.microsoft.com/en-us/library/ee382832.aspx ) , doesn't support user-defined types (udt). we recommend work udt via plain ado.net: http://www.devart.com/dotconnect/oracle/docs/?objects.html . as odp.net, please refer oracle support question: https://community.oracle.com/community/developer/english/oracle_database/windows_and_.net/odp.net

gnu make - Makefile automatic rule dependency generation depends on another rule dependency generation -

i using 2 programming languages together. compiler takes program written first language (the source language) , translates them second language (the target language, me, c language). there few files generated way, , hand-written ones. finally, compile these file (in target language) executable code. i managed generate automatically dependency files (classically named .d files) source language, tell makefile (i'm using gnu makefile) in order , when call first compiler. (order important compiler.) know how generate dependencies target language (using gcc). use include directive automatically include dependencies. makefile find rule call generate dependency files , include them. makefile works in 3 phases. first, includes generated. second, generate missing includes if possible. third, tries build target. now, generate automatically dependencies target language, first need generate files (since generated headers included) using first compiler. here problem, in second phase...

bash sum grouping loop -

i have helpfile1 of format: client1 bla blahblah 2542 kb client1 bla blahblah 4342 mb client1 bla blahblah 7 gb client2 bla blahblah 455 mb client2 bla blahblah 455 mb ... and need weeklysize client1 sum xy kb client2 sum yx kb currently im using: sumfunction () { inputfile=helpfile1 in `awk -f":" '{print $1}' $inputfile| sort -u | xargs` awk -v name=$i 'begin {sum=0}; $0~name { print $0; if ($5 == "gb") sum = sum + $4*1024*1024; if ($5 == "mb") sum = sum + $4*1024; if ($5 == "kb") sum = sum + $4}; end {print name " sum " sum " kb"}' $inputfile done } sumfunction | grep sum | sort -g -r -k 3 > weeklysize i need use on pretty long file , awk taking time. there code (bash only), done faster? thank you you can use following awk script: awk '/mb$/{$4*=1024};/gb$/{$4*=1024*1024};{a[$1]+=$4}end{for(i in a){printf "...

Bootstrap 3 accordion - expand collapse icons beside panel title -

i want simple bootstrap 3 accordion: <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseone"> collapsible group item #1 </a> </h4> </div> <div id="collapseone" class="panel-collapse collapse"> <div class="panel-body"> anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. food truck quinoa nesciunt laborum eiusmod. brunch 3 wolf moon </div> </div> </div> </div> to have plus icon when in closed , minus icon when in hover , active. css: .panel-title { backgroun...

android - How to load and save checkbox values in a listview -

i have listview full of text, each row has got checkbox. when oncreate() called want load checkbox values sharedpreferences , apply them checkboxes. when onpaused() called, want save checkbox values. anyone got idea how that??? p.s. have been reading stuff little , have found custom adapters don't quite point of them. if can explain me that, appreciated. when extending custom adapter , you're precisely implementing stuff described. in case, seems arrayadapter enough achieve it. this adapter has getview() method called each of rows, , processes rows , you implement how should shown. method has 3 parameters, first 1 position of row being rendered. second 1 view that, vaguely talking, represents layout of entire row. third 1 represents parent of view . way, assuming second parameter called convertview , can like: checkbox cb = convertview.findviewbyid(r.id.mycheckbox); and set call cb.ischecked(...) appropriate value show current's row value ch...

dns - blogger custom domain redirection not working..! -

hope fine,i purchased domain blogger account...and have added blog problem site doesn't load without www. , have checked options available redirect domainname.com www.domainname.com.. infact wondering done still it's not working..so if people can please take @ this..! and here domain name check please : www.bloggingdust.com waiting replies..! ok digg domain name digwebinterface. bloggingdust.com@ns1.dnsowl.com.: bloggingdust.com. 7207 in 74.125.20.121 bloggingdust.com. 172800 in ns ns1.dnsowl.com. bloggingdust.com. 172800 in ns ns2.dnsowl.com. bloggingdust.com. 172800 in ns ns3.dnsowl.com. bloggingdust.com@ns2.dnsowl.com.: bloggingdust.com. 7207 in 74.125.20.121 bloggingdust.com. 172800 in ns ns1.dnsowl.com. bloggingdust.com. 172800 in ns ns2.dnsowl.com. bloggingdust.com. 172800 in ns ns3.dnsowl.com. bloggingdust.com@ns3.dnsowl.com.: bloggingdust.com. 7207 in 74.125.20.121 bloggingdust.com. 172800 in ...

monkeyrunner - Android tool MonkeyImage does not support jpeg? -

i have written script in python using monkeyrunner: image=device.takesnapshot() image.writetofile('filename.jpg','jpg') but have got null image this: -rw-rw-r-- owner group 0 apr 14 21:56 filename.jpg when write image.writetofile('filename.png','png') it worked well.i don't know why. fortunately, adbclient communication method used androidviewclient/culebra interact android devices , emulators, supports saving images jpeg. the basic script simple #! /usr/bin/env python # -*- coding: utf-8 -*- com.dtmilano.android.adb.adbclient import adbclient adbclient('.*').takesnapshot().save('/tmp/image.jpg', 'jpeg') if interested in knowing more adbclient , why can save images jpeg or driving forces behind creation, there article understand, adbclient: under hood of androidviewclient/culebra .

File line splitting in Jython -

i trying read file , populate values in db of jython in odi. this, read line 1 one split line on basis of ',' present. now have line 4jgbb8gb5aa557812,,miss,maria,cruz,,"266 faller drive apt. b", new milford,nj,07646,2015054604,2015054604,20091029,51133,,, n,lessee,"mercedes-benz usa, llc",n,n "mercedes-benz usa, llc" field has , within double quotes due gets split 2 fields whereas should considered one. can please tell me how should avoid this. fields = valuelist.split(',') i use splitting valuelist individual line present in file you can use csv module can take care of quotes: line = '4jgbb8gb5aa557812,,miss,maria,cruz,,"266 faller drive apt. b",new milford,nj,07646,2015054604,2015054604,20091029,51133,,,n,lessee,"mercedes-benz usa, llc",n,n' import stringio import csv f = stringio.stringio(line) reader = csv.reader(f, delimiter=',') row in reader: print('\n'.joi...

c# - Problems publishing working application to Azure -

i have mvc 5 build building , running locally without problems whatsoever. cannot publish azure. i'm publishing intellitrace enabled , i'm seeing exception being thrown attempting activate role. exception thrown: "requested registry access not allowed." (system.security.securityexception) i have made sure of following: i have latest edition of microsoft azure sdk all relevant project references of project references set copy local: true all relevant libraries have correct binding redirects in respective app.config/web.config files all azure references in project correct versions of assemblies the event log shows following exceptions in chronological order: error 4/11/2014 3:23:57 srmsvc 8228 none file server resource: manager unable access following file or volume: 'e:'. file or volume might locked application right now, or might need give local system access it. error 4/11/2014 3:31:44 .net runtime ...

python - Iterating over links in selenium with scrapy -

i learning scrape selenium , scrapy. have page list of links. want click first link , visit page crawl items , again come main(previous page list of links) , click on second link , crawl , repeat process until desired links over. click first link , crawler stops. done again crawl second link , remaining ones? my spider looks so: class test(initspider): name="test" start_urls = ["http://www.somepage.com"] def __init__(self): initspider.__init__(self) self.browser = webdriver.firefox() def parse(self,response): self.browser.get(response.url) time.sleep(2) items=[] sel = selector(text=self.browser.page_source) links = self.browser.find_elements_by_xpath('//ol[@class="listing"]/li/h4/a') link in links: link.click() time.sleep(10) #do crawling , go , repeat process. self.browser.back() thanks you can take...

sql server - SQL equivalent for First -

i understand there not equivalent works same access looking in writing query perform same task. basically, here have far: select pr.ssn ssn, min(pr.[last name]) [last name], min(pr.address) [address], min(pr.city) [city], min(pr.state) [state], min(pr.zip) [zip], min(cast(pr.[pay begin period] date)) [pay begin period], max(cast(pr.[pay end period] date)) [pay end period], payroll.dbo.[table1] pr (cast(pr.[pay begin period] date) > '1/1/2013' , cast(pr.[pay end period] date) < '12/31/2013') group pr.ssn this query retrieve earliest [pay begin period] , latest [pay end period] each ssn. however, want [last name] retrieved earliest [pay begin period]. in cases, people have [last name] change. want earliest/first 1 ever recorded. so change line: min(pr.[last name]) [last name], to this: (select [last name] payroll.dbo.[table1] [pay begin period] = min([pay begin period])), i realize not work, best way ...

php - How to use a layout statically in Laravel? -

as admin can create pages (don't think have paste adminpagescontroller here, because understand logic). i'm getting stuck on, selecting, using layout used page. i.e. have 3 layouts: page left sidebar page right sidebar page full-width (no sidebars) and i.e. want create salespage or so, uses layouts "page full-width". how can call in view? now views begin @extends('layouts.path.file') <--- need filled in database, if know mean. one way of doing use view composer define current layout used. view composers set variables can used views ('*') or ('users.profile', 'admin.profile'), example of using user specific layout: view::composer('*', function($view) { $view->with('userlayout', auth::check() ? auth::user()->layout : 'main'); }); and in view have to: @extends('layouts.'.$userlayout); if need select page on controller, can pass layout it: return view::make...

javascript - bootstrap.min.js IE8 Object doesn't support property or method 'on' -

everything works fine in chrome, firefox, , newer version of ie. govt contract , stuck ie8. i'm getting error object doesn't support property or method 'on' file: bootstrap.min.js, line: 6, column: 1434 i have tried including html5shiv.js , respond.min.js , , style sheets local. <div class="collapse navbar-collapse"> not display @ in ie8 works fine in else. i have added meta tags below <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> this asp.net application.. that's because .on added in 1.7 . and know, ie-compatible jquery v1.11. why in world using v1.4?

jquery - Javascript regular expression matching css selectors -

i'm trying match regular expression against set of css rules. part of code not working: selector = $.trim(selector.replace('.', '\.')); var re = new regexp('/'+selector+'(?=\{| \{| \{)/', 'g'); here i'm escaping fullstop in selector in case class eg ".styler". then i'm trying match specific selector followed curly bracket or 1 space , curly bracket, or 2 spaces , curly bracket. what i'm trying achieve is selector ".styler" matches: ".styler{" , ".styler {", ".styler {" , not match: ".styler span{", ".styler h1 {" etc. backslash escapes next character in js string. need escape backslash too: selector = $.trim(selector.replace('.', '\\.'));

php - database value are not show when page refresh -

i building form in 2 combo box 1st combo having more 6 value , 2 , combo having 2 value when user select combo 1 choose value , select combo 2 1st value , press submit open home.php fetch value database , show. problm-1- when refresh page value not print. problem-2- next want when user select combo1 choose value , select combo2 , choose second value open page. <?php session_start(); ?> <html> <body> <fieldset> <select id = "mylist" name= "casetype" class="form-login" style="width:250px;" > <option value = "d">d</option> <option value = "e">e</option> <option value = "a">a</option> <option value = "c">c</option> <option value = "f">f</option> <option value = "s">s</option> <opt...

matlab - matching vectors based on string -

i'm trying used doing things in vectors rather looping. question have have 2 vectors. vector 2 64x2 cell first column contains strings second contains numbers. want match vector 1 & 2 on string value , copy numeric value on new field in vector 1 if possible? vector 1 vector 2 ghj abc 352 lmn ghj 62 opq lmn 3698 opq 12 i vector 1 below, vector 1 ghj 62 lmn 3698 opq 12 actually guess problem solved deleting row abc vector 2. you can use ismember compare 2 arrays. have strings , numbers in 1 array you'll have use cell array. a = {'abc', 352; 'ghj', 62; 'lmn', 3698; 'opq', 12} b = {'ghj'; 'lmn'; 'opq'}; matchindex = ismember(a(:,1), b) %put vector 2 first matchindex = 0 1 1 1 this return logial vector length of containing 1 (true) data in found in b. elsewhere...

python - How to mass http request gevent? -

i found example gevent documentation want control concurrent requests done gevents: import gevent import urllib2 gevent import monkey monkey.patch_all() urls = ['http://www.google.com', 'http://www.example.com', 'http://www.python.org'] def print_head(url): print 'starting %s' % url data = urllib2.urlopen(url).read() print '%s: %s bytes: %r' % (url, len(data), data[:50]) jobs = [gevent.spawn(print_head, url) url in urls] gevent.joinall(jobs, timeout=2) how can limit connections 50 if example have 5000 urls request? you need use gevent.pool . typically such this: # 50 pool size pool = gevent.pool.pool(50) url in urls: pool.spawn(print_head, url) pool.join(timeout=2) you spawn directly in fixed size pool, wait pool execute requests. timeout of 2 may little short if have 5000 requests, though.

Getting friend list from MySQL using PHP -

Image
i have tables in mysql database, users , friends. have structure: users table: friends table (two users friends if exists 2 rows in image): i want create mysql query in php select nombre (name) of users friends. read have use operator left join did not succeed. thank you! try using inner join instead. try below query - select users.nombre users inner join friends on (users.id = friends.usuari_o or users.id = friends.usuari_t) (friends.usuari_o = $id or friends.usuari_t = $id);

Java.sql.SQLException doing a SELECT -

when try execute code: try { pstm = connection.preparestatement("select * menu (menuname '?%')"); pstm.setstring(1,searchedmenu.getmenuname()); rs = pstm.executequery(); while (rs.next()) { menu menu=new menu(); menu.setmenuid(rs.getint("menuid")); menu.setmenuname(rs.getstring("menuname")); temp.add(menu); } i error in subject, why? purpose search string or part of it. thank you. edit: error is: java.sql.sqlexception: parameter index out of range (1 > number of parameters, 0). , referred line: pstm.setstring(1,searchedmenu.getmenuname()); the error fact don't have parameter markers set, because put question mark string: menuname '?%' so when this: pstm.setstring(1,searchedmenu.getmenuname()); there nothing set, , throw error. if check stack trace, it's you're seeing message number of parameter markers. y...

javascript - AJAX Load and PHP Error -

i have created simple form submits data database. i want use ajax when submit pressed, loading bar shows , takes success! page after few seconds. how go this? also following code gives me following error, need fix - solved : notice: undefined index: command in f:\xamppnew\htdocs\web\billing.php on line 5 code: <?php include "storescripts/connect_to_mysql.php"; session_start(); if ($_request['command']=='update'){ $name=$_request['name']; $email=$_request['email']; $address=$_request['address']; $phone=$_request['phone']; $item_id = $_session['item_id']; $quantityorder = $each_item['quantity'] = $_session['quantity1']; $carttotal = $_session['carttotal']; // add product database $sql = mysqli_query($link,"insert transactions values('','$item_id','$quantityorder','$carttotal'...