Posts

swift - Epson printer - print two images horizontally from iOS -

i downloaded ios (swift) sdk epson epos2 printer , integrate application without problem. can print images or texts vertically 1 one. problem want print 2 image , 1 text horizaontal. format tried addpagearea(x,y,width,height) addpagebegin() , addpageend() , tried addpageposition(x,y) also. these methods print in vertical format only.

postgresql - How can u make psql process idempotent in ansible? -

i have process runs psql process in ansible - name: run psql pull in initial config data become_method: sudo become: yes become_user: postgres shell: psql -u postgres -w eclaim < /opt/eclaim_revamp/sql_scripts/{{ item }}.sql with_items: - initial_config - initial_sql_script - tmp_hrms this task runs time. how make idempotent ? i guess way wrap sql-script shell scripts , make checks. example (i know there postgresql_user module, example): #!/bin/bash if [[ $(psql postgres -tac "select 'found' pg_roles rolname='{{ user }}'" | grep found) ]]; echo "user exists" else psql -c "create user {{ user }} login encrypted password '{{ password }}';" > /dev/null echo "user created" fi and in playbook: - name: run psql shell: createuser.sh register: result changed_when: "'user created' in result.stdout"

java - How to refresh my current latitude longitube at background in android -

tell me how referesh current latitude , longitude in activity @ every 5 min public class mapsactivity extends fragmentactivity implements onmapreadycallback, googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener,locationlistener{ private googlemap mmap; private googleapiclient mgoogleapiclient; private locationrequest mlocationrequest; private marker mcurrlocationmarker; private textview mlatitude, mlongitude; private button mnextbtn; private location location; private int minterval = 5000; private static final string tag = "broadcasttest"; private intent intent; handler mhandler; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maps); mlatitude = (textview) findviewbyid(r.id.tv_lat); mlongitude = (textview) findviewbyid(r.id.tv_long); mnextbtn = (button) findviewbyid(r.id.btn_next); intent = new intent(this, broadcastservice....

php - Run Symfony app with Vagrant -

i try run symfony app vagrant, install vagrant, copy symfony app in vagrant folder (vagrantrasmus/clientproject) add in hosts 192.168.7.7 clientproject , add in client.conf conf.d server { server_name clientproject; root /vagrantrasmus/clientproject/web; location / { # try serve file directly, fallback app.php try_files $uri /app.php$is_args$args; } # dev # rule should placed on development environment # in production, don't include , don't deploy app_dev.php or config.php location ~ ^/(app_dev|config)\.php(/|$) { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; # when using symlinks link document root # current version of application, should pass real # application path instead of path symlink php # fpm. # otherwise, php's opcache may not detect changes # php files (see https://github....

reporting services - Date picker issue in SSRS reports hosted in WPF application -

Image
we have hosted ssrs reports in wpf application using reportviewer . month selection in date picker not working properly. date selection through navigation buttons working fine. date picker getting displayed shown in below image. on selecting month returning current date. it needs work in calendar control in wpf not sure problem here. datepicker control returns datetime object, can determine month of date using ssrs expression . if mean reporting services control in 2008 r2 isn't pretty wpf; older tech , there's nothing can apart upgrade sql server 2016.

ajax - how do we use request.session.setAttribute for already existing session variable to UI -

while loading view page setting session variable as: request.session.setattribute("list",list); after onclick of button using ajax call refresh list. in backend able see latest list contents. in ui using : list<string> clist = (list<string>)session.getattribute("list"); but after list changed not able see latest list contents.still old list contents displaying on page. need suggestions on how resolve issue. var refreshthisdiv= "refreshthisdiv"; var gourl= "unametest/getusernameslist; var httprequest=null; var refreshcontent = "null"; httprequest = xmlhttpobject(); httprequest.open("post", gourl, true); httprequest.onreadystatechange = function () {ajaxfcuntion(refreshthisdiv,httprequest); } ; httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); httprequest.send(null...

sql server - MSSQL After Update Trigger: Multi Row Stored Prc -

i've written stored procedure invoke on row updates. it this: create procedure [tracechange] @id uniqueidentifier, begin /*do inserts, updates, etc*/ end now create trigger table, works fine single row update: create trigger t1_traceinsert on t1 after update begin set nocount on; declare @id uniqueidentifier exec tracechange @id end this works fine - single row. how rewrite execute on multi row updates ? afaik not great approach use cursor within such triggers. thanks! there 2 options: 1) process data in while loop - data inserted table, , execute sp x times - 1 per row. 2) rewrite sp (or create new one) accepts table input parameter. process rows in 1 go if possible. depends on code of sp. so, in trigger, execute sp , pass predefined table based on inserted table see https://msdn.microsoft.com/en-au/library/bb510489.aspx example.