Posts

c# - Where does the .ToList() go in LINQ query result -

when getting data populate data grid, have pulled data, made list , mapped model, this: public list<person> getpeople() { var data = _db.person.tolist(); list<person> people = new list<person>(); foreach (var item in data) { person person = new person() { personid = item.personid, firstname = item.firstname, lastname = item.lastname }; people.add(person); } return people; } this works fine, in interest of writing less code discovered .select method , (what think is) anonymous type. have: public list<person> getpeople() { return _db.person.select(d => new person { personid = item.personid, firstname = item.firstname, lastname = item.lastname }).tolist(); } though not easy read, works fine too. there preference either way? ...

java - Google Cloud SQL with SSL from Compute Engine and/or External Network -

i'm trying connect google cloud sql (mysql) instance using ssl. i've enabled 2 ip addresses , user remote access permissions ip addresses. have generated certificate files google's developer console. client-key.pem client-cert.pem server-ca.pem using command each of 2 enabled ip addresses make connection. mysql --ssl-ca=server-ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem --host=xxx.xxx.xxx.xxx --user=username --password since mysql client works know firewall settings, users, certs, etc. set correctly. now i'd make similar connection java within executable jar file. following steps outlined here: http://dev.mysql.com/doc/connector-j/en/connector-j-reference-using-ssl.html step 1: keytool -import -alias mysqlservercacert -file cacert.pem -keystore truststore note: substitute server-ca.pem cacert.pem used in instructions step 2: openssl x509 -outform der -in client-cert.pem -out client.cert step 3: keytool -import -file client.cert -ke...

Listeners to visualise results of load test in JMeter -

i want run load test in non-gui mode , save results in .csv file. (i have not modified .properties files, standard information saved) i plan load file , visualise results jmeter’s listeners. which listeners suited purpose? should avoid @ cost, might cause me misinterpret information? (e.g. in view results tree response data empty have - - not saved this. however, there has in fact been response. if saw listener might think there hasn’t been one. since want avoid this, listeners have gain information needed .csv file.) i’d know both jmeter listeners plugins. if running test in non-ui mode ideally should disable listeners in script. use '-l' option store test results .jtl extension. can later open jtl file jmeter. aggregate report or summary report should summarize test results , response time , throughput. if want plot graphs see trends on test duration can use http://jmeter-plugins.org/#/ standard , lib set. i suggest following listeners: response ...

hadoop - lotus notes DB's to HDFS - any tips or tricks? -

i investigating options migrate multiple lotus notes databases somehow hdfs... options see @ point are: write notes jobs dump text, put text in hdfs, maybe apply notes extracted metadata , apply hive/hbase. i think notes has odbc driver (for windows only?)... i'm pretty sure have caveats. don't think gets nested attachments documents instance, , documents don't write. love efficiencies of maybe being able sqoop in... although lose things. some commercial options don't have experience with... does have experience moving many large lotus notes db's hdfs? tips or tricks?

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

