Posts

Showing posts from September, 2010

c# - Error using Data Source relative path in Excel Data Driven Unit Test -

i using system.data.odbc connection string connect excel data source. following error occurs when using relative dbq path: error [42s02] [microsoft][odbc excel driver] microsoft office access database engine not find object 'sheet1$'. make sure object exists , spell name , path name correctly. app.config: <configuration> <configsections> <section name="microsoft.visualstudio.testtools" type="microsoft.visualstudio.testtools.unittesting.testconfigurationsection, microsoft.visualstudio.qualitytools.unittestframework, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"/> </configsections> <connectionstrings> <add name="excelconnection" connectionstring="dsn=excel files;dbq=exceldatasource.xlsx;defaultdir=.;driverid=790;maxbuffersize=2048;pagetimeout=5" providername="system.data.odbc"/> </connectionstrings> <microsoft.vis

javascript - ThreeJS - Inside A Room - Depth -

i able create room in threejs. here have far: http://jsfiddle.net/7oyq4yqz/ var camera, scene, renderer, geometry, material, mesh, focus; init(); animate(); function init() { scene = new three.scene(); focus = new three.vector3( 0, 0, 0 ); camera = new three.perspectivecamera( 45, window.innerwidth / window.innerheight, 1, 1000 ); scene.add(camera); camera.position.set(0,0,1); camera.lookat(focus); camera.updateprojectionmatrix(); //camera.lookat(scene.position) controls = new three.trackballcontrols( camera ); controls.rotatespeed = 3.0; //controls.zoomspeed = 0; //controls.panspeed = 0.8; controls.nozoom = true; controls.nopan = true; controls.staticmoving = true; controls.dynamicdampingfactor = 0.3; controls.keys = [ 65, 83, 68 ]; controls.addeventlistener( 'change', render ); geometry = new three.boxgeometry( 1000, 1000, 1000 ); ( var = 0; < geometry.faces.length; ++ ) {

javascript - How do I check if the current url or path is equal to a certain link and if not, append a forward slash to the href in the nav bar? -

i javascript , jquery newby , have issues page scroll being directed different page. work being done in wordpress php. using page-scroll href=#id , changed href=/#id slash allows directing properly. issue if on current page of home. forward slash jumps rather page-scrolls. thinking leave href=#id without slash , have check if current url != home, append forward slash href. genuinely appreciated! this allows page scroll current page , doesn't direct pricing & services page <li><a class="page-scroll" href="#howitworks">how works</a></li> adding "/" allows directing pricing& services page jumps if on homepage. want jump if not on homepage. smooth scroll on current page. <li><a class="page-scroll" href="/#aboutus">about us</a></li> page directing from. <li><a class="page-scroll" href="pricing-services">pricing

How to write a regex to find HTML tags outside CDATA tags in an XML document -

