Posts

Showing posts from March, 2010

nested - Error with YAML deep nesting -

i wanted create config file in yaml stores few translations. encapsulate everything, began nest options. while parsing file, see following error: failed read data customize.yaml\customize.yaml: yaml: line 30: mapping values not allow ed in context the parser refers following lines: contact: title: contact form: name: name error: please enter name. email: email error: please enter email address. phone: phone error: please enter phone number. message: message error: please enter message. send: send if want value error messages "belong" key, need make list of 2 items name: - name - error: please enter name. or mapping 2 items: name: value: name error: please enter name.

Python: How can I get the previous 5 values in a Pandas dataframe after skipping the very last one? -

i have pandas dataframe, df follows: 0 1 2 0 k86e 201409 180 1 k86e 201410 154 2 k86e 201411 157 3 k86e 201412 153 4 k86e 201501 223 5 k86e 201502 166 6 k86e 201503 163 7 k86e 201504 169 8 k86e 201505 157 i know in order last 5 values of column 2, have do: df[2].tail() this return values 157, 169, 163, 166, 233 . however, skip last value = 157 , last 5 values before 157 e.g. 169, 163, 166, 233, 153 . how can this? thanks in advance! use negative indices , pass these iloc slice rows of interest: in [5]: df.iloc[-6:-1] out[5]: 0 1 2 3 k86e 201412 153 4 k86e 201501 223 5 k86e 201502 166 6 k86e 201503 163 7 k86e 201504 169 you can index col of interest using above: in [6]: df.iloc[-6:-1]['2'] out[6]: 3 153 4 223 5 166 6 163 7 169 name: 2, dtype: int64 the following work uses ordinal position of column df.iloc[-6:-1,2] the syntax iloc means iloc[start:end...

html - display flex doesn't work on summary tags in Chrome? -

Image
i have display: flex on <summary> tag child <p> elements. should arrange them in row, right? , does, in firefox. not on chrome (43.0.2357.81). me? http://jsfiddle.net/laggingreflex/5e83uqf9/ summary { display: flex; flex-flow: row wrap; } summary h3 { display: block; flex: 1 100%; } <summary> <h3>heading</h3> <p>1</p> <p>2</p> <p>3</p> </summary> the summary element not structural tag, has own display properties. meant toggled visibility box details tag. according both mdn , caniuse , chrome has implemented summary tag, while firefox has not. un-implemented tag type, default behavior of major browsers draw element generic block-level element. in firefox, then, using summary tag same using div tag. in chrome; however, may rendered replaced element , mean (among other things) cannot override display type. edit: summary tag implemented in firefox...

Not able to populate the User object when using Spring OAuth2 Jdbc token store -

i updated roy clarkson's spring rest service ( https://github.com/royclarkson/spring-rest-service-oauth ) jdbc-based token store. original implementation uses in-memory token store. able see user details in user object. on other hand, after switching jdbc-based token store, fields in user object empty. appears somehow spring security not able associate access token user under obtained token when using jdbc-based token store. the in-memory token store implementation: @configuration @enableauthorizationserver protected static class authorizationserverconfiguration extends authorizationserverconfigureradapter { @autowired private datasource datasource; private tokenstore tokenstore = new inmemorytokenstore(); @autowired @qualifier("authenticationmanagerbean") private authenticationmanager authenticationmanager; @autowired private customuserdetailsservice userdetailsservice; @autowired private clientdetailsservice...

php - defining constant values & accessing globally in zend framework 2 -

i new zend2, worked cakephp & codeigniter. want write constant values in particular file & able access them in project. in cakephp configure::write('environment','dev'); write in file in config folder @ app/config/file name and can access $env = configure::read('environment'); where.. can in same way in zend framework 2, defining constants in file & can access them anywhere..? please give example how define & read path of file no short answer. cake, zf1, codeigniter made use of design pattern, discouraged, called the registry pattern (which singleton ). the fact class globally accessible, 1 of reasons why use not advised. zf2 has different architecture , offers flexible approach merging configuration based on environment variables . when comes 'using' configuration, should injecting services using service manager , service factory .

java - JavaFx: fxmlLoader.load returns Parent? -

i have scrollpane @ root level in fxml file , have following code: import javafx.scene.parent; ... parent = (parent)fxmlloader.load(getfxmlstream("my.fxml")); if (parent.getclass().isassignablefrom(parent.class)){ system.out.println("this parent"); }else{ system.out.println("this not parent");//this printeed } why load function returns not assignable parent class? from javadocs isassignablefrom : determines if class or interface represented class object either same as, or superclass or superinterface of, class or interface represented specified class parameter. so testing if runtime type of object got fxml loader equal to, or superclass of, parent . if strict subclass of parent ( vbox , borderpane etc), false . if want test if value have kind of parent , usual way instanceof : if (parent instanceof parent)){ system.out.println("this parent"); }else{ system.out.println("this not parent"...

java - How to convert from String[] to JTextField[] -

i trying make jtextfield array based on word length input file. can't seem find way convert string[] jtextfield[]. //splits word chosen word list array jtextfield[] wordamount = new jtextfield[word.length()];//creates jtextfield each letter string[] items = word.split(""); string temp; (int j = 0; j < items.length; j ++) { temp = items[j]; wordamount[j].settext(temp); } you need initialize each jtextfield in jtextfield array before call method before call settext() method add statement wordamount[j] = new jtextfield(); so change loop this for (int j = 1; j < items.length; j++) { temp = items[j]; wordamount[j] = new jtextfield(); wordamount[j].settext(temp); }

operand type clash int is incompatible with date in sql server -

create table employee2 ( employeeid int primary key identity(1,1), firstname varchar(50)null, lastname varchar(50)null, salary bigint not null, joiningdate date not null, departmentname varchar(50) ) this table have created. , want insert values given below. insert employee2 (firstname,lastname,salary,joiningdate,departmentname) values('john','abraham',1000000,2013-01-01,'banking'), ('michael','clerk',800000,2013-01-01,'insurence'), ('roy','thomos',700000,2013-01-01,'banking'), ('tom','jose',600000,2013-02-01,'insurence'), ('jerry','pinto',650000,2013-02-01,'insurence'), ('philip','mathew',750000,2013-01-01,'services'), ('testname1','123',650000,2013-01-01,'services'), ('john','cook',600000,2013-02-01,'insurence'); but getting error like: operand type clash: int incompatible date ...

xaml - ControlTemplate Trigger -

<style targettype="{x:type textbox}"> <setter property="snapstodevicepixels" value="true" /> <setter property="overridesdefaultstyle" value="true" /> <setter property="keyboardnavigation.tabnavigation" value="none" /> <setter property="focusvisualstyle" value="{x:null}" /> <setter property="minwidth" value="120" /> <setter property="minheight" value="25" /> <setter property="allowdrop" value="true" /> <setter property="fontsize" value="16"/> <setter property="fontfamily" value="arial"/> <setter property="verticalcontentalignment" value="center"/> <setter property="verticalalignment" value="bottom"/> <setter property="template...

asp.net - How to get binary to image from database using vb.net -

convert binary image using vb.net database. have stored images binary format in sql database. how retrieve value image using vb.net bytes = ctype(dt.rows(0)("data"), byte()) imgprv.imageurl = bytes i suggest converting bytes base64 string , applying image url: bytes = ctype(dt.rows(0)("data"), byte()) dim base64string string = convert.tobase64string(bytes, 0, bytes.length) imgprv.imageurl = "data:image/png;base64," & base64string

Unix variables - The correct way -

is recommended way of writing shell script? #!/bin/bash var_version_number = "x.y" cd /path/to/var_version_number no, correct way: #!/bin/bash var_version_number="1.3" cd /path/to/file/${var_version_number}/more/path the things missing example: dollar sign ($) in front of variable name (var_version_number). there should no space between variable name , equal sign (=) in assignment. it practice surround variable name in curly braces, not needed here. also note once script on , shell exits, original directory started in. effect of cd command limited shell script running in, not shell launching script from.

c# - Create Expression<Func<TEntity,object>> dynamically and call Aggregate to IQueryable<TEntity> -

i'd create expression<func<tentity, object>> later pass function parameter. if use following function creating it... public expression<func<tentity, object>> getinclude(string property) { parameterexpression parameter = system.linq.expressions.expression.parameter(typeof(tentity)); system.linq.expressions.expression ppty = system.linq.expressions.expression.property(parameter, property); lambdaexpression lambda = system.linq.expressions.expression.lambda(ppty, parameter); return (expression<func<tentity, object>>)lambda; } ... error @ runtime trying return result, saying type cannot converted object. example, if tentity purchases , want purchases.customers giving "customers" parameter. on other hand, if function become generic like... public expression<func<tentity, tdest>> getinclude<tdest>(string property) tdest: class, new() { parameterexpression parameter = system.linq.ex...

grid - ExtJS 5: Chrome, with data-qtip with column selection doesn't work -

i have added following data-qtip each column in grid renderer: function (val, meta, record){ meta.tdattr = 'data-qtip=" ' + val + '"'; return val; } the above code adds mouseover each value in grid columns. works fine in ff in chrome, same code, if use dropdown menu column hide/show column, dropdown menu disappears fast user make selection.

javascript - React DnD in a Meteor app -

i using react meteor app , need integrate this list of items. there itemlist.jsx , itemrow.jsx since item has text, links, images, ect. itemrow.jsx itemrow = reactmeteor.createclass({ templatename: "itemrow", proptypes: { item: react.proptypes.object.isrequired, showpooltitle: react.proptypes.bool, }, getinitialstate: function() { return { editing: false, drop: this.props.item, pool: {}, } }, startmeteorsubscriptions: function() { meteor.subscribe("itemrow", this.props.item._id); }, getmeteorstate: function() { return { item: items.findone(this.props.item._id), pool: pools.findone(this.props.drop.poolid), }; }, toggleediting: function() { this.setstate({ editing: !this.state.editing }); }, render: functi...

.htaccess - How to Block Spam Referrers like darodar.com from Accessing Website? -

i have several websites daily around 5% of visits spam referrers. there 1 strange things noticed referrers: show in google analytics, cannot see them in custom designed table insert visitors site, think manipulate ga code, never reaching site itself. if follow link, redirect affiliates link. i don't know whether have impact on seo/serp, rid of them. may via htaccess file? one peculiar aspect visitors different forum pages. e.g.: forum.topic221122.darodar.com , forum.topic125512.darodar.com etc., block full darodar.com domain. besides darodar.com , there econom.co , iloveitaly.co bothering stats. can block them htaccess ? this blog post suggests spam referrers manipulate google analytics , never visit site, blocking them pointless. google analytics offers filtering if want mitigate fake site hits.

How to send data to command line after calling .sh file? -

i want install anaconda through easybuild. easybuild software manage software installation on clusters. anaconda can installed sh anaconda.sh . however, after running have accept license agreement , give installation location on command line entering <enter> , yes <enter> , path/where/to/install/ <enter> . because has installed automatically want accepting of terms , giving install location in 1 line. tried this: sh anaconda.sh < <(echo) >/dev/null < <(echo yes) >/dev/null \ < <(echo /apps/software/anaconda/1.8.0-linux-x86_64/) > test.txt from test.txt can read first echo works <enter> , can't figure out how accept license agreement, sees not sending yes: do approve license terms? [yes|no] [no] >>> license agreement wasn't approved, aborting installation. how can send yes correctly script input? edit: sorry, missed part having enter more 1 thing. can take @ writing expect scripts. thegeekstu...

azure - ARM template - website deployment failure -

Image
i’m attempting use azure resource manager (arm) template files deploy asp.net website , hitting roadblock. nascent feature of azure there isn’t know-how out on web it, hoping here can instead. i can create new site (i.e. microsoft.web/sites resource) in new resource group i.e. works when define website in arm template so: { "apiversion": "2014-06-01", "name": "[parameters('sitename')]", "type": "microsoft.web/sites", "location": "[parameters('sitelocation')]", "tags": { "[concat('hidden-related:', resourcegroup().id, '/providers/microsoft.web/serverfarms/', parameters('hostingplanname'))]": "resource", "displayname": "website" }, "dependson": [ "[concat('microsoft.web/serverfarms/', parameters('hostingplanname'))]" ], "properties": { ...

java - Typesafe Activator: "run" works, but "start" fails with an error -

i'm working on project, using java play-framework. until tested executing ./activator run , worked flawlessly. now, wanted try , deploy running ./activator start instead. raises compilation error though, , don't know why because code seems in order. the error: [error] /home/ghijs/psopv/psopv-2015-groep13/code/activator-codesubmission/app/helpers/login.java:12: illegal cyclic reference involving method login [error] public class login { [error] ^ [error] 1 error found [error] (compile:doc) scaladoc generation failed [error] total time: 16 s, completed jun 4, 2015 2:02:31 pm the "login" class: package helpers; import models.user; import play.logger; import play.data.form; import play.data.validation.constraints.minlength; import play.data.validation.constraints.required; public class login { @required @minlength(4) private string username; @required @minlength(5) private string password; private string userid; ...

mdns - How to 'avahi-browse' from a docker container? -

i'm running container based on ubuntu:14.04, , need able use avahi-browse inside it. however: (.env)root@8faa2c44e53e:/opt/cluster-manager# avahi-browse -a failed create client object: daemon not running (.env)root@8faa2c44e53e:/opt/cluster-manager# service avahi-daemon status avahi mdns/dns-sd daemon running the actual problem have pybonjour error; pybonjour.bonjourerror: (-65537, 'unknown') i've read linked problem avahi-daemon. so; how connect avahi-daemon container ? p.s. have switch dbus off in avahi-daemon.conf fill make possible start it, otherwise avahi-daemon won't start, dbus error this: (.env)root@8faa2c44e53e:/opt/cluster-manager# avahi-daemon found user 'avahi' (uid 103) , group 'avahi' (gid 107). dropped root privileges. avahi-daemon 0.6.31 starting up. dbus_bus_get_private(): failed connect socket /var/run/dbus/system_bus_socket: no such file or directory warning: failed contact d-bus daemon. avahi-daemon 0.6.31 exiting...

python - to_latex() produces incorrect result with MultiIndex DataFrame -

i suspect bug 0.16.1 , can confirm i'm not being idiot? the df.to_latex() method prints data shifted down 1 row respect multiindex (but right thing single-level index.) import pandas pd import numpy np c = ['gbr', 'usa', 'fra'] n = 5 x = pd.dataframe(np.round(np.random.random([n, 3]), 2)) x['from'] = np.random.choice(c, size=n) x['to'] = np.random.choice(c, size=n) print x print x.set_index('from').to_latex() print x.set_index(['from', 'to']).to_latex() this results in: 0 1 2 0 0.22 0.45 0.65 gbr fra 1 0.14 0.30 0.75 gbr usa 2 0.10 0.92 0.25 fra usa 3 0.78 0.07 0.55 usa gbr 4 0.24 0.32 0.28 fra fra # table looks fine \begin{tabular}{lrrrl} \toprule {} & 0 & 1 & 2 & \\ \midrule & & & & \\ gbr & 0.22 & 0.45 & 0.65 & fra \\ gbr & 0.14 & 0.30 & 0.75 & u...

android - Sent Blob results empty -

in cordova/phonegap app i'm testing on android 4.0 need send file server multipart/form-data through ajax. i have file content in arraybuffer , put in formdata , firstly creating blob it. the problem file sent appears empty. this console session (performed on android platform through weinre ) can see that: the file content loaded in mybuf a blob created mybuf (and size non-zero) a formdata object created sent ( fd ) (i'm using webkitblobbuilder because blob constructor raises typeerror on platform) ❯ mybuf ▼ arraybuffer bytelength: 23673 ▶ __proto__: arraybuffer ❯ var bb = new webkitblobbuilder() undefined ❯ bb.append(mybuf) undefined ❯ myblob = bb.getblob("image/jpeg") ▼ blob size: 23673 type: "image/jpeg" ▶ __proto__: blob ❯ fd = new formdata() ▶ formdata ❯ fd.append("pics[]", myblob, "1433412118197.jpg") undefined when perform ajax request passing fd object data, see...

sql - MSSQL stored procedure select all columns -

i have stored procedure select statement looks this: select @keyname dbo.ficonfig (nolock) issuerkey = @issuerkey where i'm creating this: create procedure get_ficonfig @issuerkey int, @keyname nvarchar(100) where keyname column name retrieving data from. my question: possible pass in * select columns although procedure asking specific column name? edit: unfortunately think may have worded question poorly. looking way see if stored procedure tell if wanted select records table, or specific columns record. i've solved own problem using null checks , if/else statements. you can use dynamic query: create procedure get_ficonfig @issuerkey int, @keyname nvarchar(100) declare @s varchar(500) = 'select ' + @keyname + ' dbo.ficonfig (nolock) issuerkey = ' + cast(@issuerkey varchar(10)) exec(@s) you should careful here. possible sql injection . can not pass column names parameters dynamic query, there no other way. but can se...

java - Spring mvc converting json response links to https -

i have spring mvc rest service returns json response (gson serialized) . response contains nodes specific link example : { link : "http://www.test.com"} when access service using http it's fine , when accessing service through https links in result converted https { link : "https://www.test.com"} any idea? full example: @requestmapping(value = "/test",method = {requestmethod.get,requestmethod.options}, produces = "application/json;charset=utf-8") @responsebody public string gettest(@pathvariable("id") string id, model model, httpservletrequest request, httpservletresponse response) { response.setheader("access-control-allow-origin", "*"); string test = "{ link : \"http://www.test.com\"}"; return test; } i had issue before , after searching full day not find solution. did work around remove protocol link url in json response before returning it.

r - SparkR collect method crashes with OutOfMemory on Java heap space -

with sparkr, i'm trying poc collect rdd created text files contains around 4m lines. my spark cluster running in google cloud, bdutil deployed , composed 1 master , 2 workers 15gb of ram , 4 cores each. hdfs repository based on google storage gcs-connector 1.4.0. sparkr intalled on each machine, , basic tests working on small files. here script use : sys.setenv("spark_mem" = "1g") sc <- sparkr.init("spark://xxxx:7077", sparkenvir=list(spark.executor.memory="1g")) lines <- textfile(sc, "gs://xxxx/dir/") test <- collect(lines) first time run this, seems working fine, tasks run successfully, spark's ui says job completed, never r prompt : 15/06/04 13:36:59 warn sparkconf: setting 'spark.executor.extraclasspath' ':/home/hadoop/hadoop-install/lib/gcs-connector-1.4.0-hadoop1.jar' work-around. 15/06/04 13:36:59 warn sparkconf: setting 'spark.driver.extraclasspath' ':/home/hadoop/hadoop...

java - Service Activator not completing before next message from JMS is processed -

the setup: using spring integration grab messages message queue. message comes in xml format , method named parsecustpaymentxml gets called service activator, processes xml message, , stores in java objects. afterwards, method named processcustpayment called parsecustpaymentxml takes java objects , inserts them database. below how have inbound jms , service activator set up... <int:channel id="jmsinchannel" /> <int-jms:message-driven-channel-adapter destination="custpaymentrequestdestination" connection-factory="jmsconnectionfactory" channel="jmsinchannel" concurrent-consumers="1" /> <int:service-activator id="parsecustpaymentserviceactivator" ref="custpaymentservice" input-channel="jmsinchannel" method="parsecustpaymentxml" requires-reply="tru...

javascript - Protractor custom locator fails to locate the element -

i have added custom data attribute elements need identify , interact using protractor. attribute data-test-id . created custom locator in onprepare callback in conf.js detect element. below: onprepare: function () { by.addlocator('testid', function(value, parentelement) { parentelement = parentelement || document; var nodes = parentelement.queryselectorall('[data-test-id]'); return array.prototype.filter.call(nodes, function(node) { return (node.getattribute('[data-test-id]') === value); }); }); } my angular app has h1 text home inside it. added data-test-id attribute it: <h1 data-test-id="test-element">home</h1> here protractor test: test.js : describe('navigate website.', function() { it('should have heading home', function() { browser.get('http://localhost:8888/#/'); browser.waitforangular(); var textvalue = 'home'; ...

c# - Windows phone store update app package on same app version? -

i have uploaded app version 1.0.0.1. want update package of submission , not version in windows phone store can that? if updating package, update version, users know have latest version. https://msdn.microsoft.com/en-us/library/windows/apps/gg442301(v=vs.105).aspx https://msdn.microsoft.com/en-us/library/windows/apps/ff769509(v=vs.105).aspx

rgb - How to create a color scale between two given colors in GNU R -

i have 2 colors rgb-codes a <- "#000099" , b <- "#ccccff" let's need 10 colors, , these colors need start a , end color b , , other colors "between" these 2 "equal distance"... so, looking like givecolorvector(start="#000099", end="#ccccff", length=10) and should return vector this: [1] "#000099" "0000ff" (...) "6666ff" "#7777ff" "#8888ff" "#9999ff" "#ccccff" how do in r? use colorramppalette so: <- "#000099" b <- "#ccccff" colorramppalette(colors=c(a,b))(10) [1] "#000099" "#1616a4" "#2d2daf" "#4444bb" "#5a5ac6" "#7171d1" "#8888dd" [8] "#9e9ee8" "#b5b5f3" "#ccccff" in place of a , b use r's color names, such colors=c("blue","green") , , can use more 2 colors if l...

javascript - Should generic React List component receive props or listeners from parent? -

this more style/theory question think both methods work. here scenario: i have infinitelist component want keep generic. gets current list of item ids parent, figures out ones has render. that, pull appropriate ids list, go fetch full data id store. my question this: keep generic, infinite list component can't hardcode store should getting full item data (say have 10 different types of items have own store). however, makes more sense me scrolling around , changing set of items being displayed state thing. so, think makes sense to: a) pass list of ids props, add/remove listeners in parent component, list component knows listen to? b) or make more sense pass in both list , full set of item data available in props , have parent component listen appropriate store? part of motivation behind "listening" if store doesn't have items, must fetch them, need list rerender once itemstore updates. inspired partly here: reactjs: modeling bi-directional infinite s...

java - Selected Row in JTable along with Sorting -

i have odd issue jtable. i put data in jtable db. when user double clicks on cell, copies cell contents of first column of row user double clicked. far, works perfect. the problem arises when user sorts jtable clicking on header. when table has been sorted , when user double clicks on row, doesn't stored on row's first column. copies stored on first column of row when jtable not sorted. any ideas? problem: the problem here getting initial rows indexes in jtable tablemodel , , not relevants row indexes shown in table view. solution: you can map shown indexes of sorted jtable relevants ones in datamodel using convertrowindextomodel(index) method takes in input row index in view , returns index of corresponding row in model. let's have following jtable: tablemodel mymodel = createmytablemodel(); jtable table = new jtable(mymodel); table.setrowsorter(new tablerowsorter(mymodel)); and loop throught model indexes , use method each index correspondi...

java - Why this code throws concurrent modification exception? -

this question has answer here: how deal concurrentmodificationexception 4 answers code: public static void main(string[] arf) { list<integer> l = new arraylist<>();// having list of integers l.add(1); l.add(2); l.add(3); (int : l) { l.remove(i); } system.out.println(l); } i want know reason behind thoring exception. know know internally there iterator being used in each , can avoided using while loop. because enhanced loop has created implicit iterator, , not using iterator remove elements list. if want remove elements list whilst iterating, need using same iterator: iterator<integer> iterator = l.iterator(); while (iterator.hasnext()) { int = iterator.next(); // ... iterator.remove(); } you can't same using enhanced loop.

android - Json Volley Fragments from TabHost -

i'm downloading data server , want set listview. doesn't work. below it's method provides data server. @override public void getvillages(string name, final taskdonelistener<village> listener) { string url = apiservice.url_base + "villages/search?s=" + name; final jsonparser jparser = new jsonparser(); jsonobjectrequest req = new jsonobjectrequest(url, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { try { village village = new village( response.getlong("id"), response.getstring("name"), response.getstring("logo"), response.getboolean("isactive"), response.getstring("contact_person"), response.getstring("contact_email"), ...

ios - How can I convert "SignalProducer<Bool, NoError>" to "SignalProducer<Bool, NSError>" of ReactiveCocoa 3? -

i tried creating instance of action<anyobject?, bool, nserror> of reactivecocoa 3. let action: action<anyobject?, bool, nserror> = action { _ in if self.flag { return self.foosignalproducer // signalproducer<bool, noerror> } else { return self.barsignalproducer // signalproducer<bool, nserror> } } this code isn't able compile error 'signalproducer<bool, noerror>' not convertible 'signalproducer<bool, nserror>' . how can convert signalproducer<bool, noerror> signalproducer<bool, nserror> ? you can use maperror operator. along lines of: self.foosignalproducer |> maperror { _ in nserror() } edit: as justin points out below, promoteerrors designed case: self.foosignalproducer |> promoteerrors(nserror)

c# - Detect if On Screen Keyboard is open -

i deteck if osk.exe process (on screen keyboard) open. it's code open osk: process.start("c:\\windows\\system32\\osk.exe"); do have ideas how can check , prevent launch twice , more process ? you running process name below: var arrprocs = process.getprocessesbyname("osk"); if (arrprocs.length == 0) { process.start("c:\\windows\\system32\\osk.exe"); }

Tracking http requests sent by the browser using javascript/jquery -

using javascript or jquery, there way track http requests(including headers, parameters, etc.), sent webpage? want achieve similar functionality of 'network' tab of google chrome's developer console. solutions found either tracking ajax requests or requests made using javascript(using xmlhttprequest object). functionality should cross browser compatible. you have 3 choices. make sure know places request can fired, , attach event it, requestfired . , bind onrequestfired event in javascript / jquery code. go through network developers document or each browser , based on browser, execute it. feature may not available in older browsers internet explorer 7 , 8. google developers doc firefox network information api networkinformation.connection if particular server, read server log using server side script , access using endpoint. can use long polling method , fetch contents of log, may way: // jquery $(document).ready(function () { ...

Not able to integrate logstash with mongodb -

i want send output of logstash mongodb using mongodb output plugins of logstash in linux. using logstash-1.5.0.beta1 , mongodb-3.0.3 versions. getting following error : loaderror: no such file load -- mongo require @ org/jruby/rubykernel.java:1065 require @ /root/logstash-1.5.0.beta1/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 require @ /root/logstash-1.5.0.beta1/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 require @ /root/logstash-1.5.0.beta1/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65 register @ /root/logstash-1.5.0.beta1/lib/logstash/outputs/mongodb.rb:37 each @ org/jruby/rubyarray.java:1613 start_outputs @ /root/logstash-1.5.0.beta1/lib/logstash/pipeline.rb:158 run @ /root/logstash-1.5.0.beta1/lib/logstash/pipeline.rb:79 execute @ /root/logstash-1.5.0.beta1/lib/logstash/agent.rb:141 run @ /root/logstash-1.5.0.beta1/lib/logstash/...

Load properties file external to webapp in Jetty -

i have webapp deploy on jetty server through jetty runner. inject properties read through properties file using spring. of now, have kept properties file within webapp (in web-inf/classes) directory. want keep properties file external webapp , inject them using spring. there configuration in jetty.xml file can can achieve this? i managed solve adding properties file command line parameter while starting jetty. like: java -dexternal.properties.file=myfile.properties -jar jetty.jar in java code, read getting system property , using fileutils file. string externalpropertiesfile = system.getproperty("extern.properties.file"); file file = fileutils.getfile(externalpropertiesfile);

file upload - Primefaces FileUpload is fired when mouse is not on the button -

Image
i have application has many problem primefaces fileupload component. show showcase: in application, have same behavior <p:fileupload> . should ? nb : have tried handle css no success.

mysql - Calling Input/Output type Store Procedure in Sequelize -

i've created store procedure in mysql expect inputs , return output. call store procedure in mysql running call createcoupon(1236,321, @message); select @message message and getting output in message object. now here comes situation need call sp in sequelize. i'm working on sailsjs project , using sequelize module queering. i've created database connection in config/db_config , connection string is: var sequelize = new sequelize(db.name, db.user, db.pass, { host: db.host, dialect: "mysql", // or 'sqlite', 'postgres', 'mariadb' port: 3306, // or 5432 (for postgres) maxconcurrentqueries: 100, pool: { maxconnections: 50, maxidletime: 2000 }, queue: true }) and i'm calling in controller like: var sequelize = require('sequelize'); var sequelize = require('../../config/db_config').dbase; function setcoupon(couponcode, userid, setcouponresponse) { var createcouponsql...

java - JavaFx dialog doesn't show all content text -

Image
i have following dialog: the last line shows part of text - text cut , instead of text "..." shown. how can make dialog show text? edit 1 code alert alert = new alert(alerttype.confirmation); alert.settitle("Выход из программы"); alert.setheadertext("Вы действительно хотите выйти из программы?"); alert.setcontenttext("Нажмите ОК для выхода. Для продолжения работы с программой нажмите Отмена."); optional<buttontype> result = alert.showandwait(); if (result.get() == buttontype.ok){ } else { } edit 2 problem appears in linux (centos 7.1 , gnome 3). in windows 7 text shown @ 2 lines , ok. edit 3 think it's linked height of dialog window. when alert.setresizable(true) , increase height of window second line appears. i didn't dig deeper reason, alternatively can set inner dialog pane's content instead: alert.getdialogpane().setcontent( new label("твое содержание текста")); edit: maybe kn...

sql - who to write multilanguage or only( urdu) in wpf application textbox with vb.net? -

Image
this code not working. done code? plz me! public sub urdu_gotfocus(byval inputlang inputlanguage) if inputlanguage.installedinputlanguages.indexof(inputlang) = -1 throw new argumentoutofrangeexception() end if inputlanguage.currentinputlanguage = inputlang end sub if try code private sub urdu_textchanged(sender object, e textchangedeventargs, byval inputlang inputlanguage) handles urdu.textchanged if inputlanguage.installedinputlanguages.indexof(inputlang) = 1 throw new argumentoutofrangeexception() end if inputlanguage.currentinputlanguage = inputlang end sub then error occurred error 1 method 'private sub urdu_textchanged(sender object, e system.windows.controls.textchangedeventargs, inputlang system.windows.forms.inputlanguage)' cannot handle event 'public event textchanged(sender object, e system.windows.controls.textchangedeventargs)' because not have compatible signature. c:\users\atk\documents\visual studi...

notepad - How to press "ALT+F4" using AutoIt -

i new in autoit. have run notepad using following code in autoit: run("notepad.exe") now want quit application using "alt+f4". how press "alt+f4" autoit tool? you'll want check out documentation autoit - pretty good. the 1 you're looking is: https://www.autoitscript.com/autoit3/docs/functions/send.htm keep in mind want make sure window active or you're targeting window. with that, recommend using : https://www.autoitscript.com/autoit3/docs/functions/controlsend.htm controlsend() works in similar way send() can send key strokes directly window/control, rather active window.

java - Unable to access jarfile using subprocess -

i trying run java command in python this: import subprocess subprocess.popen(['java -xmx1024m -jar /maui-standalone-1.1-snapshot.jar run /data/models/term_assignment_model -v /data/vocabulary/nyt_descriptors.rdf.gz -f skos'], cwd=r'/users/username/repositories/rake-tutorial/', shell=true) unfortunately throwing unable access jarfile /maui-standalone-1.1-snapshot.jar error. have checked permissions , tried number of other options including using os.system command run shell script. error still remains. there seem lot of people have encountered same problem none of solutions seem work me. suggestions? let me know if need more information. in advance!

sockets - MIT Kerberos - kpropd does nothing -

i'm attempting start kpropd on centos box. gives no status , doesn't start process. exit code "1" i started in debug mode: kpropd -d -s it shows: kpropd: address in use while binding listener socket i don't see in netstat listening on port 754. system vm , has eth0 , lo. krb5kdc running correctly. this local i'll post iptables entry anyway: -a input -p tcp -m tcp --dport 754 -j accept any thoughts on might blocking socket? well, took doing there 2 problems. first, starting kpropd manually -d -s, socket getting blocked /sbin/portreserve. port released during init script, if want have stop portreserve temporarily, or release port /sbin/portrelease. recommend not leaving portreserve off though, disable test. service portreserve stop the real issue didn't have kpropd.acl, or rather had named wrong. strange "service" showed nothing, returned nothing. in case, after creating file kprop inits correctly. ...

locust - can locustio store data for reuse? -

i want store data later use in locust, example response = self.client.post('/' "username:'xx', password:"xx") self.client.data1 = response.content['data1'] self.client.data1 can used in next request, when simulate more, self.client.data1 lost. there better way store data later use?

git - Get result of merging a PR while it is already merged -

for pr number 1 github automatically creates ref refs/pulls/1/head , refs/pulls/1/merge . latter contains result of merge , useful e.g. ci (because want test result of merge). after merging pr, refs/pulls/<number>/merge no longer available (i suppose because pr no longer mergeable). want run test on version merged while ago. there easy way access result of merged pr, given pr number? the following should trick though should aware there possibly multiple "children" of commit (someone else base work on pr , merge master again later): $ git rev-list -n1 upstream/pull/<number>..upstream/master this works getting first commit walking upstream/pull/<number> upstream/master . luckily github leaves upstream/pull/<number> on last commit of pr. here's example of https://github.com/rdflib/rdflib : it's current history looks this: * 371263f - (upstream/pull/486) removed debugging print statement ... * fe3fa52 - (upstream/mast...