Posts

Showing posts from January, 2013

typescript - Customize Angular routing for multiple angular instances in the same page -

i want use angular render liferay portlets inside same page. each portlet coded separately, managed multiple angular instances running in parallel. now, have portletid1 , portletid2 inside same page, each portlet separate angular application , has separate routes. want each portlet listen hash change events separately can imagine url example: https://myportal/page#portletid1:/login;portlet2:/route2 possible let angular app on portlet 1 listen portletid1:route_of_portlet_1 , keep portlet 2 listening portletid2:route_of_portlet_2 ? i'm using angular 2. i don't have experience angular, angular sample project added liferay's blade samples, might either want or might simple - please validate on own. it's copy full sample here, note magic-values used in views: bnd.bnd declares web-contextpath: /angularjs-simple-portlet , used in view.jsp . the portlet itself, without code, declares javax.portlet.name=angularjssimpleportlet (i've taken liberty res...

parsing - none of the parsers are finding all beautiful soup python -

i trying simple parsing of html file contains unit test results in body url = urllib2.urlopen('file:/randomstuff/results.txt').read() soup = beautifulsoup(url, 'lxml') save = soup.body.findall(text = re.compile("failed")) the best can out of 1 instance of text (when there closer 50) lxml , html5lib. other parsers find none. there anyway can work around broken html? an example of body this ********* finished testing of logleveltypetest ********* ********* start testing of apploggerconfigtest ********* config: using qtest library 4.8.1, qt 4.8.1 pass : inittestcase pass : testsetfromenvironment pass : cleanuptestcase totals: 3 passed, 0 failed, 0 skipped html looks this <html> <head></head> <body> <pre style="word-wrap: break-word; white-space: pre-wrap;"> "common unit test results" ... ... </pre> </body>

r - Extract string and its location using dplyr/tidyr approach -

