Posts

Showing posts from April, 2013

dsl - Is it possible to build JetBrans MPS editor into my program? -

they have tool design dsls: https://www.jetbrains.com/mps/ is possible embed editor there program? or purpose use during development (to compile dsl)? in principal, since mps editor java swing application, embedded, however, current wiring makes not trivial process. off beaten path. the preferred way create single-purpose ides around dsls build standalone ide, leverages intellij platform , bundles desired dsls - https://confluence.jetbrains.com/display/mpsd34/building+standalone+ides+for+your+languages

Some regex pattern is breaking the javascript regex engine -

i wrote following regex: /\d(?!.*\d)|^-?|\d+/g i think should work way: \d(?!.*\d) # match last non-digit | # or ^-? # match start of string optional literal '-' character | # or \d+ # match digits but, doesn't: var arrtest = '12,345,678.90'.match(/\d(?!.*\d)|^-?|\d+/g); console.log(arrtest); var test = arrtest.join('').replace(/[^\d-]/, '.'); console.log(test); however, when playing pcre(php) -flavour online @ regex101 . works described. i don't know if think should work 1 way doesn't work. or if there pattern not allowed in javascript regex-flavour. js works differently pcre. point js regex engine not handle zero-length matches well, index manually incremented , next character after zero-length match skipped. ^-? can match empty string, , matches 12,345,678.90 start, skipping 1 . if have @ string#match documentation , see each call match global reg

javascript - How to unsubscribe from event handler in SignalR hub proxy? -

i working javascript signalr client. open hub connection like: hubconnection = $.hubconnection(url); proxy= hubconnection.createhubproxy('somehub'); when want subscribe hub event: proxy.on("someevent", function(somedata){ console.log(somedata); }); how unsubscribe listening hub event? tried proxy.off("someevent"); doesn't work. use off method: var mycallback = function(somedata) { console.log(somedata); } proxy.on("someevent", mycallback); proxy.off("someevent", mycallback);

sharepoint online - Micorosft Graph Group API get file previous versions -

is possible previous versions of file microsoft graph api. upload file group multiple times (version history shown in sharepoint online library going contextmenu - version history). cannot find in graph api documentation. for example file found at: https://graph.microsoft.com/v1.0/groups/{group-id}/drive/items/{file-id} . data present there, alongisde download url sharepoint site, version history found. is possible? or need use sharepoint csom or that?

pandas - Python: how to iterate over dataframes while using their name as a string? -

i have 3 different pandas dataframes df_1 df_2 df_3 i loop on dataframes, computations, , store output using name of dataframe. in other words, this for my_df in [df_1, df_2, df_3]: my_df.reset_index(inplace=true) my_df.to_csv('mypath/' + my_df +'.csv') output files expected: 'mypath/df_1.csv' , 'mypath/df_2.csv' , 'mypath/df_3.csv' i struggling doing because df_1 object, , not string. ideas how that? thanks! another more general solution create dict column names , loop items() : d = {'df_1':df_1,'df_2':df_3, 'df_3':df_3} k, my_df in d.items(): my_df.reset_index(inplace=true) my_df.to_csv('mypath/' + k +'.csv') another possible solution use list dataframes names, enumerate , value of name position: names = ['a','b','c'] print ({names[i]: df i, df in enumerate([df_1, df_2, df_3])})

regex - Regular Expression for Digits and Special Characters - C# -

i use html-agility-pack extract information websites. in process data in form of string , use data in program. sometimes data includes multiple details in single string . name of movie "dog eats dog (2012) (2012)" . name should have been "dog eats dog (2012)" rather first one. above 1 example many. in order correct issue tried use string.distinct() method remove duplicate characters in string in above example return "dog eats (2012)" . solved initial problem removing 2nd (2012) created new 1 changing actual title. i thought problem solved regex have no idea how can use here. far know if use regex tell me there duplicate items in string according defined regex code. but how remove it? there can string "meme 2013 (2013) (2013)". actual title "meme 2013" year (2013) , duplicate year (2013). if bool value indicating string has duplicate year, cant think of method remove duplicate substring . the duplicate year com