i'm trying import onix (xml) file coming import errors due html tags in descriptive text. in particular file, of descriptive text enclosed in cdata tags, appears isn't. how can write regex find html tags aren't enclosed in cdata tags? i'm using vb.net app import data sql server database, @ point i'm trying write regex in notepad++ see what's possible. can incorporate regex vb code later. here example of xml import properly: <othertext> <texttypecode>01</texttypecode> <textformat>02</textformat> <text><![cdata[more series of chapters on theology of john's gospel, <em>jesus christ</em> relates each of john's teachings declared aim, expressed in john 20: 30-31: "jesus did many other signs before disciples, have not been written in book; these have been written may believe jesus christ, son of god, , believing may have life in name." indeed, each chapter in morris's book takes

java - Buffer Strategy IllegalStateException -

i know has been asked before still can't work. public class gui extends jframe implements runnable{ public static jpanel contentpane; public static graphics2d graphics; public static bufferstrategy bufferstrategy; /** * launch application. */ public static void main(string[] args) { eventqueue.invokelater(new runnable() { public void run() { try { gui frame = new gui(); frame.setvisible(true); frame.setresizable(false); } catch (exception e) { e.printstacktrace(); } } }); } /** * create frame. */ public gui() { setresizable(false); settitle("tower defense game"); setignorerepaint(true); setdefaultcloseoperation(jframe.exit_on_close); setbounds(100, 100, 450, 300); contentpane = new jpanel();

c# - MVC5 model binding -- child objects all null -

when parent class/model posted server , use bindattribute "bind", child objects null. if don't include binding, works public actionresult saveedit(int id, person person) for instance person.address property not null, , it's properties set based upon form submission. just fyi, address created in view using editorfor, included in request form. but if use bind, doesn't work.. public actionresult saveedit(int id, [bind(include = "personid, addressid, address.addressid, address.line1, address.city, address.state, address.zip")] person person) person.personid , person.addressid set correctly, person.address null. if use bind , multiple parameters , so... public actionresult saveedit(int id, [bind(include = "personid")] person person, [bind(prefix = "address", include = "addressid, line1, city, state, zip")] address address) it halfway works, both object created, neither has related properties th

php - Closure with confusing usort -

i trying rewrite co-developers script , ran across little gem, life of me cannot understand does, less how refactor it. explain me does, , if interpretation of code correct? the original code: $f = "return (${$v[0]}['{$k}'] - ${$v[1]}['{$k}']);"; usort($results, create_function('$a,$b',$f)); my attempt , rewriting closure: $f = function ($k,$v) { return ($v[0][$k] - $v[1][$k]); }; usort($results, $f($k, $v)); edit for clarity, $k random string, , $v array of either ['a','b'] or array of ['b','a'] i'm lost on attempt was, maybe this? usort($results, function () use ($k,$v) { return ($v[0][$k] - $v[1][$k]); }); you have this $f = function ($k,$v) { return ($v[0][$k] - $v[1][$k]); }; usort($results, $f); read more closures , usort in php.net

r - NaNs produced in scale transform -

Image
i trying create ggparcoord plot y-value logged of data has positive , negative values in it: x = data.frame(a=2*runif(100)-1,b=2*runif(100)-1,c=2*runif(100)-1,d=2*runif(100)-1,e=2*runif(100)-1) dim(x) [1] 100 5 i try plot parallel coordinates plot: library(ggally) ggparcoord(x, columns=1:5, alphalines=0.5) + scale_y_log10() and receive following error: warning messages: 1: in scale$trans$trans(x) : nans produced 2: removed 167 rows containing missing values (geom_path). i thinking nans produced when take log of negative value. however, not understand why 167 rows containing missing values, when dimension of x 100 rows. in case, try solve adding value of 2 every index in x (so values in x between +1 , +3). x=x+2 ggparcoord(x, columns=1:5, alphalines=0.5) + scale_y_log10() warning messages: 1: in scale$trans$trans(x) : nans produced 2: removed 167 rows containing missing values (geom_path). however, receive same message. idea how solve this? the ggparco

excel - Apply 'On error GoTo' only for specific range -

i apply "on error goto err1" next few lines in code: on error goto err1 activeworkbook.saveas filename:="c:\project\" & year(date) & "\" & _ monthname(month(date)) & "\" & myfilename & ".xls" activeworkbook.close savechanges:=false that's it, after want disable error handling. tried add "on error resume" no results whatsoever. err1 handling looks this: err1: msgbox ("project not overwrite file"), vbcritical activeworkbook.close savechanges:=false this sub saves 1 sheet of file new .xls file, automatically saved date. in case there file generated, , person run macro clicks on "no" when asked overwrite file, err1 pop out message , prevent user getting debug message. however, error handling seems going through code not - after saving file sub generating auto email, , if person wants go project before clicking "send" button goes s

ruby on rails - Tried installing mysql using brew, cmake builds fails error -

i'm installing mysql using brew on linux (ubuntu 14.04) i type brew install mysql command following errors ==> installing mysql dependency: cmake ==> downloading http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz downloaded: /home/sharif/.cache/homebrew/cmake-3.2.2.tar.gz ==> downloading https://pypi.python.org/packages/source/s/sphinx/sphinx-1.2.3.ta downloaded: /home/sharif/.cache/homebrew/cmake--sphinx-1.2.3.tar.gz ==> python -c import setuptools... --no-user-cfg install --prefix=/tmp/cmake2015 --record=installed.txt traceback (most recent call last): file "<string>", line 1, in <module> importerror: no module named setuptools read this: https://github.com/homebrew/linuxbrew/blob/master/share/doc/homebrew/troubleshooting.md#troubleshooting these open issues may help: cmake builds fail on clt-only --env=std (https://github.com/homebrew/homebrew/issues/29101) its stuck on tried many times, don't know should do. i'm naive f

excel - Formula to SUM values that are flagged -

basically, wish sum values in 1 column when row marked or flagged. eg: flag|value 1 |14 |23 1 |3 1 |7 so formula return 24 . i can achieve if dedicate each row column display value if there flag. sum column total. however, not wish dedicate column extract values in each row. is there way of achieving this? it doable sumif, of more general availability: =sumif(a:a,1,b:b)

c# - Is it possible to pass 2 types of objects to Restsharp? -

we have scenario external api returns either user xml or error xml based on whether request succeed or failed. at moment i'm passing user poco restsharp , works fine. if fails, object null. , won't know why failed unless parse error xml manually. is there way workaround this? e.g. var restclient = new restclient(baseurl); var request = new restrequest(uri); request.method = method.post; var response = restclient.execute<user>(request); on execution of above method api can return error xml object. how error object on fail , user on success? this possible, although code little ugly. restsharp allows specify own xml deserializer, we'll need in order make work. first, though, need data type can store either error or user (i made generic works more users): public class result<t> { public t data { get; set; } public error error { get; set; } } so idea is, when execute request, ask restsharp result<user> instead of user , i

c# - Why does MVC HttpCookieCollection.Set update the request's cookies? -

i came upon issue because interested in cookies present in httprequest object, not in httpresponse object. confused cookie browser , fiddler claimed not in request present in httprequest object. found actionfilterattribute setting response's cookie. after stepping on response.cookies.set saw request.cookies included cookie added response. long story short decompiled assembly , figured out intentional. my questions are: i have ideas on how solve it, there established way around this? what reasoning behind decision? seems counterintuitive.

AFNetworking 2.5 uploadTaskWithStreamedRequest swift -

i have simple question swift. i'm trying figure out why can't uploading data file using put . in example, self subclasses afhttpsessionmanager . let request = self.requestserializer.multipartformrequestwithmethod("put", urlstring: url, parameters: params as! [nsobject : anyobject], constructingbodywithblock: {(formdata: afmultipartformdata!) in if attachmenttype == "image/jpeg" { formdata.appendpartwithfiledata(data, name: "image", filename: attachmentname, mimetype: "image/jpeg") } }, error: nil) let task:nsurlsessionuploadtask = self.uploadtaskwithstreamedrequest(request, progress: nil, completionhandler: { (response, responseobject, error) in }) task.resume() i can't figure out why it's not uploading, trying log error, it's not compiling, thoughts? let task:nsurlsessionuploadtask = self.uploadtaskw

Dispatching events to a .subscribe JavaScript method -

i've been stuck on , i'm coming guys last resort. have javascript file (parent.js) loading .js file (child.js). parent.js file has event subscription: class.prototype.subscribe('someevent', someeventhandler) very similar facebook does: fb.event.subscribe('auth.authresponsechange', auth_response_change_callback); fb.event.subscribe('auth.statuschange', auth_status_change_callback); i'm trying understand how child.js can dispatch (or broadcast) someevent someeventhandler gets fired. it seems see tells how add listener, nothing how dispatch event handle method attached listener. references: api-docs https://developers.facebook.com/docs/reference/javascript/fb.event.subscribe/v2.3 someone similar resolved issue, i'm not using fb sdk, using example make objective clearer: fb.event.subscribe not firing events event dispatching in general: https://developer.mozilla.org/en-us/docs/web/guide/events/creating_and_triggering_events

Trouble with multithreading python -

having lot of trouble adding additional thread program'. sits accesses api , executes trades on account. fine , until try , pass streaming rate stoploss order. once run way code runs loop blocking out else , prints latest price. how can set thing run concurrently other 2 threads? main trading program: import queue import threading import time import json import streamer execution import execution settings import stream_domain, api_domain, access_token, account_id strategy import testrandomstrategy streaming import streamingforexprices event import tickevent streamer import demo stop = demo(0) def trade(events, strategy, execution): """ carries out infinite while loop polls events queue , directs each event either strategy component of execution handler. loop pause "heartbeat" seconds , continue. """ while true: try: event = events.get(false) except queue.empty:

mysql - SQLQuery - Counting Values For A Range Across 2 Values Grouped-By 3rd Value in A Single Table -

i have mysql database structured follows: (the numbers on left row numbers) +------------+----------+--------------+-------------+ | start_dsgn | end_dsgn | min_cost_1 | min_cost_2 | +------------+----------+--------------+-------------+ 1| 1 | 2 | 3 | 100 | 2| 1 | 3 | 5 | 153 | 3| 1 | 4 | 10 | 230 | 4| 2 | 1 | 4 | 68 | 5| 2 | 3 | 5 | 134 | 6| 3 | 1 | 7 | 78 | 7| 3 | 2 | 8 | 120 | +------------+----------+--------------+-------------+ i query database such each start design, return count of end designs 1 of 2 cost inputs less input. example user inputs value cost_1 , cost_2. query return count of number of rows, grouped design, in cost_1 >= min_cost_1 or cost_2 >= min_cost_2. so database above lets assume user inputs

html - Javascript WYSIWYG removeEventListener then bring it back -

i creating weird wysiwyg scratch using pure js exercise. here code far: <style> body { height: 200px; background: white; } .title1 { height: 12px; width: 100px; background: white; position: relative; } </style> <script> newtitle1 = function() { var title1 = document.createelement("div") title1.setattribute("contenteditable", "true") title1.innerhtml = "whatever"; title1.classname = "title1"; title1.addeventlistener("click", function() { removeeventlistener("click", newtitle1); }) title1.style.left = (event.pagex -4) + "px"; title1.style.top = (event.pagey -4 ) + "px"; document.body.appendchild(title1) } addeventlistener("click", newtitle1) </script> my question title1.addeventlistener("click", function() { remove

How to get character string out from file in UNIX -

i have file on unix has line special characters pure character string. special character .,$%&*()-@. sample below sample input \302\275b\303\236gcl\302\275t erkatmbn; jacob chinese 39:00 language 53.00 output: jacob chinese language i want pure character string lines out of file. have way read each line , compare each character alphabets if file big consume lot of time. any better approach or suggestions? your best bet grep utility. grep -i '^[a-z]\+$' file.txt specifically, we're doing case-insensitive search ( -i ) lines contain characters [a-z] , , characters start ( ^ ) finish ( $ ).

cocos2d x 3.0 - what is the difference between `doc.AddMember("key1",1,document.GetAllocator())` and `doc["key1"]=1`? -

i want create json object in cocos2d-x 3.4 rapidjson , convert string: rapidjson::document doc; doc.setobject(); doc.addmember("key1",1,doc.getallocator()); doc["key2"]=2; rapidjson::stringbuffer sb; rapidjson::writer<rapidjson::stringbuffer> writer(sb); doc.accept(writer); cclog("%s",sb.getstring()); but output {"key1":1} not {"key1":1,"key2":2} , why? in old (0.1x) versions of rapidjson, doc["key2"] returns value singleton representing null. doc["key2"] = 2 writes singleton. in newer versions of rapidjson (v1.0.x), behavior has been changed. make assertion fail key not found in json object, in order solve exact problem mentioned. as reminder, when operation potentially requires allocating memory (such addmember or pushback , allocator object must appeared. since operator[] has 1 parameter, cannot add new members in stl. quite weird , not user-friendly, tradeoff in rap

javascript - Dynamically setting ng-model is breaking -

i have directive html template this: textinput.html <label for="{{name}}">{{label}}</label> <input type="{{type}}" placeholder="{{placeholder}}" id="{{name}}" ng-model="{{name}}"> the label outputting correctly, inside of input field outputing static {{varname}} if remove ng-model this: <input type="{{type}}" placeholder="{{placeholder}}" id="{{name}}"> it outputs variables correctly, moment place ng-model in , dynamically assign value, breaks entire input. why happening? my goal able create simple 1 line text inputs can mass change directive, so: <textinput name="username" label="username" type="text" placeholder="enter username"></textinput> finally figured out, have pass ng-model through using 2 way binding this: <textinput type="email" name="useremail" ng-model="userem

pdf generation - A particular SVG file is not printable using wkhtmltopdf -

i can't generate pdf particular svg file wkhtmltopdf. can tell me why? i can view , print chrome perfectly. https://drive.google.com/file/d/0b2swqpqbikkqwfc1bkv6z0hqlvu/view?usp=sharing i changed height , width percentage exact pixel values. --thanks boss jayan.

PowerShell Search software installed -

i attempting foreach loop search specific software install on computer using registry search. reason find 1 , not other 2 though know , can see installed. have missed. clear-host $computers = hostname $array = @() foreach($pc in $computers){ $computername=$pc.computername #define variable hold location of installed programs $uninstallkey="software\\microsoft\\windows\\currentversion\\uninstall" #create instance of registry object , open hklm base key $reg=[microsoft.win32.registrykey]::openremotebasekey('localmachine',$computername) #drill down uninstall key using opensubkey method $regkey=$reg.opensubkey($uninstallkey) #retrieve array of string contain subkey names $subkeys=$regkey.getsubkeynames() #open each subkey , use getvalue method return required values each foreach($key in $subkeys) { $thiskey=$uninstallkey+"\\"+$key $thissubkey=$reg.opensubkey($thiskey) #

php-extract data from nested json -

i've nested json code below: fn({ "processingdurationmillis": 714, "authorisedapi": true, "success": true, "airline": "mh", "validcreditcards": [ "ax", "ca", "vi" ], "paypal": true, "outboundoptions": [ { "optionid": 0, "flights": [ { "flightnumber": "0066", "departureairport": { "code": "kul", "name": "kuala lumpur intl", "city": "kuala lumpur", "country": "malaysia", "timezone": "asia/kuala_lumpur", "lat": 2.745578,

ElasticSearch mapping "not working" v1.1.1 -

i have been struggling on must simple syntax issue, trying make basic es mapping work. version 1.1.1 i have gist able create scratch: https://gist.github.com/jrmadsen67/1fc5e296e26e7a5edae0 the mapping query is: put /movies/movie/_mapping { "movie": { "properties": { "director": { "type": "multi_field", "fields": { "director": {"type": "string"}, "original": {"type" : "string", "index" : "not_analyzed"} } } } } } i ran: curl localhost:9200/movies/movie/_mapping?pretty=true to confirm mapping there the query: post /movies/movie/_search { "query": { "constant_score": { "filter": { "term": { "director.original": "francis ford coppola&

algorithm - Finding Shortest path in weighted directional multigraph with extra constraints -

given weighted directed multigraph, have find shortest path between starting vertex u vertex v. apart weight, each edge has time. path connecting u , v cannot take more given maximum time. trouble while using djikstra, there chances shortest path takes more time limit. my approach find valid paths between u , v , minimize weight. approach not practical due high complexity. any ideas? if weights small enough in case, can each node, store possible sums of weights can on path node. can dijsktra on new graph , try minimize time on nodes pairs (node, weight_sum). if times small enough you can same in previous example, on pairs (node, time). general problem i'm afraid in general can try possible paths, try improve prunning.

python - converting iteration into a function -

i'm beginner in python, , computer languages in general, , i'm totally stumped on how format iteration function. iteration takes sum of someone's birth year, month, , day , adds create sum of numbers, , second iteration takes first sum , adds numbers create final sum. this i have users input birthyear, month, , day (all converted int) , code first sum (example: bday of 01/01/1997= 1999): first_sum=b_yr + b_dy + b_mo then first iteration takes sum , adds numbers (example: 1999 = 1+9+9+9 = 28): z = first_sum zstr1=str(z) accum1=0 x in zstr1: accum1 += int(x) (accum1) then second iteration takes first sum , adds numbers again create final sum (example: 28 = 2+8 = 10): str2=str(accum1) accum2=0 cnt2 in str2: accum2 += int(cnt2) i think should work: def numerology(z): zstr1=str(z) accum1=0 x in zstr1: accum1 += int(x) str2=str(accum1) accum2=0 x in str2: accum2 += int(x) return accum2 call function

java - Access files outside the Webcontent folder -

i have made folder outside webcontent save uploaded images user. tried access files directly passing location in "src" tag unable fetch it. after researching found have set path using in "conf/server.xml" file inside tag. although have made these changes unable access file. 1)my tomcat installed @ e:\my work\tomcat 2)i having webroot @ e:\my work\project 3)image folder @ e:\my work\images path setting in "conf\server.xml" is <host name="localhost" appbase="webapps" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false"> <context docbase="/my work/images/" path="/images" /> </host> but still when tried access file using following url http://localhost:8080/images/paper.jpg i unable fetch , getting "http status 404" , request resource not found error. please me i

Dataflow performance issues -

i'm aware update made cdf service few weeks ago (default worker type & attached pd changed), , made clear make batch jobs slower. however, performance of our jobs has degraded beyond point of them fulfilling our business needs. for example, 1 of our jobs in particular: reads ~2.7 million rows table in bigquery, has 6 side inputs (bq tables), simple string transformations, , writes multiple outputs (3) bigquery. used take 5-6 minutes , takes anywhere between 15-20 mins - not matter how many vm's chuck @ it. is there can speeds used see? here stats: reading bq table 2,744,897 rows (294mb) 6 bq side inputs 3 multi-outputs bq, 2 of 2,744,897 , other 1,500 rows running in zone asia-east1-b times below include worker pool spin , tear down 10 vms (n1-standard-2) 16 mins 5 sec 2015-04-22_19_42_20-4740106543213058308 10 vms (n1-standard-4) 17 min 11 sec 2015-04-22_20_04_58-948224342106865432 10 vms (n1-standard-1) 18 min 44 sec 2015-04-22_19_42_20-47401

angularjs - How to sync ionic navigation bar and hardware button in android in a phonegap mobile app -

in phonegap app, there ionic navigation bar has button. if navigate app using navigation bar navigate each page, if use hardware button in point of time, navigation messed up. there fixes this. <ion-view view-title="store locator" ng-controller="storelistctrl" > <ion-nav-buttons side="right"> <button form="searchid" class="button button-icon icon ion-ios7-search" ng-click="search(searchform.searchtext)"></button> </ion-nav-buttons> <ion-content> code here.... </ion-content> </ion-view> this page in our app. button have overrided actions ioplatform.registerbackbuttonaction $ionicplatform.registerbackbuttonaction(function (event) { if($state.current.name==="app.home"){ var mypopup = $ionicpopup.show({ title: 'exit application', scope: $scope,

json - Access the string value from a Dictionary -

i have following code : a= {'b': '{"c":46, "d": 1}', 'e': 10} here need value of "c" in dictionary inside dictionary, value of 'b' dictionary in string format. thanks in advance..!! you have decode string value json format python object following (using python's json module ): import json b_value = json.loads(a['b']) # decode value json string c_value = b_value['c'] # use/access value

mysql - How to make sure that SQL statement is executed and only then start next code step -

i have strange behaviour when executing ruby code. make new model @user = user.first_or_initialize , @user.save what's strange when after try devise helper method sign_in @user fails because time sql query hasn't been executed. have seen in console. made puts @user.inspect right after sign_in @user . , in terminal i've got unpleasant surprise, puts @user.inspect showed me user model without id means sign_in @user passed user without id . , sql query insert users made after put shown in terminal. so question, how can lock ruby code execution, until sql statement has executed? when pass @user sign_in passes user model id ??? edit: @user = user.where(:uid => @shop[:uid]).first_or_initialize if @user.persisted? puts 'persisted.' false else # new customer .... @user.save sign_in @user end i sure record not getting saved , when inspecting record showing initialized copy of object, can use save! see if there exceptions o

c# - Find out $ amount by using regular expressions -

can tell me how find out $ amount of below kind of string using regular expressions ? i'm not @ regex :( in advance. jone has done $15 per unit: "good luck" result should = $15 you can use simple regex like \$\d+ \$ matches $ \d+ matches 1 or more digits regex demo example string str = "jone has done $15 per unit: \"good luck\""; regex pattern = new regex (@"\$\d+"); match match = pattern.match(str); console.writeline(match.groups[0]); => $15 edit to include decimals well \$\d+(?:\.\d+)? \. matches decimal point \d+ matches 1 or more digits ? quantifier, matches 0 or 1 presceding pattern. quantifier ensure optional matching of decimal part. regex demo example string str = "jone has done $15.5 per unit: \"good luck\""; regex pattern = new regex (@"\$\d+(?:\.\d+)?"); match match = pattern.match(str); console.writeline(match.groups[0]); => $15.5

Reformatting code involving Lambda is extremely slow in Intellij IDEA 14.1.2 -

when practice implementing promise-like network processing, find intellij ide becomes unresponsive when reformatting long code involving lambda expressions. luckily finished reformatting job in several minutes, time got stuck. how happen? , how fix it? thanks:) below code node myaddr = nodes.get(local); server = new tcpserver(); server.bindasync(myaddr.host, myaddr.port) .<channelfuture>then(future -> { if (log.isinfoenabled()) log.info("local server has started @" + myaddr + " result=" + future.issuccess()); async.onevent(future); }) .<connectevent>loop(conn -> { if (log.isinfoenabled()) log.info(conn.channel.remoteaddress() + " connected me"); conn.asyncstream .<networkevent<bytebuf>>then(id_event -> {//identification bytebufinputstream

html - css: decorating a div with ::after content without wrapping -

i've been playing around while list have main list text left aligned in content column "+" sign right aligned on same line. have working in firefox, discover lines longer single line (and therefore have ellipsis overflow) wrapping "+" sign in ie , chrome. the example have extracted project @ https://jsfiddle.net/qo65lg2n/2/ . since extract things category numbering isn't showing correctly. is there way of approaching work in 3 major browsers? thanks html: <div style="width: 1000px; text-align: center; margin: auto"> <div class="sfexpandablelistwrp"> <ol class="sflistlist"> <li class="sflistitemtitle"> <a class="sflistitemtogglelnk" href="#"> short list title </a> </li> <li class="sflistitemtitle"> <a class="sflistitemtogglelnk" href=&quo

maven - Connecting to db2 from java client -

i trying connect db2 java client running application jar. jar super-jar dependencies generated shade plugin. when run program ide(netbeans) runs fine, when run commandline fails: java -jar target/locationimporter.jar the exception is: exception in thread "main" java.lang.nullpointerexception @ com.ibm.as400.access.portmapper.getserversocket(portmapper.java:216) @ com.ibm.as400.access.as400implremote.signonconnect(as400implremote.java:2363) @ com.ibm.as400.access.as400implremote.signon(as400implremote.java:2278) @ com.ibm.as400.access.as400.sendsignonrequest(as400.java:3142) @ com.ibm.as400.access.as400.promptsignon(as400.java:2706) @ com.ibm.as400.access.as400.signon(as400.java:4035) @ com.ibm.as400.access.as400.connectservice(as400.java:1184) @ com.ibm.as400.access.as400jdbcconnection.setproperties(as400jdbcconnection.java:3338) @ com.ibm.as400.access.as400jdbcdriver.prepareconnection(as400jdbcdriver.java:1419) @ com.ibm.as40

ios - is it possible to create own XMPP server in Java -

by looking url know can connect xmpp server using link good xmpp java libraries but want create own xmpp server, have openfire, tigase , many other servers available. there libraries , tutorial available making xmpp server scratch? i want make server can handle web, client application, android , ios requests (for chat , other purpose). webchat perfect . have download openfire server open source xmpp server , install webchat on , provide web based interface chat . can use android webview customize , feel in android application

javascript - How to make the 'clickable hand' appear in an HTML document? -

i built sample html webpage recently, , when hover mouse pointer on <div> element makes drop down menu come down on click, pointer changes cursor, allowing me highlight text in <div> . the thing is, don't want mouse pointer change cursor.(i don't want able highlight text either.) want either remain way or change 'clickable hand' pointer comes when mouse pointer hovers on link. how can achieve this? the cursor can changed using css cursor property. cursor:pointer; https://css-tricks.com/almanac/properties/c/cursor/ you can prevent highlighting using user-select property: -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; how disable text selection highlighting using css? for example: div{ cursor:pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none;

Change position of elements in an associative array in php -

i have associative array : $headers= array ( [module_id] => module id [platform_id] => platform id [package_guid] => package guid [aggregate_package] => aggregate package [deld] => deld ) now wish change position ofpackage id @ top resemble : $desired= array ( [package_guid] => package guid [module_id] => module id [platform_id] => platform id [aggregate_package] => aggregate package [deld] => deld ) i tried array_unshift method not works in case associative array. unset($headers['package_guid']); array_unshift($headers, 'package_guid'); how can achieve it? thanks. unset($headers['package_guid']); array_unshift($headers, array('package_guid' => 'package guid'));

linux - What is the difference between system call and library call? -

Image
can explain differences these 2 in linux? please go deep possible each step operating system takes. low level kernel calls handled kernel system calls. the man page says: 2 system calls (functions provided kernel) 3 library calls (functions within program libraries) a pictorial image can make clear: and

Why aren't files being ignored by Git? -

this question has answer here: ignore files have been committed git repository [duplicate] 21 answers i want git ignore files named build-impl.xml in project. to added *build-impl.xml .gitignore however git still shows files being modified: $ git status modified: tma02q1server/nbproject/build-impl.xml modified: tma2q1client/nbproject/build-impl.xml what doing wrong? edit: not aware files being tracked - asking question helped understand why wasn't getting result expected. question may people in similar situation. .gitignore not apply files being tracked. if delete file disk, commit it, , restore file original location, git stop tracking it. or, run git rm --cached tma02q1server/nbproject/build-impl.xml

javascript - Get querystring and send to other file script -

how send query string on checkfolder.php? want use query string in checkfolder.php, don't know how querystring have value in checkfolder. i need echo out query string in checkfolder.php. script: have $_get['location'] querystring. // function querystring function geturlvars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } // function run checkfolder every 5 second. $(document).ready(function () { setinterval(function() { // code goes here run every 5 seconds. var txt = ''; var first = geturlvars()["location"]; $.ajax({ type: "post", url: "checkfolder.php", success: function(result) { if(parseint(result) == "1") { location.reload(); }

tcp - Understanding of netstat -na command in linux -

i facing bad issue , pathetic in networking concepts. when try connect system using tcp protocol getting failure if connect same system after time success. scenario : disconnect target environment , there no connections established target confirmed using below command netstat -na|grep 10.11.12.13 initiate fresh request netstat -na|grep 10.11.12.13 failure given in below tcp 0 182 ::ffff:127.0.0.1:1234 ::ffff:10.11.12.13:8444 established i try initiate again after time same request netstat -na|grep 10.11.12.13 see connections in established mode. i observed difference in second third column of netstat results says value 182 did not see when request successful. know 182 stands for. consider this: [root@stg openssl]# netstat -na| more active internet connections (servers , established) proto recv-q send-q local address foreign address state you can see description of columns @ beginning of netst

ios - How can I close UIAlertController without button -

Image
i use uialertcontroller , uiactivityindicatorview loading indicator, , close until app gets server response. when wrong server or network app never response, can't control alertview, want know there method can close alertview touching screen. , uialertview without title , buttons. hints thankful. it crashed when touch screen, here code: uialertcontroller *alert = [uialertcontroller alertcontrollerwithtitle:nil message:@"正在装载页面...\n\n" preferredstyle:uialertcontrollerstylealert]; uiactivityindicatorview *spinner = [[uiactivityindicatorview alloc]initwithactivityindicatorstyle:uiactivityindicatorviewstylewhitelarge]; spinner.center = cgpointmake(130.5, 65.6); spinner.color = [uicolor darkgraycolor]; [spinner startanimating]; [alert.view addsubview:spinner]; uitapgesturerecognizer *recognizer = [[uitapgesturerecognizer alloc]initwithtarget:alert action:@sel