i using new android support design view collapsingtoolbarlayout. have need position expandedtitle programmatically. actually way set position expandedtitle in .xml file (example here: https://goo.gl/l5h5fc ) there no public api set text position programmatically , fields private . do know if it's possible without reflection or 'hacky' tricks? i have solved problem exposing properties via reflection ( https://gist.github.com/fpezzato/8e7d45112883dbbc5ffb ), works don't use trick in production code. @google: please no more private or final stuff! :)

javascript - Trigger the setinterval after post data is received -

i've got jquery $post() bring data when page loads. i've got setinterval() load other data when page loads. $.post('my.php', { send:"123" }, function(resp){ //trigger setinterval }); how trigger setinterval after data being received? var wait = setinterval(function() { //do }, 1000); function myintervalfunction() { // something, interval function } // start general interval working process setinterval(myintervalfunction, 1000); $.post('my.php', { send:"123" }, function(resp){ // trigger myintervalfunction once // after ajax call finished myintervalfunction(); } );

apple push notifications - Confusion about IOS certificates, APNS mainly -

i'm developing hybrid app using cordova, , i'm getting confused certificates issue (total newbie apple here). now, think manage creating .p12 file , build apps. don't understand how add apns certificate send/receive push notifications. have merge files in order have 1 .cer file includes production certificate , apns certificate? or how go? there protocol such popular build? i'll appreciate clear out confusion, i'm using windows i'm doing through openssl. help!

Include file to CGI output using Server Side Includes -

i trying include file using ssi output of cgi script. proper way of doing that? tried cgi:ssi module code , file wasn’t included. use cgi::ssi; $ssi = cgi::ssi->new(); $ssi->include(virtual => 'logo.inc'); or should use apache::ssi? if so, simplest way of doing that? thanks! is filename/path correct? stated, if script in /cgi-bin/ logo.inc must in /cgi-bin/ . if can't find file, can't include it. might have meant write: $ssi->include(virtual => '/logo.inc'); if logo.inc in server's root directory.

jquery - Show and loader after click button on Bootstrap modal form -

i try find solution problem during day , gave up. have aspx page gridview. click on row opens standard bootstrap modal form details. , on modal form have gridview(lets call them gridview2). because adding new row gridview2 take few seconds (max 10) want run loader. bootstrap modal not allow open more 1 modal @ same time. try lot of jquery loaders nwith no luck. there solution display loader on bootstrap modal form? br thomas

date - Hive not detecting timestamp format -

i have pig script loads , transforms data csv replaces characters calls java program (jar) convert date-time in csv 06/02/2015 18:52 2015-6-2 18:52 (mm/dd/yyyy yyyy-mm-dd) register /home/cloudera/datetime.jar; = load '/user/cloudera/data.csv' using pigstorage(',') (ac,datetime,amt,trace); b = foreach generate ac, replace(datetime, '\\/','-') newdate,replace(amt,'-','') newamt,trace; c = foreach b generate ac,converter.datetime(newdate) convdate,convamt,trace; store c '/user/cloudera/output/' using pigstorage('\t'); sample input -- 21467245 06/02/2015 18:52 -9.59 518 sample output -- 21467245 2015-6-2 18:52 9.59 518 i loading output hive, other fields seem fine during import, date-time field results null if loaded timestamp , intact when string. where going wrong? am using cloudera cdh 5 from the hive docs: timestamps in text files have use format yyyy-mm-dd hh:mm:ss[.f...]. if in ...

How to set up SOLR parameter substitution in solrconfig.xml -

this first question @ stackoverflow apologies in advance if break rules did study them , made sure isn't duplicate question. so, according http://yonik.com/solr-query-parameter-substitution/ 1 can set search handler in solrconfig in way request handler defaults, appends, , invariants configured handler may reference request parameters i have following query works fine curl curl http://localhost:7997/solr/vb_popbio/select -d 'q=*:*&fq=bundle:pop_sample_phenotype , phenotype_type_s:"insecticide%20resistance" &rows=0&wt=json&json.nl=map&indent=true &fq=phenotype_value_type_s:${pfield}& &pgap=5&pstart=0&pend=101&pfield="mortality rate"& json.facet = { pmean: "avg(phenotype_value_f)", pperc: "percentile(phenotype_value_f,5,25,50,75,95)", pmin: "min(phenotype_value_f)", pmax: "max(phenotype_value_f)", ...

Cloudify 2.7 and source code -

i try download , analyze code of cloudify 2.7 on github. cannot found web ui interface. where can download source code of web managment interface? thanks. salvo. the cloudify 2.x web ui not open source, not find source code available online. cloudify 2 has reached end-of-life. should have @ cloudify 3. barak

javascript - Bootstrap Accordion - Set to specific height -

i have bootstrap accordion has list mile long, , set opened height 200px. when in css, accordion opens, full height, sets 200px after has been opened. i attempted style not collapse class, collapsing , collapse in classes, , have accordion pop open no animation. css: .collapse.in, .collapse{ height: 200px; overflow-y: scroll; } where need set height accordion opens 200px , stops animation @ 200px? example: http://jsfiddle.net/murphy1976/c8nw2jmo/1/ the content height of to-be-opened page bigger. bootstrap accordion build display all. if make wrapping html element fixed height, works, demonstrated in updated fiddle <form id="max200"> #max200 { height: 200px; overflow-y: scroll; }

Job fails on loading com.databricks.spark.csv in SparkR shell -

Image
when open sparkr shell below able run jobs successfully >bin/sparkr >rdf = data.frame(name =c("a", "b"), age =c(1,2)) >df = createdataframe(sqlcontext, rdf) >df dataframe[name:string, age:double] wherease when include package spark-csv while loading sparkr shell, job fails >bin/sparkr --packages com.databricks:spark-csv_2.10:1.0.3 >rdf = data.frame(name =c("a", "b"), age =c(1,2)) >df = createdataframe(sqlcontext, rdf) > rdf = data.frame(name =c("a", "b"), age =c(1,2)) > df = createdataframe(sqlcontext, rdf) 15/06/25 17:59:50 info sparkcontext: starting job: collectpartitions @ nativeme thodaccessorimpl.java:-2 15/06/25 17:59:50 info dagscheduler: got job 0 (collectpartitions @ nativemetho daccessorimpl.java:-2) 1 output partitions (allowlocal=true) 15/06/25 17:59:50 info dagscheduler: final stage: resultstage 0(collectpartition s @ nativemethodaccessorimpl.java:-2) 15/06/25 17:59:50 info ...

immutable.js - How to calculate difference between two Maps in ImmutableJS? -

i have 1 parent map , want divide logic. let m = map(); let sub1 = m.filter((el) => el.isfiltered()); how can rest of map? know can invert condition inside filter, want know if there method analogue _.difference in underscore ? you can use groupby both subsets 1 iteration round: let m = map(); let grouped = m.groupby((el) => el.isfiltered()); let pass = grouped.get(true) let fail = grouped.get(false) example on jsbin: http://jsbin.com/gavikufefi/edit?js,console

php - CakePHP 3.0 - order by assocation count? -

lets have table users hasone userdata , hasmany contests. how retrieve users pagination ordered by: 1: first ones have more 1 contest , userdata filled 2: second ones have userdata filled , no contests 3: last ones empty userdata , contests im paginating far cant solve problem: $this->paginate = [ 'contain' => [ 'userdatas', 'contests' ], 'maxlimit' => 20, ]; $query = $this->users->find('all'); $this->set('users', $this->paginate($query));

asp.net mvc - Kendo grid is not working at web side(front side) of nopcommerce? -

my kendo ui grid not working @ web side(front side) of nop commerce if i have displayed kendo grid @ end side , write same code @ front side not display me kendo grid.i have write same code @ admin side working whats problem. dll or other thing should have add plz tell me. i have resolved myself not working on fornt side of nop commerce because kendo has own css & jquery , when try put @ front side of nop commerce not working prefer not use kendo ui @ front end side of nop commerce.

jquery - Compare index value and add class to the container -

created carousel slider. cant able figure logic compare "slidesjs-index" & "data-item". if both value same, add class "active" "carousel-thumb--content". can 1 pls me solve issue? carousel slider: <div class="slides-item slidesjs-slide" slidesjs-index="0"> <a href="#"> <img src="http://placehold.it/1120x632" /> </a> </div> <div class="slides-item slidesjs-slide" slidesjs-index="1"> <a href="#"> <img src="http://placehold.it/1120x632" /> </a> </div> carousel div container pagination: <div class="carousel-thumb"> <div class="carousel-thumb--content"> <a href="#" class="custom-item" data-item="0"> <div class="carousel-thumb--text"> <div class="carousel-thumb--titl...

asp.net - How to parse data in a List from JSON data like following link using C#? -

how parse data in list json data following link using c# ? { "voters": [{ "id": "5644309456813", "name": "rimi khanom", "address": "house no: 12. road no: 14. dhanmondi, dhaka", "date_of_birth": "1979-01-15" }, { "id": "9509623450915", "name": "asif latif", "address": "house no: 98. road no: 14. katalgonj, chittagong", "date_of_birth": "1988-07-11" }, { "id": "1098789543218", "name": "rakib hasan", "address": "vill. shantinagar. thana: katalgonj, faridpur", "date_of_birth": "1982-04-12" }, { "id": "7865409458659", "name": "rumon sarker", "address": ...

git - Heroku toolbelt doesn't seem to be using HTTP over SSH -

i've installed latest heroku toolbelt (3.38.2) , trying deploy heroku instance. know ssh blocked company firewall understand heroku toolbelt uses http default. i ran following commands git init $ heroku git:remote -a myheroku $ git add . $ git commit -am "commit" $ git push heroku master however still error: ssh: connect host heroku.com port 22: bad file number fatal: not read remote repository. please make sure have correct access rights , repository exists. and suggests trying push via ssh. i tried running command heroku git:remote -http-git try force result same. am missing something?