Posts

Showing posts from January, 2013

In Javascript, how do I make a function calls a specific function before executing anything within it? -

this question has answer here: add line of code functions 3 answers in javascript, how make function calls specific function before executing within (similar super.func in oo language)? e.g. function test() { // call custom function } function test2() { // call same custom function } the idea of can achieve things logging out function gets called, without having inject log statement beginning of every single function. javascript not have such feature can done in automatic way. you'd have replace test , test2 else calls logging thing , calls original. for example, here's generic function can hook other function , call log thing first: function test() { // function whatever } // function hooker function logfunction(fn, logfn, arg) { return function() { logfn(arg); return fn.apply(this, arguments); } } // cus...

C#/WPF - Picturebox like control? -

does picturebox control exist in wpf? want control can change/retrieve backcolor of. image class looking for. name may confusing, control. also, in wpf can customized. background color of every control can changed.

android - AndroidStudio Show Logcat in Finder -

is there way, can let me see logcat logs in finder. androidstudio's "show log in finder". "show log in finder" show idea log. , want logcat logs. there way? helps thank you. i not aware of way show androidstudio logcat files in finder. can run logcat @ command line , save them file. cd $android_sdk/platform-tools adb logcat -v threadtime |tee logcat.txt if looking more advanced things logs have @ lograbbit allow save (or import) logs. lograbbit provides way search android logs. has strong search capabilities rich real-time filter functionality. can on youtube examples of can do.

c# - Google play error when making a purchase while implementing Soomla Unity3d plugin -

i creating app implements soomla unity iap plugin. in effort iap work, have gotten point can make purchase when in editor. (not real purchase, updates virtual currency user can buy/spend in game). when launch on android device, error: authentication required. need sign google account. now have read multiple different articles people have had issue , nothing seems helping me. here list of have tried far: 1) make sure app published either alpha or beta testing.(in alpha now) 2) make sure prices match game , in developer console. 3) use device logged in user not using developer email. 4) make sure email on test device listed tester in developer console. 5) make sure necessary permissions listed in android manifest. 6) confirm merchant account set correctly , verified. 7) make sure build release , not development (not sure if matters, tried both ways). 8) removed of soomla plugin project , added in while following tutorial closely makes sure nothing small mis...

ios - What is the best way to create a viewController of iPad? -

i'm developing universal app, have troubles viewcontroller of ipad. best way sizes of images correct size of device, autolayout or create new storyboard ipad? thanks the current version of xcode uses 1 storyboard both ipad , iphones. within interface builder, can customize layout various screen sizes clicking bottom of ib says "w h any". paul hegarty of stanford covers autolayout extensively in cs193p in lecture 8 , may find helpful if you're getting started ios.

sql - MYSQL- Update Row Based on Fields From Another Row In Same Table -

i have "matches" table holds matches various games. looks (team1 , team2 correspond team ids) team1|team2|tourney_identity|tourney_next|winner 5 6 1 3 6 7 8 2 3 7 0 0 3 5 0 team 0 "tbd" , placeholder when teams arent decided yet. i need query can run continuously grab winner match, update match has matching identity tourney_next it needs able see if needs update team1 or team2 the final table should this: team1|team2|tourney_identity|tourney_next|winner 5 6 1 3 6 7 8 2 3 7 6 7 3 5 0 this current subquery have isnt working, place start update matches m,( select *, case when t1score > t2score team1 else team2 end winner matches isnull(round_id)=false , tourney_next<>0 , event_id=$event order tourney_next) m2 ...

php - Change Cookie w/ Ajax: Strange Delay -

this question has answer here: php cookie has 1 refresh delay [duplicate] 5 answers i'm coding simple function here. i'm using cookies limit users 5 votes per day (not perfect, in fact pretty easy around, client insisted, no user accounts, next best option). so, i'm using ajax call in javascript change cookie on fly - every time user clicks 'vote up' button, ajax talks php file reduces cookie value one. but there's odd delay happening. i've told ajax console.log cookie value (echoed out in php file), , i'm getting delay of 1 value when in log. cookie starts @ 5, when click 'vote' once, should console.log of '4', because value decreased 1 , logged. instead, '5'. next time, should '3', '4', , on. my code posted below. i'm not sure here - i've thought through code logically, , unless h...

