Posts

Showing posts from September, 2013

swift - Submitting apps to app store for iOS9 -

i have been trying submit app multiple times app store , keep seeing error: invalid swift support - files libswiftpasskit.dylib, libswiftcoreaudio.dylib, libswiftcontacts.dylib, libswiftcorelocation.dylib, libswiftcoremedia.dylib, libswiftcoredata.dylib, libswiftavfoundation.dylib don’t match /payload/myapp.app/frameworks/libswiftpasskit.dylib, /payload/myapp.app/frameworks/libswiftcoreaudio.dylib, /payload/myapp.app/frameworks/libswiftcontacts.dylib, /payload/myapp.app/frameworks/libswiftcorelocation.dylib, /payload/myapp.app/frameworks/libswiftcoremedia.dylib, /payload/myapp.app/frameworks/libswiftcoredata.dylib, /payload/myapp.app/frameworks/libswiftavfoundation.dylib. make sure files correct, rebuild app, , resubmit it. don’t apply post-processing /payload/myapp.app/frameworks/libswiftpasskit.dylib, /payload/myapp.app/frameworks/libswiftcoreaudio.dylib, /payload/myapp.app/frameworks/libswiftcontacts.dylib, /payload/myapp.app/frameworks/libsw...

php - Enclose the value of input button with p -

how can enclose value of button p? trid add <p> tag doesn't work displayed text. i want enclose value can add psuedo element on button value. or if possible select value via css directly if adding html on value not possible can solution this. this one: <input type="submit" class="button refreshbtn" name="update_cart" value="<?php _e( '<p>update cart</p>', 'woocommerce' ); ?>" /> original code: <input type="submit" class="button refreshbtn" name="update_cart" value="<?php _e( 'update cart', 'woocommerce' ); ?>" /> html not allowed in attributes value, e.g. value="submit" valid example. if want use html formatting button, can use anchor tag , use javascript submit form (or other action) on click of anchor . <a id="btnsubmitform" class="button refreshbtn"><span>up...

unit testing - Test Automation (Flow) -

Image
my intention test functional flows of application. think best way testing ui steps of functional flow. (e.g : add item, after search , add pricing etc.). concern find best automation tool should support desktop application. have handheld experience of doing this. coding guy don't have experience in testing. additionally: application huge application have connected oracle database. need clear database startup of testing. tool should support matter also. programming language : c# i found selenium (but web application), renorex , ibm rational functional tester. is approach(test ui steps functional steps) correct? have 1 work on above tools or other best tools whcih support c# windows application. i think nunit best text unit test in project. correct? according research google found result. i'll try keep short. fit case automation tool should support desktop application. and programming language : c# will visualstudio's build in coded ui ...

get input from user and store it in String Array in Java -

