Posts

Showing posts from September, 2015

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?

c++ - Implementing Lisp eval with a stack instead of recursion -

i looking @ howtowriteaprogram.blogspot.com/2010/11/lisp-interpreter-in-90-lines-of-c.html , see how implement eval() function without recursion, instead iterative function using stack. here code eval() taken article: ////////////////////// eval cell eval(cell x, environment * env) { if (x.type == symbol) return env->find(x.val)[x.val]; if (x.type == number) return x; if (x.list.empty()) return nil; if (x.list[0].type == symbol) { if (x.list[0].val == "quote") // (quote exp) return x.list[1]; if (x.list[0].val == "if") // (if test conseq [alt]) return eval(eval(x.list[1], env).val == "#f" ? (x.list.size() < 4 ? nil : x.list[3]) : x.list[2], env); if (x.list[0].val == "set!") // (set! var exp) return env->find(x.list[1].val)[x.list[1].val] = eval(x.list[2], env); if (x.list[0].val == "define"

scheme - Why does 'The Reasoned Schemer' add an 'o' to the end of its functions? -

in reasoned schemer, name standard lisp functions 'o' on end, eg conso , appendo . my question is: why 'the reasoned schemer' add 'o' end of functions? from page 2 of http://www.cs.indiana.edu/~eholk/papers/sfp2012.pdf : it conventional in scheme names of predicates end ‘?’ character. have therefore chosen end names of minikanren goals superscript o, meant resemble top of ?. superscript e in conde stands ‘every,’ since every conde clause may contribute answers.

Flask-SQLAlchemy and Gevent not closing mysql connections -

i using flask-uwsgi-websockets provide websocket functionality application. use flask-sqlalchemy connect mysql database. flask-uwsgi-websockets uses gevent manage websocket connections. the problem having when websocket connection ended, database connection set flask-sqlalchemy keep on living. i have tried calling db.session.close() , db.engine.dispose() after every websocket connection, had no effect. calling gevent.monkey.patch_all() @ beginning of app not make difference. a simple representation of doing this: from gevent.monkey import patch_all patch_all() flask import flask flask_uwsgi_websocket import geventwebsocket flask_sqlalchemy import sqlalchemy app = flask() ws = geventwebsocket() db = sqlalchemy() db.init_app(app) ws.init_app(app) @ws.route('/ws') def websocket(client): """ handle messages """ while client.connected true: msg = client.recv() # db stuff message # following part exec

apache - AWS:EC2 - php files are not working -

