Posts

java - Upload complete event using HttpPost -

my app uploads image server. in order execute uploading, use httppost class. here relevant code fragment: try { httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("%path_to_server_page%"); httppost.setentity(new urlencodedformentity(namevaluepairs)); httpclient.execute(httppost); } catch (exception e) { system.out.println("connection error: " + e.tostring()); } my question how can raise event , know if uploading has been finished sure file on server? thanks. probably, implementation of observer design pattern suitable solution. reference: https://stackoverflow.com/a/6270150/462347

Is it possible to have deployment slots with different service plans in Azure WebApps? -

i've worked lot in past azure cloud services web roles, bit new azure websites/webapps. loved concept of multiple deployment slots define webapps, enables useful cd scenarios. in case, have test->preprod->prod slots defined. good! is possible specify different pricing tiers or number of instances each of environments? seem share pricing tier of service plan. possible define different number of instances each one? well, multiple deployment slots available in standard sku (the highest one): http://azure.microsoft.com/en-us/pricing/details/websites/ so, no. require not possible. you can mitigate not using staged publishing. can instead, have different service plans different web apps. can link each of web apps different branch of repository ( https://azure.microsoft.com/en-us/documentation/articles/web-sites-deploy/ ). when push uat branch - deployment in uat web site. when push relese branch, deployment releas web site , on.

javascript - Generate HTML Canvas from AngularJS Template -

Image
i trying render html element on canvas using html2canvas js. using angularjs data binding on html page , dynamic data not rendered on generated canvas these html elements. example, have html element this: <table class="table table-striped table-bordered table-hover"> <tr> <th>name</th> <th>uri</th> <th>is default</th> <th>action</th> </tr> <tr ng-repeat="printer in printers"> <td>{{printer.name}}</td> <td>{{printer.url}}</td> <td>{{printer.default}}</td> <td><button ng-click="printtestpage(printer.url)">print test page</button></td> </tr> </table> but can see dynamic data not rendered on canvas: suggestions regarding how properly, or without using html2canvas js??? when call html2canvas? should call function after d...

private key - Using Bitcoin-ruby to make a transaction -

i posted question on bitcoin stack told may have better luck reposting here. i having trouble bitcoin-ruby gem. following error when trying send money address have on test network: /var/lib/gems/2.2.0/gems/bitcoin-ruby-0.0.7/lib/bitcoin/protocol/txout.rb:76:in pk_script=': undefined method bytesize' nil:nilclass (nomethoderror) i generating private key with: def new_address bitcoin::generate_address end and getting details private key with: def key_details(prikey, pubkey) #returns prikey, prikey_hash58, pubkey_hash58, pubkey_uncompressed, address hash my_key = bitcoin::key.new(prikey, pubkey) { prikey:prikey, prikey_base58:my_key.to_base58, pubkey_58:my_key.hash160, pubkey: my_key.pub_uncompressed, address:my_key.addr } end the code have send money myself follows: require 'bitcoin' require_relative 'utilities.rb' require 'open-uri' bitcoin.network = :testnet3 def build_transaction(prev_tx, prev_o...

java - JDBC is throwing grammar error when the query is working in php myadmin -

i working on java website using jdbc mysql. here simple function fetch data sql, @override public list fetchmusic(string _uname, string _chnl_name) throws sqlexception { string sql = "select * `channel_songs` `uid` = " + " (select `id` `user` binary `uname` = ?)"+ " , `chnl_id` = (select `id` `channel` binary `chnl_name` = ?);"; connection conn = datasource.getconnection(); preparedstatement ps = conn.preparestatement(sql); ps.setstring(1, _uname); ps.setstring(2, _chnl_name); list<map<string, object>> musiclistsbychnl = jdbctemplate.queryforlist(string.valueof(ps)); return musiclistsbychnl; } so, when running this, getting error says, org.springframework.jdbc.badsqlgrammarexception: statementcallback; bad sql grammar [com.mysql.jdbc.jdbc4preparedstatement@3a4eb50a: select * `channel_songs`]; nested exception com.mysql.jdb...

How to use multiple Git SSH keys on Eclipse? -

i looked several answers , forums solution not find single 1 works. i have scenario: eclipse luna service release 2 (4.4.2) ubuntu 14.04 x64 two ssh keys on ~/.ssh folder two bitbucket accounts (one personal projects , 1 enterprise) a git repository accessible primary key (~/.ssh/id_rsa) a git repository accessible secondary key (~/.ssh/other) i created ~/.ssh/config file contents: host bitbucket bitbucket.org hostname bitbucket.org identityfile ~/.ssh/id_rsa identityfile ~/.ssh/other user git and sake of sanity added second key using ssh-add well. running ssh-add -l lists both keys. when using command line, git commands work charm, both repositories. when using eclipse, invalid remote: origin error when trying clone or pull repository secondary key: caused by: org.eclipse.jgit.errors.noremoterepositoryexception: git@bitbucket.org:myuser/myrepository.git: conq: repository access denied. i added secondary key @ window > preferences >...

sql server 2008 - SQL query with distinct records -

i want distinct records below query. mean if uncomment commented lines. please help. select cs1.nm categorytype, cs2.nm category --, cs2.nm sub_category cat_struct cs inner join cntrct_cat cc on cc.cat_struct_id = cs.cat_struct_id inner join cat_struct cs1 on cs1.cat_cd = cs.cat_cd , cs1.mkt_cd not null inner join cat_struct cs2 on cs2.cat_cd = cs.cat_cd , cs2.mkt_cd null --join cat_struct cs3 --on cs3.cat_cd = cs.cat_cd , cs3.mkt_cd null --and cs3.sub_cat_cd not null cs.lob_cd ='p' , cc.cntrct_vers_id = 781439637 , cs2.nm = 'adult books' use keyword distinct in select statement. yow records not repeated. thanks