collect2: error: ld returned 1 exit status in c++ -

this question has answer here: compiling c++ program gcc 7 answers i have switched elementary os , installed sublime text editor. wrote basic hello world program in c++ check working. , error. /tmp/cc3pmvft.o: in function `main': source.cpp:(.text+0xa): undefined reference `std::cout' source.cpp:(.text+0xf): undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' source.cpp:(.text+0x14): undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' source.cpp:(.text+0x1c): undefined reference `std::ostream::operator<<(std::ost

opengl - glReadPixels always returns a black image -

some times ago wrote code draw opengl scene bitmap in delphi rad studio xe7, worked well. code draw , finalize scene, pixels using glreadpixels function. tried compile same code on lazarus, black image. here code // create main render buffer glgenframebuffers(1, @m_overlayframebuffer); glbindframebuffer(gl_framebuffer, m_overlayframebuffer); // create , link color buffer render glgenrenderbuffers(1, @m_overlayrenderbuffer); glbindrenderbuffer(gl_renderbuffer, m_overlayrenderbuffer); glrenderbufferstorage(gl_renderbuffer, gl_rgba8, width, height); glframebufferrenderbuffer(gl_framebuffer, gl_color_attachment0, gl_renderbuffer, m_overlayrenderbuffer); // create , link depth buffer use glgenrenderbuffers(1, @m_overlaydepthbuffer); glbindrenderbuffer(gl_renderbuffer, m_overlaydepthbuffer); glrenderbufferstorage(gl_renderbuffer, gl_depth_component, width, height); glframebufferrenderbuffer(gl_framebuffer

typescript - Execute a promise until a condition is met (within a while loop) -

i want encapsulate promise within while loop, method executed until condition met. i've tried implement this, end infinite promises generated until stack overflow occurs. i want implement following in typescript: while (responsesuccess === false) { myclass.executescript.then((thiswassuccessful: boolean) => { responsesuccess = thiswassuccessful; }); i know little unconventional, script have created request server application executes. not return success first time, or n times (not can change). try use await operator. while (responsesuccess === false) { responsesuccess = await myclass.executescript; }); ps: should use ts 2.1 or higher target es5

Visio VBA - How do I get the title and subtitle of a state shape (UML) -

Image
i want shape information out of state (uml standard stencil). can see in picture title "aktiv" , "eintritt/" etc. have no clue variable. edit: make clear, don't know how can information out of uml shape in visio. here example code: private sub test() dim s shape dim vsopage visio.page dim getstatename string 'i need name example "aktiv" state 'and name of "sub" information "eintritt" etc. set vsopage = thisdocument.pages(1) each s in vsopage.shapes getstatename = s.???? next s end sub okay found solution, don't know if there nicer 1 though. private sub test() dim s shape dim vsopage visio.page dim getstatetitle string dim getstatesubtitle string set vsopage = thisdocument.pages(1) each s in vsopage.shapes if contains(s) = false 'not stateshape else getstatetitle = getstatetitle & s.shapes.item(1).text & vbcrlf getstatesubtitle = getstatesubtitle & s.

css - How do I achieve the functionality shown in the image below? -

Image
i following below example flex box, not fit requirements link . case 1: left > right case 2: left , right equal , fill space available case 3: left , right lesser space available case 4: left < right in above cases, if left >> right, consumes entire width of box , 'right' not shown @ all. as shown below. question 1: how set minimum width 'left' , 'right' divs not out of view. question 2: when left , right require more allocated space, both have occupy 50% width , truncated ellipsis. html: <div id='parent5' class="parent"> <div class="left">left</div> <div class="right">right</div> </div> <div id='parent5' class="parent"> <div class="left">lefkjasdkjsadkjhdkjsahdklksajdlksajsahdhkjsahdkjsahdkjsat</div> <div class="right">rikjsadkjsahdkjsahdkjsahdkjsahdkjsahdkjsahdkjsahdksaght&

ios - unlimited reverse Geocoding request -

