Posts

Showing posts from January, 2011

rest - Easier way to produce HTTPGET REQUEST URI on Android -

i'm trying make httpget request rest server, url need send contains many parameters: this uri : http://darate.free.fr/rest/api.php?rquest=adduser&&login=samuel&&password=0757bed3d74ccc8fc8e67a13983fc95dca209407&&firstname=samuel&&lastname=barbier i need login,password,first, name , last name user types, produce uri once above. is there easy way create uri, without concatenate first part of uri http://darate.free.fr/rest/api.php?rquest=adduser every &&parameter:value i prefer use uri.builder building uri s. makes sure escaped properly. my typical code: uri.builder builder = uri.parse(base_uri).buildupon(); builder.appendpath(request_path); builder.builder.appendqueryparameter("param1", value); uri builturi = builder.build();

php - Symfony2: Intermittent High Response Time/Slow SessionHandlerProxy::read() completion -

Image
i'm seeing strange behavior coming symfony2 session manager component. in particular, sessionhandlerproxy::read() function slow in production environment. symfony\component\httpfoundation\session\storage\proxy\sessionhandlerproxy::read i'm using apache2, on amazon ec2 running ubuntu, default symfony2 session storage (not redis, or similar), though i'm wondering if should be. have newrelic installed trace transactions reports following: the slow responses intermittent , haven't noticed marked correlation between requests/min , slow session read times. i'm stumped, ideas might try? i ran similar on project. identified when switched redis session handling (we've switched default file system handler php, problem still occurs intermittently). what's happening sessionhandlerproxy::read() method locked out of session , process waiting session unlock. session locking good thing , prevents race conditions in php. happening request accessi

vaadin7 - How to display a modal Window in Vaadin? -

i'm new vaadin , still learning. here trying basic vaadin project compile. want , display modal window when ui runs, having trouble. here have far: captchaui.java - import com.vaadin.server.vaadinrequest; import com.vaadin.ui.ui; public abstract class captchaui extends ui { /** * */ private static final long serialversionuid = 1l; @override protected void init(vaadinrequest request) { addwindow(new captchawindow()); } } captchawindow.java - import com.vaadin.ui.button; import com.vaadin.ui.label; import com.vaadin.ui.verticallayout; import com.vaadin.ui.window; public class captchawindow extends window { /** * */ private static final long serialversionuid = 1l; public captchawindow() { // other ui content setcontent(new label("here's ui")); // create sub-window , set content window subwindow = new window("sub window"); verticallayout subcontent = new verti

teamcity - How can I cleanly build one project in git that relies on artifacts from another project -

if have 2 projects, 1 outputs .dll , .lib stub, , links .lib stub, , extension uses generated .dll @ runtime, how can set tc build system , git repository cleanly: allow user checkout client application, build it, , run without having go find latest .dll/.lib files keep official builds , tc builds of client application in sync; if checkout , run locally, behaves same tc build version, using same .dll , .lib my initial thoughts either have appropriate .lib , .dll files in client application (like 3rd party binaries), checked in tc whenever new .dll built; it's little strange have tc pushing git, seems might work. or, have logic in pre-build step of solution goes out tc latest binaries, less because building user may not have credentials tc, , may not want latest versions. if first solution way go, there easy support in tc this? or have full checkout, update, add/commit, push during build process? there pitfalls these solutions haven't considered? you can h

javascript - Inject content script on extension reload programmatically (chrome extension) -