html - How to make background(color, not img) responsive? -

i building responsive page. 1 section has problem. when make screen smaller background-color goes out(down on few mm).i checked - when don't have background - don't have problem. how fix it? why happen? .bottomright{ grid-area: bottomright; display: flex; justify-content: center; align-items: center; flex-direction: column; background-color: #d3d3d3; position: relative; } .bottomright:hover{ z-index: 1; box-shadow: 0px -2px 24px 2px rgba(0,0,0,0.2); transform: scale(1.02); } .bottomright h4{ color: #808080; flex: 0 0 auto; align-self: flex-start; position: absolute; top:2rem; left: 2rem; } .bottomright img{ flex: 0 1 auto; align-self:center; max-width: 80%; } <div class="bottomright"> <h4>shcedule meeting @ <p>ibc 2016</h4> <img src="comigo/other/img-event-ibc.jpg"> </div> ...

javascript - Function.prototype.apply left me with undefined is not a function error -

i have simple function js so: function simple(){ } i got undefined not function error when did this: simple.prototype.apply(null,arguments); but when did this: simple.apply(null,arguments); i did not error, why on earth that? the .prototype object not have .apply() method why first example not work. .apply() method on function objects only. see mdn reference .apply() . instead, this: functionname.apply(xxx,yyy) there cases might see function on prototype object being used .apply() such as: array.prototype.slice.apply(xxx,yyy) but, again, that's calling .apply() on function since array.prototype.slice function. in specific example, simple function. so, if want call specific this value and/or pass array of arguments, proper syntax is: simple.apply(xxxx, yyy) that why syntax works - because it's proper syntax .apply() . perhaps if share problem you're trying solve , show relevant code can more specifically.

c - Threading issue when calling same function -

i trying create 4 instances of given function having trouble working out how function called knows thread has called it. this in header file: // gpio pins stored within structs, each sonic range finder. typedef struct sonicpins { // front left pins. int trig1; int echo1; // front right pins. int trig2; int echo2; // rear left pins. int trig3; int echo3; // rear right pins. int trig4; int echo4; } args; void* setup(void *pinsptr); extern int threadfunc(); this within c file. int threadfunc() { struct sonicpins * pins; pthread_create(&pt1, null, setup, (void*) pins); pthread_create(&pt2, null, setup, (void*) pins); pthread_create(&pt3, null, setup, (void*) pins); pthread_create(&pt4, null, setup, (void*) pins); return 1; } the duty of snippet below set pin value , run operations manage sensor. each sensor has own echo , trigger values integers. void* setup(void *pinsptr) { struct ...

regex - replacing with a numbered value -

this question has answer here: how replace token increasing numbers in perl? 3 answers suppose have string $t = "some {great} vacation {we} had {year}" and want replace placeholders numbered value: "some {0} vacation {1} had {2}" i'd have expected single replacement it: $i = 0; $t -replace "{.*?}", "{$([string] ++$i)}" but is: "some {1} vacation {1} had {1}" as if string evaluated once. in perl regex there's way specify function replacement value... how done in psh? try this: $i = 0 ; [regex]::matches($t,"{.*?}") | %{ ++$i ; $t = $t.replace($_.value,"{$i}") } ; $t i think problem regex engine never gets new value of $i each match finds, every time increments it, $i 0 .

icalendar - In iCal format how would I specify a the contact person's phone number -

looking @ spec here: https://www.ietf.org/rfc/rfc2445.txt have contact person event, have name, email , phone number. see can add field: organizer;cn=john smith:mailto:jsmith@host1.com i'm not sure put phone number. nb: i'm producer , primary consumer of feed, ideally others consume also. , using dday.ical generate feed. suggested answer: if don't mind if other consumers missing field... can use x-custom-field format? edit: i'm doing following, works me, i'm not sure other clients? organizer;cn=john smith;tel=00000000000:mailto:john.smith@example.com edit: in circumstances dday ical not formatting field correctly when though use same library encode , decode it. here's encoding method: calevent.organizer = new organizer("mailto:"+detail.eventdetails.contactemail) { commonname = detail.eventdetails.contactname, parameters = { {"tel", detail.eventdetails.contactphone } } }; ...

Configuration for pom.xml to buil an rpm -

i have below folder structure : /a/b/c/test.sh location of pom : /a/pom.xml i need pom.xml file generating rpm this. condition: when deploying rpm script test.sh should automatically run. please help. mojohaus maintains rpm plugin maven build rpm part of maven build. can take @ example pom.xml file started.

PHP extract just a specific number from a string -

how possible extract number after last = symbol in string this: /neuroscan/analysis/admin/listo_aoi_list.php?mastertable=listo_pages&masterkey1=11 the number 1,11,345,888888 etc, if possible int variable. thanks you can try this: $url = $_server['request_uri']; $val = (explode("=",$url)); echo $val[1]; $val[1] getting second value after explode text after "="

sql - How I create this mysql select query? -

i have mysql product table columns of id, name, description, , category_id. this result when select id, name , category_id. +----+-------------+----------------------------+ | id | category_id | name | +----+-------------+----------------------------+ | 6 | 1 | category name | | 7 | 2 | category name | | 8 | 3 | category name | | 9 | 2 | category name | | 11 | 2 | category name | | 15 | 3 | category name | | 13 | 4 | category name | | 14 | 1 | category name | | 15 | 2 | category name | | 16 | 2 | category name | | 17 | 3 | category name | | 18 | 4 | category name | | 19 | 1 | category name | +----+-------------+----------------------------+ my question is,...

java - Not able to properly display time in AM, PM format in Android -

i have achieved time formate using am-pm below code date date = new simpledateformat("h:m").parse((mhour+":"+mminute)); string newstring = new simpledateformat("hh:mm a").format(date); system.out.println("time - "+newstring); but in above code there 1 problem if set time 12:00 am in timepickerdialog display 12:00 am if change time in timepickerdialog 12:00 pm still display 12:00 am it's because h 12 hour time format . , timepickerdialog sending 24 hour format. use, date date = new simpledateformat("h:m").parse((mhour+":"+mminute)); // upper h here. edit: simpledateformat java doc , check out date , time patterns section.

excel - Error 91 when unloading form after Error Handling -

hello fellow developers, i working on little project internship in vba excel (it first time project in vba). program includes several modules , userforms, , complete, implemented error handling. i used : sub ....... modname = "nameofthemodule" subname = "nameofthesub/function" on error goto proc_err /code exit sub proc_err: call loggenerator(modname, subname, erl, err.number, err.description) exit sub end sub (sorry can't post whole file, quite confidential) i wrote code in every sub or function, along line numbers, in case there error, goes proc_err, calls loggenerator that'll generate .txt file module name, sub/function name, line number, error number. don't know if that's best way, works treat. until now. now, when code runs in userform code, log generated, userform doesn't close. pretty dangerous, because still "active", meaning user still put data , validate, though there error before. i tried putting "u...

scroll - Show more than 3 item in a wearable listview without scrolling -

Image
i want create wearable listview can show more 3 item simultaneously, wearable listview shows 3 item, , have scroll down see other items. wearablelistview specific thing? so wearablelistview looks this: but want show more 3 item without scrolling, because has enough space. the listview container xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/kaempewatch_screen_bg" android:orientation="vertical"> <android.support.wearable.view.wearablelistview android:id="@+id/exercise_listview" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> the item xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:...

AngularJs email validation error -

this question has answer here: how validate email id in angularjs using ng-pattern 9 answers i have 2 email address example@gmail.com and example@somevalue both email address valid when use angularjs validation <input type="email" ng-model="application.email_id" placeholder="enter email"> i need make example@somevalue mail address false if address wrong. this tutorial part of angularjs email validation: there validation true when inputing above email address. use ng-pattern="" custom pattern validate email. in controller: $scope.pattern = /.+\@.+\..+/; in html: <input type="email" name="input" ng-model="email.text" ng-pattern="pattern" required> see plunker (the example angular documentation extended ng-pattern)

using cat command with variable unix -

sh temp1.sh gold.txt silver.txt 2 gold.txt $2 silver second gold. unique position in competition. cat: cannot open $2 tstetlx () /appl/edw/apps/scripts/scenario1> vi temp1.sh i=$# echo $i echo $1 echo $`echo $i` #cat "$`echo $i`" cat $2 cat "\$$i" the below command not printing contents of second file passed argument file. cat "\$$i" not clear me trying do. consider using $1 or $2 . the reason line fails because parameter cat literally $2 - no attempt shell substitute $2 if variable. this 1 way handle problem. note bash solution. i=$# echo $i echo $1 echo $`echo $i` #cat "$`echo $i`" cat $2 cat "\$$i" declare -a arr=( "$0" $@ ) echo ${arr[i]} cat ${arr[i]}

pass data to R from java using jri -

i trying integrate r code inside java code.primary objective able use predictions on models created in r. able set environment , basic r commands working fine. issue: trying push data java r function. code snippet: rexp data=re.eval("newdata <- with(cbpp, expand.grid(period=unique(period), herd=unique(herd)))"); rexp fit=re.eval("predict(gm1,newdata,type=\"response\")"); //want pass data created in java newdata system.out.println(fit.asdoublearray().length); in above code "newdata being populated r , used want able create own data in java , pass predict function in r. note: r code trying execute example lme4 package generalised linear mixed mmodel(glmm) model it's been long time since used jri think can use assign() . here's simple example passing array of doubles: re.assign("newdata", new double[] {1.5, 2.5, 3.5});

Standard conventions for indicating a function argument is unused in JavaScript -

are there standard ways of marking function argument unused in javascript, analogous starting method argument underscore in ruby? just have example work from, common jquery's $.each you're writing code doesn't need index, value, in iteration callback ( $.each backward relative array#foreach ): $.each(objectorarraylikething, function(_, value) { } // use value here }); using _ closest i've seen standard way that, yes, i've seen lots of others — giving name reflective of purpose anyway ( index ), calling unused , etc.

c# - Uploading to Azure Media Services with sas url using rest api -

i followed guide https://azure.microsoft.com/en-us/documentation/articles/media-services-rest-upload-files/ , have gotten part have sas url (upload url). here im in doubt of im supposed do. followed link lead me azure storage services - whole other documentation specifying how authenticate requests , make canonicalized strings. have upload url - url created through many steps already. please tell me im supposed when have upload url , want upload media file? in advance, im kinda lost here. if have sas url, need @ following rest api functions: put blob , put block , put block list . when using these rest api operations, things consider: your request url sas url. since you're using sas url, don't worry authorization header authorization information included in sas token ( sig query string parameter). you don't have include x-ms-version , x-ms-date headers well. don't forget include x-ms-blob-type header , make sure it's value blockblob . i...

javascript - move marker and update place in google maps -

i using google maps, , in textfield can type place , see marker on google maps coordinates. can move maker , coordinates in info box updated. how update place name in textfield? thank you. this jquery script: var map; function initmap() { var geocoder = new google.maps.geocoder(); var startaddress = $('#form_inp19').val(); geocoder.geocode({ 'address': startaddress }, function (results, status) { if (status === google.maps.geocoderstatus.ok) { startlocationmap = results[0].geometry.location; map = new google.maps.map(document.getelementbyid('map'), { zoom: 12, center: startlocationmap }); geocoder = new google.maps.geocoder(); document.getelementbyid('submit').addeventlistener('click', function () { geocodeaddress(geocoder, map); }); } else { alert('place doesnt exist on...

Execute R Models in Spark -

i apologise having no code functional question. i looked @ sparkr. allows data manipulations of data held in spark via r code. not have access spark-mllib till spark 1.5 release wip. however of - can execute r models on data held in spark via sparkr? thanks, manish if install developmental version apache spark repository , there models available play with. in particular, if @ mllib.r , glm method (with associated predict , summary methods) available.

validation - An error when serializing a list of validationattribute -

i trying serialize list of (validationattribute) shown below: requiredattribute trequired = new requiredattribute(); list<validationattribute> validationlist = new list<validationattribute>(); validationlist.add(trequired); xmlserializer txmlserializer = new xmlserializer(typeof(list<validationattribute>)); memorystream tmemstream = new memorystream(); streamwriter tstreamwriter = new streamwriter(tmemstream); txmlserializer.serialize(tstreamwriter, validationlist); when (serialize) function execute, following exception thrown: the type system.componentmodel.dataannotations.requiredattribute not expected. use xmlinclude or soapinclude attribute specify types not known statically i have figured out. needed pass type of (requiredattribute) xmlserializer: requiredattribute trequired = new requiredattribute(); list<validationattribute> validationlist = new list<validationattribute>(); validationlist.add(trequired); type[] textratypes ...

javascript - Too much recursion when updating state in react -

in example, when try update state during componentdidupdate life cycle callback, too recursion error. how should updating state? import react 'react'; class notescontainer extends react.component { constructor(props) { super(props); this.state = { listofshoppingitems: [] }; } componentdidupdate(nextprops, nextstate) { let newshoppingitems = this.calculateshoppingitems(); this.setstate({ listofshoppingitems: newshoppingitems }); } calculateshoppingitems() { let shoppingitemscart = [] if (this.props.milk < 3) { let value = "buy milk"; shoppingitemscart.push(value); } if (this.props.bread < 2) { let value = "buy bread"; shoppingitemscart.push(value); } if (this.props.fruit < 10) { let value = "buy fruit"; shoppingitemscart.push(value); } if (this.props.juice < 2) { let value = "buy juice"; shoppingitemscart.pus...

c# - Does getting current class and method name reduce performance? -

i have logging class creates instance of log4net , can call anywhere in code. have method find out class , method name of caller. here method: private static string currentmethod() { stacktrace stacktrace = new stacktrace(); methodbase method = stacktrace.getframe(2).getmethod(); string cn = method.reflectedtype.name; string mn = method.name; string output = "[" + cn + "." + mn + "]"; return output; } i found these articles: link1 , link2 , link3 , link4 , many others, none of them discuss efficiency , performance. have 2 questions: 1- can use method in big project(about 1000 requests in 1 second)? mean how effect project's efficiency , performance? 2- os there better way write above method? also here part of logging class. guess can help: public static class tools_log { private static ilog logger; public static ilog getlogger() { return logger ?? (logger = createlogger()); } private st...

how can i pass a php variable from parent page to include page -

i including page childpage.php in parent page, want pass variable parent page childpage.php , want access variable in childpage.php . here code: include_once("childpage.php?a='$x'"); why doesn't work? you can define variable before include so $x = 'something needed in include file'; include_once("childpage.php"); you can use $x variable in childpage.php now.

amazon s3 - Cannot load more than 2 files to S3 using plupload -

my code below works fine long load 2 multiple files. if load 3 or more, every file after 2nd 1 not added s3 bucket (although no error shown plupload). can understand why? var uploader = new plupload.uploader({ browse_button: 'browse', // can id of dom element or dom element url: 'https://s3.amazonaws.com/mybucket', filters: { max_file_size: '25mb', prevent_duplicates: true, multiple_queues: true } }); uploader.init(); uploader.bind('filesadded', function (up, files) { plupload.each(files, function (file) { var myfilename = file.name.tolowercase(); myfilename = myfilename.replace(/[|&;$%@"<>()+,]/g, ""); var elem = $('#hfreplyguid'); $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", datatype: "json", ...

android volley can't get response -

i trying response instagram api using volley, can't data. did't receive call methods onresponse or onerrorresponse. nothing show up. not see error. here code. public string getuserid(string usrname) { url = tcontants.urlbeforeuserid + usrname + tcontants.urlafteruser; jsonobjectrequest jsonobjreq; jsonobjreq = new jsonobjectrequest(method.get, url, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { tagsresponse gsondata = gson.fromjson(response.tostring(), tagsresponse.class); userid = gsondata.data[0].id.tostring(); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { log.e("volley:", "getuserid response error"); } }); appcontroller.getinstance().addtorequestqueue(jsonobjreq, tcontants.tag_json_obj); return userid; }...

file access - What is sys.stdin.fileno() in python -

i sorry if it's basic or asked before (i googled couldn't find simple & satisfactory explanation). i want know sys.stdin.fileno() is? i saw in code , didn't understand does. here's actual code block, fileno = sys.stdin.fileno() if fileno not none: new_stdin = os.fdopen(os.dup(fileno)) i executed print sys.stdin.fileno() in python command line , returned 0 . i searched google, , this (nullage.com) reference find, says, fileno() -> integer "file descriptor". this needed lower-level file interfaces, such os.read(). so, mean? file descriptor low-level concept, it's integer represents open file. each open file given unique file descriptor. in unix, convention, 3 file descriptors 0 , 1 , , 2 represent standard input, standard output, , standard error, respectively. >>> import sys >>> sys.stdin.fileno() 0 >>> sys.stdout.fileno() 1 >>> sys.stderr.fileno() 2

node.js - Create & Find GeoLocation in mongoose -

i'm trying save longitude/latitude of location in user model , query $geonear . i've looked @ page find on topic, still i'm not sure how 1) create model appropriately , how query it. here's part of model: loc: { //type: 'point', // see 1 //type: string, // see 2 coordinates: [number], index: '2dsphere' // see 3 }, @1: according documentation type must 'point' if want store point, throws typeerror: undefined type `point` @ `loc` did try nesting schemas? can nest using refs or arrays. which makes sense, since guess should string @2: doesn't throw error, when try store user get: name: 'validationerror', errors: { loc: { [casterror: cast string failed value "[object object]" @ path "loc"] @3: if want create index error: typeerror: undefined type `2dsphere` @ `loc.index` did try nesting schemas? can nest using refs or arrays. so tried store ind...

python 2.7 - Need help extracting links from a TD in webpage -

i new @ python , trying hands @ building small web crawlers. trying code program in python 2.7 beautifulsoup extract profile urls page , subsequent pages http://www.bda-findadentist.org.uk/pagination.php?limit=50&page=1 here trying scrape urls linked details page, such this http://www.bda-findadentist.org.uk/practice_details.php?practice_id=6034&no=61881 however, lost how make program recognize these urls. not within div class or id, rather encapsulated within td bgcolor tag <td bgcolor="e7f3f1"><a href="practice_details.php?practice_id=6034&amp;no=61881">view details</a></td> please advise on how can make program identify these urls , scrape them. tried following, neither worked for link in soup.select('td bgcolor=e7f3f1 a'): link in soup.select('td#bgcolor#e7f3f1 a'): link in soup.findall('a[practice_id=*]'): my full program follows: import requests bs4 import beautifulsoup def bd...

javascript - Make a div that go somewhat curved -

Image
this question have been asked billion times think, case. how make html / css (and, if no other option, js - i'm thinking of canvas or svg) : notes : div should able contain scrolling background image on whole green part. , should work on ie9+ , common mobile devices (default browser). also, space around shape needs stay transparent (no white element create rounded shape can used) what's better option ? css implementation you can create border shape within container , hide unwanted parts. have used view port sized units scalable. can further improved requirement manipulating values. body { background: #f5f5f5; } .container { height: 70vh; overflow: hidden; display: inline-block; width: 30vh; background: white; margin: 0 10px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); } .curve { background: transparent; border: 20vh solid #7cc576; border-radius...

javascript - Unable to load and run bootstrap.js in an iframe -

for specific use case (some kind of demo of parts of full-page application inside other web-app) need load content html page iframe, apply css run js. the loaded content uses bootstrap elements js. since there many different examples loaded, not want manually add bootstrap js , required css each loaded html snippet manually (which work) instead add per js once html loaded iframe. what following: after making sure dom of html loaded iframe add css , necessary js follows: $('#'+index+'-iframe-example').contents().find("head").append( '<link href="/app/static/css/app.css" rel="stylesheet" type="text/css" />' ); $('#'+index+'-iframe-example').contents().find("body").append( '<script src="/libs/jquery/dist/jquery.js"></script>' ); $('#'+index+'-iframe-example').contents().find("body").append( '<script src="/libs/b...

osx - When it's a right time to -expandItem: in a NSOutlineView? -

i have nsoutlineview use display items grouped sections. ┌──────────────────────────────┐ │ section 0 │ └──────────────────────────────┘ ┌────────────────────────────┐ │ item 0 │ └────────────────────────────┘ ┌────────────────────────────┐ │ item 1 │ └────────────────────────────┘ ┌──────────────────────────────┐ │ section 1 │ └──────────────────────────────┘ ┌────────────────────────────┐ │ item 2 │ └────────────────────────────┘ outline view backed custom fetched results controller issues 2 kinds of notifications on model changes: insert/move/delete section @ index (to index) when notification insert/move/delete item @ root level of outline view. insert/update/move/delete item @ index in section (to index in section) when notification insert/update/move/delete item @ corresponding section level. that is, manage outline view in incremental fashion , did...

java - cannot import org.apache.poi in spring so not able to compile -

i trying import excel data in desktop mysql database not able parse excel file not able import org.apache.poi have given pom file also, in have included org.apache.poi dependency still not able import because of not able poifsfilesystem,hssfworkbook,etc use my java code: public static void main( string[] args ) { fileinputstream input = new fileinputstream("/users/desktop/file.xlsx"); poifsfilesystem fs = new poifsfilesystem( input ); hssfworkbook wb = new hssfworkbook(fs); hssfsheet sheet = wb.getsheetat(0); hssfrow row; applicationcontext appcontext = new classpathxmlapplicationcontext("resources/spring/config/beanlocations.xml"); stockbo stockbo = (stockbo)appcontext.getbean("stockbo"); int row1 = 1; /** insert **/ stock stock = new stock(); fo...

linux - Check if download / upload in progress -

is there way check if there's active download / upload (file transfer) using command in command prompt ? interested if there's anyway check same thing under linux os? you check packet status of socket on data transfer being handled. don't think give specific information on whether "download" activem, because there many ways of handling "download/upload".

java - How to create an Eclipse project for an OPC DA interface? -

i consulter , started shortly in project have use both opc da & rest api. in first step, decided install eclipse scada & make communication opc da simulator. first job install eclipse scada project, because scada includes both interfaces pure java & not need os-specific code/resources dlls etc. on web, found tutorial , page seems outdated. enlisted resources such not exist (anymore). message reads: no software site found @ http://git.eclipse.org/c/eclipsescada/org.eclipse.scada.base.git. wish edit location [ no ] [ yes ] what need simple tutorial creates appropriate eclipse project & communicates opc da simulator. what have done sofar: installed oracle vm virtualbox linux debian run near raspberry pi installed oracle vm virtualbox windows 7 run the installed windows 7 virtual machine run matrikon opc simultor installed eclipse kepler 4.3, said eclipse scada running there the java 1.8 se & jdk do know resources opc da newbie? thank in advance!...

angularjs - Show/Hide ng-messages wrapper only when focus field is dirty -

Image
i triying display/hide ng-messages div when field in target dirty , contain error... i have ng-messages wrapper : <div class="alert-bloc red clearfix" data-icon="warning-white" ng-if="changepwd.$dirty" ng-hide="hideme" ng-messages="changepwd.$invalid" ng-messages-multiple> <div> <p ng-message="required">votre nouveau mot de passe est requis</p> <p ng-message="minlength">votre nouveau mot de passe est trop court</p> <p ng-message="pattern">votre nouveau mot de passe doit intégrer au moins une majuscule, une minuscule et un chiffre</p> <p ng-message="different">{{ errormsg }}</p> <p ng-message="mirror">{{ errormsg }}</p> </div> </div> my form : <form role="form" name="changepwd" novalidate autocomplete="off"> ...

jodatime - How to check if a given date is not end of week, end of month and end of Quarter using java -

how check if given date not end of week, end of month , end of quarter should not end of week, end of month , end of quarter here partial answer: localdate today = localdate.now(); localdate endofmonth = today.dayofmonth().withmaximumvalue(); system.out.println("today end of month: " + today.equals(endofmonth)); note similar simple solution not possible quarters because joda-time not support element (workaround or other library necessary). furthermore, similar solution calendar weeks using weekofweekyear() instead of dayofmonth() possible long want iso-8601-compatible calendar weeks start on monday , have @ least 4 days within calendar year (this excludes us-weeks!).