i have implemented application can import gpx file , contains many lat/long coordinates (several hundred). my application performs reverse geocoding each lat/long. want display in tableview lat/long address (which ordered country , town). i'm performing 1 geocoding request @ time (like it's described in apple's documentation of reversegeocodelocation() in core location. when answer of geocoding request request next 1 , until have resolved lat/long. unfortunately when have resolved around 40 lat/long, reversegeocodelocation() raises error (clerror.network) , need wait 60 seconds before resolve next ones etc... i have several questions: - there way go faster? because if have 800 lat/long takes around 20 minutes (800/40) * 60 = 1200 seconds (it's long app running on iphone) - if don't perform improvements on rate, there risk if have many users apple forbid app because number of geocoding request high? thanks feedback regards, sebastien is gpx

Error when starting docker service on Windows 10 -

i had problems in hyper-v on windows 10. seems resolved now, when try start docker service following error: service cannot started. system.typeloadexception: not load type 'docker.backend.itimeintegrationservice' assembly 'docker.backend, version=1.12.5.9503, culture=neutral, publickeytoken=null'. @ docker.service.dockerservice.dorun() @ system.serviceprocess.servicebase.servicequeuedmaincallback(object state) as per other blogs i've found, have uninstalled docker, removed c:\programdata\docker , restarted pc number of times. when reinstall still same error. any ideas on how repair this? finally found on docker forum : 'c:\program files\docker\docker\resources\mobylinux.ps1' -destroy $service = get-wmiobject -class win32_service -filter "name='com.docker.service'" $service.stopservice() $service.delete() start-sleep -s 5 remove-item -recurse -force "~/appdata/local/docker" remove-item -recu

Filtering by condition in Python dataset -

Image
i'm struggling sorting operation of stata file in phyton3: asked keep households without kids out of dataset/table: i used filtering condition filter these rows out of table: filtering_condition = df["kids"] > 0 df_nokids = df.loc[filtering_condition,"kids"] this, however, gives me unknown error: keyerror traceback (most recent call last) /opt/anaconda/anaconda3/lib/python3.5/site-packages/pandas/indexes/base.py in get_loc(self, key, method, tolerance) 1944 try: -> 1945 return self._engine.get_loc(key) 1946 except keyerror: pandas/index.pyx in pandas.index.indexengine.get_loc (pandas/index.c:4154)() pandas/index.pyx in pandas.index.indexengine.get_loc (pandas/index.c:4018)() pandas/hashtable.pyx in pandas.hashtable.pyobjecthashtable.get_item (pandas/hashtable.c:12368)() pandas/hashtable.pyx in pandas.hashtable.pyobjecthashtable.get_item (pandas/hashtable.c:1232

ios - Unable to simultaneously satisfy constraints after updating height -

Image
i have cell 2 image views: constraints small image view: constraints big one: constraints button: the big image view has "scale fill" content mode. i don't know size of image before load sdwebimage, i've created constant height constraint , outlet in code. when image loaded, i'm changing height constraint's constant keep image's aspect: imageiv.sd_setimage(with: feedad.getimageurl(), completed: { (image: uiimage?, error: error?, cachetype: sdimagecachetype!, imageurl: url?) in if image != nil { let ratio = image!.size.height / image!.size.width self.imageheightconstraint.constant = self.imageiv.frame.width * ratio self.updateconstraints() } else { print("image == nil!") } if self.imageviewloadedcallback != nil { self.imageviewloadedcallback!() }

powershell - Add users from another domain to AD group -

i need add users 1 ad group ad group. both groups in same domain, though users domain in forest. domain "lpc": $source_group , $destination_group domain "forestx": users here 1 example wrote of this microsoft article : $source_group = "cn=testsrc,ou=xxx,ou=yyy,dc=lpc,dc=de" $destination_group = "cn=testdest,ou=xxx,ou=yyy,dc=lpc,dc=de" $sourceuseres = get-adgroupmember -identity $source_group foreach ($person in $sourceuseres) { $user = get-aduser $person -server forestx-dc-1 add-adprincipalgroupmembership -server lpc-dc-1 $user -memberof $destination_group } get-aduser $person -server forestx-dc-1 seems contain right object if write comand line, reference seems not work in add-adprincipalgroupmembership statement. i found answer myself using set-adobject command: $source_server = "x1" $source_group = get-adgroup "xxx" -server $source_server $destination_server = "y1" $destinat

