Posts

Android prepare Resume Ability to download manager -

this below code simple download manager , i'm trying add resume ability that. @daniel nugent share code. public class mainactivity extends actionbaractivity { private imageview image; private bitmap bmp; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); image = (imageview) findviewbyid(r.id.imageview); new postasync().execute(); } @override protected void onresume() { super.onresume(); //put on resume functionality here.... } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.menu_main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home...

python - No response in ssh.exec_command in paramiko -

i trying use python paramiko execute commands on remote server. when run following commands prompt , appears have succeeded prompt back >>> import paramiko >>> ssh = paramiko.sshclient() >>> ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) >>> ssh.connect('a.b.c.d', username='server', password='xyz') >>> the response when try execute command [] >>> stdin, stdout, stderr = ssh.exec_command("host") >>> stdout.readlines() [] almost command gives same output. command "host" when ssh executed shell gives several lines of usage output i error if don't give password >>> ssh.connect('a.b.c.d', username='server') traceback (most recent call last): file "<stdin>", line 1, in <module> file "build\bdist.win32\egg\paramiko\client.py", line 307, in connect file "build\bdist.win32\egg\paramiko\client.py...

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...

javascript - Reinvoke function on model update in AngularJS -

first off, apologize in advance if terminology or approach off - come structural engineering background , trying learn javascript , angularjs through small pet project. my question is: how re-invoke function updateme() within service whenever model updates. sample code , plunker below. initially, code run fine , result calculated. if a or b updated, updated values propagated controllers, value of result not updated. i've tried playing around $scope.$watch() couldn't work, nor sure right approach. in actual project, function in question depends on several properties of myservice object, , generates json data plotted n3-charts . want make plot interactive regenerating data when user updates property of myservice object. angular .module('app', []); //some function evaluated when data in myservice changes function updateme(x, y) { return x * y; } //define service (to provide data multiple ctrls) function myservice() { var myservice = this; m...

c# - Binding SelectedItems of ListView to ViewModel -

i have list view binding items property in viewmodel. <listview height="238" horizontalalignment="left" name="listview" verticalalignment="top" width="503" itemssource="{binding businesscollection}" selectionmode="multiple" > <listview.view> <gridview> <gridview.columns> <gridviewcolumn> <gridviewcolumn.celltemplate> <datatemplate> <checkbox ischecked="{binding relativesource={relativesource ancestortype={x:type listviewitem}}, path=isselected}" /> </datatemplate> </gridviewcolumn.celltemplate> </gridviewcolumn> <gridviewcolumn displaymemberbinding="{binding id}" he...

linq - Concatenating Two Different IEnumerable Objects in C# -

i have got 2 different ienumerable objects, properties similar in both classes,now want concatenate/merge them, both results can assigned repeater datasource, below sample code. ienumerable<icacheditem> cacheold = cache<string>.cacheditems; //my old cache class, here fetching cached items ienumerable<caching.icacheditem> cachenew = caching.cache<string>.cacheditems; //my new class cached items var combined = cachenew.cast<icacheditem>().concat(cacheold); //trying concat both repeater.datasource = combined.orderby(entry => entry.region + ":" + entry.prefix + ":" + entry.key); //assigning datasource repeater.databind(); combined object coming blank, suggestions. update: have got these in class public class cacheditem<t>: icacheditem { public cacheditem(string key, string prefix, t value) : this(cacheregion.site, prefix, key, value) { } } do need modify class? you can use select ...

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?