when load website, no pages loading , looking apache logs, see following errors [thu jun 25 09:42:59.279803 2015] [:error] [pid 31196] php warning: include_once(/var/www/htdocs/inc/inc/util/sessionmanager.php): failed open stream: no such file or directory in /var/www/htdocs/inc/util/inag.php on line 13 [thu jun 25 09:42:59.279854 2015] [:error] [pid 31196] php warning: include_once(): failed opening '/var/www/htdocs/inc/inc/util/sessionmanager.php' inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/htdocs/inc/util/inag.php on line 13 [thu jun 25 09:42:59.279875 2015] [:error] [pid 31196] php warning: require_once(/var/www/htdocs/inc/inc/config.php): failed open stream: no such file or directory in /var/www/htdocs/inc/util/inag.php on line 14 [thu jun 25 09:42:59.279884 2015] [:error] [pid 31196] php fatal error: require_once(): failed opening required '/var/www/htdocs/inc/inc/config.php' (include_path='.:/usr/share/pear:/usr/s

wordpress - How to get woocommerce country select dropdown? -

Image
i want display woocommerce countries list on website. how can country list image? yes can achieve having following code ever want global $woocommerce; $countries_obj = new wc_countries(); $countries = $countries_obj->__get('countries'); echo '<div id="my_custom_countries_field"><h2>' . __('countries') . '</h2>'; woocommerce_form_field('my_country_field', array( 'type' => 'select', 'class' => array( 'chzn-drop' ), 'label' => __('select country'), 'placeholder' => __('enter something'), 'options' => $countries ) ); echo '</div>'; i have tested same , have used same code in shortcode , used shortcode on product description let me know if works too.

Group together Jasmine's it specs into a single test run -

i have following situation: describe('base test suite', function () { beforeeach(function (done) { // initialization routine done callback verylonginitialization(done); }); it('description of first spec', function (done) { // first expectations done(); }); describe('nested suite builds upon base test suite', function () { beforeeach(function (done) { secondverylonginitialization(done); }); it('description of second spec', function (done) { // second expectations }); }); describe('second nested suite builds upon base test suite', function () { beforeeach(function (done) { thirdverylonginitialization(done); }); it('description of third spec', function (done) { // third expectations }); }); }); as can see, have nested test suites. it's important outer

c# - JSON Serialisation - How to flatten nested object structures using JSON.net/Newtonsoft -

i have following json structure : { "name":"", "children":[ { "id":"1", "metadata":[ { "info":{ "guid":"cdee360d-7ea9-477d-994f-12f492b9e1ed" }, "data":{ "text":"8" }, "name":"dataid" } ] } ] } and want flatten metadata , nested info , data objects in array. want use name field field name text value becomes "dataid" : "8". { "name":"", "children":[ { "id":"1", "guid":"cdee360d-7ea9-477d-994f-12f492b9e1ed", "dataid":"8&quo

javascript - Jquery method for HTML <option> selected -

what correct method selecting of these options in jquery? <select> <option id="x" >a</option> <option>b</option> <option>c</option> <option>d</option> </select> <div id="one"></div> this doesn't work: $("#x").click(function(){ $("#one").fadeout(1000); }); or select: $("#x").select(function(){ $("#one").fadeout(1000); }); ps: imagine have 3 options , 3 divs fadeout. how can select of 3 options specific div? this: <select> <option id="x" >a</option> <option id="y">b</option> <option id="z">c</option> </select> <div id="one"></div> <div id="two"></div> <div id="three"></div> for option x want div 1 fadeout, option y div 2 , option z div 3 change html , have use id in

flex - Can we get supported paper size of printer in Actionscript 3 -

can supported paper size of printer in actionscript 3? read document of adobe printjob class can not find method list of paper size of printer. thanks. you should use printjob.paperarea paper size in points, use this table convert width*height readable paper format. according manual, property available before start print job, should suffice.

css - Anything below top half of page displays in black & white on print preview in browser -

i'm working on old site , when trying print reports css styling doesn't appear on below first half of page. there 2 tables per report , might have this, first table displays colour when in print preview whereas second table not. the site utilises vb , aspx, , believe site created use microsoft word, might important.

signal processing - IFFT Synthesis from an empty spectrum -

i'm trying generate sawtooth wave using ifft. can first performing fft , putting analysed spectrum ifft, able write ui enables me draw bin magnitudes , generate spectrum that. have been partially successful, waveforms don't quite look/sound right though spectrum input per formula synthesising sawtooth wave. my question how generate spectrum array of complex values ifft when have magnitude values? i know bin 0 , 1 0 valued. i've been trying render wave calculating magnitudes , phases significant bins containing non 0 magnitudes. able put white noise in remaining magnitude bins , calculate accompanying phases @ centre frequency? in advance contribution. my question how generate spectrum array of complex values ifft when have magnitude values? sorry clear answer: not @ all. values need complex, must offer user method input complex values. letting user specify magnitude offering half of freedom she/he needs specify arbitrary wave forms.

ibm - Configuration for JMS Input node in IIB 9.0.0.2 for Tibco_EMS Subscription -

i have configure jms input node in iib jms provider tibco_ems. tibco ems has provided jar files. configured jar files in classpath , set jarsurl using mqsichangeproperties , deployed same. getting error " there configuration problem jndi administered objects where: initial context factory = com.tibco.tibjms.naming.tibjmsinitialcontextfactory '" exception text : 'name not found: '' node cannot obtain jndi administered object, because of values specified incorrect. check jndi administered configuration jms provider used node. but using java code same configuration able connect tibco. any suggestions?

python - Streaming text from a file while its been written to -

is there better , cleaner way stream data text file been written in real time? at moment im using server simulate data being written continuously , using seek() method read added data , print screen. the problem im having testing if file been written or not , if not sleep short period test if been written generate , output print screen. import time seek1 = 198707 seek2 = 198719 file_open = open('c:\users\jay\desktop\tools\uni- server\uniserverz\core\\apache2\logs\\access.log') #c:\users\jay\desktop\tools\uni-server\uniserverz\core\apache2\logs #c:\users\jay\pycharmprojects\parsly\\access.log def generate_list(read_lines):#properly build seek positional checks. #file_object.seek(seek_position) #lines = file_object.readlines() in read_lines: yield def seek_new_postion(generator): listt = [] seek = file_open.tell() old_seek = none counter = 0 while 1: if old_seek == seek , not counter == 5: print "sle

syntax - can there be 'cross-referencing' generators in Python? -

this question has answer here: nested loops using list comprehension 3 answers imagine following piece of code generates list of file sizes current directories' files: _sizes = [] _base, _dirs, _files in os.walk('.'): _file in _files: _size = getsize(join(_base, _file)) _sizes.append(_size) i wonder whether can create nested generator - s.th. like: _sizes = [getsize(join(_base, _file)) _file in _files [_base, _dirs, _files in os.walk('.')]] this syntactically incorrect of course since [_base, _dirs, _files in os.walk('.')] not correct generator syntax. need way iterate through sub-element list ( _files ) while referencing 1 ( _base ) (what called cross-referencing in title). i wonder if can't see obvious or if approach not valid in general. you can this: _sizes

java - Integration tests fails if run via maven, but passes if run via IDE -

i have acceptance test module ejb call module. acceptance test, don't want call ejb directly may cause tests slow. on come that, used simplenamingcontextbuilder mock jndi call. acceptance test, using cucumber framework. i created own annotation @mockjndiservices , java method jndi looks like @before("@mockjndientityservice") public void mockjndiservice() throws namingexception { final ejbserviceremote ejbservice = new ejbserviceremotestubimpl(); final simplenamingcontextbuilder contextbuilder = new simplenamingcontextbuilder(); contextbuilder.bind(ejbserviceremote.ejb_name, ejbservice); contextbuilder.activate(); } ejbserviceremotestubimpl stub tests call instead of service itself. and feature file has heading @mockjndientityservice @transaction feature: lookups library of policy when run code via ide ( intellij ), works fine , passes. when run through build tool ( maven ), remote lookup failure caused by: javax.naming.namenotfoun

ubuntu - git clone: GnuTLS recv error (-9): A TLS packet with unexpected length was received -

i'm trying clone git repository , i'm receiving following error while executing command: gnutls recv error (-9): tls packet unexpected length received. my client machine ubuntu 14.04. this known bug @ivan ternovtsiy said ,but there workaround remove current git system sudo apt-get purge git download git deb git_1.9.1-1_amd64.deb link execute downloaded deb.

Post score on facebook wall in unity3d -

i made game in unity3d , share score on facebook wall. used this private const string facebook_app_id = "1624727317787654"; private const string facebook_url = " http://www.facebook.com/dialog/feed "; and code of sharing is void openuserfbwall (string linkparameter, string nameparameter, string captionparameter, string descriptionparameter, string pictureparameter, string redirectparameter) { application.openurl (facebook_url + "?app_id=" + facebook_app_id + "&link=" + www.escapeurl(linkparameter) + "&name=" + www.escapeurl(nameparameter) + "&caption=" + www.escapeurl(captionparameter) + "&description=" + www.escapeurl(descriptionparameter) + "&picture=" + www.escapeurl(pictureparameter) + "&redirect_uri=&q

How to invoke command manager scripts of Microstrategy using Java program without .bat file -

i had created array commands: string[] commands={"chdir c:\\program files (x86)\\microstrategy\\command manager","cmdmgr -n xyz -u pqr -p lmn -f c:\\users\\administrator\\desktop\\script.scp -o c:\\users\\administrator\\desktop\\myscript.log"}; it giving me invalid -n error. with -n should specify project source name. in developer or project source manager if not sure name correct. if single word without spaces can provide is. if contains spaces has enclosed in double quotes -n "my project source" . hth!

objective c - How to create a progress bar with two colors in iOS? -

Image
i need create progress bar in ios first 90% in white color , rest 10% red. have checked many codes available online. i need have simple code simple progress bar. can guide me. here screenshot: here steps yourself: create view red background. assume width 100 px. create view white background above red view. to show progress increase width of white view. 1% = 1px if want width more 100 px progress in width ratio. example 320px width: 3.2px = 1% 1080px width: 20.16px = 2%

c# - Unable to load DLL 'sqlite3' in SQLite Net Platform WinRT -

Image
i in process of developing native app using xamarin.forms. problem facing not related xamarin. added new windows phone project right-click > add > new project -> windows phone apps -> blank app(windows phone). in existing xamarin project in visual studio premium 2013. using sqlitenet pcl database connection. have below code in project. public isqliteplatform createsqliteplatforminterface() { return new sqliteplatformwinrt(); } when executes above line, throws exception an exception of type 'system.dllnotfoundexception' occurred in sqlite.net.platform.winrt.dll not handled in user code additional information: unable load dll 'sqlite3': specified module not found. (exception hresult: 0x8007007e) this has been asked many many times , tried suggested solution, still not able fix it. my packages.config <package id="sqlite.net-pcl" version="3.0.5" targetframework="wpa81" /> &l

html - bootstrap form too large -

i trying design form within area of width col-sm-8. there 3 columns in form: label, text input , username check. width of label col-sm-2, width of username check col-sm-1 , rest should text input. calculation text input should have width of 5 result ugly. tried manually set width col-sm-7 still not long enough. if set width of text input col-sm-8 saw scroll bars on bottom of web-page. goal 1. set width of label col-sm-2 left; 2. set width of username check col-sm-1 right; 3. text input takes whole width in middle. how achieve please? old code below: <div class="col-sm-8" id="content" style="border-left: #dbe0e3 1px solid;"> <form name="form_register" id="form_register" method="post" class="form-horizontal"> <fieldset> <legend class="text-center">enter details below.</legend> <div class="form-group"> <label for="usernam

nfc - OTA updates for Device Owner Android Application(Kiosk mode) -

i able make app, device owner app through nfc mentioned here . want update app on air, couldn't find method without rooting . google providing many options enterprises develop apps mentioned here , providing way update application through ota. looking solution. this pure speculation i've never tried use package installer api myself: you try set installer package device owner app (using packagemanager.setinstallerpackagename() ). installer package need separate apk signed same certificate device owner apk. getpackagemanager().setinstallerpackage("<device.owner.package.name>", "<installer.package.name>"); from installer apk, use packageinstaller prepare update: packageinstaller pi = getpackagemanager().getpackageinstaller(); int sessid = pi.createsession(new packageinstaller.sessionparams(packageinstaller.sessionparams.mode_full_install)); packageinstaller.session session = pi.opensession(sessid); outputstream out = sessio

ios - Swift Closure why does calling function return error? -

Image
just learning closures , nesting functions. given nested function below: func printerfunction() -> (int) -> () { var runningtotal = 0 func printinteger(number: int) { runningtotal += 10 println("the running total is: \(runningtotal)") } return printinteger } why calling func have error, when assign func constant have no error? printandreturnintegerfunc(2) passing 2 int parameter have return value? printerfunction(2) // error let printandreturnintegerfunc = printerfunction() printandreturnintegerfunc(2) // no error. 2 going?? first of getting error here printerfunction(2) because printerfunction can not take argument , if want give argument can like: func printerfunction(abc: int) -> (int) -> (){ } and work fine: printerfunction(2) after giving reference of function variable this: let printandreturnintegerfunc = printerfunction() which means type of printandreturnintegerfunc this: that means

PHP passing data using form -

i have form passes data index.php update.php. code passed date of birth variable didn't pass $leadid variable. wrong code? part of code in index.php <form method="post" action="update.php"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">lead id</td> <td> <?php mysql_connect('localhost', 'root', ''); mysql_select_db('test'); $sql = "select leadid table lead_no ='$lead_no'"; $result = mysql_query($sql); $row = mysql_fetch_row($result); $leadid = $row[0]; echo $leadid; ?> </td> </tr> <tr> <td width="100">date of birth</td> <td><input name="birth" type="date" id="birth"></td> </tr> </table> </form> in update.php have post $id = $_post['leadid']; $birth = $_po

ios - GoogleTagManager error: _avn has no backing implementation -

this simple push data layer of screen view prints error verbose logging enabled. , subsequent calls data layer fail. neither logged nor executed. [[tagmanager instance].datalayer push:@{@"event" : @"screen-loads", @"screen-name": [tracker get:kgaiscreenname], @"viewcontroller" :nsstringfromclass([sender class]) }]; this error message being logged: googletagmanager error: _avn has no backing implementation. the clue in _avn . our friends on @ analytics pros took @ container , noticed had reference built in variable {{app version name}} . noticed wasn't set, , think it's variable no longer part of v2. anyway, changing {{app version name}} {{app version code}} got rid of error , data flowing freely. hope helps.

c# - How to fill datagrid from list? -

Image
yo guyz, i'm trying fill 2 datagrids columns tree other list. know how can this? solution read data table , show in message boxes loop. don't know how bind columns showing information in datagrid. public void wybierzdoraportu() { list<string> nametab = new list<string>(); list<string> numertab = new list<string>(); list<string> ilosctab = new list<string>(); datatable dt = new datatable(); dataset ds = new dataset(); mysqlcommand cmd = new mysqlcommand(" select c.nazwa, c.symbol, z.id_czesci_symbol, z.ilosc, z.z_numer_naprawy `sylpo_test`.`zamowienie` z left join `test`.`czesc` c on c.symbol=z.id_czesci_symbol z.z_numer_naprawy='" + numberbox.content.tostring() + "' order ilosc;", connection); mysqldataadapter adp = new mysqldataadapter(cmd); try { connection.open(); using (mysqldatareader dr =

c# - remove a char from string or replace it by another in string array -

we have array of string this: string[] names = new [] {"jo!oje","kaba!b","!zorrat","kotlet!","fat!!"}; and want remove '!' each string. how can it? names = names.select(x => x.replace("!", "")).toarray();

Android: Viewing a ListView Item After Delete Operation Views Deleted Item -

i attempting crud operations using sqlite database in android list view. using fragment, activity, , custom base adapter. can highlight, delete or edit item, , update list view , adapters. i run problem when delete item (the list view , adapter updated) , attempt select , highlight item after. edit operation references deleted item. when delete item , reload activity works intended. this leading me believe list view refresh , database operations working intended adapter not updating after delete. perhaps has way passing selected position persistent highlighting purposes. code follows. please let me know if need me post more or have morsels of advice improvement. championlistfragment.java (our primary list view) ` package com.androidtitan.trooptracker.fragment; import android.app.activity; import android.app.fragment; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; impo