Image
i write 1 program input user "enter number of students:" add student names , print in console. write 1 code run fine problem loop ramble 1 time code not working want know how inputs using command line argument without scanner , store in string array current output here code please , in learning phrase of java import java.util.scanner; public class stringscanner { public static void main(string args[]) { scanner in = new scanner(system.in); //get input number of students: system.out.println("enter number of students:"); int totalstudents = in.nextint(); //store string array string studentname[] = new string[totalstudents]; for(int = 0; < studentname.length;i++) { system.out.println(i); system.out.println("enter student names: "); studentname[i] = in.nextline(); } for(string names:studentname) { system.out.println(names); } } } next(): finds ...

install4j - Is it possible to change privileges during installation? -

for our installer application not necessary install administration privileges. when user decide install system program folder c:\program file\ourapp user gets dialog privileges missing , folder has choose/create. question: possible grand previliges depending on installation location during installation instead before starting? yes, "request privileges" action can added screen. default it's in "startup" node, can delete there , add screen. can have condition expression, it's executed when necessary. action starts elevated helper process execute elevated actions. as of install4j 6.0.4, installation location screen show error message if selected directory not writable. starting 6.0.5, can deselect "check if directory writable" property , handle writability yourself. added in 6.0.5 helper function util::isdirectorywritable helps check if available privileges allow write directory.

c# - ORM for stateful application. Does EF fit? Or any? -

i need orm suitable stateful application. i'm going keep entities between requests in low-latency realtime game server persistent client connections. there 1 server instance connected database no data can changed "outside" , server can rely on cache. when user remotely logs in server whole profile loaded server memory. several higher-level services created each user operate profile data , provide functionality. can have internal fields (state) store temporary data. when user wants change signature asks corresponding service so. service tracks how user changes signature , allows once per ten minutes (for example) - such short interval not tracked in db, temporary state. change should stored db executing 1 query: update users set signature = ... user_id = ... . when user logs off it's unloaded server memory after minutes/hours of inactivity. db here storage. call stateful. some entities considered "static data" , loaded once @ application start. can r...

java - How to configure IB gateway on headless server -

i run ib gateway on headless server, want change default config. there question. read config file random directory when ib gateway starting. don't know dir's name. when restart it, create new dir. so, can me? ib gateway's 'random' configuration directory name isn't random, corresponds user name use login. can login on desktop , login on headless server same user, , compare 'random' directory generated. should have same name. to configure ib gateway on headless server, use mac desktop set configurations, , copy files under directory corresponds login user name linux headless server. works expected.

c++ - Scaling a QGrahicsView when MouseWheenTurned first scrolls, then scales -

i'm trying add zoom in/out functionality graphic i'm drawing in qt. first did extend qgraphicsscene own class graphicsscene , overload wheel event. class graphicsscene : public qgraphicsscene { q_object public: graphicsscene(qobject *parent, bool drawaxes){ /*drawing stuff here.. */} virtual void wheelevent(qgraphicsscenewheelevent *mouseevent); signals: void mousewheelturned(int); }; void graphicsscene::wheelevent(qgraphicsscenewheelevent* mouseevent) { int numdegrees = mouseevent->delta() / 8; int numsteps = numdegrees / 15; // see qwheelevent documentation emit mousewheelturned(numsteps); } when wheel turned, event sent view contains scene, , there scale performed: class graphicsview : public qgraphicsview{ q_object qreal m_currentscale; public: graphicsview(qwidget * parent): qgraphicsview(parent){ m_currentscale = 1.0; } public slots: void onmousewheelturned (int); }; void graphicsview::onmousewheelturned(...

android - Why MapView returns null if not logged into Google Play Account? -

i created fragment mapview , works fine if user logged google play account. if reset device , launch application, crashes when initialize mapview. map = mapview.getmap(); why happen? , in order prevent crash, should check if user logged google account? from documentation it returns googlemap. null if view of map not yet ready. can happen when google play services not available. if google play services becomes available afterwards, calling method again initialize , return googlemap. and can not access google services until did not logged-in play. although method googlemap getmap () has been deprecated, should use getmapasync (onmapreadycallback callback)

Spark job fails in yarn-cluster mode -

my job runs in spark on yarn-client mode , fails on yarn-cluster mode, stating error " file not exist: hdfs://192.xxx.x.x:port/user/hduser/.sparkstaging/application_1442810383301_0016/pyspark.zip ". although shows has uploaded file above directory!! cause?? this full error log: application application_1449548654695_0003 failed 2 times due container appattempt_1449548654695_0003_000002 exited exitcode: -1000 more detailed output, check application tracking page:http://server1:8088/cluster/app/application_1449548654695_0003then, click on links logs of each attempt. diagnostics: file not exist: hdfs://192.168.0.109:54310/user/hduser/.sparkstaging/application_1449548654695_0003/pyspark.zip java.io.filenotfoundexception: file not exist: hdfs://192.168.0.109:54310/user/hduser/.sparkstaging/application_1449548654695_0003/pyspark.zip @ org.apache.hadoop.hdfs.distributedfilesystem$22.docall(distributedfilesystem.java:1309) @ org.apache.hadoop.hdfs.distributedfilesystem$22.doc...

django - how to run mongo db query via python script? -

i have 2 mongo db query first is: db.sale_order.find().foreach(function(doc){doc.orderdate = new date(doc.orderdate);db.sale_order.save(doc);}) and second is: db.sale_order.aggregate({$group: { _id: {year : { $year : "$orderdate" }, month : {$month : "$orderdate"},day :{ $dayofmonth : "$orderdate"},},price : {$sum: "$price"}}} ) this second query work after running first query , after performing other operation using python . so running 2 query , using following code : def create_demo_accounts(): account.objects.all().delete() client = mongoclient('localhost', 27017) db = client['mydb'] collection = db['sale_order'] #collection.find().foreach(function(doc){doc.orderdate = new date(doc.orderdate);db.sale_order.save(doc);}) doc in collection.find(): doc['orderdate'] = date(doc['orderdate']) # line 127 db.sale_order.save(doc) try: p...

node.js - How to identify the service name of a mail id -

in node js sending mails using node mailer. var transporter = nodemailer.createtransport({ service : 'gmail', auth : { user : 'xyz@gmail.com', pass : '*******' } }); this scenario working fine. now going use "invite@myhealthcircles.com" mail id authentication. var transporter = nodemailer.createtransport({ service : 'myhealthcircles', auth : { user : 'invite@myhealthcircles.com', pass : '*******' } }); now mails not sending. service name correct ? or have give else. if , how finde service name you need use nodemailer-smtp-pool module, , provide email server credential in option: var mailer = require('nodemailer'); var smtppool = require('nodemailer-smtp-pool'); var option = { host: 'localhost', port: 25, auth: { user: 'your@email.com', pass: 'yourpassword...

Bash - find recursively in many directories -

i have 2 or more directories path stored in variable - output of find command: folders="$(find /g -type d -name "jpgtest*")" note: directory names may have spaces. assuming there 2 directories: g/jpgtest1 , g/jpgtest2. how search subdirectories of 2 files of form "*.a", and remove files in form "*.b" * means: name starts same name of files extension a. for example: found: g/jpgtest1/test1/j.a remove: g/jpgtest1/test1/j1.b , don't remove g/jpgtest1/test1/f1.b and on 2 directories. a possible solution: shopt -s globstar nullglob f in $folders/**/*.a ; rm -f "${f%.a}"*.b done but works 1 directory found in "folders", should change work several directories well. edit: any solution when it's in bash script , content of "folders" unknown , , result finding folders older 1 month: folders="$(find /g -maxdepth 1 -type d -atime +30)" your problem following: sup...

swift - GCM for iOS, gcm connection handler is never called -

i'm implementing google cloud messaging in application. i've followed tutorial given in google documentations. can send notifications device http post request, problem in applicationdidbecomeactive, google showed, try connect gcmservice the connectionhandler block never called . applicationdidbecomeactive function in appdelegate func applicationdidbecomeactive(application: uiapplication) { gcmservice.sharedinstance().connectwithhandler({ (nserror error) -> void in if error != nil { print("could not connect gcm: \(error.localizeddescription)") } else { self.connectedtogcm = true print("connected gcm") self.subscribetotopic() } }) } does 1 have solved issue? edit - correct way here complete appdelegate.swift file // // appdelegate.swift // import uikit import coredata @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate, gglinst...

c# - How to hide options in crystal report file format dialogue -

i using crystal report in visual studio 2012 asp.net c#.i want hide options crystal report dialogue because not working correctly.option following 1- microsoft word (97-2003)data 2-microsoft excel (97-2003)data 3-xml etc... how can hide these options crystal report. we need assign onload event handler reportviewer control shown below. <rsweb:reportviewer id="reportviewer1" runat="server" width="600" onload="reportviewer_onload"> </rsweb:reportviewer> then inside event handler write code hide export option in export button dropdown. all export options in reportviewer control available through listrenderingextentionslist method. list need find extension of export option wish hide, have done matching extension name in lambda expression query. once extension found need access m_isvisible property using reflection , set false. protected void reportviewer_onload(o...

Delete some specific objects from a JSON file using python and then push the file to Elasticsearch Index -

i having large json file contains many object. trying remove number objects fetched file since contains public keys , stuff.. ref have named download.json: "osfamily": "debian", "sshrsakey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2xxx", "lsbmajdistrelease": "32", "interfaces": "eth0,lo", "physicalprocessorcount": 1, "ec2_kernel_id": "pki-724545-724545", my python script downloads above json file sqs queue , pushes es server follows : import os import json import uuid import time import boto.sqs import boto boto.sqs.connection import sqsconnection boto.sqs.message import message boto.sqs.message import rawmessage sqs = boto.sqs.connect_to_region("ap-southeast-1") q = sqs.get_queue("nishantqueue") #text_file = open('download.json', 'w') m = q.read(visibility_timeout=15) if m == none: print "no message!" else: open(...

Google Cloud Messaging showing success message but not sending iOS -

so have run strange problem google cloud messaging. problem having is registering devices successfully, , when message sent success message google. devices never receive messages. the message gcm is: "result": "push notification sent successfully: {\"multicast_id\":6008387530769664000,\"success\":1,\"failure\":0,\"canonical_ids\":0,\"results\":[{\"message_id\":\"0:1442824842607522%73fc535e73fc535e\"}]}" to make things more confusing, implementation working 2 weeks ago , have not changed date. android version of app receiving messages no problems ios implementation not working. any appreciated! thanks! so solved issue after of pulling last remaining hairs out of head. it turns out devices receiving messages gcm sets priority lowest priority default. means device receives notification never displays it. priority used silent notifications wake app in background. discovered be...

ios - SecItemAdd returns -25299 when adding second certificate -

when trying add second certificate fails -25299 (the item exists.). have different ksecattrlabel. before trying delete fails code -25300 (the item cannot found.). maybe knows wrong code? did miss attributes? if let cer1 = "cert1".datausingencoding(nsutf8stringencoding), let cer2 = "cert2".datausingencoding(nsutf8stringencoding) { addcertificate(cer1, label: "testcertificate_1") addcertificate(cer2, label: "testcertificate_2") } func addcertificate(certificate: nsdata, label: string) { let query = [ string(ksecclass) : ksecclasscertificate, string(ksecattrlabel) : label, string(ksecvaluedata) : certificate ] var status = secitemdelete(query) if status != noerr { print("error deleting cer keychain. error: \(status)") } status = secitemadd(query, nil) if status != noerr { print("error addi...

jasper reports - How to connect to DB2 database from iReport 3.7.5? -

i new db2 , have no idea on db2 drivers also. have connect db2 database using ireport , generate reports. i tried connect db2 database ireport. got error like: com.ibm.db2.jdbc.app.db2driver class not found. i have added db2jcc.jar , db2jcc_license_cu.jar , db2java.jar files in ireport classpath (tools--->classpath). have added db2java.jar file in ireport services under (window menu) loading class com.ibm.db2.jdbc.app.db2driver . ireport unable load class.

c - Why does app terminate for no reason when I scroll the mouse wheel while the control key is pressed? -

when control key down , scroll mouse wheel app terminates no reason. testing on windows xp. happens when control key pressed while scrolling. if control key not pressed while scrolling, doesn't happen. don't know how other operating systems. use code below test this #include <windows.h> #include <tchar.h> lresult callback wndproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { static hwnd hedit = 0; switch(msg) { case wm_create: hedit = createwindowex(ws_ex_clientedge, text("edit"), 0, ws_visible | ws_child | ws_hscroll | ws_vscroll | es_multiline | es_readonly, 0, 0, 0, 0, hwnd, 0, getmodulehandle(0), 0); break; case wm_size: movewindow(hedit, 0, 0, loword(lparam), hiword(lparam), true); break; case wm_mousewheel: sendmessage(hedit, msg, wparam, lparam); break; case wm_destroy: postquitmessage(0); break; default: return def...

javascript - How to wait until tracking scripts have fired before redirecting the user? -

i run typical price comparison website, user browses products, clicks on link go merchant's website. before being redirected merchant's website, user presented "we redirecting you..." page. this page there allow tracking codes (google analytics, adwords, bing ads...) track event. i've placed tracking codes right before closing </body> tag, avoid blocking rendering of page while scripts loaded. i'm redirecting user meta refresh tag: <meta http-equiv="refresh" content="0; url=..."> it seems work alright, i'm worried that, depending on browser / speed of internet connection, redirect can happen before tracking scripts have fired. i delay redirect few seconds on safe side, want keep experience smooth user. i include scripts in <head> , but: this delay display on "redirecting..." page while scripts loaded this not guarantee tracking scripts have done job before user redirected: tracking ...

javascript - I cannot make "commands" in chrome extension work -

i trying write chrome extension. facing problems. unable make commands in chrome extension work. below given code have written. here manifest.json file. { "manifest_version": 2, "name": "test", "description": "this test", "version": "1.0", "browser_action": { "default_icon": "icon.png" }, "content_scripts": [ { "matches": ["<all_urls>"], "js": ["content.js"] } ], "commands": { "toggle-feature-foo": { "suggested_key": { "default": "ctrl+shift+1", "mac": "command+shift+1" }, "description": "show alert" } } } here content.js file. alert("this test 3"); chr...

sql server - Inefficient sql query with joined tables -

i have table 1700 rows of data. i'm querying using query below pulls complimentary data related tables too. it's running (around 10 seconds). i'd appreciate help/tips improving efficiency of query. many in advance. select [jobid] , (select orgname pm_clients c c.orgid in (select orgid pm_jobs j j.jobid=t.jobid , j.jobstatus>=13)) orgname , (select sector pm_clients c c.orgid in (select orgid pm_jobs j j.jobid=t.jobid , j.jobstatus>=13)) sector , (select region= case country when 1 region else (select countryname at_a_countrycodes x x.id= l.country) end pm_clientdetails l l.userid = (select userid pm_jobs j j.jobid=t.jobid)) region , (select postcode pm_clientdetails l l.userid = ...

language agnostic - Why Are Floating Point Numbers Inaccurate? -

why numbers lose accuracy when stored floating point numbers? for example, decimal number 9.2 can expressed ratio of 2 decimal integers ( 92/10 ), both of can expressed in binary ( 0b1011100/0b1010 ). however, same ratio stored floating point number never equal 9.2 : 32-bit "single precision" float: 9.19999980926513671875 64-bit "double precision" float: 9.199999999999999289457264239899814128875732421875 how can such apparently simple number "too big" express in 64 bits of memory? in programming languages, floating point numbers represented lot scientific notation : exponent , mantissa (also called significand). simple number, 9.2 , fraction: 5179139571476070 * 2 -49 where exponent -49 , mantissa 5179139571476070 . reason impossible represent some decimal numbers way both exponent , mantissa must integers. in other words, floats must integer multiplied integer power of 2 . 9.2 may 92/10 , 10 cannot expressed 2 n if n ...

How to implement something like cron jobs on Rails 4 -

i'm developing app in rails 4 , not sure how implement feature: need implement sort of cron job. instance, let's create invoice in app. need app check invoice due date , send reminder customer invoice hasn't been paid. want achieve without input user. how can achieve this? i've been thinking , thought use tool whenever check db every often. but there way it? more efficient? thanks edit: inefficiencies i'm trying avoid: the way envisaged work is: an invoice created. due date selected. date automatically added collection (i'm using mongoid, same table) every day whenever (the gem ) or cron job fire script/method/function check aforementioned collection entries. if finds entries due dates within time-range (due within 3 days instance) fire script/method notify customer invoice due. my concern if there thousands of invoices, might quite resource intensive check entries , check whether they're within specific time range. so, there better ...

ios - Adapting PinTintColor to Ray Wenderlich tutorial for mapkit -

i'm using tutorial building first app. http://www.raywenderlich.com/90971/introduction-mapkit-swift-tutorial ive searched pintintcolor nothing comes up. basically tutorial uses code set color // pincolor disciplines: sculpture, plaque, mural, monument, other func pincolor() -> mkpinannotationcolor{ switch discipline { case "sculpture", "plaque": return .red case "mural", "monument": return .purple default: return .green the trouble apple has on developers site https://developer.apple.com/library/mac/releasenotes/general/apidiffsmacosx10_11/swift/mapkit.html modified mkpinannotationview declaration from: class mkpinannotationview : mkannotationview { var pincolor: mkpinannotationcolor var animatesdrop: bool } to: class mkpinannotationview : mkannotationview { class func redpincolor() -> nscolor class func greenpincolor() -> nscolor class func purplepin...

mod_python ignoring shebang and using Python 2 instead of 3 -

i'm trying run script in browser. installed mod_python running web-based applications on server , set shebang in script: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys def index(): print ("content-type: text/html\n") print('version python {0}'.format(sys.version_info[0])) if __name__ == '__main__': index() however, when run script browser ( my application ), see python version 2. when run script console, using: python3 index.py python version 3.3.5 used expected. why mod_python ignoring shebang? upd. question closed i opted out of mod_python. i founded mistake in shebang (i should set \n line endings unix). writed wrapper on php running python 3 set executable flag on file: chmod a+x yourfile.py then, execute as: ./yourfile.py

dotnetnuke - Redirect to another control DNN -

in page_load event of custom dnn module retrieve settings have stored using following. if (((string)settings["username"] != null) && ((string)settings["username"] != "")) username = ""; { username = (string)settings["username"]; if (((string)settings["password"] != null) && ((string)settings["password"] != "")) { password = (string)settings["password"]; } if (((string)settings["baseserviceurl"] != null) && ((string)settings["baseserviceurl"] != "")) { baseserviceurl = (string)settings["baseserviceurl"]; } baseserviceurl = ""; now question how redirect module settings(called settings.ascx) control if username, password or baseserviceurl null. i'm sure it's not simple response.redirect('settings.ascx'); my aim replace username = ""; with snippet similar response.redirect(...

javascript - Node.js database initalization from multiple modules -

i have 3 modules in project: a,b,c; of them using rethinkdb, requires async r.connect call upon initialization. i'm trying make call module b command line; however, despite starting r.connect on require(), b couldn't serve this, because rethinkdb haven't loaded time module calls. in ways might code refactored, such can make sure initializations complete before calling b? i've tried use closures pass state around modules; however, due r.connect being available async function, take form of: r.connect( config.rethinkdb, function(err, connection) { rconn = connection; // module requires require("./moduleb")(rconn); require("./modulec")(rconn); ...lotsacode... }); which feels wrong. better suggestions? you can use promise, , pass connection around. this r.connect(config.rethinkdb) .then(function(connection) { //do stuff here if want initwholeapp(connection) }) and inside initwholeapp connection, can pu...

mysql set password authorization on server -

now: need input password login mysql remote terminal.but in mysql server,i don't need input password. then want input password in mysql server login. how change it? i have known. set password of user user login localhost update user set password=password('password') host='localhost'

arduino - software serial not working with my esp8266 -

i not able use esp8266 wifi module on arduino uno using software serial, problem not getting correct output. able work arduino mega has additional hardware serial tx-rx pairs. how make work on uno? i used lm1117 voltage divider esp8266, tried other voltage dividers(1k+2k), nothing seems work on uno , nano. here output getting at+rst ok ets jan 8 2013,rst c`use:2, boot mode:(3,7) load 0x40100000, len 1386, room 16 t`il 4 chkstm 0x89 load 0x3ffe8000, len 776, rtail 4 e t`ilcn1e ieko ŒÕ(j5�! -€3%1… j äsl��oÿ ai-thinker technology co. ltd. ready aj+cwmobd=3 ok ar+cwjap="max_regul]®Ã…ªÖkb½�aaÃ…¢Âª²r‰j wifi connected wifi got ip ok at+cipmux=1 ok at+¨r5uiver=1,<0 ok server ready

C: How to save the result of 2 32 bit unsigned integer into a signed integer -

i have following piece of code saves result in 32 bit signed integer , 64 bit signed integer. using 32 bit signed integer results in problem when subtract 0 2147483647 (max allowed value signed 32 bit integer) correct way should using 64 bit signed integer , should have typecast unsigned 32 bit signed 64 bit desired answer. right way it? #include <stdio.h> #include <string.h> #include <stdint.h> int main(void) { int32_t fig32; int64_t fig64; uint32_t peak_seq = 2480694779; uint32_t pkt_seq = 2480694780; uint32_t zero_seq = 0; fig32 = peak_seq - pkt_seq; fig64 = peak_seq - pkt_seq; printf("\n 32 ans : %d, 64 ans %ld\n", fig32, fig64); fig32 = zero_seq - pkt_seq; fig64 = zero_seq - pkt_seq; printf("\n 32 ans : %d, 64 ans %ld\n", fig32, fig64); fig64 = (int64_t)peak_seq - (int64_t)pkt_seq; printf("\n fix (peak - pkt) 64 ans %ld\n", fig64); fig64 = (int64_t)zero_seq - (int...

node.js - header not revealing the ip address? -

{ host: '127.0.0.1:8080', connection: 'keep-alive', 'cache-control': 'max-age=0', 'user-agent': 'mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) ubuntu chromium/44.0.2403.89 chrome/44.0.2403.89 safari/537.36', accept: '*/*', referer: 'http://127.0.0.1:8080/', 'accept-encoding': 'gzip, deflate, sdch', 'accept-language': 'en-us,en;q=0.8', cookie: 'io=bp2exrqs3skwyy4caaac11' } i using koa.io npm try , ip address of client connecting. when try following code above printed in console. can't seem ip address of client. app.io.use(function* userleft(next) { // on connect console.log(this.headers); }); i on localhost. expecting client ip address 127.0.0.1? try this.request.ip . should work... after testing realized 2 things. when behind proxy, make sure proxy forwarding clients ip using x-forwarded-for header. in theory 1....

node.js - Sitespeed.io and graphite -

i m trying use sitespeed.io , graphite , m facing problem. in fact, want use commande line : sitespeed.io -u http://google.com -b firefox --graphitehost http://127.0.0.1:3000 --graphitenamespace sitespeed.io.newyork and here's error : error: error getting versions: { [error: command failed: /home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version /home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: no such file or directory ] killed: false, code: 127, signal: null, cmd: '/home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version' } error: error: command failed: /home/skahrz/.nvm/v0.11.16/lib/node_modules/sitespeed.io/node_modules/phantomjs/lib/phantom/bin/phantomjs --version /home/skahrz/.nvm/v0.1...

Every time get result from else block cant get result from if block in android -

every time result else block cant result if block time show result else block,how solve problem please me.here code: protected void onpostexecute(string result) { if (pd != null) { pd.dismiss(); } try { log.d("request : 2 ", "" + result); if (result.equals("1")) { toast.maketext(registrationpatient.this, "you have submited successfully", toast.length_short).show(); intent intent = new intent(registrationpatient.this, duraentmenu.class); startactivity(intent); } else { textview txt2 = (textview) findviewbyid(r.id.textview2); txt2.settext("not available"); } } catch (exception ex) { ex.printstacktrace(); } }

Utf-8 on windows python -

i have html file read parse etc, it's encode on unicode (i saw notepad) when tried infile = open("path", "r") infile.read() it fails , had famous error : unicodeencodeerror: 'charmap' codec can't encode characters in position xx: character maps undefined so test tried copy paste contain of file in new 1 , save in utf-8 , tried open codecs : infile = codecs.open("path", "r", encoding="utf-8") outputstream = infile.read() but error message : unicodeencodeerror : 'charmap' codec can't encode character u'\ufeff' in position 0: charcater maps undefined i don't understand because created file in utf8. unicodeencodeerror suggests code fails while encoding unicode text bytes i.e., actual code tries print windows console. see python, unicode, , windows console . the link above fixes unicodeencodeerror . next issue find out character encoding used text in "pa...

javascript - ExtJs Layout: Can't display Ext.form.Panel -

Image
hello im trying display filter panel doenst work idea why? im tryed set window.js layout: 'border' without success found examples @ sencha im failed sencha layouts my window.js ext.define('shopware.apps.unsqlreader.view.window.window', { extend: 'enlight.app.window', alias: 'widget.main-window-view', height: '90%', width: '90%', layout: 'fit', title: '{s name=window_title}sql reader{/s}', minimizable: true, maximizable: true, menudisabled: true, enablectxmenu: false, initcomponent: function() { var me = this; me.items = me.getitems(); me.callparent(arguments); }, getitems: function() { var me = this; me.filtergrid = ext.create('ext.grid.panel', { height: '90%', width: '90%', autoscroll: true, hidden: true, cls: 'enable-scroll-bar', layout: 'border', split: true, overflowx: 'scroll', ...

Transform Image during transformPage in Viewpager Android -

i want transform image when view pager slides. have seen when viewpager slides public void transformpage(view view, float f) is called. in function want add functionality when view slides 1 2 or 2 3 image 1st page should go 2nd screen. i want implement functionality grofers android app welcome screen. please me i did using - public void transformpage(view view, float f) { if(view.gettag() != null) { int = integer.parseint(string.valueof(view.gettag())); if (f >= -1f && f < 1.0f) { if (i == 0) { animateonfirstscreen(f); } else { if (i == 1) { animateonsecondscreen(f); return; } if (i == 2) { animateonthirdscreen(f); return; } ...

multithreading - Correct Way for Threads in Java -

i beginning learn threads in java , bit confused now. hope right place ask. made little program testing: public class getinfo implements runnable { //private static boolean stoppointerinfo = false; private static thread tn; public static void startpointerinfo() { //stoppointerinfo = false; tn = new thread(new getinfo()); tn.start(); system.out.println("after start1"); } public static void stoppointerinfo() { //stoppointerinfo = true; tn.interrupt(); } @override public void run() { // while (stoppointerinfo == false) { while (! tn.isinterrupted() ) { try { thread.sleep(500); } catch (interruptedexception e) { tn.interrupt(); } . . dosomething } } } because run() method must know thread interrupted must use global definition of thread tn ? should...

c# - How to Display value of textbox in label in another form? -

hi i'm new c# , want display value of textbox1 in form1 label1 in form2. tried using this: private void button1_click(object sender, eventargs e) { label1.text = textbox1.text; form2 frm = new form2(); frm.show(); this.hide(); } but didn't work because it's in form. can tell me how right? in form1 write code private void button1_click(object sender, eventargs e) { form2 form = new form2(textbox1.text); form.show(); } in form2 write this public form2(string text) { initializecomponent(); label1.text = text; }