Ruby simple Array/Iterator? -

i have story written in .txt file , have count number of letters , words divide both in order find average. unable find total number of letters or total number of words. when run program, ruby shows me list of numbers think number of letters per word. i'm looking total letters i'm not sure how make ruby add everything. here code. iterator count total number of words ".count" ? myfile = file.new("story.txt", "r") contents = myfile.read wordlist = contents.split wordlist.each |length| puts length.size.to_s end also iterator count total number of words ".count" ? no. count() string method, can read in string docs . on other hand, each() iterator. you can length or size of string, described in string docs . so, this: words = %w[ cat ] #shortcut ["a", "to", "cat"] #saves having type quotes. letter_count = 0 word_count = 0 words.each |word| word_count

Openwrt documentation describing web interface -

i'm looking documentation/tutorial openwrt 15.05 describe router web interface. company using openwrt 1 of our iot node, , needs have custom wifi web interface able choose network node connects, connection test our server , few other features. there sample adding new elements luci . , can read luci essentials .

php - Can we use one logic expression to compare multiple strings at once? -

i'm trying find simpler way check 1 var not equal multiple values in 1 comparison string. i found can reduce code empty() not == string values. empty() example validate concept. if (empty($var_1 . $var_2 . $var_3) { echo 'all these vars empty, run code...'; } the above checks if $var_1, $var_2 , $var_3 empty. but there way run similar when using !== ? see code explanation below... test('unknown_value'); echo php_eol; test('value_1'); function test($var = '') { // below method ideal... // if ($var !== 'value_1' . 'value_2' . 'value_3') { // below method 2nd ideal // if ($var !== 'value_1' , 'value_2' , 'value_3') { // have write below... // i'm looking way not have write $var !== each comparison since not equal if ($var !== 'value_1' , $var !== 'value_2' , $var !== 'value_3') { echo 'failed!!!'; }

k means - Segementing a 3-D matrix with MATLAB -

i have 3-d matrix representing hyper-spectral image: 2 dimensions represent different pixels, , 1 dimension represents different spectral bands. i need segment image in following way: 1. divide image, pixel-wise, 2 segments. 2. calculate average spectral value each of 2 segments. 3. set pixels in each of 2 segments equal said average. in end, need image divided 2 segments, pixels in same segment equal segment's spectral average. i've tried using kmeans, no success far. does have idea how it? it if elaborate on kmeans() not working you. suspect trying preserve image dimensions (m x n pixels) in call kmeans . if collapse across rows/cols, kmeans should able classify each pixel spectral-band vector. [m,n,sps] size(data); %pixel row, pixel col, spectral band numgroups = 2; [idx,centers] = kmeans(reshape(data,[m*n,sps]),numgroups);

android - Getting the Bluetooth UUID with Cordova -

i'm looking universal cordova plugin can me uuid of bluetooth adapter on both ios , android. i'm using cordova ble central ble operations (advertising , receiving advertisements) , need uuid of current device store on server. is there plugin needs?

How to monitor all container status in kubernetes? -

at present, there lots of containers running in kubernetes cluster, there solution monitor each container , sent alert when container in bad status ? this broad subject , lot depends on want monitor, size of deployment , technical expertise available. the comprehensive solution prometheus . comes extensive documentation, getting start guide, etc. setup pretty involved though. depending on how have setup cluster grafana might available. if not, need deploy these addons: heapster, influxdb , grafana . there number of tutorials again depends on environment.

javascript - getting name attribute dynamically using jquery -

