Posts

Showing posts from September, 2010

fiware - iotagent-json tutorial error -

during tutorial: https://github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md when execute curl: curl -x post -h "content-type: application/json" -h "accept: application/json" -h "fiware-service: myhome" -h "fiware-servicepath: /environment" -h "cache-control: no-cache" -d '{ "value" : "300" }' 'http://localhost:1026/v1/contextentities/livingroomsensor/attrs/sleeptime' i'm getting error response: { "orionerror" : { "code" : "400", "reasonphrase" : "bad request", "details" : "service not found" } } how fix this? cumps it seems "mixing" url styles ngsiv1 , ngsiv2 :) mean, should either: /v2/entities/livingroomsensor/attrs/sleeptime or /v1/contextentities/livingroomsensor/attributes/sleeptime my recomendation use ngsiv2, more powerfull, flexible , simple version of context

cordova - when I play a mp4 video file in phonegap app on my ipad, it can't display, but it works in my iphone and the xcode simulator -

now developing phonegap app, app include static pages play videos in html video tag. first, use xcode simulator debug app, works fine, video display. then, install app in iphone, works fine. last, install in ipad, unfortunately, video can't play, shows 'video box' , play button forbidden slash. the code video play in html below: <div class="video"> <video src="video/2.mp4" controls="controls" autoplay type="video/mp4"> your browser not support video tag </video> </div>

ember.js - Transition to route's action from Ember object -

i new ember. have existing ember app , need implement functionality in it. have ember object below `import ember 'ember'` callservice = ember.object.extend ... other code here _updateconnectedleadid: (-> console.log "do here??" **pass route action here** ).observes('some_other_here') `export default callservice` unfortunately, couldn't put whole code here. my route looks like applicationroute = ember.route.extend actions: showlead: -> console.log data console.log "did here?" @transitionto('dashboard') `export default applicationroute` i tried using @send('showlead') , @sendaction('showlead') in method no luck. my main intention make transition once console.log "do here??" displayed. not sure if on right way here. i tried using @transitionto('dashboard') , @transitiontorote('dashboard') directly throws me errors. i have been st

APK doesn't work on phone but App works normal in Android Studio -

i have app works without problems in android studio, when build apk , install shows stranges behaviors: 1- when app installing, phone shows me notification no 1 permission necessary app (and not true, app works awareness) 2- after installation, , running, app crushed, no 1 screen showed. i thinking maybe problem manifest, said in emulator works without problem. first time see behavoir. idea how solve ?? 03-28 13:15:22.851 7334-7334/com.itelma.tele d/androidruntime: shutting down vm 03-28 13:15:22.851 7334-7334/com.itelma.tele e/androidruntime: fatal exception: main process: com.itelma.tele, pid: 7334 java.lang.runtimeexception: unable instantiate service com.itelma.tele.api_ac.fcminstanceidservice: java.lang.classnotfoundexception: didn't find class "com.itelma.tele.api_ac.fcminstanceidservice" on path: dexpathlist[[zip file "/data

node.js - How to handle url+multiple otpional query params in node? -