the input data frame has 3 id columns , 1 raw_text. u_id corresponds user, doc_id corresponds document of particular user , sentence id corresponds sentence within document of user. df <- data.frame(u_id=c(1,1,1,1,1,2,2,2), doc_id=c(1,1,1,2,2,1,1,2), sent_id=c(1,2,3,1,2,1,2,1), text=c("admission date: 2001-4-19 discharge date: 2002-5-23 service:", "pertinent results: 2105-4-16 05:02pm gap-14 2105-4-16 04:23pm rdw-13.1 2105-4-16 .", "method exists , former because calls corresponding", "admission date: 2001-4-19 discharge date: 2002-5-23 service:", "pertinent results: 2105-4-16 05:02pm gap-14 2105-4-16 04:23pm rdw-13.1 2105-4-16 .", "method exists , former because calls corresponding...

dataframe - How to add column to exploded struct in Spark? -

say have following data: {"id":1, "payload":[{"foo":1, "lol":2},{"foo":2, "lol":2}]} i explode payload , add column it, this: df = df.select('id', f.explode('payload').alias('data')) df = df.withcolumn('data.bar', f.col('data.foo') * 2) however results in dataframe 3 columns: id data data.bar i expected data.bar part of data struct... how can add column exploded struct, instead of adding top-level column? df = df.withcolumn('data', f.struct( df['data']['foo'].alias('foo'), (df['data']['foo'] * 2).alias('bar') )) this result in: root |-- id: long (nullable = true) |-- data: struct (nullable = false) | |-- col1: long (nullable = true) | |-- bar: long (nullable = true) update : def func(x): tmp = x.asdict() tmp['foo'] = tmp.get('foo', 0) * 100 res = z...

javascript - I want to use the value on the radio button and press the screen as a score -

i want use value on radio button , press screen score. correct answer "dogru" , score 50 points. when press check button, score show alert on screen. <div class="col-md-4"> <p>which faster?</p><br><br> <ul> <li><input class="sorular" type="radio" name="faster" value="dogru"> airplane</li> <li><input class="sorular" type="radio" name="faster" value="yanlis"> car</li> <li><input class="sorular" type="radio" name="faster" value="yanlis"> cheetah</li> <li><input class="sorular" type="radio" name="faster" value="yanlis"> bicycle</li> </ul> </div> <div class=...

Excel VBA Search + Sum Engine -

i trying code search + sum engine on excel vba. have list of entries, , need code search specific type of cost (for example "1 equipment") , needs sum equipment costs , print in cell in worksheet. heres typed far: sub sample() dim fnd string dim myar dim long dim rng range, foundcell range, lastcell range, myrange range set myrange = activesheet.usedrange set lastcell = myrange.cells(myrange.cells.count) fnd = "1 equipment" myar = split(fnd, "/") = lbound(myar) ubound(myar) set foundcell = myrange.find(what:=myar(i), after:=lastcell) if not foundcell nothing firstfound = foundcell.address end if set rng = foundcell until foundcell nothing set foundcell = myrange.findnext(after:=foundcell) set rng = union(rng, foundcell) if foundcell.address = firstfound exit loop if not rng nothing rng.**(____in here needs sum value of cell in column right of word found___)** end if ...

flow typed - How can I express the type of a map, where one of the keys has a different type? -

basically want this: type thing = { description: string } & { [key:string|number]: thing } but above results in key description being described 2 incompatible types. tried intersection $diff remove description second part, didn't help. how can describe map type single key special cased?

Python - Nested For Loop New Tab in Selenium -

i'm having trouble in running nested loop iterate 2 lists click through while opening new tabs , closing old one. this code: # loop w in agroecological_suitability_and_productivity_list: # opens new tab driver.execute_script("window.open()") # switch newly opened tab driver.switch_to.window(driver.window_handles[1]) # navigate new url in new tab driver.get("http://www.gaez.iiasa.ac.at/w/ctrl?_flow=vwr&_view=type&idas=0&idfs=0&fieldmain=main_py_six&idps=0") # click on agro-ecological suitability , productivity list driver.find_element_by_css_selector('input[value="{}"]'.format(w)).click() # click on crop link driver.find_element_by_css_selector("input.linksubmit[value=\"▸ crop\"]").click() aes_and_p = w x in crop_list: driver.find_element_by_css_selector('input[value="{}"]'.format(x)).click() driver.switch_to.window(d...

What does this refer to in a JavaScript function? -

function box(width, height) { this.width = width; this.height = height; } var mybox = new box(5,5); what new keyword doing here technically? creating new function? or creating new object , applying function it? if way create "box", mean this keyword referring object mybox? it's creating new object, using box constructor. value of this in case (when function called new keyword) new instance being constructed. new object inherit whatever defined box.prototype (the default being object.prototype ). i said in case , because in javascript value of this determined how function called. recommend reading mdn page on this more information. note: if question supposed closed, should have been duplicate. here possible duplicate links might you: how "this" keyword work? javascript 'this' value changing, can't figure out why this value in javascript anonymous function javascript object how "this" keyword wor...

Kotlin comment formatting in IntelliJ/Android Studio -

is there way format long kotlin comments in intellij idea/android studio same way java comments when set: code style > java > javadoc > wrap @ right margin when turn setting on, after formatting turns this: /** * very long comment should multi-line.... */ into this: /** * very long comment * should multi-line... */ i don't see same option kotlin maybe there way achieve this? there open issue reported, please follow updates.

c# - Managing complex unit test mock data -

i make unit tests code relies on rather complex database structure (nested, circular references etc.). this: var personrepository = new mock<ipersonrepository>(); personrepository.setup(r => r.getperson()).returns( new person() { firstname = "joe", lastname = "smith" }); the problem "complex" data feel tests gets cluttered mock data. options? thought saving data .json files, guess work. ideally, use in memory representation of database snapshot. possible using ef6? other suggestions? you might want @ effort , designed allow unit test code uses entity framework. it @ database , construct in-memory version acts real thing, can recreated each test. write code populate pseudo database data, allowing test it.

Python Selenium - Cannot clear default value and paste new value in drop down box -

i need clear default value website's drop-down box, , paste new value it. <div> <select id="gene.profile" class="form-control shinyjs-resettable selectized shiny-bound-input" data-shinyjs-resettable-id="gene.profile" data-shinyjs-resettable-type="select" data-shinyjs-resettable-value="a1cf" tabindex="-1" style="display: none;"><option value="a1cf" selected="selected">a1cf</option></select> <option value="a1cf" selected="selected">a1cf</option> </select> <div class="selectize-control form-control shinyjs-resettable single"> <div class="selectize-input items full has-options has-items focus input-active dropdown-active"> <div data-value="a1cf" class="item">a1cf</div> <input type="text" autocomplete="off" tabindex=...

c# - How to effectively crop and scale image data -

i need operate on pixel values in images. therefore wrote such class: public class image_class { #region property public int width { get; private set; } public int height { get; private set; } byte[] buffer; #endregion #region constructors public image_class() { ; } public image_class(int width, int height, byte[] data) { if (data.count() == (width * height * 3)) { this.width = width; this.height = height; this.buffer = data; } else throw new exception(); } #endregion #region bitmap public imagesource bmp { { try { var pixelformat = pixelformats.rgb24; var bytesperpixel = (pixelformat.bitsperpixel + 7) / 8; var stride = bytesperpixel * width; var bitmap = bitmapsource.create(width, height, 96d, 96d, pixelformat, null, buffe...

hadoop - How much My assumptions /Understanding about "Big data Stack" is farthest from the truth? Specially the Cloud part -

not talking oltp . no sql,cassandra ,hbase. post . pros • generalized distributed/ , parallel cluster framework. • cost : escape licensing , vendor specific storage why not or original point point • streaming : nothing new point 1 , 2 in pros section apply. • unstructured data : needs data model . there . point 1 , 2 in pros section apply. • mpp : long way go. parquet , adaptive ser-de , off heap processing still long way match traditional rdbms mpp or exadata . lack in multiple read , multiple write of same data because of inherent storage design . need compaction after update. • low latency need large in memory processing still lack of collocation , relatively less sophisticated algorithms. impala not support orc. hive orc supports acid,update though bad performance . means hive /imapla not option hive/spark can . again imapala outperform spark in low latency,structured queries • random access: 128 mb or more chunk ,no physical ...

bash - How to understand this redirection command? -

this question has answer here: in shell, “ 2>&1 ” mean? 15 answers find /home -name .bashrc > list 2>&1 i learn book above command redirect output of find file called list including both stdout , stderr. (particularly, things in stdout outputted in front of stderr.) and know 2 stderr, 1 stdout. but i'm having problem "parsing" , understanding > list 2>&1 part? , 2>&1 ? > list redirects command's standard out file list . 2>&1 redirects standard error standard out. in case, standard out file list , list contain output , errors find command generates. further read: https://www.gnu.org/software/bash/manual/html_node/redirections.html

laravel 5 - MAMP incorrect PHP version -

Image
i have mamp installed , when start server choose php 5.6.1, when run php -v in terminal in mamp/htdocs/project folder shows 5.5.36 , if run composer install throws error doctrine/annotations v1.3.0 requires php ^5.6 || ^7.0 -> php version (5.5.36) not satisfy requirement. moreover, if run in mamp/htdocs shows 5.6.31. what doing wrong , should update php? mamp uses different version of php system. mamp version of php installed to: /applications/mamp/bin/php/php5.6.1/bin/php so, if do: /applications/mamp/bin/php/php5.6.1/bin/php -v you correct version displayed. if edit ~/.bash_profile file on machine add following lines (and reopen terminal): alias php='/applications/mamp/bin/php/php5.6.1/bin/php' export mamp_php=/applications/mamp/bin/php/php7.1.1/bin export path=$mamp_php:$path (if have path setup in ~/.bash_profile , append :$mamp_php end) you can do: php -v get correct version. , can run composer install or composer upda...

c# - Error After Updating Azure Web Jobs SDK update -

hi have updated nuget packages azure web jobs sdk version 2.0 , getting following error. microsoft.azure.webjobs.host.functioninvocationexception: exception while executing function: functions.sparkpostcold_queue ---> system.invalidoperationexception: exception binding parameter 'emails' ---> system.invalidoperationexception: invalid invoke string format attribute. @ microsoft.azure.webjobs.host.bindings.attributecloner`1.new(string invokestring) @ microsoft.azure.webjobs.host.bindings.defaultattributeinvokerdescriptor`1.frominvokestring(attributecloner`1 cloner, string invokestring) @ microsoft.azure.webjobs.host.bindings.attributecloner`1.<resolvefrominvokestringasync>d__10.movenext() my function looks below. public static void queueitem( [table("emails")] iqueryable<emailentity> emails, [queue("queue")] icollector<string> outputqueuemessage, textwriter logger) { var query = p in emails select p...

match - Conditional merge/replacement in R -

i have 2 data frames: df1 x1 x2 1 2 b 3 c 4 d and df2 x1 x2 2 zz 3 qq i want replace of values in df1$x2 values in df2$x2 based on conditional match between df1$x1 , df2$x2 produce: df1 x1 x2 1 2 zz 3 qq 4 d use match() , assuming values in df1 unique. df1 <- data.frame(x1=1:4,x2=letters[1:4],stringsasfactors=false) df2 <- data.frame(x1=2:3,x2=c("zz","qq"),stringsasfactors=false) df1$x2[match(df2$x1,df1$x1)] <- df2$x2 > df1 x1 x2 1 1 2 2 zz 3 3 qq 4 4 d if values aren't unique, use : for(id in 1:nrow(df2)){ df1$x2[df1$x1 %in% df2$x1[id]] <- df2$x2[id] }

c# - How can I make method dynamically load key/value pairs? -

how can take code , make more dynamic? right have post json as { values: [{key: 'mykey', value: 'myvalue'}] } ideally post json like: { values: [{make: 'car', color: 'red'}] } or { values: [{firstname: 'george', lastname: 'constanza'}] } so tied using key/value in json. how can dynamically load values without having use key/value? public class myperformercontroller : apicontroller { [httpput("update/{mypath}")] public task<iactionresult> dosomething(string mypath, [frombody]mycollection values) { foreach (var val in value) { var keyvalue = val.key; var somevalue = val.value; } } } public class mycollection : ienumerable<keyvaluepair<string,string>> { public ienumerable<keyvaluepair<string, string>> values { get; set; } public ienumerator<keyvaluepair<string, string>> getenumerator() { ...

swing - Creating GUI components dynamically in java -

so, can create example button dynamically: panel.add(new jbutton("button")); validate(); but question is, how make calls elements later? example, how add event listener button created above, like, 100 lines of code later? create variable jbutton: jbutton jbutton = new jbutton("button"); panel.add(jbutton); validate(); /* * * 100 lines of code * */ // add event listener jbutton.addactionlistener((actionevent) -> { // });

Modify Subject, Body after message_from_string in Python -

i trying modify email2sms script smstools 3. a sample incoming sms file: $ cat /var/spool/sms/incoming/gsm1.ateo8g from: 950 from_toa: d0 alphanumeric, unknown from_smsc: 421950900050 sent: 17-09-13 17:41:17 received: 17-09-13 17:48:21 subject: gsm1 modem: gsm1 imsi: 231030011459971 report: no alphabet: iso length: 5 test1 the script using following code format message: if (statuscode == 'received'): smsfile = open(smsfilename) msg = email.message_from_string(smsfile.read()) msg['original-from'] = msg['from'] msg['to'] = forwardto the problem: want modify subject field in code above. tried msg['subject '] = 'example' (after msg['to']), subject field not overwrited, doubled. knows how modify after email.message_from_string() function? you want replace subject header message. msg.replace_header('subject', 'example subject') assigning index adds new header. use when heade...

regex - Why is a regular expression containing the exact string not matching successfully? -

this might beginners mistake. regex turns out not matching while should. #!/usr/bin/perl # print "hello, world" print "hello, world\n"; $addr = "hello"; #if($addr =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\)/ ) if (my $addr =~ /hello/) { print("matched\n\n"); }else { print("didnt match\n\n"); } the my makes variable match local , uninitialised. should change if ($addr =~ /hello/) the my indicates $addr in if "my own here", i.e. different other $addr 1 larger, outer scope. outer scope variable got initialised match regex. second, inner 1 not initialised , (at least in case) has no matching value. note: comments other authors have proposed best practice avoiding/detecting cause of problem in future programming.

swift - updateChildValues using dictionary or url -

i looking update firebase database atomically, have been using updatechildvalues. however, have experienced behaviour explained. when add data database using following code, works fine , new objects added json tree under newly generated key beneath either itemownership or itemcategory nodes: let key = rootref.child("posteditems").childbyautoid().key let updatelocations = ["itemownership/\(key)" : uid, "itemcategory/\(key)" : category ] rootref.updatechildvalues(updatelocations) print("item has been saved!") however, if use constants hold dictionaries, like-so: let key = rootref.child("posteditems").childbyautoid().key let itemownership = [key : uid] let itemlocation = [key : location] let updatelocations = ["itemownership" : itemownership, "itemcategory" : itemlocation ] rootref.updatechildvalues(updatelocations...

ios - printing only a array with all data with firebase -

printed result ["data1"] ["data1", "data2"] ["data1", "data2", "data3"] ... wanted result last printed array data or getting last array me out ["data1", "data2", "data3"] here code use data firebase var dataarray = [string]() func fetchfirebasedata(){ var datref: databasereference! datref = database.database().reference() datref.child("data").observe(.childadded, with: { (snapshot) in if let dictionary = snapshot.value as? [string: anyobject]{ let data = speisekarteinfos(dictionary: dictionary) data.setvaluesforkeys(dictionary) self.dataarray.append(data.name!) print(self.dataarray) } }, withcancel: nil) } you observing .childadded events, called repeatedly, once each entry in database. haven't used firebase, base...

Message: Undefined offset: in codeigniter -

Image
this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers undefined offset 1 6 answers i want multiple insert using codeigniter, error. a php error encountered severity: notice message: undefined offset: 3 filename: controllers/menu.php line number: 284 this code:

typescript - How to correctly use angular directives when using [innerHTML]? -

i have sidebar code app text changes based on page being loaded. using switch statement set text [innerhtml] reads from. however, not work when there directives such routerlink . how should properly? way use bunch of *ngif 's in html? html: <div [innerhtml]="text"></div> ts: check = true; text = '<p>hello world</p>' + '<div *ngif="check">testing</div>' + '<a routerlink="/link">this link</a>'; set text : check = true; text = '<p>hello world</p>' + '<div *ngif="'+check+'">testing</div>' + '<a routerlink="/link">this link</a>'; it equivalent to: <p>hello world</p> <div *ngif="true">testing</div><a routerlink="/link">this link</a> which *ngif="check" when check = true

sql - Query to delete duplicate records from a table created without primary key -

i want delete duplicate records without using row_number() function (sql server). i see 2 options: using row_number() , think best option unless your using sql server 2000 (which doesn't support it): delete yourtablerow (select *, row_number() on (partition yourid order yourid ) row yourtable) yourtablerow row!=1 the other option using select distinct put distinct rows table, delete rows in original table , insert again, this: select distinct * temptable yourtable truncate table yourtable -- faster delete yourtable insert yourtable select * temptable drop table temptable if take approach recommend using regular table temptable instead of real #temporaltable because if connection dropped in middle of operation temporal table lose data.

linux - influxdb: Line Protocol Syntax -

i not understand influxdb line protocol syntax! have been reading influxdb documentation , searching web 2 days , haven't loaded single point. below sample of practice data. want write influxdb. my os linux ubuntu. # datefrom | sigma | wl | location | dateto # 2015-08-18 00.00.00.0 | 0.04 | 8.12 | coyote creek | 1970-01-01 00.00.00.0 | 2015-08-18 00.06.00.0 | 0.04 | 8.01 | coyote creek | 1970-01-01 00.00.00.0 | 2015-08-18 00.12.00.0 | 0.04 | 7.89 | coyote creek | 1970-01-01 00.00.00.0 | 2015-08-18 00.18.00.0 | 0.04 | 7.76 | coyote creek | 1970-01-01 00.00.00.0 | 2015-08-18 00.24.00.0 | 0.05 | 7.64 | coyote creek | 1970-01-01 00.00.00.0 |

css - Bootstrap hamburgermenu (collapse in) visibility issue on IOS (Safari) -

i have responsive webapp uses bootstrap. when mobile-size hamburger menu shows in header. when clicked on pc/mac/android phone displays correctly.. when clicked ios-safari, shows quarter of second, , hides again. suspect height or z-index issue i'm not sure, , have not been able solve it. you can try on www.gjovikhk.no . anyways.. here html code header , menu : <div id="menu" class="navbar navbar-default"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>...

git - Set "active scheme" for Xcode -

i wanted find way set "active scheme" xcode project. created fresh single-page project, setup repo, created 2 schemes, , began switching , forth. git status shows no changes working tree! order of schemes saved in xcuserdata file, selected 1 not store anywhere far can tell! having projects not nice have prevented mistakes made in past, great feature have. there way hack this? i.e., saving favored scheme in text file , script sets active scheme programmatically based on it?

c++ - I want to check parameters before puting them into constructor -

in class b want check if n , m bigger 0 , put them constructor of a. how can it? class a{ private: int x; int y; public: a(int x, int y){ this->x=x; this->y=y; } void print(){ cout<<x<<" "<<y<<endl; } }; class b:public a{ public: b(int n,int m):a(){ /// } }; there must more elegant approach this, best i've got right now. can use ternary operator check variables being passed call a 's constructor. #include <iostream> class { private: int x; int y; public: a(int x = 0, int y = 0) { this->x = x; this->y = y; } void print() { std::cout << x << " " << y << "\n"; } }; class b : public { public: b(int n,int m) : a( n > 0 && m > 0 ? n : 0, n > 0 && m > 0 ? m : 0 ) { } }; int main() { b b(-1, 1); b.print(); ...

html - CSS Selectors: if div's class name contains AT LEAST one char -

what correct css selector if want know if there's @ least 1 character in element's class name? i use know if div class name inside .bar begins "foo-": .bar div[class^="foo-"] {display: block;} but how check if there's @ least 1 char (letter or number or special char) in class name? you can check if element has empty or missing class attribute this: div { color: red; } /* has class attribute @ least 1 character */ div:not([class=""]) { color: blue; } /* has empty class attribute */ div:not([class]) { color: green; } /* has no class attribute */ <div class="foo">foo</div> <div class="">bar</div> <div>baz</div>

java - android studio how to configure javadoc and method multiple line format -

android studio javadoc comment: how change format javadoc @param * @param nameofparameterverylong hello world hello world hello world * how how how how * to * @param nameofparameterverylong hello world hello world hello world * how how how how how * method: change public void methodnameveryveryverylong(int param1, int param2, int param2, int param4) to public void methodnameveryveryverylong(int param1, int param2, int param2, int param4) (indented 2 tabs) related settings not found under file>settings>editor>coding style>java. configure it?

Calabash Android - Query url of webview -

i query url of webview. i'm trying query("android.webkit.webview marked:'web view'", :geturl) i getting error saying [0] { "error" => nil, "receiverclass" => "android.webkit.webview", "receiverstring" => "android.webkit.webview{e0d51d8 vfedhvc.. .f...... 0,147-1080,1731 #7f0f00cd app:id/kb_webview}", "methodname" => "property[geturl]" } can 1 shed light on this. thanks

Telephone Bill Project: C++ -

alright, have edited of code, question how calculates right final total? working on regular service, , want subtract 50 free minutes first, add minutes user has overused, multiply minutes $0.20 , make finaltotal. , if have more mistakes please tell me. know have made lot of mistakes, sorry! have project do, , here requested functionalities list: prompts user enter account number, service code, , number of minutes service used. regular: values “r” , “r”: $10.00/month first 50 min. free charges on 50 min. $0.20 per min. premium: values “p” , “p”: $25.00/month plus: calls between 6 - 18 first 75 min free, after they’re $0.10 per min calls between 18 - 6 first 100 min free, after they’re $0.05 per min if other character used display error message calculate total , print bill (display out) this code: #include <iostream> using namespace std; int main() { // variables // int accnum, minnum, minnumm; double total, finaltotal, grandtotal, finaltotall; char...

Python 2.7.13 variable accentuation -

ubuntu 17.04 x64 python 2.7.13 having hard time trying call variable accentuation: └──╼ $python python 2.7.13 (default, jan 19 2017, 14:48:08) [gcc 6.3.0 20170118] on linux2 type "help", "copyright", "credits" or "license" more information. >>> nomes = ('mário') >>> nomes 'm\xc3\xa1rio' >>> any tips? :) regards vitor jr. try print nomes , you'll find has looking for. the 'm\xc3\xa1rio see how special characters represented python.

Run-Time EGL Error: "Failed to Open Swrast" (Nix) -

1 context i have private repo builds via nix (in case matters, repo haskell + stack project). in particular, repo has low-level graphics dependencies, including (at top level): buildinputs = pkgs; [ mesa xorg.pixman wayland-protocols wayland xorg.libx11 dbus weston ]; and system i'm building repo on arch linux machine (with nix installed outside package manager). 2 problem the program compiles fine, when launch soul-crushing run-time error: loading module '/nix/store/98ipsxd20n5nw71q1kjpb5kyr55ysx7y-weston-2.0.0/lib/libweston-2/x11-backend.so' loading module '/nix/store/98ipsxd20n5nw71q1kjpb5kyr55ysx7y-weston-2.0.0/lib/libweston-2/gl-renderer.so' egl client extensions: egl_ext_client_extensions egl_ext_platform_base egl_khr_client_get_all_proc_addre...

opencv - Haar Cascade Classifier -

i newbie opencv . i have read lot of articles haar classifier. not getting 1 information kinds of object haar classifier should used. for project, need detect railway line. have trained haar classifier small sized samples of rail line , created own detector, not detect properly. in maximum cases detects object environment rather rail line. that's why, still confused if use of haar classifier proper way rail line detection or if not, classifier should used. thanks in advance.

html - Windows 10 Mail giving me large TD cells -

Image
i writing email having issues in "windows 10 mail." have 3 table cell graphic in middle td. left & right tds contain 2-pixel height table gray background. make icon surrounded 2 gray lines. the small tables have height=2 applied. i've tried using vml code, no effect. ideas? results: code below: <table cellpadding="0" cellspacing="0" border="0" width="300" style="max-width: 300px"> <tr> <td valign="middle" width="35%" style="max-width: 108px; line-height: 0; font-size: 0"> <!-- left gray table --> <table cellpadding="0" cellspacing="0" border="0" width="100%" style="max-width: 108px; max-height: 2px" height="2"> <tr> <td height="2" bgcolor="#eaeaea" style="height: 2px; background-color: #eaeaea; font-size: 0; line-height:...

Java exception handling concept. why do compiler allow to write exceptions in throws section even if it can not be thrown? -

i investigate java exception handling , faced following behaviour. non me. consider code snippet: snippet 1 public void g(){ try { } catch (filenotfoundexception e) {//any checked exception } } it compile error message unreachable catch block filenotfoundexception. exception never thrown try statement body snippet2 public void g() throws filenotfoundexception{ } it compiles fine. therefore, on results of first code snippet, compiler can calculate if method possible or impossible throws exception. and can make conclusion made especially. don't why. point of question - why compiler allow write exceptions in throws section if can not thrown? i want understand full concept. p.s. understand behavior corresponds documentation question understanding of exception handling concept in java. the compiler allows because throws clause of method part of signature of method, rather part of implementation . possible impleme...

Connecting ColdFusion to Google Bigquery -

we trying connect coldfusion engine google bigquery. solaris / linux os cfml engine: coldfusion or lucee we have tried simba jdbc drivers provided google connection not work, using service account. oauth not viable in case. was wondering if has tried java class files instantiate connection , query dataset in bigquery. just looking starting point in terms of setting connection , basic query. if got simba driver working , have example of connection game too. https://cloud.google.com/bigquery/partners/simba-drivers/ i found page seems have steps laid out nicely using driver - query bigquery data in coldfusion write standard coldfusion data access code connect bigquery data. the cdata jdbc driver bigquery seamlessly integrates connectivity bigquery data rapid development tools in coldfusion. article shows how connect bigquery data in coldfusion , query bigquery tables. create jdbc data source bigquery in coldfusion the jdbc data source enabl...

javascript - Can I completely disable 'debugger' in scripts? -

i wanted see network log of third-party web site. (no malicious purposes, solve login problem of client legitimate user of web site.) seems developers have put measure prevent that. dynamically generated function loops 200 times , calls debugger . so, if open developer tool, stops , "never pause here" not work either, because location keeps changing. i tried major browsers (chrome, ff, edge) , stopped. there way temporarily disable dubugger pause, or web browser has developer tool ignores keyword? chrome's dev tools has disable breakpoints button ignore this.

Xamarin Inspector Extension for VS 2017 -

i have installed xamarin inspector windows not see button on visual studio 2017. there vs extenstion xamarin inspector visual studio 2017. link has solution vs 2015. https://bugzilla.xamarin.com/show_bug.cgi?id=36509 visual studio enterprise includes bytecode hiding live app inspection profiler test recorder ide community , professional editions not. https://www.xamarin.com/compare-visual-studio

Multiple items added to ListView (Android Studio) -

i seem have problem needs fixed. have listview assigned data xml code... <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center|left" android:padding="5dp" > <imageview android:id="@+id/ivimage" android:layout_width="70dp" android:layout_height="70dp" android:src="@drawable/profile" /> <textview android:id="@+id/tvfullname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="textview...

java - Converting UnixTimestamp to TIMEUUID for Cassandra -

i'm learning apache cassandra 3.x.x , i'm trying develop stuff play around. problem want store data cassandra table contains these columns: id (uuid - primary key) | message (text) | req_timestamp (timeuuid) | now_timestamp (timeuuid) req_timestamp has time when message left client @ frontend level. now_timestamp, on other hand, time when message stored in cassandra. need both timestamps because want measure amount of time takes handle request origin until data safely stored. creating now_timestamp easy, use now() function , generates timeuuid automatically. problem arises req_timestamp. how can convert unix timestamp timeuuid cassandra can store it? possible? the architecture of backend this: data in json frontend web service process , stores in kafka. then, spark streaming job takes kafka log , puts in cassandra. this webservice puts data in kafka. @path("/") public class memoin { @post @path("/in") @consumes(mediatype.applicat...

sorting performance less than O(nlogn) -

besides limited bucket sort, why not possible achieve sorting performance less in run time less o(nlog(n))? in limited domains possible beat n log n limit. for example using van emde boas priority queue , combining thorups . conversely, priority queue can trivially used sorting: first insert keys sorted, extract them in sorted order repeatedly deleting minimum. asymptotically, settles complexity of priority queues in terms of of sorting.

multithreading - GNU/Linux RPC Multithread Support -

we migrating onc/rpc applications solaris gnu/linux. applications written in c , c++. the applications call rpc_control() rpc_svc_mtmode_set set "multithread mode", rpc_svc_connmaxrec_set set "non-blocking max rec size", rpc_svc_use_pollfd set "number of file descriptors unlimited", etc. apparently rpc_control() can't resolved on gnu/linux. does know if multithread rpc supported on gnu/linux? if does, substitute call is? thank you!

angular - Converting Array.map + Promise.all to Observable -

i have vanilla.js (typescript) http client returned promises, so: class person { name: string; id: number; friendsids: number[]; } class myclient { getpersoninfo(personid: number): promise<person> { return fetch( '/people/' + personid) .then( r => r.json() person ); } } my display code gets details of each person's friends, so: refresh(): void { client.getpersoninfo( 123 ) .then( (person: person) => { // array-of-promises: let friendsdetailspromises: promise<person>[] = person.friendsids.map( friendid => client.getpersoninfo( friendid ) ); // promise-of-array: let friendsdetailsall : promise<person[]> = promise.all( friendsdetailspromises ); return friendsdetailsall; } ) .then( (friendsdetails: person[]) => { // (do stuff each person) } ) .catch( reason => console.e...