i have div block trying find name of input element clicked , update value using jquery: $(document).ready(function(){ $(this).click(function(){ console.log($(this).attr('name')); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div> <input type="text" name="name1" id="id1">testdata1</input> <input type="text" name="name2" id="id2">testdata2</input> </div> when try find input element clicked undefined . i assuming may because checking click event on , again trying attr name of it, since can increase @ least 5 input elements , these being fetched dynamically, cannot bind id/class click event. the this has no context inside ready function : $(this).click(function(){ _^^^^^___________________ console.log($(this).attr('name')); }); you should use input

foreach - Scala Parallel Print Hanging the console -

i new scala world , trying exercises book. so, have example print vector in sequential , parallel fashion. former works , later hangs console. code val v = vector.range(0, 10) v.foreach(println) code output 0123456789 but if use same code, instead of using foearch, use par, freezes console val v = vector.range(0,10) v.par.foreach(println) the book using says output should like: 5678901234 but hangs , program never finishes. can explain me why?

c# - Create a folder after build using project.json in NET Core -

i know can use "copytooutput" in project.json copy files project's output directory, possible copy on entire folder? you can add directories way add files. note empty directories ignored using approach. "buildoptions": { "copytooutput": { "include": [ "somefile.json", "mydirectory" ], } }

php - How to put values without repeating inside a table -

i have problem, need put different values inside table , not know how make structure. these values in database: |--------------|------------|-----------|----------| | id_r_a_p_f | id_param | id_frec | value1 | |--------------|------------|-----------|----------| | 1 | param1 | frec1 | | |--------------|------------|-----------|----------| | 2 | param2 | frec1 | b | |--------------|------------|-----------|----------| | 3 | param3 | frec1 | c | |--------------|------------|-----------|----------| | 4 | param4 | frec1 | d | |--------------|------------|-----------|----------| | 5 | param1 | frec2 | e | |--------------|------------|-----------|----------| | 6 | param2 | frec2 | f | |--------------|------------|-----------|----------| | 7 | param3 | frec2 | g | |--------------|------------|------

android - The application crashes when the media recorder starts? -

i using media recorder record calls in android. times mediarecorder recording audio , times doesn't record audio. when play recorded audio error shown "the player doesn't supports type of audio file ". the below code recording audio try { f1 = file.createtempfile("sound", ".mp3", dir); } catch (ioexception e) { e.printstacktrace(); } filename = f1.getname(); mediarecorder = new mediarecorder(); mediarecorder.setaudiosource(mediarecorder.audiosource.mic); mediarecorder.setoutputformat(mediarecorder.outputformat.mpeg_4); mediarecorder.setaudioencoder(mediarecorder.audioencoder.aac); mediarecorder.setoutputfile(f1.getabsolutepath()); try { mediarecorder.prepare(); } catch (illegalstateexception e) { // todo

java - Identify the hash mehtods (md5, sha1) given only hashed string -

i asked setup application on this repository , works mysql , jsp , , run selenium test against functionalities. file bank.sql schema of database. but, believe application broken because, not provided credential log system. query such as: insert `users` (`username`, `password`, `enabled`) values ('jake', 'e2a79383c1347633461eb9fb56cf4972a0155919', 1), ('maria', '3e182b1ea9376483a38614d916a0b666ef531b6d', 1), ('mike', 'd6ac022931a66a2bcc244db91818ebec76ce5e18', 1), ('sara', '5d569dfc13001c8b30aa11eeb2a59d22071f3d80', 1), ('tom', '26d58cf3df0903a2298788b72fced5bca9ea7144', 1); shows username, , hash passwords of users. but, not me obtain passwords, because seems passwords kept in hash format. i going reset these passwords new passwords, hashing function not clear. instance, hashed passwords obtained either md5 , or sha1 . therefore, replacement not work. my opinion code not enough selenium te

java - Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.5:wsdl2java -

i'm trying tutorial http://camel.apache.org/tutorial-example-reportincident-part1.html . created project via maven described in tutorial , ran exception: failed execute goal org.apache.cxf:cxf-codegen-plugin:2.7.5:wsdl2java (generate-sources) on project camel-example-reportincident: org/apache/commons/collections/extendedproperties: org.apache.commons.collections.extendedproperties my pom looks that: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.apache.camel</groupid> <artifactid>camel-example-reportincident</artifactid> <packaging>war</packaging> <version>0.0.1-snapshot</version> <name>camel-example-reportincident maven webapp</name>

javascript - Canvas toBlob is not recognized as a function in safari -

hi below code able download image in chrome& firefox not working in safari browser it's throwing below error typeerror: 'undefined' not function (evaluating 'canvas.toblob(blobcallback('wallpaperdeae'))') $("#save").click(function(){ function blobcallback(iconname) { return function (b) { var = document.getelementbyid('download'); a.download = iconname + ".jpg"; a.href = window.url.createobjecturl(b); } } canvas.toblob(blobcallback('wallpaperdeae')); }); thanks i don't think toblob method supported in safari: https://developer.mozilla.org/en-us/docs/web/api/htmlcanvaselement/toblob#browser_compatibility according it's available in chrome 50+ , firefox (19+ basic support , 25+ image quality parameter) basic support in ie 10 , above. so there's no support whatsoever safari.

javascript - Cookies are not sent with request in nginx -

i have problem cookies, nginx , backend server. what achieve this: nginx @ port 70 location / { if session cookie not set return 301 localhost/login.html else proxy_pass http://somewhere } location /login.html{ proxy_pass http://localhost:8080 <- backend server logging @ localhost:8080/login.html } location /redirection/ { return 301 localhost:70 } so should go login.html , proxy pass logging server localhost:8080/login.html , can log in. process credentials , redirect /redirection/ in form action (processing done in javascript - it's setting cookies only). after being in redirection server should send request itself, has session cookie it's going http://somewhere . but mine problem in login.html cookies should set, aren't. if i'm going localhost:8080/login.html alone , try - cookies work well. somehow proxy_pass cookies lost. p.s if use 2 server block , /login.html , /redirection on second server works well, can't have 2 server blocks in configu

librsvg - why rsvg prevent from rendering images out of the path of the SVG source file -

i stuck getting rsvg render images in svg file , research lead me post . best answer gives solution : file:// paths must in or below path of svg source file. i'm using version 2.40.13 , still have limitation. do know why limitation exists , if/how workaround ?

ios - UITableView didSelectRowAt indexPath not called in custom cell -

Image
i create new viewcontroller , drag new uitableview works, in previous 2 viewcontrollers cannot work. all following done: uitableviewdelegate .delegate=self uitableviewdatasource .datasource=self swift3 , didselectrowat not diddeselectrowat .setediting(true, animated: true) .allowsselection = true .allowsselectionduringediting = true singelselection and data can load tableview, thing cannot select rows, in mainviewcontroller have 1 table view, 1 used testing. -this 1 of viewcontroller tableview cannot select row can load data, here have 1 tableview, test create new table view -this second viewcontroller cannot select row this mainviewcontroller extension mainviewcontroller: uitableviewdelegate, uitableviewdatasource { func tableview(_ tableview: uitableview, numberofrowsinsection section: int) -> int { return 10 } func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { if tablevi

apache ignite building in linux for c++ -

while installation of apache ignite (i following devnotes.txt)in doc mentioned steps build,when doing 2nd step ./configure it's giving error bash: ./configure: no such file or directory first of all, check you're in correct folder ( modules/platforms/cpp ). if case, first step failed , configure not created. check if there errors in log.

Python Module Import, differences on Windows and Linux -

i have wrapper function puts results of generic parsefunction queue def parse_threaded(parsefunction, response_q, parsed_q, stop_event): while not (stop_event.is_set() , response_q.empty()): if response_q.qsize() > 0: response = response_q.get() parsed = parsefunction(response) response_q.task_done() if parsed: parsed_q.put(parsed) the parse functions, passed argument imported different module with import parser these parse functions may later passed following code beer_parse_worker = threading.thread(target=parse_threaded, args=(parse_beer, beer_response_q, beer_q,stop_beer_parse_worker)) beer_parse_worker.start() as can see pass parse function (parse_beer) argument, works on windows python 3.5, on linux same python version need following code: beer_parse_worker = threading.thread(target.parse_threaded, args=(parser.parse_beer, beer_response_q, beer_q,stop_beer_parse_worker)) beer_parse_worker.start() so in linux n

xml - XAML xmldataprovider shows on runtime but not on designer -

i have following code(this code copied online example , sample not working) in order preview usercontrol during design time: <stackpanel orientation="horizontal" width="200"> <stackpanel.resources> <xmldataprovider x:key="myxmlprovider" xpath="mydata"> <x:xdata> <mydata xmlns=""> <mydataitem mystring="test data 1" myint="32" mycolor="#ffaabbcc"/> <mydataitem mystring="test data 2" myint="42" mycolor="red"/> </mydata> </x:xdata> </xmldataprovider> <datatemplate x:key="mytemplate"> <stackpanel background="{binding xpath=@mycolor}">

Could not extract text from python selenium -

i have written following code extract price detail url. from selenium import webdriver selenium.webdriver.common.desired_capabilities import desiredcapabilities dcap = dict(desiredcapabilities.phantomjs) dcap["phantomjs.page.settings.useragent"] = ('mozilla/5.0 (windows nt 6.3; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/53.0.2785.89 safari/537.36') driver = webdriver.phantomjs(desired_capabilities=dcap) driver.get("https://www.walmart.com/ip/fitness-reality-tr3000-maximum-weight-capacity-manual-treadmill-with-pacer-control-and-heart-rate-system/37455841#") driver.find_element_by_css_selector("div[itemprop='price']:nth-of-type(1)").text it giving empty value although have price details inside particular tag. when tried extracting innerhtml of tag instead of text using following. driver.find_element_by_css_selector("div[itemprop='price']:nth-of-type(1)").get_attribute("innerhtml") i these

java - How to create a Tabbed Activity with ListViews - Android -

Image
first of all, i'm beginner in android programming. i'm trying program 3 tabs each listview inside (you know e.g. whatsapp). android studio makes easy automatically create tabbed activity. question is: how can implement listview each tab? there nice tutorial on http://www.androidhive.info/2012/05/android-combining-tab-layout-and-list-view/ uses tabactivity. method deprecated , fragments should used instead. have extended main_fragment.xml (which created android studio) listview. correct way set corresponding list adapters , set them? setting them listview list_all = (listview) findviewbyid(r.id.listviewall) in oncreate() not work because of null object reference error. didn't find out how use rootview returned oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) how can solve problem? main_fragment.xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.and

apache spark - NegativeArraySizeException while training prediction io universal recommender -

i trying deploy prediction io system. getting negativearraysizeexception while training phase. help appreciated. the events have pushed has entitytype user , targetentitytype item verified http://localhost:7070/events.json?accesskey=<myacccesskey> [{ "eventid": "aax2w8b2ufaxuydlzyigbgaaavgabv1uhz7erglatba", "event": "purchase", "entitytype": "user", "entityid": "b571c84da7104d339a436b40d07ba59c", "targetentitytype": "item", "targetentityid": "00572208a2e742f397f7e082aa40ae2e", "properties": {}, "eventtime": "2016-10-26t08:05:01.422z", "creationtime": "2016-10-26t08:05:01.423z" }] [info] [engine] extracting datasource params... [info] [workflowutils$] no 'name' found. default empty string used. [info] [engine] datasource params: (,datasourceparams(juggernautrecommendor,list(purchase, view))) [i

typescript - Add Models/Entities/Objects to NgModule in Angular 2 -

i've been trying create @ngmodule (named modelsmodule ) made of objects user, book, library, movie, , on. doing i'm trying not import every object every time need importing them @ beginning in appmodule (main @ngmodule) , use them many times want. objects/entities/classes... example export class author { constructor ( public name: string, public avatar: string ) { } } modelsmodule import { ngmodule } '@angular/core'; import { commonmodule } '@angular/common'; import { formsmodule } '@angular/forms'; import { author } './author/author.model'; (...) @ngmodule({ imports: [ commonmodule, formsmodule, author, book, movie, store ], }) export class modelsmodule {} appmodule import { browsermodule } '@angular/platform-browser'; import { ngmodule } '@angular/core'; import { formsmodule } '@angular/forms'; import { httpmodule } '@angular/http'; import { materialmodul