Posts

Showing posts from August, 2013

Azure diagnostics - Event Source is always disabled -

i trying log etw events enabling azure diagnostics in cloud service. after deployment, if check in diagnostics configuration dialog, etw logs seems enabled. also, wad* tables created custom etw tables specified in diagnostics.wadcgfx file not created @ all. here logging code - public sealed class vstseventsourcewriter : eventsource { public void logexception(int eventid, string errormessage, string exceptiontype, string exceptionmessage, string stacktrace) { if (isenabled()) { writeevent(eventid, errormessage, exceptiontype, exceptionmessage, stacktrace); } } } code in diagnostics.wadcfgx - <etwproviders> <etweventsourceproviderconfiguration provider="vstseventsourcewriter" scheduledtransferperiod="pt5m"> <event id="1" eventdestination="table1" /> <event id="2" eventdestination="table2" /> <event id="3&qu

mariadb - Why do i get more results from my mysql query in php then what i ask for? -

i getting return values not exist in current database. if change query return array stays same missing values. how can did wrong? mysql server version 10.0.22 , server gives me correct result. issue must in php. my code: $select_query = "select process_state.uid process_state process_state.updatetimestamp > \"[given time]\""; $result = mysql_query($select_query, $link_identifier); var_dump($result); result: array(1) { [1]=> array(9) { ["uid"]=> string(1) "1" ["creationtimestamp"]=> null ["updatetimestamp"]=> null ["processstate"]=> null } } solution: have found code somewhere in program. program used same name ass mine. function turns mysql result array. happens between result view , script. done make result readable. parent::processupdatedafter($date); function: public function processupdatedafter($date) { $result = parent::processupdatedafter

Java/Android - How to set timeout external service call with handler -

my scenario oncreate() activity method executes following code (simplified): dialog.show(); //loading wheel try { remote.sendrequest(mydata, new myhandler()); } catch (exception e) { dialog.dismiss(); //log , react } class myhandler extends sdkspecificcompiledhandler { @override public void failure() { dialog.dismiss(); //do stuff } @override public void success() { dialog.dismiss(); //do stuff } } //i have read-only access handler! public abstract class sdkspecificcompiledhandler { public abstract void success(jsonobject successdata); public abstract void failure(jsonobject errordata); } explanation: remote service called passing handler gets called when he's done. loading wheel (dialog) shown user until success, failure or exception happens. the problem when service gets called no response ever comes. in case dialog.dismiss() doesn't called , loading wheel keeps spinning ever. wh

java - Need assistance in handling Alerts - waiting for alert to be present & Unhandled Alert exception -

i have below alert. problem is returning error on wait.until(expectedconditions.alertispresent()) line unhandledalertexception , though can see alert triggered on-screen. if remove unhandledalertexception , error have unhandledalertexception . can please provide solution this, , explanation understand happened? ` //alert alert getalert() { try{ alert alert = driver.switchto().alert(); string alertcheck = alert.gettext(); this.bcase = true; system.out.println(alertcheck); if(alertcheck.equals("define higher 0 quantity products")){ m.print("correct error message appeared! user cannot advance further!"); } else if(alertcheck.equals("invalid payment document number")){ m.print("correct error message appeared! user cannot advance further!"); }else if (alertcheck.equals("define rates products")){ m.print("correct error message

actionscript 3 - Importing my original package -

i trying import original package. said there no class files form akirasda1972_001.as. package file uploaded on sexydesign.club/particle/. package{ import flash.display.sprite; import club.sexydesign.particle.akirasada1972_001; public class akirasada1972_002 extends sprite{ private var akirasada1972_001:akirasada1972_001; public function akirasada1972_002():void{ akirasada1972_001=new akirasada1972_001(); akirasada1972_001.akirasada1972_001(); addchild(akirasada1972_001); } } }

git - Why am I told to 'cd' when updating Homebrew? -

this question has answer here: homebrew fatal: needed single revision (macos sierra) 3 answers since latest update of homebrew (to 1.0.0), instead of seeing checking out v1.0.1 in /usr/local/homebrew... when brew update or brew upgrade --all see checking out v1.0.1 in /usr/local/homebrew... checkout v1.0.1 in /usr/local/homebrew run: 'cd /usr/local/homebrew && git checkout v1.0.1 is error should about? what's going on here? updates no failing me? i had same problem. found solution in this question , similar yours: cd $(brew --prefix)/homebrew && git fetch && git reset --hard origin/master it seemed caused difference in "prefix" , "repository" directories homebrew.

ibm - How to start Websphere Mq Service? -

i using web sphere version 7.5,does require system broker starting mq service.how can start mq service when access through java code. getting following exceptions when access through code mqje001: mqexception occurred: completion code 2, reason 2009 mqje016: mq queue manager closed channel during connect closure reason = 2009 mqje001: mqexception occurred: completion code 2, reason 2009 mqje016: mq queue manager closed channel during connect closure reason = 2009 com.ibm.mq.mqexception: mqje001: mqexception occurred: completion code 2, reason 2009 mqje016: mq queue manager closed channel during connect closure reason = 2009 the code used given below public class demo { private mqqueuemanager _queuemanager = null; public int port = 1422; public string hostname = "192.168.1.5";//ip of host public string channel = "qm_orange.qm_apple";//channel name public string qmanager = "qm_orange"

java - the code won't work, calculator -

i try run program multiple times, won't run. "it looks post code; please add more details." public class calculator { private static final int add = 0; private static final int sub = 1; private int a; private int b; public int geta() { return a; } public void seta(int a) { this.a = a;} public int getb() { return b; } public void setb(int b) { this.b = b;} public int calculate(int type) { calculator meincalc = new calculator(); if(type == add){ int r = meincalc.geta() + meincalc.getb(); return r; } if(type == sub){ int r = meincalc.geta() - meincalc.getb(); return r; } return meincalc.calculate(type); } public static void main(int[] args) { calculator meincalc = new calculator(); meincalc.seta(12); meincalc.setb(8); system.out.println(meincalc.calculate(add)); system.out.println(meincalc.calculate(s

powervr sgx - Rotate Object OpenGL ES 2.0 -

we using following code plot bmp image in opengl es 2.0: (x1,y1 lower left coordinates, , x2,y2 top right coordinates of objects on screen, tempimage data pointer bmp image information stored) struct { gluint uiid; gluint uilowerleftloc; gluint uiscalematrixloc; gluint auiloc[enumuniforms]; } m_shaderprogram; gluniform2f(m_shaderprogram.uilowerleftloc, x1, y1); float afmatrix[4] = { x2 - x1, 0, 0, y2 - y1 }; gluniformmatrix2fv(m_shaderprogram.uiscalematrixloc, 1, gl_false, afmatrix); glbindtexture(gl_texture_2d, m_uitexforeground); glteximage2d(gl_texture_2d, 0,gl_rgb, width, height, 0, gl_rgb, gl_unsigned_byte, tempimagedata); glbindbuffer(gl_array_buffer, m_uivbo); glenablevertexattribarray(vertex_array); glvertexattribpointer(vertex_array, 2, gl_float, gl_false, 0, 0); gldrawarrays(gl_triangle_strip, 0, 4); gldisablevertexattribarray(vertex_array); i want rotate object in terms of angles. how can achieved ? you should send rotation/transfom-matrix shader y

c++ - Is there any downside in std::get_temporary_buffer and std::raw_storage_iterator? -

recently heard of get_temporary_buffer , raw_storage_iterator 's, seem great. in each copy it's possible avoid initialization of n elements, improve performance significantly. but have worked c++ pretty much, , didn't see anywhere usage of functionalities. there downside? why people don't use them often? why shouldn't use them every time want copy (in new container, of course)?

c# - Reusing models in Web Api -

i have c# class below public class createstudent { public int id { get; set; } public string name { get; set; } public string address { get; set; } public int age { get; set; } } and need class following properties public class editstudent { public string name { get; set; } public string address { get; set; } public int age { get; set; } public datetime date_of_birth { get; set; } } i have repeated properties except 1 field (date_of_birth) added in editstudent model. there option reuse of properties previous createstudent model i going handle these data json objects in front end angularjs based application you null-able property. public class student { public int id { get; set; } public string name { get; set; } public string address { get; set; } public int age { get; set; } public datetime? date_of_birth { get; set; } } this way have 1 student model can accommodate both use-cases.

maps - Android SphericalUtil.computeOffset with 90 degrees returns point with wrong latitude -

i'm using sphericalutil.computeoffset, takes 3 params public static latlng computeoffset(latlng from, double distance, double heading) in way: latlng position = new latlng(50, 14); double distance = 2 * 1000 * 1000 //2 thousand kilometers latlng result = sphericalutil.computeoffset(position, distance, 90); and expect resulting point have same latitude, because pass 90 degrees, "strictly east" direction, in real returns point with (46.76979930677399,40.79730389984821) coordinates. if use less distance closer origin, if bigger - becomes worse what doing wrong? maybe i'm passing wrong angle?

scala - spray marshalling cats.data.Xor -

i writing rest api using spray , having difficulties json marshalling. service returns cats.data.xor[failure, success]. how can return data type rest endpoint? how write response marshaller this? the simplest solution call toeither on value in router, lets spray-provided either marshaller take over. another solution provide own marshaller (i've done couple of times myself): import cats.data.xor import spray.httpx.marshalling.toresponsemarshaller implicit def xormarshaller[a, b](implicit ma: toresponsemarshaller[a], mb: toresponsemarshaller[b] ): toresponsemarshaller[xor[a, b]] = toresponsemarshaller[xor[a, b]] { (value, ctx) => value match { case xor.left(a) => ma(a, ctx) case xor.right(b) => mb(b, ctx) } } this lets avoid both runtime cost (probably negligible) , syntactic cost (less negligible) of converting. note cats removing xor in favor of standard library's either in upcoming versions, though, going toeither

sql - How to make a DISTINCT CONCAT statement? -

new sql developer here, how make distinct concat statement? here statement without distinct key: column employee format a25; select concat(concat(employeefname, ' '), employeelname) "employee", jobtitle "job title" employee order employeefname; here it's output: employee job title ------------------------- ------------------------- bill murray cable installer bill murray cable installer bob smith project manager bob smith project manager frank herbert network specilist henry jones technical support homer simpson programmer jane doe programmer jane doe programmer jane doe programmer jane fonda project manager john jameson

angularjs - Managing Big Data in Angular2 -

i'm following angular2 course having background of sencha extjs framework. my question pretty easy : angularjs how store , interact big data structures? in course when service retrieving data small , stored in array. why did mention extjs? because offers classes called store to, name says, store data , query it, possibility of filtering,sorting,mapping , on. let's make example : i have list of airports in world , want offer in select. of course setup service injected select offers entire list. then: -i want filter user go on typing -the array containing data array of objects other properties after name country or id which approach follow? as per comments, here's answer. in angular 2 have smart components , hosts logic , data, , dumb components pure views, no logic , preferably stateless. ideally, retrieve data api , deliver smart components either returning whole data or exposing stream rxjs. an example using rxjs be: a service calling

R: SQUAREM vs. TURBOEM for fixed point convergence? -

i have calculation in r needs iteratively call function fixed point contraction mapping. i've been using squarem function out of squarem package ravi varadhan. today while trying figure out way around issue having squarem came across turboem package, varadhan. @ first glance turboem seems same things squarem , additional functionality in dimensions. does know whether 1 or other of these packages preferred, either in general or particular applications? 1 more current/updated other? turboem seems have ability customize convergence criterion, might me out of current bind i'm in, i'm concerned there might other issues. can go off , test corresponding functions each package, if out there knows background on 2 packages might save me ton of time. there 4 underlying squarem algorithms used each package. identical*. can see underlying functions using: squarem:::cyclem1 squarem:::cyclem2 squarem:::squarem1 squarem:::squarem2 turboem:::bodycyclem1 turboem::

node.js - display array of json objects using handlebar in nodejs & express -

i'm new node , trying retrieve data mongodb , display client.i'm using handlebars purpose.i'm retrieving data mongo collection it's array of json objects not display in html. here code snippets : retrieving mongodb: usrrouter.route('/profile/projects') .get(function(req,res){ project.find({pusername:usern},function (err,projects) { if(err){console.log(err); } else{ res.render('projects',{"project":projects}) } }); }); it's results: take on screenshoot html code: <table class="table table-striped"> <thead> <tr> <th>project name</th> <th>project type</th> <th>project description</th> <th>actions</th> <

types - Haskell - Combining datatypes? -

i'm new haskell, i've looked around answer below had no luck. why doesn't code compile? newtype name = name string deriving (show, read) newtype age = age int deriving (show, read) newtype height = height int deriving (show, read) data user = person name age height deriving (show, read) data characteristics b c = characteristics b c examplefunction :: characteristics b c -> user examplefunction (characteristics b c) = (person (name a) (age b) (height c)) error: "couldn't match expected type ‘string’ actual type ‘a’,‘a’ rigid type, variable bound type signature" however, compiles fine: examplefunction :: string -> int -> int -> user examplefunction b c = (person (name a) (age b) (height c)) i realize there's simpler ways of doing above, i'm testing different uses of custom data types. update: my inclination compiler doesn't 'examplefunction ::characteristics b c' because not type safe. i.e. i'm provi

cassandra - ClusterKey Attribute in DataStax C# Driver -

i have been trying test object mapping working using attributes in datastax c# driver cassandra. there table in cassandra defined by create table test.omfieldtest ( integer int, bigint varint, stringtext text, universal uuid, bool boolean, singleprecision float, variableprecision decimal, primary key ((integer), bigint, stringtext, universal) ); i have decorated c# class map table [table("test.omfieldtest")] public class mappingtest { [partitionkey] public int32 integer; [clusteringkey(0, sortorder.ascending, name = "bigint")] public int64 bigint; [clusteringkey(1, sortorder.ascending, name = "stringtext")] public string stringval; [clusteringkey(2, sortorder.ascending, name = "universal")] public guid universal; [column("bool")] public bool boolval; [column("singleprecision")] pu

C# to JSON conversion, dictionary -

i have class follows , want json signature. it's last property actions unsure how transfer json. have tried c# json converter online gives null actions . public class notification { public string name { get; set; } public string body { get; set; } public string subject { get; set; } public string users { get; set; } public string date { get; set; } public list<dictionary<string,dictionary<string,string>>> action { get; set; } } any here appreciated. the json class be: { "name":"test", "body":"testbody", "subject":"testsubject", "users":"testusers", "date":"9/22/2016 12:26:20 pm", "action":[ { "key":{ "innerkey":"value" } } ] } for c# code: var notification = new notification()

ios - How do I show selected sticker (image) on preview subview? -

Image
i have been working on chat app can send sticker. have done far when tap on sticker on sticker view, selected sticker sent chat room immediately. asked add stickerpreviewview pops when tap on sticker , selected sticker shown on stickerpreviewview first awaiting user response. if user tap on selected sticker (uibutton sticker image on it), sent chat room. question how can given below related code shows how send sticker chat room. inputfunctionview // method called when tap on sticker - (void)selectedsticker:(nsstring *)stickerurlstring { gstickerurlstring = stickerurlstring; // added sanit - pass on stickerurlstring global variable // added sanit - initialize stickerpreviewview _stickerpreviewview = [[uiimageview alloc] initwithframe:cgrectmake(0, +180, framewidth, 120)]; _stickerpreviewview.backgroundcolor = [[uicolor blackcolor] colorwithalphacomponent:0.5f]; _stickerpreviewview.userinteractionenabled = yes; [self.superview addsubview:_stickerprev

android - register app to read e-mail attachments -

i want send file, created in app , send user. user should able open attachment app , use sent file work. mime-type : java-serialized-object : .ser my manifest <application <intent-filter> <data android:scheme="content" /> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:mimetype="application/*" android:host="*" android:pathpattern=".*\\.ser" /> </intent-filter> my view, containing emailintent: intent emailintent = new intent(intent.action_send); emailintent.setdata(uri.parse("mailto:")); emailintent.settype("text/plain"); emailintent.putextra(intent.extra_email, to); emailintent.putextra(intent.extra_cc, cc); emailintent.putextra(intent.extra_subje

r - `print(x)` not giving same output as `x` -

at r console, expected print(x) give same output x . had assumed print used console printing everything. there null here print : library(data.table) print(data.table(1)[0]) # empty data.table (0 rows) of 1 col: v1 # null # why 'null' printed here? data.table(1)[0] # empty data.table (0 rows) of 1 col: v1 # .. no 'null' here? this sample data created data.table package, think general question still applies when not using data.table : function/method used print return values @ console? # r --vanilla # r version 3.2.3 update : the fix has been merged in v1.10.5. michael chirico. after running: install.packages('data.table', type = 'source', repos = 'http://rdatatable.github.io/data.table') it work expected: library(data.table) # data.table 1.10.5 in development built 2017-05-18 00:04:56 utc; travis # fastest wa

templates - Python Tornado: nested templating -

is possible sort of eval in tornado templates? let me show example of wish do: {% c in columns %} <!-- cdata dictionary, , columns list --> <div class="cell"> {{ cdata[ {{ c }} ] }} </div> {% end %} e.g. want evaluate current value in columns , , use key search in cdata dictionary. how do that? thanks expressions in tornado templates cannot nested, they're python expressions, gives flexibility want. includes calling python eval if that's need, looks in case need {{ cdata[c] }} .

go - Running FFMPEG command through Golang exec -

i need run ffmpeg command create video images crossfade between images transition. command derived post . need run through golang os/exec package. command need run is: ffmpeg -loop 1 -t 5 -i img-0.png -loop 1 -t 5 -i img-1.png -loop 1 -t 5 -i img-2.png -filter_complex "[1:v][0:v]blend=all_expr='a*(if(gte(t,0.5),1,t/0.5))+b*(1-(if(gte(t,0.5),1,t/0.5)))'[b1v];[2:v][1:v]blend=all_expr='a*(if(gte(t,0.5),1,t/0.5))+b*(1-(if(gte(t,0.5),1,t/0.5)))'[b2v];[0:v][b1v][1:v][b2v][2:v]concat=n=5:v=1:a=0,format=yuv420p[v]" -map '[v]' -c:v libx264 -pix_fmt yuv420p -r 30 -s 1280x720 -aspect 16:9 -crf 1 -preset ultrafast output.mp4 if run command directly in terminal, works fine. however, not work through code. code takes string command , runs through os/exec package: command := "ffmpeg -loop 1 -t 5 -i img-0.png -loop 1 -t 5 -i img-1.png -loop 1 -t 5 -i img-2.png -filter_complex "[1:v][0:v]blend=all_expr='a*(if(gte(t,0.5),1,t/0.5))+b*(1-(if(gte

database - Read from a realtime API and store all messages -

i'm looking tool read events series of realtime apis , store them in database processing later. i've hobbled in python , postgres postgres has become slow presume it's write heavy. before go , build this, thinking there might can me already? or if not, tool job? logstash? thanks

web services - Difference between MSAzure VM and APP -

i'm beginning research cloud computing options. i'm trying understand difference between server running application on virtual machine in azure , using azure cloud service deploy application. help? i'd recommend reviewing document: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-choose-me/

java - Apache not aware of window path variables? -

i trying same this guy . want able result when this: $javaexec = shell_exec('java -version 2>&1'); var_dump($javaexec); however, is: 'java' not recognized internal or external command, operable program or batch file. if run "java -version" command line (i.e. cmd), get: java version "1.8.0_65" java(tm) se runtime environment (build 1.8.0_65-b17) java hotspot(tm) 64-bit server vm (build 25.65-b01, mixed mode) but can't php/apache same result. there need make apache aware of path environment variables? i tried restarting apache , pc, unfortunately no luck. ideas?

perl - When combining PDF's using CAM::PDF I get an XObject error and some fields removed in the combined file -

i trying combine 2 pdfs one. both have text boxes , required fields. im using command line tool now appendpdf.pl doc1.pdf doc2.pdf combineddoc.pdf after run command "internal error: unsupported resource type 'xobject' @ /lib/perl5//cam/pdf.pm line 3757" error open combined file generated , few random text fields deleted , required field tags removed well. how fix this?

javascript - unable to push node.js app on heroku -

i tried pushing node.js application on heroku but. no default language detected app. tried heroku buildpacks:set heroku/nodejs. still unable push. counting objects: 31, done. delta compression using 4 threads. compressing objects: 100% (24/24), done. writing objects: 100% (31/31), 5.37 kib | 0 bytes/s, done. total 31 (delta 3), reused 0 (delta 0) remote: compressing source files... done. remote: building source: remote: remote: ! no default language detected app. remote: hint: occurs when heroku cannot detect buildpack use application automatically. remote: see https://devcenter.heroku.com/articles/buildpacks remote: remote: ! push failed remote: verifying deploy... remote: remote: ! push rejected radiant-cliffs-91678. remote: https://git.heroku.com/radiant-cliffs-91678.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed push refs

c# - How to launch url on "click_action" from GCM? -

i sending following notification in third part app using amazon sns , c#: { "collapse_key": "demo","default": "lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "gcm":"{\"notification\":{\"body\":\"check out these awesome deals! said: check out these awesome deals!\",\"title\":\"test\",\"click_action\":\"www.google.com.br\"}}" } i'm trouble 2 problems: i need app goes open link on click action, using notification. possible? the notification, in android, showing 1 line of text. can configure amount of lines displays in message? can me? thanks lot. when implement notifications , can set appropriate click event depending on use case. yes, possible. i&

ignore first two characters on a column while importing csv to mysql -

i trying import csv file mysql table, need remove first 2 characters on particular column before importing mysql. statment : string strloaddata = "load data local infile 'e:/park/export.csv' table tickets fields terminated ',' enclosed '\"' lines terminated '\n' ignore 1 lines (siteid,datetime,serial,deviceid,agentaid,vehicleregistration,carpark,spacenumber,gpsaddress,vehicletype,vehiclemake,vehiclemodel,vehiclecolour,issuereasoncode,issuereason,noticelocation,points,notes)"; column issuereasoncode' has data 'lu12' , need remove first 2 characters should have integers on , not alpha numeric . need remove 'lu' column. is possible write on left(issuereasoncode +' '2). column varchar(45) , cant changed because of large data on it. thanks load data infile has ability perform function on data each column read in (q.v. here ). in case, if wanted remove first 2 characters issuereason

Cookie issue in CURL (PHP) - Cookie information not attached in CURL headers -

i have code <?php $mloginurl = "https://www.test.com/login"; $mcookiefile = dirname(__file__).'/tmpcookies/cookie'.rand().'.txt'; define('user_agent', 'mozilla/5.0 (windows nt 5.1) applewebkit/537.36 (khtml, gecko) chrome/35.0.2309.372 safari/537.36'); define('cookie_file', $mcookiefile); define('login_form_url', $mloginurl); define('login_action_url', $mloginurl); $postvalues = array( 'user[email]' => "mymail@email.com", 'user[password]' => "mypassword" ); $headers = array( "accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "cache-control: max-age=0", "connection: keep-alive", "keep-alive: 300", "accept-charset: iso-8859-1,utf-8;q=0.7

sql - DISTINCT OR GROUP BY statements not removing duplicates? -

what trying have client bills one, instead of "whale mart" coming 3 times different values wish "whale mart have 1 total value, total 25968.75 i tried using distinct , group by not show repeated values. distinct : select distinct clientname "client", hoursworked*chargerate "total billable" employee clientname not null order "total billable" desc; group by : select clientname "client", hoursworked*chargerate "total billable" employee clientname not null group clientname, hoursworked*chargerate order "total billable" desc; both methods give same output: client total billable ------------------------- --------------------------------------- whale mart 19868.75 flitter 11271 acme corp. 9067.375 flitter

java - Call ASyncTask for notification -

i want use asynctask on app sending notification user when on website, json value =\= false. the asynctask as: public class asynctask extends asynctask<string, void, string> { private static boolean onair; public static final string tag = "[notif]"; private final static int interval = 1000; //2 minutes handler mhandler = new handler(); private final httpclient httpclient = new defaulthttpclient(); final httpparams params = httpclient.getparams(); httpresponse response; private string content = null; private boolean error = false; private context mcontext; private int notification_id = 1; private notification mnotification; private notificationmanager mnotificationmanager; runnable mhandlertask = new runnable() { @override public void run() { detectonline_prepare(); mhandler.postdelayed(mhandlertask, interval); } }; public asynctask(context context){ this.mcontext = context; //get notificati

tomcat7 - What are acceptCount, maxConnections and maxThreads in Tomcat HTTP connector configuration? -

this configuration i'm using <connector port="8080" protocol="http/1.1" connectiontimeout="20000" redirectport="8443" acceptcount="1000" maxconnections="500" /> i have read doc can't able understand, please explain example if possible, , relationship between them. acceptcount -- maximum queue length incoming connection requests when possible request processing threads in use. requests received when queue full refused. default value 100. redirectport -- if connector supporting non-ssl requests, , request received matching <security-constraint> requires ssl transport, catalina automatically redirect request port number specified here. maxconnections -- maximum number of connections server accept , process @ given time. when number has been reached, server accept, not process, 1 further connection. connectiontimeout -- number of milliseconds connector wait, af

javascript - xmlhttp.open does not seem to do anything in MVC structure -

i'm trying add auto-complete function text field. used work, switched mvc structure , can't work. php/html: echo '<br><br>add member:<br>' . '<form method="post"><input type="text" name="username" oninput="findusers(this.value)" list="livesearch">' . '<datalist id="livesearch"></datalist>' . '<input type="submit" value="add">' . '</form>'; javascript: <script> function findusers(str) { if (str == "") { document.getelementbyid("livesearch").innerhtml = "no suggestions"; xmlhttp.send(); } else { if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp = new activ

ios - Firebase Authentication Error Handling -

not sure if somewhere already, couldn't find made it. hope provides someone. steps have follow: step #1 put guard statement after try login step #2 call fireerrorhandle function that's , enjoy! guard let error = autherrorcode(rawvalue: (error?._code)!) else { return } fireerrorhandle(code: error) func fireerrorhandle(code: autherrorcode) { switch code { case .invalidcustomtoken: print("indicates validation error custom token") case .customtokenmismatch: print("indicates service account , api key belong different projects") case .invalidcredential: print("indicates idp token or requesturi invalid") case .userdisabled: print("indicates user's account disabled on server") case .operationnotallowed: print("indicates administrator disabled sign in specified identity provider") case .emailalreadyinuse: print("indica

How to get all authors for current state of git? -

i've been trying find authors of git project, can ask relicensing commits. figured there'd no point in contacting authors, there may have been have had code in codebase, removed. wanted contact authors commits visible in current head. i told git log had capability, couldn't find on except like: git log --format='%an <%ae>' which sort of i'd achieve except doesn't exclude authors without code in current codebase. how can achieve this? ianal, relicensing not sure enough have permission of authors have code in current project. after contributions / commits somehow lead current state of project. that aside may want take @ git blame . shows line of file introduced in commit author. should closer solution of problem. maybe additional post processing awk ... | sort | uniq can rest. however, git blame shows information single file, have repeat files in repository. in root directory of git repository, use shell command on linux syst

angularjs - Uncaught TypeError: Cannot read property 'openDatabase' of undefined -

i want work sqlite cordova framework first time. i've read on tutorial should use ngcordova this: if (window.cordova) { db = $cordovasqlite.opendb({ name: "littlebird.db" }); //device } else { db = window.opendatabase("littlebird.db", '1', 'littlebird', 1024 * 1024 * 100); // browser } $cordovasqlite.execute(db, "create table if not exists mobilecontact (id integer primary key, name text, mobile text,exit integer)"); but facing issue while deployment uncaught typeerror: cannot read property 'opendatabase' of undefined ng-cordova.min.js (9,20659) edit : specifying location solve problem : db = $cordovasqlite.opendb({ name: "dbname.db" ,location:'?'}); (look in comments of answers post more details. )

How can we manually manipulate score field in Elasticsearch -

i working on current scenario there need boost few documents in case if there particular text search. scenario is, have set of documents have term query based on particular keyword , catch here is. let's search keyword test fetch 100 records requirement says few docs should come top result, irrespective of there weightage , other criteria. how can achieve elasticsearch, suggestion , ideas welcome. you can control relevance scripts. take at: https://www.elastic.co/guide/en/elasticsearch/guide/current/script-score.html this example using groovy: price = doc['price'].value margin = doc['margin'].value if (price < threshold) { return price * margin / target } return price * (1 - discount) * margin / target so, in pseudo-code like: if (word == 'test') { return score * n } return score

php - htmlspecialchars() on array of values fetch -

lets fetch data pdo $stmt = $this->dbh->prepare("select * posts"); $stmt->execute(); $result = $stmt->fetchall(); return $result; how should use htmlspecialchars() before displaying results using echo on view page? is ok escape array of results right after fetchall() or should escape results 1 one in view page? if use htmlspecialchars() right after fetch, following work? $stmt = $this->dbh->prepare("select * posts"); $stmt->execute(); $result = $stmt->fetchall(); $results= implode(',', $results); $results= htmlspecialchars($results); $results= explode(',', $results); return $results; disregarding whether solution in question works (it not marc b pointed out), technically doesn't matter where encode values long encoded before being written page. it's pretty design decision. let me note though htmlspecialchars() not holy grail against xss. protects when output

laravel - Displaying routes that do not exists -

i getting strange problem can't solve. worked fine yesterday today not. building api , have following in route file route::group(['prefix' => 'api'], function() { route::post('login', 'auth\authcontroller@login'); route::group(['middleware' => ['jwt.auth']], function() { route::post('logout', 'auth\authcontroller@logout'); }); }); there no other routes in route file - have double checked using vim via putty. anyway, if visit route of url, shown default laravel 5 welcome page. strange thing is, have deleted welcome.blade.php server , still displays! if try posting api route using postman, yesterday being returned token, today get notfoundhttpexception in routecollection.php line 161 i have tried clearing caches without success. has seen before? or maybe knows problem be? thanks

android - Fragment will not display in 1st attempt, but 2nd time onward it will working fine -

i have navigation drawer activity, can go different different fragments. 2 of fragments need pass value using bundle. did this //navigation drawer item select switch between different fragment @suppresswarnings({"statementwithemptybody", "constantconditions"}) @override public boolean onnavigationitemselected(@nonnull menuitem item) { int id = item.getitemid(); if (id == r.id.nav_breakfast) { fragment fragment = null; class<category> fragmentclass; fragmentclass = category.class; try { assert fragmentclass != null; fragment = fragmentclass.newinstance(); } catch (exception e) { e.printstacktrace(); } fragmentmanager fragmentmanager = getsupportfragmentmanager(); bundle args = new bundle(); args.putstring("header", "breakfast"); args.putstring("category", "1"); fragment.setarguments(a