i creating chrome extension want able enable/disable. have made popup that. trouble is, if reload extension (or if user downloads initially) content scripts default being off. could inject content script in manifest.json results in content script being injected new tab--which not want. behavior should if download/reload extension, on default, can enable it/disable , applies every new tab. have tried put initialization in background.js not called @ startup apparently. manifest.json { "manifest_version": 2, "name": "rotten tomatoes search", "description": "this extension searches rotten tomatoes highlighted text", "version": "1.0", "browser_action": { "default_icon": "./icons/icon_on.png", "default_popup": "popup.html" }, "permissions": [ "activetab", "<all_urls>", "background"

java ee - How to change the logging level on Weblogic server -

how can change logging level on weblogic sever. my code adding logs following way : import oracle.adf.share.logging.adflogger; public class myclass{ private static final adflogger logger = adflogger.createadflogger(myclass.class); public void mymethod(){ logger.info(" "); logger.debug(" b "); logger.severe(" c "); } } i can see sever level logs in weblogic server logs. none of debug , info level logs appearing. please see answer server log location . location mentioned in answer of i-wls . in logging.xml file , can specify logging level odllogger (should finer or finest case). check whether server running in production mode or dev mode. if file system not accessible you, can change level of logging em. there many blogs available on this. -sid

CISCO MSE API : SOAP communication with Android APP -

i want know how apply soap-request parameter in android source. example... q1. right ? (<--) private static final string soap_action = " "; <-- ??? private static final string method_name = "getstationstats "; <-- right? private static final string namespace = " http://cisco/mse/location"; <-- right? private static final string url = "https://192.168.100.231/location"; <-- right? q2. change soap-xml <aesbusinesssession id="10510"/> <aesmobilestation macaddress="00:01:02:03:04:05"/> => android source request.addproperty("aesbusinesssession id" ,10510); <-- right? request.addproperty("aesmobilestation macaddress" ,00:01:02:03:04:05); <-- right? this souce. private void soapdata(string searchdata) { soapobject request=new soapobject(namespace, method_name); log.e("dd", "soap created"); soapseri

php - jQuery autocomplete not displaying results in wordpress subsections -

i using jquery autocomplete on site building. works everywhere but, in section of site using wordpress, results aren't displayed. the weirdest part in home of section, works, when go subsection or article, doesn't. this home of wordpress section, autocomplete search top left: http://www.metagame.gg/news/ this subsection not working: http://www.metagame.gg/news/category/opinion/ i have been trying figure out happening, couldn't fix it. any idea? thank in advance. you have 5 errors reason javascript not working failed load resource: server responded status of 404 (not found) jquery-migrate.min.js?ver=1.4.0:2 jqmigrate: migrate installed, version 1.4.0 http://www.metagame.gg/news/category/js/jquery.js failed load resource: server responded status of 404 (not found) http://www.metagame.gg/news/category/js/jquery-ui.js failed load resource: server responded status of 404 (not found) www.metagame.gg/:406 uncaught typeerror: $ not fun

React Native 0.26: iOS and Android version support -

which versions of ios , android react native 0.26 support? i can't find in react native main site or github pages. supported operating systems >= android 4.1 (api 16) , >= ios 7.0. you should've looked harder! it's on there github page: https://github.com/facebook/react-native

jquery - Pass Golang Variables into Javascript -

i trying pass golang variables javascript file. have read multiple articles online, including how pass variables , data php javascript? . feel i'm pretty close, alas eloquent implementation problem eludes me. i'm looking simple , elegant solution injects object value in go variable in javascript . feel common problem, lack of clear tutorial on surprises me. my first file [server.go] servers html page using templating libraries in golang passing in context , serving them through handlers. type passstruct struct{ data []int number1 int number2 int } //inject structure render func render(w http.responsewriter, tmpl string, context context){ //parse context , fill in templating variables using template } i have html document served, adds javascript file it. <html> <head> //import javascript file </head> <body> //some body </body> </html> finally, javascript file interested

oracle - How to count repeat values in multiples columns with a select -

i have position_table table: code_position name grade validity date elimination level 1 aaaa01 manager 10 01/03/2016 31/12/2999 high 2 bbbb01 analyst 09 01/03/2016 31/12/2999 low 3 cccc01 staff 05 01/03/2016 31/12/2999 high 4 bbbb01 analyst 09 01/03/2016 31/12/2999 high 5 aaaa01 manager 10 01/03/2016 31/12/2999 low 6 dddd01 intern 01 01/03/2016 31/12/2999 high 7 dddd01 intern 01 01/07/2016 31/12/2999 low i use query find , count same code_position: select code_position, count(code_position) position_table group code_position having count(code_position) > 1; and result: code_position count(code_position) 1 aaaa01 2 2 bbbb01 2 3 dddd01 2 note: the aaaa01 code repeated twice , has same date of val

java - setting servlet context attribute in a theadsafe manner -

i'm working on web application in servlet named checkurl read data xml file in init method , put node list xml in servletcontext. every request coming servlet not have read data xml again , again. node list servletcontext. there servlet in application used update xml , update servletcontext nodelist variable if xml updated. so in scenario, have synchronization in place make sure that, when writing xml happens, reading servletcontext nodelist should blocked. if not might reading data not date. to achieve this, wondering synchronization level should using. should synchronize on servletcontext object or should synchronizing on element set in servlet context or should synchronizing on servlet class instance. synchronization scope recommended minimal possible performance reasons. less chunk of code takes less time execute , less time other threads wait. on case should synchronize on nodelist level. can use collections.synchronizedlist contain node list. synchronizati

How to update a product database by entity framework core 1.0 rc2 -

in entity framework core 1.0 rc1 when published website, generated ef.cmd file, can ran ef database update update product database. how can in rc2 when there no ef.cmd file. with rc2, need install tooling via project.json file, issue dotnet restore . here sample project.json brings in entityframeworkcore.sqlite: { "version": "1.0.0-*", "buildoptions": { "emitentrypoint": true }, "dependencies": { "microsoft.netcore.app": { "type": "platform", "version": "1.0.0-rc2-3002702" }, "microsoft.entityframeworkcore.tools": { "type": "build", "version": "1.0.0-preview1-final" }, "microsoft.entityframeworkcore.sqlite": "1.0.0-rc2-final", "microsoft.extensions.configuration.json": "1.0.0-rc2-final

cordova - Google Analytics on phonegap app -

we planning use google analytics tracking in our phonegap based hybrid app. using single page architecture based on backbone. existing app , planning add tracking code now. i know there couple of ways implement - 1) use phone gap plugin ( https://github.com/danwilson/google-analytics-plugin ) 2) use web version of gtm , add tracking code pages of app. can me understand pros , cons of each , 1 recommended way? the author of https://github.com/appfeel/analytics-google here. gtm: p: easy go, no need install p: no new learning if use websites c: no native features plugin: p: native app tracking (specific features apps in ga pannel) p: idfa & remarketing (with cordova plugin add cordova-plugin-analytics-adid see https://support.google.com/analytics/answer/2444872 ) p: offers wrappers common actions ( see documentation ): trackview(screenname, options, success, error); c: needs installed: cordova plugin add cordova-plugin-analytics in opinion, if

javascript - How to wait for AJAX calls in an each loop to complete before moving on without ASYNC: FALSE -

i have setup ajax php set of functions processes number of items on page. code inserts series of tasks database, inserts supplies database based on newly created task id's. works 90% of time. seems though task id's not created first doesn't allow supplies use id's inserting database. there way make sure task inserted, supplies inserted id, move onto next one. @ end when complete redirect new page, again put in last success call on supplies portion, redirect on first loop. process generates around 5 tasks, 12 supplies per each task. reading $.when loop not work. note: after testing ajax calls submitting correctly, 1 field on of them null, , db having issue. counter method below works. $(document).on("click", "#submittasks", function(e) { e.preventdefault(); var tasks = $('#tasks').find('.box'); var project_id = $('#project_id').val(); tasks.each(function() { var trs = $(this).find('.reqtables&

php base64 encode appears unexpected character -

i have xml string in php this. <?xml version="1.0" encoding="utf-8"?><payplatrequestparameter><request_header>...... and convert base64 form by base64_encode() however, client after decoding found xml looks like <?xml version="1.0" encoding="utf-8"?><payplatrequestparameter?<request_header>....... so return error code me. i have try use iconv convert xml str utf-16 utf-8, set notepad++'s encoding utf-8 without bom. it's cant help. cant ask client change code. ok solved question. that's not xml or base64 question curl.... it seems con't put on string variable, put on array map , problem sloved

java - Android permissions - regarding permission request conflicts -

i have following code request read_ext_storage permission in activity's oncreate() : if(build.version.sdk_int >= build.version_codes.m) { if (contextcompat.checkselfpermission(this, manifest.permission.read_external_storage) != packagemanager.permission_granted) { if (activitycompat.shouldshowrequestpermissionrationale(this, manifest.permission.read_external_storage)) { // show expanation user *asynchronously* -- don't block // thread waiting user's response! after user // sees explanation, try again request permission. alertdialog.builder adb = new alertdialog.builder(this); adb.setmessage("this app needs read external storage/gallery provide images , music you're going use in video.").setpositivebutton("ok", null).create(); adb.show(); } else { // no explanation needed, can re

sql - A specific record in a table causes table to hang -

Image
i've run table can't delete contents of suddenly. select , delete operations on table hang, if abort select of rows returned (29, exact). i tested using select top n , found point after query hangs. select top 37 [id] [foo] go select top 38 [id] [foo] go results in this: (timeout of 5 minutes) the execution plans: the index on id column primary key. is there way can delete contents of table? haven't tried using truncate table yet.

android - Cannot add ActionBarSherlock lib -

i have apps including owngame, facebooksdk. built normally. after added actionbarsherlock, although haven't using function of abs error appears : dex loader] unable execute dex: method id not in [0, 0xffff]: 65536 conversion dalvik format failed: unable execute dex: method id not in [0, 0xffff]: 65536 the strange thing worked on last day. today open eclipse , start working, shit come. stuck here, bcz have use abs add different kinds of action bar abs support. some people said have multiply dex file . think it's not mainstream , not programmatic. prefer use way. can me solve ? looks app has grown point there more 2**16 methods. check out more details. how solve issue dalvik compiler limitation on 64k methods?

sql - How to update database column values in a single command(no CASE/SWITCH)? -

lets have table name swap-table. *input table* id name type ------------------ 1 name1 2 name2 b 3 name3 b i want write single command update table.the output table be **output table** id name type ------------------ 1 name1 b 2 name2 3 name3 condition: no case/switch i offer "cute" way transformation, rather i'd allow (or recommend) in production code: declare @t table (id int not null,name varchar(17) not null,type varchar(3) not null) insert @t(id,name,type) values (1,'name1','a'), (2,'name2','b'), (3,'name3','b') update @t set type = char(195-ascii(type)) select * @t produces: id name type ----------- ----------------- ---- 1 name1 b 2 name2 3 name3 (different database products may have different ways transform from

asp.net mvc - Identity Management in MVC 6 -

i have switched mvc 5 project mvc 6 , having issues identity management. as part of sign-up process, user selects role saved in userroles table using applicationusermanager. in mvc 5 version, code in accoutncontroler is public applicationusermanager usermanager { { return _usermanager ?? httpcontext.getowincontext().getusermanager<applicationusermanager>(); } private set { _usermanager = value; } } later on in controller... public async task<actionresult> register(registerviewmodel model) { if (modelstate.isvalid) { var user = new applicationuser() { username = model.email, email = model.email, isregcomplete = true}; identityresult result = await usermanager.createasync(user, model.password); if (result.succeeded) { usermanager.addtorole(user.id, model.role); await signinasync(user,

excel - range.replace method doesn't work -

here do: replace words in column d of sheet15 according list in sheet1 in sheet1 , col a housed list of words want replace, , corresponding words replace next (in col b ) below code works fine when try in new workbook when place in project, not. debugged line line, no error, words not being replaced accordingly. i can't figure out what's wrong. here know did go wrong? sub changeproc() dim fromval string, toval string, cel range, lr long sheet1 'validation list , replacement lr = .cells(.rows.count, 1).end(xlup).row each cel in .range("a1:a1" & lr) 'ori list in col fromval = cel.value2 toval = cel.offset(0, 1).value2 'replacement list in col b 'sheet15.range("d:d").replace fromval, toval, xlwhole, , true 'replace @ data sheet next end end sub code fine, make sure u use proper sheet names. check in vba project, or sure use sheets("name_here"). and

Firebase messaging, where to get Server Key? -

firebase allows send notification messages via our own application making post request. this tutorial, gives instructions how make request . however, there authorization field in header must place own server key. where can server key? there no instructions this. click settings icon/cog wheel next project name @ top of new firebase console click project settings click on cloud messaging tab the key right under server key

amazon web services - What is the cheapest way to send fast website update alerts to users as push notifications? -

i'm trying animal shelter deliver faster updates when new pet added website. happen between 0-20 times day. the website simple data dump, animals in tables row delineation (easy parse) , have unique ids. when new pet added, ideally trigger mobile notification subscribed users (could email message). faster updates sent, better, checking every 30 mins or fine. because charity, want spend little possible on resources (because want able scale other shelters might want use this). for instance mobile notifications, twitter seems candidate. looks needs wont run fees/restrictions. the part i'm stuck on how best ping site updates , publish updates twitter. 2 options i've come are: build own system. use web crawler scrapy periodically crawl site , check new petids. using aws, think nano instance (~$57 year). using dynamodb cache existing petids seems small additional cost. use twitter api post updates use rss feed generator feedity. these seem pretty expensi

c# - TabStop property is not working for usercontrol inside the panel -

i have usercontrol placed inside 1 panel , other controls buttons in panel. when usercontrol active , move other controls using tab key, usercontrol gets focus when tapstop property usercontrol set "false". in case, when have usercontrol placed in form not inside panel, usercontrol didnt focused when moving other controls using tab key. could share me details why usercontrol getting focused when placed inside panel? thanks , regards, amal

shell - How to install a module on Python? -

okay, so, i'm beginner in programming python, , found out yesterday how supposed encode pip install modulename in python command line , not in interactive shell. i'm trying download lot of modules, such send2trash module, pyperclip, requests, beautiful soup, , selenium. before checked forums installing modules, found out how needed have pip tool. i'm windows user, reason, didn't have 'scripts' folder installed when downloaded python. didn't know needed it, used raw scripts github, setup.py, , copy pasted script file editor in python, ran in interactive shell, , tried import module needed. worked pyperclip , requests module; no errors popped after imported them using import pyperclip or import requests , when tried same procedure rest of modules needed, there errors. also, when tried download modules on pypi.python.org, tried open using interactive shell, pops up, 'the file's encoding invalid python3.x...', , when click 'ok', it&

javascript - Cannot open the event or launch the Calendar app after create an event programming? -

i'm using https://www.npmjs.com/package/cordova-plugin-calendar cordova/phonegap plugin create events. events created (i tested in emulator). clicking event in calendar crash calendar app. following debug output. i tried stop calendar app , clear data , didn't help. when sideloading phone, calendar app cannot launch @ all. bug of calendar app since data written 3rd party plugins can crush app? the following javascript code used create events. $scope.addcalendar = function (title, eventlocation, notes, startdate, enddate) {//, success, error) { //var success = function (message) { console.log("success: " + json.stringify(message)); }; //var error = function (message) { console.error("error: " + message); }; //window.plugins.calendar.createcalendar("test calendar", success, error); var s = new date(startdate); var e = new date(enddate); window.plugins.calendar.createevent(title, eventlocation, notes, s, e, f

Java: How can I define an anonymous Hamcrest Matcher? -

i'm trying use junit / hamcrest assert collection contains @ least 1 element custom logic asserts true. i'm hoping there's kind of matcher 'anyof' takes lambda (or anonymous class definition) can define custom logic. i've tried typesafematcher can't figure out it. i don't think anyof i'm looking either seem take list of matchers. what testing? there's chance use combination of matchers hasitem , allof , hasproperty , otherwise implement org.hamcrest.typesafematcher . find looking @ source code of existing matchers helps. i've created basic custom matcher below matches on property public static class foo { private int id; public foo(int id) { this.id = id; } public int getid() { return id; } } @test public void custommatcher() { collection<foo> foos = arrays.aslist(new foo[]{new foo(1), new foo(2)}); assertthat(foos, hasitem(hasid(1))); assertthat(foos, hasitem(hasid(2)))

sql - Primary index in teradata -

i have defined primary index on 3 columns below primary index ( col1,col2,col3) to query table using index order of col1,col2,col3 in predicate matter ? no, pi in teradata hashed index.

Binding Data in Excel to a 2D array in C# without VSTO usage -

there's data displayed in excel using com interop c#. data stored in 2d array/list in c#. now, whenever there change/edit in excel sheet want data stored in data structure in c# change appropriately. i more happy if inserting or deleting row in excel leads similar operation on 2d data structure in c#. this question isn't duplicate. cannot use vsto add-in accomplish task though worksheet_change event can used. thanks in advance :)

android - Paypal SDK sandbox mode return status "Created" -

i have integrated paypal in android app, user can pay either paypal or card. card payment working correctly when paying through paypal returns status "created" instead of "approved". below response paypal - { "client": { "environment": "sandbox", "paypal_sdk_version": "x.xx.x", "platform": "android", "product_name": "paypal-android-sdk" }, "response": { "create_time": "2016-05-23t10:51:47z", "id": "pay-xxxxxxxxxxxxxxxxxxxxxxxx", "intent": "sale", "state": "created" }, "response_type": "payment" } why not returning status approved. wrong in code. tia for sandbox environment, need use credit card registered under sandbox personal account. check "profile" of paypal sandbox personal account , go "funding

sql - Faster count(*) with pivot tables -

my problem in our application complex select on our ms sql server (2008) database made ​​up of several joins (3 , more) used between tables created using pivot (every pivot table has 10 000 rows). only select quite fast (select returns few rows total 50 10, 000). finding count of records count(*) or filtering slower (for 10 000 records 2 seconds) is there way speed queries on total number of queries , on filtering? example caching in sql server or optimalization query? note: query database made our asmx service. note2: every table, contains pivot has primary key type: uniqueidentifier base select looks this: select table1.[id] [id], table1.[status] [status], table2.[id] [id], table2.[status] [status], ( -- pivot ) table1 left join ( -- pivot ) table2 on table2.xxx = table1.yyy ) --catch first x records.. you should use view each of pivot from ms documentation after unique clustered index created on view, vi

c# - What is the difference between these two XAML in workflow foundation? -

came across 2 types of xaml specified in windows workflow foundation, want know differences. type 1. <?xml version="1.0" encoding="utf-8"?> <!-- copyright (c) microsoft corporation. rights reserved. --> <activity mc:ignorable="sap" x:class="microsoft.samples.invokemethodusage.sequence1" mva:visualbasic.settings="assembly references , imported namespaces serialized xml namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:msi="clr-namespace:microsoft.samples.invokemethodusage;assembly=invokemethodusage" xmlns:msi1="clr-namespace:microsoft.samples.invokemethodusage;assembly=invokemethodusage, version=1.0.3516.24075, culture=neutral, publickeytoken=null" xmlns:mv="clr-namespace:microsoft.visualbasic;assembly=system" xmlns:mva="clr-namespace:microsoft.visualbasic.act

java - Unable to connect to external Bluetooth barcode scanner -

i trying connect app external bluetooth barcode scanner (yhd-3100) keep getting java.io.ioexception: read failed, socket might closed or timeout, read ret: -1 when try call .connect() bluetoothsocket. this code works fine when connect wireless printer (able print out no problem) fails barcode scanner. might cause here? here code: public class bluetoothconnect implements runnable { // code eliminated public bluetoothconnect(context context, int device) { // code eliminated } public string retrievebarcode() { bluetoothadapter = bluetoothadapter.getdefaultadapter(); if(bluetoothadapter.isenabled()) { log.d(tag, "bluetooth enabled"); getbluetoothlist(device, true); } else { log.d(tag, "bluetooth disabled"); alertdialog(title_bluetooth_off, message_bluetooth_off); } return barcode; } private void getbarcode() { log.d(tag, "

how to remove HTML5 validation error on a button click -

i have html form use html5 validation validation .when reset form data reset validation error not gone <div class="row"> <div class="col-sm-6 col-sm-offset-5"> <div class="btn-toolbar"> <button class="btn-danger btn" onclick="javascript:$('#validateform').parsley( 'validate' );">submit</button> <button class="btn-default btn" onclick="this.form.reset();">cancel</button> </div> </div> </div> finally found answer <div class="row"> <div class="col-sm-6 col-sm-offset-5"> <div class="btn-toolbar"> <button class="btn-danger btn" onclick="javascript:$('#validateform').parsley( 'validate' );">submit</button> <button class="btn-default btn" onclick="javascript:$('#validate-form').parsley(

wordpress - Get server timezone In PHP -

my client needs system report plugin running server details, means have server timezone. working wordpress. tried on this, not working on every server. $date = new datetime(); $date->settimezone(new datetimezone(ini_get('date.timezone'))); this gives me fatal error on servers, got common function server timezone? any suggestions appreciated. try this: $date = new datetime(); $date = $date->gettimezone(); $date = $date->getname(); echo $date;

permissions - Android 6 Error in Reading Device ID? -

while reading device id etc. getting error in android 6. how ever working fine in other versions 4.0,5.1 etc.. this code: public class mydevids extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); setrequestedorientation(activityinfo.screen_orientation_nosensor); packageinfo pinfo = null; try { pinfo = getpackagemanager().getpackageinfo(getpackagename(), 0); } catch (namenotfoundexception e) { e.printstacktrace(); } string version = pinfo.versionname; textview versiontext = (textview) findviewbyid(r.id.tv7); versiontext.settext("version : " + version); telephonymanager telephonymanager = (telephonymanager) getsystemservice(context.telephony_service); string imei_id = telephonymanager.getdeviceid(); textview imei_idt

authentication - How to set the username/password on Websphere MQ connection string from .Net / C#? -

how specify username , password in wmq connection string? sample connection string i'm working with. uri sampleaddress = new uri("wmq://localhost:1414/msg/queue/q1?connectqueuemanager=qm1&replyto=q2"); how put userid/password used authentication mq manager here? for v8.0 successful making connection in following way: hashtable connectionproperties = new hashtable(); connectionproperties.add(mqc.transport_property, mqc.transport_mqseries_managed); connectionproperties.add(mqc.host_name_property, _queueserver); connectionproperties.add(mqc.port_property, _portnumber); connectionproperties.add(mqc.channel_property, _channelinfo); connectionproperties.add(mqc.user_id_property, "userid"); connectionproperties.add(mqc.password_property, "password"); queuemanager = new mqqueuemanager(_queuemanager, connectionproperties); see here . although version below 8.0 please see have use

amazon web services - XML Format issue for AWS Command cs-configure-from-batches -

i'm using aws cli, in particular cs-configure-from-batches command i'm getting invalid format error per below. c:\>cs-configure-from-batches -d mysearchdomain --source c:\cloudsearch\awscloudsearchimplementation\xmlminibatch.xml --endpoint cloudsearch.ap-southeast-2.amazonaws.com --verbose connecting cloudsearch in region [ap-southeast-2] sending endpoint [https://cloudsearch.ap-southeast-2.amazonaws.com/] region [ap-southeast-2] endpoint set cloudsearch.ap-southeast-2.amazonaws.com analyzing sources. invalid format c:\cloudsearch\awscloudsearchimplementation\xmlminibatch.xml, ignoring. analysis results. this xml i'm giving it <?xml version="1.0" encoding="utf-8"?> <batch> <add id="96fd3c87-df5c-e511-8167-02cc745dd7d4"> <field name="code">000000000000010000</field> <field name="description">blah blah</field> <field name="sprcode">4100

cygwin - AutoHotKey: unexpected mintty behavior -

i'm using autohotkey show/hide mintty terminal window. here's autohotkey.ahk: showhide_(title, commandline) { outputdebug, showhide called detecthiddenwindows, on ; matchmode = 2 : title contains expression settitlematchmode, 2 outputdebug, looking window named "%title%" ifwinexist %title% { outputdebug, "%title%" found, active? ifwinnotactive %title% { winshow winwait, %title% winrestore winactivate outputdebug, window not active, activating... } else { winminimize winhide outputdebug, window active, hiding... } } else { outputdebug, "%title%" doesn't exist, starting... run, %commandline% } } #^:: f1::showhide_("ahk_class mintty", "c:\cygwin\bin\mintty.exe -t cygterm") as notice, made generic function abl

Barcode API for Windows Phone and iOS similar to Android Mobile Vision existing? -

i have created android app using relatively new android mobile vision api ( https://developers.google.com/vision/ ). wondering if guys know if there similar api, detects multiple barcodes (and faces in best case) in live view @ same time , keeps scanning though codes found, windows phone , ios. hope has idea. cheers

javascript - Accessing props of React events -

https://facebook.github.io/react/docs/events.html i'm using onmouseover , onmouseout events. ... mouseover(e) { this.setstate({hover: true}); } mouseout(e) { this.setstate({hover: false}); } render() { ... <navitem onmouseover={this.mouseover.bind(this)} onmouseout={this.mouseout.bind(this)} eventkey={0} href='#' </navitem> ... how access/set props of 2 events, property screenx you can access properties of event, in vanilla javascript. mouseover(e) { const screenx = e.screenx; this.setstate({hover: true}); } note: if want access event asynchronously, call e.persist() @ beginning of event handler.