i making rest api. , have multiple optional params. here solution have taken, there solution? url can be www.myurl.com/ or www.myurl.com/faqid/22 or www.myurl.com/faqid/22/locale/english here implementation var getfaq = (req, res) => { let faqdetails = faq.map(obj => obj);//it mock json faqdetails = req.params.faqid ? faqdetails.filter(obj => obj.id == req.params.faqid) : faqdetails; faqdetails = req.params.topic ? faqdetails.filter(obj => obj.topic == req.params.topic) : faqdetails; return res.status(200).send(faqdetails); } router.get('/:faqid/topic/:topic', getfaq) router.get('/:faqid', getfaq) router.get('/', getfaq) i suggest should try organise app routes in such way methods follow single responsibility principle every function write should 1 thing. should have 1 defined goal. in above getfaq seems doing many things. you'd ideally want divide them getall() , getsingle() , gettopic() function

python - Empty SVG file errror while it's not -

working pycairo, create "svgsurface" (which create me svg file) , write on using "context". after finish, need use svg file, seems file not closed gave me error telling document empty. ps = cairo.svgsurface("header.svg", width, height) cr = cairo.context(ps) drawrectangle (cr, papersize.convert_length(int(lg[0]), "px","pt"), papersize.convert_length(int(lg[2]), "px","pt"), papersize.convert_length(int(lg[1])-int(lg[0])-1, "px","pt"), papersize.convert_length(int(lg[3])-int(lg[2])-1, "px","pt"), 0, 0, 0.5 ) cr.show_page() head = st.fromfile("header.svg") it gives me error : file "/usr/local/lib/python2.7/dist-packages/svgutils/transform.py", line 249, in fromfile svg_file = etree.parse(fid) file "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src/lxml/lxml.et

Python - Data analysis of XML file with ElementTree -

this going pretty long question since problem quite specific , needs explaning sorry that. i have xml file contains multiple 'spreekbeurten'. want obtain text spreekbeurten, problem spreekbeurten not have 'al-group' , do. (see code below example piece ofthe xml file) <handelingen> <spreekbeurt nieuw="ja"> <spreker> <voorvoegsels>de heer</voorvoegsels> <naam> <achternaam>recourt</achternaam> </naam> (<politiek>pvda</politiek>):</spreker> <tekst status="goed"> <al-groep> <al>much</al> <al>very</al> <al>hungry</al> <al>i am</al> <al>hello.</al> </al-groep> </tekst> </spreekbeurt> <spre

vb.net - How to keep VSTO Powerpoint-COM-Add-In in sync with Powerpoint application on user shape delete action -

i'm working on vb.net based vsto powerpoint-com-add-in. i shape automation stuff , running errors when user deletes shapes reside within grouped shape. example: create 3 rectangles - group them - delete 1 rectangle without ungrouping when check number of groupitems in group doesn't refreshed (it should decreased number of deleted shapes, e.g. one), have still 1 or more references no longer existing shapes in application causes exceptions being thrown. i can recognize problem looking special conditions , catching error, have ugly workaround "sync" add-in powerpoint application in case performing "ungroup.group"-command comes further downsides. if blastselectionwasgroupchildonly andalso globals.thisaddin.application.activepresentation.hasoneshapeselected andalso globals.thisaddin.application.activepresentation.firstselectedshape.type = microsoft.office.core.msoshapetype.msogroup '*** vorhergehende selektion durchgehen / check last s

hashmap - java insert in Map<String, Set<String>> -

in c++ can do: map<string, set<string>> v; v["aha"].insert("ba"); in java have: hashmap<string, set<string>> v = new hashmap<string, set<string>>(); how can insert "ba" v["aha"] c++? yes try this: set<string> vs = v.get("b"); if (vs == null) vs = new hashset<string>(); vs.add("v"); v.put("b", vs); but large if want add set, , allow possibility key/value pair might not yet exist in map, can use computeifabsent v.computeifabsent("aha", k -> new hashset<string>()).add("ba") this key in map, , if missing, add new empty set value, can add stuff straight it. if you're using version of java before java 8, it's little more code: set<string> s = v.get("aha"); if (s==null) { s = new hashset<string>(); v.put("aha", s); } s.add("ba");

Checkout a git submodule in Xcode 8 Build Phase script -

Image
i have git repo on bitbucket utility project , use git submodule in other projects. wrote xcode build phase script clones, initializes , updates submodule fails cloning error: cloning '[location of working copy]'... ssh_askpass: exec(/usr/x11r6/bin/ssh-askpass): no such file or directory permission denied (publickey). fatal: not read remote repository. i can checkout xcode's interface, can checkout command line, , can run same script command line myself, , works, prompted passphrase. except when script run xcode. i contacted bitbucket support , pointed out according error xcode trying use /usr/x11r6/bin/ssh-askpass prompt me passphrase of private key can't find file (i found /usr/x11r6 symlink /opt/x11). suggested check following links: https://support.rstudio.com/hc/en-us/community/posts/200660237-using-git-with-password-authentication-on-os-x https://github.com/markcarver/mac-ssh-askpass https://github.com/theseal/ssh-askpass i installed missing bin

excel - Test for change in month from list of dates -

i want code in vba identify each time there's change in month, example january february. in below example can see want take input column b, , output column c. output should be: test when month change occurs. train when month same before. example data: a b c 1 29/12/2006 train 2 01/01/2007 test 3 02/01/2007 train 4 03/01/2007 train 5 04/01/2007 train 6 05/01/2007 train .. 100 01/07/2007 test here's way. a1-day(a1) return last day of preceding month. so: b2: =if((a1-day(a1))=(a2-day(a2)),"train","test")

sql server 2008 r2 - Sum values of column on a row with null values in the same column -

i have below query generates following table. wonder if there way replace null-value in column "rate" sum(yieldportion) 5 currencies includes data every position date? preferable in case-clause generates "rate". positiondate| currency | yield | ratename | rate | yieldportion 2017-03-27 | dkk | -7,0 | cibor_3m | -24,750 | -0,058 2017-03-27 | eur | -21,2 | euribor_3m | -33,000 | -0,069 2017-03-27 | nok | 138,6 | nibor_3m | 94,000 | 0,114 2017-03-27 | sek | 5,5 | stibor_3m | -49,100 | -0,195 2017-03-27 | usd | 122,8 | libor_3m | 115,130 | 0,045 2017-03-27 | portfolio| 18,5 | benchmark | null | null 2017-03-24 | dkk | -7,1 | cibor_3m | -24,750 | -0,056 2017-03-24 | eur | -21,1 | euribor_3m | -33,000 | -0,068 2017-03-24 | nok | 139,4 | nibor_3m | 96,000 | 0,118 2017-03-24

python - Write a template that takes two column names and applies a simple equation to the values -

i have table number of columns. trying write jinja2 template take names of 2 of columns , use these cell values of each column. needs loop through these pairs , apply simple mathematical formula (i.e. cell1 * cell2 ) , thing need rendered template resultant value. a column has name , cells attribute. this seems should quite simple achieve having problems it. may due unfamiliarity python come js background , have started using python. any problem appreciated. thanks time. update: column a: { name: 'column 1', cells: [ {value: 1000}, {value: 1000}, {value: 1000} ] } column b: { name: 'column 5', cells: [ {value: 11}, {value: 39}, {value: 50} ] } this template applied values in table react component, , evaluated on back-end. if done in python need: a = { 'name': 'column 1', 'cells': [ {'value': 1}, {'value': 2}, {'value': 3} ]

java - AbstractMethodError due to slf4j api and sl4j marker call apacheds-all-1.5.5 -

i landed on famous error: java.lang.abstractmethoderror: ch.qos.logback.classic.logger.log(lorg/slf4j/marker;ljava/lang/string;iljava/lang/string;ljava/lang/throwable;)v @ org.apache.commons.logging.impl.slf4jlocationawarelog.debug(slf4jlocationawarelog.java:120) after going thru lot of questions here progress: mvn.cmd dependency:tree -dskiptests | findstr /r /c:slf4j proof i'm using same versions of slf4j on slf4j-api, jcl-over-slf4j (1.5.5, can't use later versions coz of following) looking classpath classes loaded see following results: debugjars(org.slf4j.spi.locationawarelogger.class); debugjars(org.apache.commons.logging.impl.slf4jlocationawarelog.class); debugjars(org.slf4j.marker.class); debugjars(ch.qos.logback.classic.logger.class); returns: file:/c:/users/user/.m2/repository/org/apache/directory/server/apacheds-all/1.5.5/apacheds-all-1.5.5.jar!/org/slf4j/spi/ file:/c:/users/user/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.5/jcl-over-s

PYTHON Remove repetitive chars from string -

this question has answer here: remove items list while iterating 18 answers remove specific characters string in python 18 answers i have string name = "aaron" , remove vowels. using remove() if char repetive letter 'a' in case stays in string. suggestions ? here code : def disemvowel(word): word_as_list = list(word.lower()) print(word_as_list) vowels = ["a", "e", "i", "o", "u"] char in word_as_list: v in vowels : if char == v : word_as_list.remove(v) return "".join(word_as_list) print(disemvowel("aaaron")) as other people have said, list comprehension way go: def disemvowel(word): word = word.lower() vowels = [

java - Not able to access Second Database using Spring batch -

i new spring . goal read existing data 1 database(mysql) , write same data database(mysql). have created 2 databases batchtest & batchtestdb . batchtest database contains table product 2 columns product_name & product_price & data in it. batchtestdb database contains table testproduct 2 columns product_name & product_price. have declared batchtest main database using **@primary**. issue trying read data product table , write same data testproduct table. have declared both databases connection details still not recognising second database , says testproduct doesnot exist here's code... batch configuration program: @enablebatchprocessing public class batchconfiguration { @autowired private jobregistry jobregistry; @autowired private datasource datasource; @autowired private jobbuilderfactory jobs; @autowired private stepbuilderfactory steps; @bean public job importproductjob() { return jobs.get("databasetodat

javascript - regex to validate three digit with one decimal -

i have written regex validate number containing 3 digits , 1 decimal return false in cases. re = new regexp("^\d{1,3}\.*\d{0,1}$"); re.test(33.0); i tried many combinations not working. aim validate number @ max 3 digit 1 decimal , less 100. can handle less 100 part. this 1 want: var test = [ 123, 12.34, 100.1, 100, 12, 1.2, 1 ]; console.log(test.map(function (a) { return a+' :'+/^(?:100(?:\.0)?|\d{1,2}(?:\.\d)?)$/.test(a); }));

xml - Sublime Text: Find all quotes(") inside double quotes using regex -

i have huge xml document want replace double quotes ( " ) html entity &quot; inside double quotes, think can done using regular expressions in sublime text don't know can regular expression that! xml example: <itemdescription descriptionvalue="rectangular cocktail table" itemdescriptionqualifier="sellerassigned" itemdescriptionclassification="product" itemfriendlydescription="rectangular cocktail table" itemfeatures="welded metal frames in baked epoxy "gunmetal" color finish." size="3.7""/> what want achieve is: <itemdescription descriptionvalue="rectangular cocktail table" itemdescriptionqualifier="sellerassigned" itemdescriptionclassification="product" itemfriendlydescription="rectangular cocktail table" itemfeatures="welded metal frames in baked epoxy &quot;gunmetal&quot; color finish." size="3.7&quot;"/

unity3d - how to limit CreateCell c# procedural grid generation unity -

Image
i learning c# unity , use pointers. i following catlikecoding hex map tutorial have modified grid own means. http://catlikecoding.com/unity/tutorials/hex-map-1/ my goal create pyramid of squares procedurally starting 7 * 7 grid. using prefab plane how place limit on createcell looped function cells (x,y) coordinates not created when meet following expression x + y > n - 1 n = grid size (for example (6,1) or (5,6) i have gotten far creating rhombus of planes undesired planes below ground plane. the script follows. public class hexgrid : monobehaviour { public int width = 7; public int height = 7; public int length = 1; public squarecell cellprefab; public text celllabelprefab; squarecell[] cells; canvas gridcanvas; void awake () { gridcanvas = getcomponentinchildren<canvas>(); cells = new squarecell[height * width * length]; (int z = 0 ; z < height; z++) { (int x = 0; x < width; x++) { (int y = 0; y < length

node.js - Pass shell environment variable as argument in npm script -

i'm trying pass environment variables npm scripts arguments no success. export environment=test.proxy.json npm run test i'm trying in package.json npm run test --proxy-config-file $environment when this: export environment=test.proxy.json npm run test or this: environment=test.proxy.json npm run test then pass "test.proxy.json" string value of environment variable named environment . if want pass arguments npm scripts may need use: npm run test -- --proxy-config-file $environment keep in mind if pass argument npm script, doesn't mean passed other scripts script executing. environment variables it's other way around - default should passed 1 script other there still no guarantee caller may decide environment variables pass, if any. but it's hard tell question real problem here - phrase "with no success" general know problem here.

shell - search 2 fields in a file in another huge file, passing 2nd file only once -

file1 has 100,000 lines. each line has 2 fields such as: test 12345678 test2 43213423 another file has millions of lines. here example of how above file entries in file2 : '99' 'databases' '**test**' '**12345678**' '1002' 'exchange' '**test2**' '**43213423**' i way grep these 2 fields file1 can find line contains both, gotcha is, search 100,000 entries through 2nd file once looping grep slow loop 100,000 x 10,000,000. is @ possible? you can in awk: awk -f"['[:blank:]]+" 'nr == fnr { a[$1,$2]; next } $4 subsep $5 in a' file1 file2 first set field separator quotes around fields in second file consumed. the first block applies first file , sets keys in array a . comma in array index translates control character subsep in key. lines printed in second file when third , fourth fields (with subsep in between) match 1 of keys. due ' @ start of line, first field $1 em

Labeling Gmail message (not the whole thread) with Google Apps Script -

is possible search messages label 'apps script queue' , give these specific messages (not whole thread) new label? when use gmailapp.search('label:apps script queue') requested messages when assign new label these messages, other messages of thread (on other places in mailbox) same label. , not want. in gmail, labels applied thread , cannot applied single email message of thread. you can apply stars / colors individual messages.

BaseStatefulBolt (Storm Core) vs StateFactory (Storm Trident) -

i confused using storm. going measure status of data source using streamed data. status calculated combine of fields, , these field can achieved different time interval. that's why need save fields measure status of data source. can use basestatefulbolt? or solution trident cenario? what difference btw them. because there statefactory inside trident too. thank you. i think difference trident higher level basestatefulbol, has options counting group by,persistentaggregate,aggregate . i have used trident counting total view per user. if care current total count, think can use trident using memorymapstate.factory() , class implement action counting or summing. in case need managing status of current fields , think implement basestatefulbolt choice, has keyvaluestate save current state.

php - Magento 1.9 - How to create multiple wishlist programmatically -

i want create module provide multiple wishlist functionality customer, similar this extension. should start creating new table or extend existing wishlist table block , model files need override. <?xml version="1.0" encoding="utf-8"?> <config> <modules> <az_wishlist> <version>1.0.0</version> </az_wishlist> </modules> <global> <models> <az_wishlist> <class>az_wishlist_model</class> <resourcemodel>az_wishlist_resource</resourcemodel> </az_wishlist> <az_wishlist_resource> <class>az_wishlist_model_resource</class> </az_wishlist_resource> <wishlist_resource> <rewrite> <wishlist>az_wishlist_model_resource_wishlist</wishlist>

scala - akka-http and JsonEntityStreamingSupport -

i'm doing experiment akka , persistency stack, wrapped akka-http stack. note: persistency, i'm using non-official plugin persist akka fsm mongodb. but problem using jsonentitystreamingsupport , recommended akka serve source json . in case, have piece of code implicit val jsonentitystreamingsupport: jsonentitystreamingsupport = entitystreamingsupport.json() val readjournal = persistencequery(system).readjournalfor[scaladslmongoreadjournal](mongoreadjournal.identifier) val route = path("workflows") { { complete(readjournal.currentpersistenceids()) } } http().bindandhandle(route, "localhost", 8081) but unfortunately, came error: $ curl localhost:8081/workflows curl: (56) recv failure: connection reset peer i not see errors or logs lead information why server closing connection. does done kind of experiment ? i'm testing akka 2.4.16 , akka-http 10.0.5 ok, figured out. readjournal.currentpersistenceids() g

ocr - Google Vision - RPC deadline exceeded. Image processing error -

we using google vision api extract text image. suddenly, since morning, google api returns below error few images , empty text(with http 200 status code) others. status: 4, message: image-annotator::rpc deadline exceeded.: image processing error! can explain why getting error , how can rectify it?

android - How to make a grid of buttons connected with google maps api? -

Image
i'm trying make android application (nearby places) using google places api , google maps api v2. i'm using this code,it looks want make grid of buttons first, , when click on 1 of them show me nearest places. grid : enter image description here how can change code want ? you can make frame layout .. , inside add map fragment , above mao make grid buttons want .. , per click hide grid layout .. result show in map , again load grid layout(buttons) infront of map

typescript - Using Renderer in Angular 4 -

i understand why it's better use renderer instead of directly manipulating dom in angular2 projects. however, have uninstalled, clear cache, reinstalled node, typescript , angular-cli several times , still error when trying inject renderer. import { injectable, renderer2 } '@angular/core'; constructor(private renderer: renderer2) {} __zone_symbol__message: "no provider renderer2!" __zone_symbol__stack:"error↵ @ error.zoneawareerror does have ideas doing wrong? according imports import { injectable, renderer2 } '@angular/core' i suspect you're trying inject renderer2 in service class. won't work. can't inject renderer2 in service. should work components , services provided within component. we can take @ source code https://github.com/angular/angular/blob/4.0.1/packages/core/src/view/provider.ts#l363-l373 while (view) { if (eldef) { switch (tokenkey) { case rendererv1tokenkey: {

mysql - Is it better to have a table with an upwards of 30 similar attributes or should I make a new table? -

i'm relatively new database design. i've taken couple classes on it, i'm still not confident. i'd appreciate design! i'm creating database of cosmetics (like face mosturizer, hand lotion, etc.). boring, know. that's i'm doing. basically, important part of able query ingredients. i.e. find creams contain zinc oxide, find creams have shea butter , not coconut. now, i'm not sure how should design tables. there many ingredients going using (around 100 or 200). thinking would make boolean each ingredient in cream table. true if has it, false if not. pretty excessive, since attributes turn out false. thought maybe try separate ingredients types , have table have multivalued attributes. i.e. possible design: table cosmetic: ingredients_with_spf animal_sourced plant_sourced ... this might seemed bit forced group them this, usage quite useful types of queries want make (overlap not huge issue) another idea have take idea of grouping them , mak

How to create Nexus 5 Android emulator by using command line -

i have android sdk installed , want create nexus 5 emulator using command line. can't use android studio virtual device manager. to create emulator using such command: avdmanager create avd -n nexus5_api24 -k "system-images;android-24;googl e_apis;x86" --tag "google_apis" the problem such command creates default emulator without skin. understand, if want set skin have specify targetid of existing skins using -t flag (according documentation: https://developer.android.com/studio/command-line/avdmanager.html ) when execute avdmanager list command can find targetid 8: id: 8 or "nexus 5" name: nexus 5 oem : google but -t flag somehow doesn't exist in reality command create avd , such error when try use it: error: flag '-t' not valid 'create avd'. where problem?

web applications - Tomcat Thread pool per webapp -

does tomcat supports thread pool configuration each webapp. think webapps share pool configured connector in tomcat. let's have webapps , b, , more critical webapp. let's connector's pool size 100, , there 100 concurrent requests destined , b each (so total 200 requests here). allocate 70 threads process a's requests, , 30 b's. note : dont want use multiple tomcat instances running,or run applications on different ports need same container config except thread configuration per webapp.. is there example config /link same. tomcat not support it. thread pool setting specified @ executor or connector level in server.xml , cannot specified @ application level (in context.xml). see also: https://serverfault.com/questions/351830/tomcat-configure-maxthreads-per-webapp

node.js - Is there any implementation of push notification backed that I can readily use -

i'm working on pwa should implement push notification. i want subscribed users ( end points ) should added list in backed where notifications can pushed subscribers ( end points ) when user unsubscribed end point entry should removed is there readily available nodejs or other implementation no need write end code ? there few node modules can use simplify job if you're going implement yourself: https://www.npmjs.com/package/push-notification https://www.npmjs.com/package/node-pushnotifications https://www.npmjs.com/package/push-notify https://www.npmjs.com/package/node-pn there project: https://www.npmjs.com/package/node-pushserver push server cross-plateform push server based on node-apn , node-gcm. push server supports ios (apn) , android (gcm) platforms. uses mongodb store push tokens. note server not meant used front facing server there's no particular security implemented.

c++ - How to add an image to a button with GTK -

i trying add image button label, image doesn't show , broken image doesn't display either. stop_button = gtk_button_new_with_label("stop"); image = gtk_image_new_from_file ("/home/cendit/escritorio/index.jpeg"); gtk_button_set_image (gtk_button(stop_button),image); i tried different path "file:///home/cendit/escritorio/index.jpeg" not successful. images inside buttons not visible default, transitioned gtk+ 2.x 3.x. sadly, api hasn't been cleaned reflect change, it's bit of trap. if want display button only image inside it, can use: gtkwidget *image = gtk_image_new_from_file ("..."); gtkwidget *button = gtk_button_new (); gtk_button_set_image (gtk_button (button), image); on other hand, if want have button both text , image inside it, can use: gtkwidget *image = gtk_image_new_from_file ("..."); gtkwidget *button = gtk_button_new_with_label ("..."); gtk_button_set_always_show_image (gt

javascript - How to convert this mysql select return into one array -

is there anyway convert example below? convert this: [ rowdatapacket { title: 'code' }, rowdatapacket { title: 'pizza' } ] into this: ['code', 'pizza'] i've provided 2 possible solutions, in case if it's array of objects or array of nested objects. var arr = [{rowdatapacket: { title: 'code' }}, {rowdatapacket: { title: 'pizza' }}], res = arr.map(v => v.rowdatapacket.title); console.log(res); var arr = [{ title: 'code' }, { title: 'pizza' }], res = arr.map(v => v.title); console.log(res);

java - EditText not WordWrapping in a Fragment -

Image
i have edittext field have wrap text. as can see example above text "some place , 200 dayton ave suite 200, redbank, ca 37404 " gets cut off. isn't behind button. edittext field stops map button starts. can scroll right , see text. wrap 2 or 3 lines. here layout file: <linearlayout android:id="@+id/layoutdestination" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <progressbar android:id="@+id/pbeditdestination" style="?android:attr/progressbarstylelarge" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone"/> <edittext android:id="@+id/editdestination" android:layout_width="0dp" android:layo

spring - Grails 3 @Conditional from external configuration files -

in grails 3 app need define spring bean based on condition. what have done created bean , annotate conditional @component @conditional(mycondition.class) class mybean { here mycondition import org.springframework.context.annotation.condition import org.springframework.context.annotation.conditioncontext import org.springframework.core.type.annotatedtypemetadata class mycondition implements condition { @override boolean matches(conditioncontext context, annotatedtypemetadata metadata) { return 'xxx' == context.environment.getproperty("myproperty") } } this works fine until need load value of myproperty external (in prod env config file outside of application) source. i loading external configuration files following class application extends grailsautoconfiguration implements environmentaware { static void main(string[] args) { grailsapp.run(application, args) } @override void seten

wget - webcron authentification website cakephp -

on site cakephp website have action allows me processing , send email going specific url: www.example.com/users/dofacture/true i want create scheduled task automatically goes url once month. problem access need authenticate myself. have tried following script: # log in server. can done once. wget --save-cookies cookies.txt --keep-session-cookies --post-data="[user][username]=xxxx&[user][password]=yy" ww.example.com/identification # grab page or pages care about. wget --load-cookies cookies.txt -p ww.example.com/users/dofacture/true but not work, when receive report of scheduled task have this: the task scheduler has completed scheduled task. task: email heure de début : sun, 26 mar 2017 23:49:23 gmt heure d’arrêt : sun, 26 mar 2017 23:49:25 gmt État actuel : 8 sortie standard/erreur : --2017-03-26 23:49:23-- www.example.com/identification resolving www.example.com... xx.xx.xxx.169 connecting [ http://www.example.com|xx.xx.xxx.169...xx.xxx.169

Error "The script failed due to call depth overflow" during execution of PowerShell script -

i have powershell script test if 2 folders exists , if no folders create new one. problem when try execute script "the script failed due call depth overflow" error. put 2 conditions in 1 if - if folder 1 , folder 2 don't exist create folder 1 , folder 2 - else - write folders exists. , (if it's possible) somehow check - if folder 1 exists create folder 2 , write - folder 1 exists! # start script recording start-transcript # variable path future/existing powershell log folder $ptsl = "$($env:homedrive)\vl\win_mult_machines" # variable path of future/existing vagrant folder $ptvf = "$($env:homedrive)\vm\win_mult_machines" # variable future/existing name of log , vagrant folders $lvn = "win_mult_machines" # test path script log - if path doesn't exist - create if (-not (test-path $ptsl -pathtype container)) { new-item -path "$($env:homedrive)\vl\" -name $lvn -itemtype directory } els

GitLab Runner cache for Gradle is not working -

i'm using gitlab runner ci build android project cache not working. here's .gitlab-ci.yml . modified https://gist.github.com/daicham/5ac8461b8b49385244aa0977638c3420 . image: runmymind/docker-android-sdk:latest variables: gradle_user_home: $ci_project_dir/.gradle stages: - build debug: stage: build script: - set +e - du -sh $ci_project_dir/.gradle/wrapper - du -sh $ci_project_dir/.gradle/caches - set -e - ./gradlew assembledebug - mkdir artifacts - cp mobile/build/outputs/apk/*.apk artifacts/ - cp wear/build/outputs/apk/*.apk artifacts/ cache: paths: - .gradle/wrapper/ - .gradle/caches/ - build/ - mobile/build/ - wear/build/ artifacts: name: "project_${ci_job_name}_${ci_commit_ref_name}_${ci_commit_sha}" expire_in: 2 weeks paths: - artifacts/ and log: running gitlab-ci-multi-runner 9.0.0 (08a9e6f) using docker executor image runmymind/docker-android-sdk:latest .

ruby - view_context equivalent in Rails 2.3 -

looking through railscast 340, datatables/will_paginate, example uses view_context when initiating new instance. def index respond_to |format| format.html format.json { render json: productsdatatable.new(view_context) } end end i've tried same code realize rails 2.3 not have it. according docs, equivalent is view.new[lookup_context, assigns, controller] what lookup_context , assigns refer to? i've tried following. user.new(current_program.users, {}, self) however, expected, if pass above in, throw unexpected error 3 1.

Use async react-select with redux-saga -

i try implement async react-select ( select.async ). problem is, want fetch in redux-saga. if user types something, fetch-action should triggered. saga fetches record , saved them store. works far. unfortunately loadoptions has return promise or callback should called. since newly retrieved options propagated changing property, see no way use select.async saga async fetch call. suggestions? <select.async multi={false} value={this.props.value} onchange={this.onchange} loadoptions={(searchterm) => this.props.options.load(searchterm)} /> i had hack assigned callback class variable , resolve on componentwillreceiveprops. way ugly , did not work better solution. thanks redux-saga handling side effects asynchronously receiving options react-select . that's why should leave async stuff redux-saga . have never used react-select looking @ documentation solve way: your component gets simple. value , options redux store. optionsrequested ac

jQuery UI Spinner + Custom Theme - Buttons Under Input -

i trying apply theme-roller theme page jquery-ui spinners. once theme applied buttons spinner hidden under input. here entire page: <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <link rel="stylesheet" href="jquery-ui-1.12.1.custom/jquery-ui.theme.min.css"> <script src="jquery-ui-1.12.1.custom/jquery-ui.min.js"></script> <script> $(function () { $(".spinner").spinner().width(120); }); </script> </head> <body> <input id="spin" class="spinner" type="text"> </body> </html> (apologies not using jfiddle. have download theme see problem.) didn't change theme in way. there example of spinner working theme here . can download theme page. i have found few cases of people complainin

php - Removing a (conditional) action from a wordpress woothemes plugin -

i want remove message block using functions.php. action wish remove: if( empty( $active_ids ) ){ add_action( 'sensei_loop_course_inside_before', array( $this, 'active_no_course_message_output' ) ); } so figure had refer class before access it's function wish remove, did: function remove_no_active_courses_message(){ //classname function want remove is: //class sensei_shortcode_user_courses implements sensei_shortcode_interface remove_action( 'sensei_loop_course_inside_before', array( 'sensei_shortcode_user_courses', 'active_no_course_message_output' ) ); remove_action( 'sensei_loop_course_inside_before', array( $sensei_shortcode_user_courses, 'active_no_course_message_output' ) ); } add_action('sensei_loop_course_inside_before', 'remove_no_active_courses_message'); but neither of 2 worked, suggestions? edit: source

javascript - app-header doesn't hide Polymer 2.0 -

i've got problem since migrate polymer 2.0, app-header doesn't want hide exemple app-drawer same attribute value. here code: <app-header slot="header" fixed shadow effects="waterfall" hidden$=[[!storeduser.loggedin]]> <app-toolbar> <div class="header--menu header--menu__size"> <paper-button drawer-toggle> <iron-icon icon="menu" drawer-toggle></iron-icon> </paper-button> </div> <div class="header--title" main-title>test</div> <div class="header--setting header--setting__size"> <paper-button on-tap="_logout"> <custom-icon iconset="ci-login" icon="normal"></custom-icon> <span>[ [[localize('logout')]] ]</span> </paper-button> </div>

Cassandra : isolated workloads -

i have 3 workloads. datacenter1 sharing data rest services - streaming ingest datacenter2 load bulk - analysis datacenter3 research i want isolated workloads, going create 1 datacenter foreach workloads. objective of operation prevent heavy process consuming resources , gurantee hight availablity data. is trying ? during loadbulk on datacenter2, data availability on datacenter1 ? short answer workload won't cause disruption of load across datacenter. how works follows: conceptually when create keyspace, cassandra creates virtual data center (vdc). nodes similar workloads must assigned same vdc. segregating workload ensure (exactly) 1 workload ever executed @ vdc. long follow pattern, works. data sync needs monitored under load on busy nodes thats normal concern on cassandra deployment. datastax enterprise support model can seen from: https://docs.datastax.com/en/datastax_enterprise/4.6/datastax_enterprise/deploy/deploywkldsep.html#deploywkldsep__srchw

swift - Disabling UIButton not working -

the solutions i'm finding on here use .enabled old, rather .isenabled . so i'm currenting trying disable functionality/clickability of buttons if condition (or isn't) met. before disable them if condition isn't met if there on after (dynamically) met should theoretically enable. being said, not disabling buttons when start off .isenabled = false . i know condition being met because have print statements , other tests (like labels being removedfromsuperview yet .isenabled = false buttons isn't working. encountered said problems or have solutions? code below: override func viewdidload() { super.viewdidload() trumpmoneydefault.setvalue(50, forkey: "trumpmoney") print("unoviewcontroller") //make buttons shouldn't clickable unlcickable locklvl2.isenabled = false locklvl3.isenabled = false trumplvl2.isenabled = false trumplvl3.isenabled = false lvl2.isenabled = false lvl3.isenabled = false

Does Spring Tool Suite run on Windows 10? -

our agency requires windows software packaged central group. we've been using sts on windows 7 quite while. can't find kind of official statement indicate run on windows 10. sts working folks running windows 10 64 bit (hp hardware, if makes difference). several of have tried finding information on sts official site , have submitted issue sts issue tracker unassigned. helpful if point practical experience or success this. thanks in advance, leila i received helpful comment martin lippert on sts issue tracker site. said "the latest version of sts (3.8.3) upcoming version (3.8.4) based on eclipse neon, has windows 10 supported target environment defined ( https://www.eclipse.org/projects/project-plan.php?planurl=http://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_4_6.xml ). therefore can run sts on windows 10." we tested on test computer , seems working fine.

javascript - Is there any way to draw a "streak" (fading "digital phosphor" effect) on HTML5 canvas? -

i want draw moving dot on html5 canvas follows complicated trajectory. know how do; see, example, lorenz attractor implemented below. small dots hard follow. is there way add blurry trail behind dot? can keep past history of drawn points, don't know how make them fade. in technical terms, suppose polyline/curve opacity/width/color changes smoothly along curve. know how draw polylines (and can figure out bezier curve stuff if need to), don't know how apply smooth gradient along path. (digital oscilloscopes solved "problem" having digital phosphor oscilloscope effect scope emulated old analog "phosphor" effect: areas hit scope's "beam" take while fade.) <!doctype html> <html> <head><script type="text/javascript"> document.addeventlistener("domcontentloaded", function(event) { var x = 1, y = 0, z = 0, t=0; function ontick(timestamp) { var ctx = document.getelementbyid('c

python - Interactive Slider Bar Chart Color Control -

i have 4 sets of random normal distributed numbers. means used plot bar chart each set's 95% confidence intervals plotted errorbar. given value y, 4 different colors set bars corresponding 4 ranges y in: 1. lower bound avg; 2. avg upper bound; 3. below lower; 4. above upper. i want use slider control y value , update bar color each time slide, tried use following code bar charts cannot plotted every update. could give me ideas? import matplotlib.pyplot plt import pandas pd import numpy np import scipy.stats st matplotlib.widgets import slider np.random.seed(12345) df = pd.dataframe([np.random.normal(33500,150000,3650), np.random.normal(41000,90000,3650), np.random.normal(41000,120000,3650), np.random.normal(48000,55000,3650)], index=[1992,1993,1994,1995]) n = len(df.columns)-1 # degree of freedom avg = df.mean(axis=1) # mean each row std = df.sem(axis=1) # unbiased standard deviation y