Posts

Showing posts from July, 2015

winsql - Informix error when calling a procedure -

recently had informix database server cloned. created new stored procedure called sp_foo. when run below sql execute procedure execute procedure sp_foo(); i below error when call stored procedure. error: system command cannot executed or exited non-zero status. (state:s1000, native code: fffffd64) i'm little baffled why error. informix not give me additional data find causing problem. ps: i'm new informix , i'm using winsql/informix odbc run sql. when ran sql in original server there no errors. hard give definitive answer little go on, looks permissions or environment problem. system() call inside sp attempting execute operating system command, , either unable find it, or failing. the fact sp works when run on server suggests me either: when executed via odbc running under different user account different privileges, or the command being executed system() call relying on environment variables exist when invoke script on server, not in place ...

Margin On A Border using CSS -

Image
ok, have searched internet solution, , nothing has come up. used bing (i'm desperate). basically, i'm trying what's in picture: i want margin border it's not striking through line. it'll clean if do, nothing coming up. if border 1 pixel, can set margin-bottom: -1px; on tab (the top part of menu). trick, though, tab part needs rendered above body of menu, can achieve position: relative; z-index: <somthing greater z-index of menu body. try 1 , go there>; .

function - C++ : What is the usage of int('0') in this code? -

this question has answer here: how convert single char int 9 answers this code find sum of digits occur in string. example sumupnumbers("2 apples, 12 oranges") = 5 //2+1+2 can explain need use int('0') in code!? int sumupdigits(std::string inputstring) { int answer = 0; (int = 0; < inputstring.size(); i++) { if ('1' <= inputstring[i] && inputstring[i] <= '9') { answer += int(inputstring[i]) - int('0'); } } return answer; } it converts char ascii code make number out of string int('9') - int('0') = 9

c# - Clicking a button in a listviewitem that is not selected and getting selected item -

i have question listview setup example below. when click button below in expander header want item selected well, i'm seeing while button command work, item selected still previous item selected, not item button in. how can have item selected when button clicked? i tried setting controltemplate this, did not work. <style targettype="{x:type listviewitem}"> <setter property="horizontalcontentalignment" value="stretch" /> <setter property="template"> <setter.value> <controltemplate targettype="{x:type listviewitem}"> <contentpresenter horizontalalignment="{templatebinding horizontalcontentalignment}" verticalalignment="{templatebinding verticalcontentalignment}" snapstodevicepixels="{templatebinding snapstodevicepixels}" /> <controltemplate.triggers> ...

c# - How do I enable delete when using Html.Sitecore().ItemRendering()? -

i have looked around internet solution , cant seem find help. @foreach (sitecore.data.items.item child in html.sitecore().currentitem.children) { @html.sitecore().itemrendering(child) } this code pointing view rendering in turn outputs basic details. <h3>@html.sitecore().field("question")</h3> <div> @html.sitecore().field("comment") </div> i have gotten render correctly , can edit each part individually "question" or "comment" text, looking add way delete entire item original page using page editor. i tried adding "delete" button rendering did not show up. any appreciated greatly! when have listing of sitecore items , need remove item list in page editor edit frames can useful. this example here shows how can add interface remove item multilist affect rendering of items. https://briancaos.wordpress.com/2011/11/28/using-sitecore-editframe-in-pageedit/ to edit frames worki...

angularjs - Why does angular-socket-io complain with 'Error during WebSocket handshake: Unexpected response code: 400?' -

i have node application (angular-fullstack) moved http https. working, socket connection isn't. missing? in socketfactory have: var iosocket = io('https://localhost', { path: '/socket.io-client' }); which believe causes transport use 'wss://'. https connection good. time, believed somehow nginx not handling proxy correctly. incorrect. next, changed form ' https://locahost ' ' https://xxx_actual_server_url_xxxx ' , works after initial page reload. see one: websocket connection 'wss://xxx_actual_server_url_xxxx/ socket.io-client/?eio=3&transport=websocket&sid=y4_ckvyterz_f1zcaaak' failed: error during websocket handshake: unexpected response code: 400 what causing this? , how around it? not doing load balancing or , running development server 'grunt serve'. thoughts? thanks! after searching , hunting, discovered when using sockets nginx needed add following proxy stuff: proxy_set_h...

messagebroker - Kafka Consumer path must not end with / character -

i using apache kafka 0.8.2.1 stream web events other datasources. kafka producer wrote working great , i'm able see data getting streaming through topic when run kafka-console-consumer.sh. however, have had no luck whatsoever trying kafka consumer retrieve messages. ideas? the following error improper path being output when code attempts run consumer.createmessagestreams(topiccountmap) exception in thread "main" java.lang.illegalargumentexception: path must not end / character @ org.apache.zookeeper.common.pathutils.validatepath(pathutils.java:58) @ org.apache.zookeeper.zookeeper.exists(zookeeper.java:1024) @ org.apache.zookeeper.zookeeper.exists(zookeeper.java:1073) @ org.i0itec.zkclient.zkconnection.exists(zkconnection.java:95) @ org.i0itec.zkclient.zkclient$11.call(zkclient.java:827) @ org.i0itec.zkclient.zkclient.retryuntilconnected(zkclient.java:675) @ org.i0itec.zkclient.zkclient.watchfordata(zkclien...

javascript - Store socketId session for sending private messages using Sails -

im building chat app , im trying implement private messaging functionality. each user registers , logs in app credentials guess should storing maybe socketid in user session in order access each client same id no matter page refresh occurs. have seen examples in previous version of sails https://github.com/balderdashy/sailschat , seem use onconnect function in config/sockets.js. can send messages specific user using user.message(id, data) have been changed in sails 0.11 , beforeconnect kinda confusing. if can point me out in right direction appreciated.

sql server - Replacing a string before the last "\" character in SQL query -

query: select filepath table filepath not null it'll return \\server\folder1\folder2\filename.tif i need query replace " \\server\folder1\folder2\ " variable that's in stored procedure ( @path ) , end format of file .jpg. so result @path + '.jpg' how go doing this? you can use combination of string functions reverse , substring , left , charindex : create table yourtable(filepath varchar(2000)) insert yourtable values('\\server\folder1\folder2\filename.tif'); declare @path varchar(2000) = 'path\to\folder\' select [file] = reverse(left(reverse(filepath), charindex('\', reverse(filepath),0) - 1)), [file without ext] = substring( reverse(left(reverse(filepath), charindex('\', reverse(filepath), 0) - 1)), 0, charindex( '.', reverse(left(reverse(filepath), charindex('\', reverse(filepath), 0) - 1)), ...

spring integration - Do transactional pollers that use task-executors use database resources for queued messages -

i have service-activator uses poller pull messages channel. channel has queue backed persistent store database. poller configured task-executor in order add concurrency message processing channel. the task-executor configured queue-capacity. since poller retrieves messages channel database , configured transactional, happens transactions messages queued in task-executor if task-executor has no more threads available. requests on task-executor thread queued , since these messages have no thread of own, happens transaction? assume removal of messages persistent channel store poller queued (in) task executor committed. if server fails while has queued runnables queued in task executor lost? since idea of transactional persistent channel queue ensure no messages lost in case server goes down, how queued messages (in task-executor) handled in terms of transactions active on channels database backed queue/store ? <bean id="store" class="org.springframework.i...

javascript - Or condition never evaluates to true -

this javascript code runs think doesn't make through "else" statement since doesn't print console...why? = 0; for(var i=1; i<4; i++) { var crazy = prompt("would marry me?"); if(crazy === "yes"|| "yes") { console.log("hell ya!"); } /* when asks "will marry me" , if user says either "no" or "no", does't print "ok..i'' try again next time". instead, still says "hell ya !" */ else if (crazy ==="no" ||"no") { console.log("ok..i'll try again next time !"); } } var love = false; { console.log("nonetheless, love !"); } while(love); try this..nice piece of code though.. marriage proposal geeky guy? i = 0; for(var i=1; i<4; i++) { var crazy = prompt("would marry me?"); if(crazy === "yes"|| crazy ==="yes...

r - 'ddply' causes a fatal error in RStudio running correlation on a large data set: ways to optimize? -

i need calculate correlations on large dataset (> 1 million of lines) split several columns. try combining ddply , cor() functions: func <- function(xx) { return(data.frame(corb = cor(xx$ysales, xx$bas.sales), cora = cor(xx$ysales, xx$tysales))) } output <- ddply(input, .(ibd,cell,cat), func) this code works pretty on relatively small data sets (dataframes 1000 lines or 10000 lines), causes 'fatal error' when input file has 100000 lines or more. looks there not enough memory on computer process such big file these functions. are there opportunities optimize such code somehow? maybe alternatives ddply work more effectively, or using loops split 1 function several consecutive? i not have problems ddply on machine 1e7 rows , data given below. in total, uses approx. 1.7 gb on machine. here code: options(stringsasfactors=false) #this makes code reproducible set.seed(1234) n_rows=1e7 input=data.frame(ibd=sample(letters[1:5],n_...

oracle - pl/sql even and odd sum block -

i have pl/sql programming question: numbers between 1..50, need multiply numbers five, odd numbers 3 , find sum of numbers in result. so had far declare ln_num number :=0; ln_num1 number :=0; ln_num2 number :=0; begin in 1..50 loop if mod(i,2) =0 ln_num:=i*5; elsif mod(i,2) = 1 ln_num1:=i*3; ln_num2 := ln_num+ln_num1; dbms_output.put_line(ln_num2); end if; end loop; end; this gives me last list of numbers need sum of of them. wondering missing , how fix this? thanks sql> declare 2 ln_num number :=0; 3 ln_num1 number :=0; 4 ln_num2 number :=0; 5 6 begin 7 in 1..50 loop 8 9 if mod(i,2) =0 10 ln_num:=ln_num+i*5; -- changes 11 12 elsif mod(i,2) = 1 13 ln_num1:=ln_num1+i*3; -- changes 14 15 16 end if; 17 end loop; 18 ln_num2 := ln_num+ln_num1; 19 dbms_output.put_line(' result ' ||...

batch file - Set date with WMIC (Invalid Verb Switch) -

i have revised question comments below pointing me in new directions. tried date.exe fails set command in instances, it's returned timestamp. so moved on wmic. however, cannot seem set date. believe may understanding of wmic. can spot errors in approach? @echo off /f "tokens=2 delims==" %%a in ('wmic os localdatetime /value') set "dt=%%a" set "trail=%dt:~8%" & set "backdt=%dt:~0,8%" set "targetstamp=20150419%trail%" echo %targetstamp% targetstamp wmic os set localdatetime=%targetstamp% /f "tokens=2 delims==" %%a in ('wmic os localdatetime /value') set "ndt=%%a" set "newtrail=%ndt:~8%" echo %backdt&&newtrail% wmic os set localdatetime=%backdt%%newtrail% pause ok, current time, replace date while keeping time , tz offset, set datetime, work right after wmic os set command, , revert current time. your code correct. note in order set date/time via wmic need r...

javascript - Trying to remove border of arc on canvas -

i drew circle using html canvas arc method, want remove border of circle. tried set linewidth = 0 doesn't seem work. there way remove border of circle in canvas? $(document).ready(function() { pie_chart = $('#pie_chart'); var p = pie_chart[0].getcontext('2d'); var canvas_width = pie_chart.width(); var canvas_height = pie_chart.height(); p.beginpath(); p.arc(canvas_width/2, canvas_height/2, 150, 0 , math.pi * 2); p.linewidth = 0; p.stroke(); p.fillstyle = '#777'; p.fill(); }); the simple answer is: drop stroke() call: p.beginpath(); p.arc(canvas_width/2, canvas_height/2, 150, 0 , math.pi * 2); p.linewidth = 0; //p.stroke(); p.fillstyle = '#777'; p.fill();

javascript - What's the differences among xx.min.js, xx.debug.js and xx.js? -

i'm newer javascript development. i'm studying extjs, find extjs has several files, file names following: xxxx.min.js xxxx.debug.js xxxx.js so question differences between them, , why? there tools make these kinds of file, mean create js file named xxx.js usually, , how can make xxx.min.js , xxx.debug.js, not copy , change name manually. thanks. .min.js files 'compressed' in meaning there not line breaks, , there few spaces possible -among things-. can created plugins or online tools, jscompress .debug.js files contain debugging instructions, console.log or console.debug . .js files deployment versions, still legible , editable (not .min.js files)

Is it possible to have different type of activation functions in different layer in Opencv neural network? -

i know there 3 types of activation functions provided in opencv neural network , sigmoid function default. ask possible have sigmoid function activation function @ hidden layer while having identity function @ output layer? i @ page here : @ method create. @ create method description: activatefunc – parameter specifying activation function each neuron: 1 of cvann_mlp::identity, cvann_mlp::sigmoid_sym, , cvann_mlp::gaussian. nont see way set or modify activation function, assume if not mentioned in documentation, you'll not able create such network different activation functions. nothing prevents downloading source code , modifying construrctor , learning algorithm purpose.

android - Unable to open camera flash during call -

i trying build app camera flash happen in call , sms incoming activity. camera flash not opening during call...i have written simple program. public class mainactivity extends activity { ..... .... public static class alerthandler extends broadcastreceiver { @override public void onreceive(context context, intent intent) { system.out.println("===inside oneceive"); boolean incomingcall = false; parameters alertparams; camera alertcamera; string callstate = intent.getstringextra(telephonymanager.extra_state); if (null != callstate && callstate.equals(telephonymanager.extra_state_ringing)) { incomingcall = true; } system.out.println("===incomingcall =="+incomingcall); if(incomingcall){ system.out.println("opening camera..."); ...

build.gradle - How do I extend gradle's clean task to delete a file? -

so far i've added following build.gradle apply plugin: 'base' clean << { delete '${rootdir}/api-library/auto-generated-classes/' println '${rootdir}/api-library/auto-generated-classes/' } however not file not deleted, print statement shows ${rootdir} not being converted root directory of project. why won't work, concepts missing? you need use double quotes. also, drop << , use dofirst instead if planning deletion during execution. this: clean.dofirst { delete "${rootdir}/api-library/auto-generated-classes/" println "${rootdir}/api-library/auto-generated-classes/" } gradle build scripts written in groovy dsl. in groovy need use double quotes string interpolation (when using ${} placeholders). take @ here .

windows 7 - MySql Workbench: Log file path must be defined before calling the WriteToLog method error -

i having mysql workbench 6.1 ce , whenever system starts throws error: @ system.xml.xmltextreaderimpl.throw(exception e) @ system.xml.xmltextreaderimpl.parsedocumentcontent() @ system.xml.xmltextreaderimpl.read() @ system.xml.xmlloader.load(xmldocument doc, xmlreader reader, boolean preservewhitespace) @ system.xml.xmldocument.load(xmlreader reader) @ system.xml.xmldocument.load(string filename) @ mysql.utility.classes.mysqlworkbench.mysqlworkbenchconnectioncollection.loadxmlfile(boolean saving) @ mysql.utility.classes.mysqlworkbench.mysqlworkbenchconnectioncollection.load() @ mysql.utility.classes.mysqlworkbench.mysqlworkbench.loadexternalconnections() @ mysql.utility.classes.mysqlworkbench.mysqlworkbench.set_externalapplicationconnectionsfilepath(string value) @ mysql.notifier.notifier.initializemysqlworkbenchstaticsettings() @ mysql.notifier.notifier..ctor() @ mysql.notifier.notifierapplicationcontext..ctor() log file path must defined befo...

Grails create-app name with dot -

it's little strange question, why when i'm running next command: grails create-app project.api grails 2.5.0 creates folder project.api main package project.api , grails 3.0.1 creates folder api package project , ignores provided project full name? try this: grails create-app "project.api" because dot has special meaning, used show package hierarchy(my guess).

javascript - Hide Heatmap DataLabels based on Condition -

how hide datalabels of heatmap based on condition i.e. want hide datalabels (==0 or <50). there bug in highcharts api, when ever restore browser zero's show in unusual order. bug link as of found workaround replacing 0 '0' dont want show on heatmap. here fiddle jsfiddle , in fiddle working when implemented on application it's replicating bug. $(function () { $('#container').highcharts({ chart: { type: 'heatmap', margintop: 40, marginbottom: 40, plotbackgroundcolor: { lineargradient: { x1: 1, y1: 0, x2: 0, y2: 1 }, stops: [ [0.03, 'rgb(247, 88, 45)'], [0.5, 'rgb(255, 224, 80)'], [0.67, 'rgb(54, 64, 207)'], [0.99, 'rgb(13, 163, 35)'], [1, 'rgb(217, 186, 50'] ] } }, titl...

c++ - Kruskal's Algorithm in O(n log n) -

i'm interested in learning how run kruskal's algorithm on o(n log n) in c++. have implemented algorithm solution runs on o(n^2), , code below. i know should possible run kruskal's on o(n log n), i'm stymied how can done. appreciate , tips. #include <vector> #include <algorithm> #include <set> using namespace std; //sort weight bool sorting (vector<int> i, vector<int> j) {return i[2]<j[2];} class submap { private: set<int> finder; public: submap(int x) {finder.insert(x);} submap(set<int> x) {finder = x;} set<int> pointreturn() {return finder;} //function add new set current tree void add(set<int> np) { finder.insert(np.begin(), np.end()); } void add(int n) { finder.insert(n); } int size() {return int(finder.size());} //find function returns true if value not found bool find(int x) { if (finder.find(x) == finder.end()) re...

PHP post zip file to java servlet causes NullPointerException -

i've got java servlet program receives zip file , extract location on server replace templating files of website (html, png, etc). now, 1 of colleagues wants try using php, encountered quite peculiar problem combination. at first, got nullpointerexception on httprequest.getparameter function on java, though did send files via php_curl servlet. strange thing is, if send same file via ruby, python, or other method (html, example) works no error generated. after lot of tinkering around, i've found php send zip file java servlet after i've removed file inside it, files causing issue turns out fonts consist of .woff , .eot , .svg , , .ttf . is there workaround issue other removing font file zip file? configuration : php 5.6 using guzzle , other curl library java 1.7, java ee 7, servlet api 3.1, running on wildfly 8.2 server

c# - Parallel Framework and avoiding false sharing -

recently, had answered question optimizing parallelizable method generation every permutation of arbitrary base numbers. posted answer similar parallelized, poor implementation code block list, , pointed out: this pretty guaranteed give false sharing , many times slower. (credit gjvdkamp ) and right, death slow. said, researched topic, , found interesting material , suggestions combating it. if understand correctly, when threads access contiguous memory (in say, array that's backing concurrentstack ), false sharing occurs. for code below horizontal rule, bytes is: struct bytes { public byte a; public byte b; public byte c; public byte d; public byte e; public byte f; public byte g; public byte h; } for own testing, wanted parallel version of running , genuinely faster, created simple example based on original code. 6 limits[0] lazy choice on part - computer has 6 cores. single thread block average run time: 10s0059ms var data = new list<bytes...

mysql - Making one row many rows -

i have rows this: school 4 hotel 2 restaurant 6 i have output this: school 1 school 2 school 3 school 4 hotel 1 hotel 2 restaurant 1 ... restaurant 6 is there mysql query can run output (i.e., number of rows output corresponds number in second field)? thanks jb nizet telling me mysql not able on it's own. inspired me write php script: $result = mysqli_query($dbc,"select abbrev,chapters books"); while ($output = mysqli_fetch_array($result,mysql_assoc)) { ($i=1; $i<=$output['chapters']; $i++) { echo "{$output['abbrev']}$i\n"; } }

mysql - unix command execution with password via python -

i trying connect mysql in unix python script. provided password connect mysql in script terminal still prompts password. have till now: import os subprocess import popen, pipe passwd = "user" command = "mysql -u root -p" proc = popen(command.split(), stdin=pipe) proc.communicate(passwd+'\n')[1] can 1 suggest doing wrong here. or there better way this. i tried script in ubuntu 14.04. easy start mysql in terminal using shell script. here code.. #!/bin/bash user=('root') pass=('xxx') mysql -u $user -p$pass echo 'success' simply run code & can start mysql @ terminal...

javascript - Enable submit button after validation using parsleyjs -

does parsley have easy way load form submit button disabled , enable validation requirements of form have been met? i'm not sure mean "easy" after can accomplished. you need listen events parsley:form:success , parsley:form:error enable / disable button. you need monitor changes each form field in order force parsley validate. tipically parsley executes validation once click on submit . since submit disabled, you'll need trigger validation manually. so, here's working example ( jsfiddle ): <form> <input type="text" name="field" data-parsley-required /> <button type="submit" disabled>submit</button> </form> <script> $(document).ready(function() { // bind parsley form $("form").parsley(); // whenever parsley validates successfully, enable submit button $.listen('parsley:form:success', function(parsleyform) { parsleyform.$eleme...

user interface - How to make app background transparent like notification in swift -

is there reference make application have transparent background , looks notification, wallpaper still remain in background when apps running when wallpaper has blur effect ? no don't think it's possible. here link answer suggests private method allowed functionality in ios7. the comments note private method stopped working ios 8.2 i imagine apple didn't idea of apps being able either fake home screen whilst still inside app (users might confused , enter bank details fake banking app) allow apps capture users background it's shame because add nice effects used in ibooks , ios dialler.

scala - Why does a unary operator enable a ()=>X implicit conversion? -

i encounter issue implicit ()=>x conversion happens when define , use unary operator. below minimal example: class gate { def unary_!(): gate = } class foo { private def foo(f: () => gate) = 1 val gate = new gate // compiles, -xprint:typer shows becomes // foo.this.foo({ // (() => foo.this.gate.unary_!()) // }) foo(!gate) // not compile, // error: type mismatch; // found : gate // required: () => gate // foo(gate) foo(gate) } where () => gate conversion happens , why happen unary_! ? edited thanks answer! raised question because eta expansion (from x () => x blocks implicit conversion defined x , wanted happen. removing unnecessary parentheses unary_! solves problem us. thanks! this eta-expansion, turns method function. http://www.scala-lang.org/files/archive/spec/2.11/06-expressions.html#eta-expansion the trigger expected type function. the link ambiguous in spec, expansion @ 6.26.5. co...

bigdata - Is there a good ETL framework for data warehouse in Hadoop -

i have investigated oozie , azkaban , think used schedule jobs. dw need large of jobs schedule, , there framework it? you can use pentaho data integration tool . check out. http://www.pentaho.com/product/data-integration

android - APP not installed an existing package by the same name with a conflicting signature is already installed -

i'm new android development have developed 1 application , distribute copy bin folder not in playstore . user try install app second time different version it's giving "app not installed existing package same name conflicting signature installed" same version it's not coming this. i want install app without uninstalling(means user don't want uninstall) previous 1 without using play store , 1 more doubt when signature generates . thanks in advance. see happens: you'd compiled debug version of app , distributed own way. @ time ide used debug certificate auto created every time install ide/sdk. now, time has passed , you'd switched working pc/notebook or you'd reinstalled ide/sdk or you'd switched lets eclipse androidstudio or changed os win7 win8 or ubuntu, no matter did result brand new debug certificate generated , used now. , you'd lost previous debug certificate 4ever (depends how happens). certificate stands unique fin...

selenium - Equivalent of Firebug's "Copy XPath" in Internet Explorer? -

i have internet explorer web application. i'm exploring can automate testing. selenium looks tool, able activate links etc. need tell are. application wasn't built kind of testing in mind, there aren't id attributes on key elements. no problem, think, can use xpath expressions. finding correct xpath for, say, button, royal pain if done inspecting source of page. with firefox / firebug, can select element use "copy xpath" expression. i have ie developer toolbar , it's frustratingly close. can click select element of interest , display sorts of information it. can't see convenient way of determining xpath it. so there way of doing ie? i use bookmarklets. have 1 xpath related, don't know if works in ie. gotta go test , give if works on ie. two bookmarklet sites web developers bookmarks: subsimple's bookmarklets , squarefree's bookmarklets . lot of useful things there... [edit] ok, back. bookmarklet had ff only, , was...

cordova - Why SocialSharing plugin not work (phonegap) -

i use button in html tag , write script on click: function social_share() { window.plugins.socialsharing.share("blog post title","post summery",null,"http://qnimate.com",function(result){ alert('result: ' + result); }, function(result){ alert('error: ' + result); }); } it generate error while clicking on button. "e/web console(1218): uncaught typeerror: object # has no method 'share' @ file:///android_asset/www/index.html:42"

hadoop - How to read Snappy Compressed file from S3 in Java -

currently running mapreduce job in hadoop in output compressed snappycompression. moving output file s3. want read compressed file s3 through java. i found answer read snappy compressed file s3. first should object content s3. , decompress file. s3object s3object = s3client.getobject(new getobjectrequest(bucketname,path)); inputstream incontent = s3object.getobjectcontent(); compressioncodec codec = (compressioncodec) reflectionutils.newinstance(snappycodec.class, new configuration()); inputstream instream = codec.createinputstream(new bufferedinputstream(incontent)); inputstreamreader inread = new inputstreamreader(instream); bufferedreader br = new bufferedreader(inread); string line=null; while ((line = br.readline()) != null){ system.out.println(line); }

javascript - traverse the dom an select each inputbox pair in order to create js object -

i'm adding dynamic number of input boxes inside view selection combobox. if choose 1 combobox add 2 input boxes inside view, 2 adds 4, 1 selection adding 1 pair of input boxes has it's unique id's: <input id="mytextbox1" type="text"> <input id="mytextboxcomp1" type="text"> <input id="mytextbox2" type="text"> <input id="mytextboxcomp2" type="text"> ... , on. let's want create js object values in inputboxes. how can traverse dom select each inputbox pair in order create js object, example: var myobj = { propone:"x", proptwo:y }; it's want? <!doctype html> <html> <head lang="en"> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"></script> <script type="text/javascript"> $(docume...

regex - cts:value-match on xs:dateTime() type in Marklogic -

i have variable $yearmonth := "2015-02" have search date on element date xs:datetime . want use regex expression find files/documents having date "2015-02-??" have path-range-index enabled on modifiedinfo/date using following code getting invalid cast error let $result := cts:value-match(cts:path-reference("modifiedinfo/date"), xs:datetime("2015-02-??t??:??:??.????")) i have used following code , getting same error let $result := cts:value-match(cts:path-reference("modifiedinfo/date"), xs:datetime(xs:date("2015-02-??"),xs:time("??:??:??.????"))) kindly :) it seems trying use wild card search on path range index has data type xs:datetime(). but, marklogic don't support functionality. there multiple ways handle scenario: you may create field index. you may change string index supports wildcard search. you may run workaround support existing system: for $x in cts:values(cts:path-ref...

c# - Unit test can not find my methods/functions -

i have written basic unit test when try run it says can not find function calling know there , have added form held in references. else works perfect except unit test. this unit test code. using system; using microsoft.visualstudio.testtools.unittesting; using windowsformsapplication1; namespace test { [testclass] public class unittest1 { [testmethod] public void checkgamecannotstartwithouttwoteamsselectedtest() { bool expected, actual; windowsformsapplication1.rugbyscorer frm1 = new rugbyscorer(); actual = startcheck(); expected = false; assert.areequal(expected, actual); } } } should't be: frm1.startcheck();

model view controller - MVC Conception in java -

Image
i need make java application use mvc model ( won't use controler avoid taht thigs complicated ) . so can see in class diagram below have 2 package had problems when try interact between model , view . the model.main composed of model.files , model.files composed of configfile,divaconnector , filesuploader. can put right links between classes ? the controler allows communicate between model , view. put main class in extern package launcher , instanciate controler model , view args. main controler can instanciate controlers specific of each view. class main { public static void main(string args[]) throws ioexception { model model = new model(); view view = new view(); controller controller = new controller(view, model); } } edit : here example of main controler, in each specific controler builder put listeners (button, tableview, textfield ...), have both model , view, can alter chart elements according model. package controller; ...

node.js - node long path module names fail teamcity build -

we trying install node in our asp.net mvc project how ever when checked our code in fail builds in team city. due known issue of long module path names npm uses. here log: [08:07:46]checking changes [08:07:49]publishing internal artifacts (5s) [08:07:54][publishing internal artifacts] sending build.start.properties.gz file [08:07:49]clearing temporary directory: c:\teamcity\buildagent3\temp\buildtmp [08:07:54]clean build enabled: removing old files c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54]checkout directory: c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54]updating sources: agent side checkout (15s) [08:07:54][updating sources] perform clean checkout. reason: checkout directory empty or doesn't exist [08:07:54][updating sources] cleaning c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54][updating sources] vcs root: git - tempsearch (15s) [08:07:54][vcs root: git - tempsearch] revision: cf23c64dd32077edeb1b96a85d1be104bd127044 [08:07:54][vcs r...

robotframework - Robot Framework: User input on linux command prompt -

in robot testing, how pass user input scripts prompt user confirmation? while testing manually, enter yes or no kind of input scripts prompt user confirmation. how acheive same in robot? tried using echo in robot test case, ex: $ echo yes | myscript.pl this works fine , accepts user input yes, fails read "yes" pipe when myscript.pl executes command using ssh on remote server , returns main script myscript.pl. after returning, script fails read "yes" pipe. is there built in function of robot framework can here? or other alternative? thanks. there commend called yes repeatedly input "yes" until killed. if doesn't work either, try using expect. yes|./myscript.pl or using expect #!/usr/bin/expect -f spawn ./myscript.pl expect "yes/no" send "yes\r"

android - ClassNotFoundException: Didn't find class on path: DexPathList -

i have problem since updated app on playstore. since update, exception thrown, haven´t changed related exception. stacktrace: java.lang.runtimeexception: unable instantiate activity componentinfo{de.opiatefuchs.onthejobtimerlight/de.opiatefuchs.onthejobtimerlight.onthejobtimeractivity}: java.lang.classnotfoundexception: didn't find class "de.opiatefuchs.onthejobtimerlight.onthejobtimeractivity" on path: dexpathlist[[zip file "/data/app/de.opiatefuchs.onthejobtimerlight-1/base.apk"],nativelibrarydirectories=[/vendor/lib, /system/lib]] @ android.app.activitythread.performlaunchactivity(activitythread.java:2236) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2387) @ android.app.activitythread.access$800(activitythread.java:151) @ android.app.activitythread$h.handlemessage(activitythread.java:1303) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activity...

android - When (& where) are my fragments created -

i'm using viewpagerindicator library ( http://viewpagerindicator.com/ ) create sort of wizard android app. works fine , want. i "extend" functionality bit having "previous"/"next" buttons in actionbar - pretty in android's "done bar" tutorial - step through wizard. works charm, too. however: display information "next" & "previous" fragment in actionbar's buttons. information pass fragments live in viewpager @ time of "creation" (actually @ time of object instantiation - using classical "newinstance(...)" approach create instance of fragment, store parameters in bundle , extract them in fragment's "oncreate" method). same way template it, when create new fragment project. so, information thing want display in wizards button know fragment next , last. the type of information not important problem. string or icon or int or ... else want. however, wherever i've tr...

php - Removing unicode from string -

i have following php string: \ud83c\udf38owner ig: deidarasss\n\ud83c\udf38free ongkir banda aceh dan lhokseumawe\n\u27a1 testimoni: #testydfs\n\ud83d\udcf1line: darafitris\nsold=delete\nclose \ud83d\ude0d\ud83d\ude03 i wanted strip out unicode string, how can so? i have tried following: private static function removeemoji($text) { $clean_text = ""; // match emoticons $regexemoticons = '/[\x{1f600}-\x{1f64f}]/u'; $clean_text = preg_replace($regexemoticons, '', $text); // match miscellaneous symbols , pictographs $regexsymbols = '/[\x{1f300}-\x{1f5ff}]/u'; $clean_text = preg_replace($regexsymbols, '', $clean_text); // match transport , map symbols $regextransport = '/[\x{1f680}-\x{1f6ff}]/u'; $clean_text = preg_replace($regextransport, '', $clean_text); // match miscellaneous symbols $regexmisc = '/[\x{2600}-\x{26...

Hint text testing using selenium IDE -

Image
i learning selenium ide. for learning , testing, have chosen popular social wbsite's 'sign up' page. on page can see several textfields hint text.( e.g : first name ). i want assert/verify text if 'present or not' in perticular text field. for have written following script: asserttextpresent | //*[@id='.....'] | first name asserttext | //*[@id='.....'] | first name verifytextpresent | //*[@id='.....'] | first name verifytext | //*[@id='.....'] | first name but every time when execute script, result : [info] executing: |asserttextpresent | //*[@id='u_0_1'] | first name | [error] false [info] executing: |asserttext | //*[@id='u_0_1'] | first name | [error] actual value '' did not match 'first name' [info] executing: |verifytextpresent | //*[@id='u_0_1'] | first name | [info] executing: |verifytext | //*[@id='u_0_1'] | first name | so ca...

android - AlarmManager not working with time picker -

i have service.. have generate notification @ time taken time picker.. working system.currenttimemillis() , not if take time time picker here time picker showing on click of textview: tv.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub mcurrenttime = calendar.getinstance(); int hour = mcurrenttime.get(calendar.hour_of_day); int minute = mcurrenttime.get(calendar.minute); timepickerdialog mtimepicker; mtimepicker = new timepickerdialog(mainactivity.this, new timepickerdialog.ontimesetlistener() { @override public void ontimeset(timepicker timepicker, int selectedhour, int selectedminute) { timepicker.setis24hourview(true); //tv.settext( selectedhour + " : " + selectedminute); mcurrenttime.set(calendar.hour,selectedhour); mcurrenttime.set(calendar.minute,selectedminute); mcurrenttime.set(calendar.second,0); // here getting time timepicker l= mcurrenttime.gettimeinmill...

MySQL query to join the same table -

i want join 2 sql queries run on same table. result should contain common rows. know mysql not have intersect . need use join guess, not sure how when sql queries run on same table. a sample query in answer great. you can use inner or cross join, that: select a.columnname table inner join table b on a.key= b.key clauses

java - OrientDB register Hooks -

i'm trying out hooks on orientdb, i'm not sure how register orecordhooks on graph. orientgraph graph = new orientgraph("remote:localhost/test"); myhook hook = new myhook(); the myhook class looks this: public class myhook extends orecordhookabstract implements odatabaselifecyclelistener { public myhook() { orient.instance().adddblifecyclelistener(this); } @override public distributed_execution_mode getdistributedexecutionmode() { system.out.println("0"); return null; } @override public priority getpriority() { system.out.println("1"); return priority.first; } @override public void onrecordaftercreate(orecord irecord) { system.out.println("2"); } @override public result onrecordbeforecreate(orecord irecord) { system.out.println("3"); return orecordhook.result.record_changed; } @override ...

Py2neo Api for Neo4j -

i playing around py2neo api neo4j , can tell me how pull data graph using pull() method. can give me example. i did following: node1=node("person",name="kartieya"); graph().create(node1); graph().pull(node1); i recieving status 200 , i.e. working how going node1.name? push , pull necessary changes on existing nodes. create statements carried out immediately. from py2neo import graph, node graph = graph() # note trailing ',' tuple unpacking # 'create' can create more 1 element @ once node1, = graph.create(node("person",name="kartieya")) to name property of node do: print node1.properties['name'] if change property have use push: node1["new_prop"] = "some_value" node1.push() pull needed if properties of node1 change on server , want synchronize local node1 instance.