Posts

Showing posts from February, 2012

how to keep track of previous value before changing it in vb.net -

private sub chkloop_checkedchanged(sender object, e eventargs) handles chkloop.checkedchanged intvalue1 = nudx4.value intvalue2 = nudy4.value dim g triglib.triglib = new triglib.triglib ' make shape closed making last point same first point. if chkloop.checked nudx4.value = nudx1.value nudy4.value = nudy1.value lblarea.text = "area: " & cint(g.areatriangle(new point(nudx1.value, nudy1.value), new point(nudx2.value, nudy2.value), new point(nudx3.value, nudy3.value))) elseif chkloop.checkstate = checkstate.unchecked nudx4.value = intvalue1 nudy4.value = intvalue2 lblarea.text = "" i trying store previous values of point nudx4 , nudy4 in 2 local variable. when uncheck checkbox values of nudx4 , nudy4 remain equal values of nudx1 , nudy1 instead of changing previous values. please help. private sub chkloop_checkedchanged(sender object, e eventargs) handles chkloop.checked

php - Android App unable to create directory on server -

i have app supposed create directory on server via url. when enter url web browser, works. when register through app, nothing appears. have tried file server , worked. file has 777 permission , still nothing on phone side. please help this php code $gcmregid = $_post["regid"]; $gcmusername = $_post["username"]; $gcmfoldername = $_post["foldername"]; $gcmdate = date("d/m/y"); $conn = new mysqli($servername, $username, $password, $dbname); if($conn->connect_error){ die("connection failed: " . $conn->connect_error); } $in_user = "user"; $in_password = "null"; $in_email = "null"; $in_dob = "null"; $in_role = "user"; $in_datejoined = "0000-00-00"; $sql = "insert user(password,regid,name,e

which sensor i have to use to find out distance of a particular device using sensors in iot -

i want create device tracker find objects keys or important things. want add sensor valuable thing find object left. can't use motion sensor, ultrasonic sensor or air proximity because of check distance form 1 direction. need find out distance of object direction. consider using 1 of both: gps rdf (radio direction find) the first great if have open sky , client (the looking device) able navigate through gps (thinking in smartphone). the second indoor can hard program , find parts. soloshot . follows beacon attached person of interest. don´t have spec kind of rdf bet. airplanes use avionic based on rdf idea. read wikpeadia article on rdf . others may come other ideas, first popped in mind.

c# - how to cast my y.Value to List<Dictionary<string, object>> -

Image
i want cast y.value list<dictionary<string, object> . i tried: y.value list<dictionary<string, object>> but return null . this watch: . i don't know how handle object {system.collections.generic.dictionary<string,object>} . thanks y.value list<object> casted object , , objects dictionary<string, object> , although casted object too. typing not helpful here. you can use linq dictionaries out: var list = ((ienumerable<object>)y.value) .cast<dictionary<string, object>>() .tolist();

list - python if-else statement returning true only for if condition -

i using python read numeric weather data file , checking humidity conditions. if humidity less or equal 75 humidity should re-written "low" , if humidity greater 75 should re-written "high". following data in file. outlook, temperature, humidity, windy, permission_to_play sunny,85,85,false,no sunny,80,90,true,no overcast,83,86,false,yes rainy,70,96,false,yes rainy,68,80,false,yes rainy,65,70,true,no overcast,64,65,true,yes sunny,72,95,false,no sunny,69,70,false,yes rainy,75,80,false,yes sunny,75,70,true,yes overcast,72,90,true,yes overcast,81,75,false,yes rainy,71,91,true,no i reading file in list , accessing humidity value. following code have written. def fetchdata(filename): datalist = [] rd =open(filename,mode='r') list = rd.readlines() l in list: sublist = l.strip().split(',') humidity=sublist[2] if humidity>75: sublist[2]="high" else:

python - JSON data to Pandas DataFrame -

help have json file , can't load in python dataframe. first question should json file? resulting file when chart rendered on web page , end data pulled chrome network inspection. it seems there code in front not json or not table messing import. http://pastebin.com/ne4rrrgp can please help the below loads file in python import json pprint import pprint open('data2.json') data_file: data = json.load(data_file) and pprint(data) does print data can't convert pandas dataframe edit ok must javascript file think json. just use pandas.read_json , merely wrapper around json class, can take remote url local filename: import pandas pd pandas_dataframe = pd.read_json('data2.json') hope helps.

Facing Issue while sending mail in java using JavaMail.jar and Activation.jar -

i trying send mail office 365 mail id in java.i have added mail.jar , activation.jar in project. facing following exception. javax.mail.messagingexception: not convert socket tls; nested exception is: java.net.socketexception: java.security.nosuchalgorithmexception: default sslcontext not available @ com.sun.mail.smtp.smtptransport.starttls(smtptransport.java:1907) @ com.sun.mail.smtp.smtptransport.protocolconnect(smtptransport.java:666) @ javax.mail.service.connect(service.java:317) @ javax.mail.service.connect(service.java:176) @ javax.mail.service.connect(service.java:125) @ javax.mail.transport.send0(transport.java:194) @ javax.mail.transport.send(transport.java:124) @ agent.client.attributegroups.sendreceive.sendmail(sendreceive.java:75) @ agent.client.attributegroups.mailqueue.calculatetime(mailqueue.java:39) @ agent.client.mainclass.<init>(mainclass.java:59) @ agent.client.mainclass.main(mainclass.java:152) caused by: j

security - secure connection from mobile device to application server -

i after little bit of help. i have mobile application runs on both ios , android. application uses in house apis of end work. i have need start using legacy services sit within end servers in company. i have proposed use new application server sit in dmz , run application contact services , me data need. my question how can ensure connection mobile device application server secure? protocol should use? thanks in advance. if application server exposes http-based end-point mobile app calls, can secured ssl. based on flavor of application server, how setup ssl-endpoint , mobile app can talk ssl-enabled http endpoint (https).

android - How to disable displaying suggestions in Delphi -

Image
can programmatically disable display of "sugested words" tedit on virtual keyboard in delphi android? in java simple: final edittext et = (edittext) findviewbyid(r.id.searchtext); et.setinputtype(et.getinputtype() | editorinfo.type_text_flag_no_suggestions | editorinfo.type_text_variation_filter); but in delphi, not found setinputtype. yes, can. set tedit.keyboardtype alphabet : documentation here says: alphabet alphanumeric keyboard general text input. on android, alphabet keyboard type has no word completion/word suggestion. keyboard looks same default keyboard, without suggestions. to achieve same programmatically write f.ex. edit1.keyboardtype := alphabet;

select - MySQL: Count() Subquery returns nothing -

i want count user id's , entries in table country. when execute query doesn't display result. select ( select count(userid) tbl_user ) countuser, ( select country tbl_user ) country i appreciate every , comment! use below query select (select count(userid) tbl_user) usercount , userid, country tbl_user

html - How to run a JavaScript function on an input field when a button is pressed -

this question has answer here: how value of text input field using javascript? 8 answers i'm trying remember how associate html , js through different actions, wrote simple reverse script (any number turned string , reversed) <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> </head> <body> <h1>number reverser</h1> <script> function reverser(n){ n = n + ""; return n.split("").reverse().join(""); } function executerev(){ console.log(reverser()); } </script> <input id="bubu"> <button onclick="executerev()">reverse 'em</button> </body> </html> the ridiculous part console returned denifednu my genius js leve

android - passing genric class as fragment -

i creating utility class pass class name extends fragment. fragment method not available in method declaration. code snippet return fragment tag. private string createfragmenttag(class<? extends fragment> aclass, boolean addargs) { stringbuilder stringbuilder = new stringbuilder(); stringbuilder.append(aclass.getclass().getsimplename()); if(addargs) { stringbuilder.append("-"); **//here argument not calling** if (aclass.getarguments() != null) stringbuilder.append(aclass.getarguments().tostring()); } return stringbuilder.tostring(); } private string createfragmenttag(fragment fragment, boolean addargs) { stringbuilder stringbuilder = new stringbuilder(); stringbuilder.append(fragment.getclass().getsimplename()); if(addargs) { stringbuilder.append("-"); **//here argument not calling** if (fragment.getarguments() !=

html - CSS nth-child: every 4th, 11th, 18th etc -

i have following div html-structure: a a a b b b b a a a b b b b etc. so, after 3 times a, comes 4 times b. want grab every b-element css nth-child selector. tried nth-child:(4n + 3), didn't work out. should possible pure css, or have use javascript. i assume that, if possible css, have declare 4 css-selectors. thank you! you can use li:nth-child(7n+4), li:nth-child(7n+5) ... li:nth-child(7n+4) match 4, 11, 18... , li:nth-child(7n+5) match 5, 12, 19 etc. li:nth-child(7n+4), li:nth-child(7n+5), li:nth-child(7n+6), li:nth-child(7n+7) { font-weight: bold; } <ol><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li><li>li</li> &l

regex - Perl - Using RegExp string as hash keys -

does perl provide modules support using regexp string hash keys , allow using matched string key find value? for example, %h = { 'a.*' : 'case - a', 'b.*' : 'case - b', 'c.*' : 'case - c' } # expected output print %h{'app'} # case - print %h{'bar'} # case - b print %h{'car'} # case - c this example can handled if regex statement, handy if there modules support functionality. from synopsis of tie::regexphash : use tie::regexphash; %hash; tie %hash, 'tie::regexphash'; $hash{ qr/^5(\s+|-)?gal(\.|lons?)?/i } = '5-gal'; $hash{'5 gal'}; # returns "5-gal" $hash{'5gal'}; # returns "5-gal" $hash{'5 gallon'}; # returns "5-gal" $rehash = tie::regexphash->new(); $rehash->add( qr/\d+(\.\d+)?/, "contains number" ); $rehash->add( qr/s$/, "ends \`s\'" ); $rehash->match( &qu

javascript - How to use same name tag to display innerhtml according to click? -

html <div name="hhh" class="col-sm-7 new" align="left" > </div> javascript yes.onclick =function() { var = document.getelementsbyname("hhh"); for(var = 0, max = all.length; < max; i++) { all[i].innerhtml="you have clicked yes."; } } no.onclick =function() { var = document.getelementsbyname("hhh"); for(var = 0, max = all.length; < max; i++) { all[i].innerhtml="you have clicked no."; } } here in html 2 buttons there yes , no.if user clicks yes,yes.onclick() execute , if user clicks no,no.onclick() execute. in same division hhh, have display message according click. if write above code,the message displayed before click. considering hhh 1 name. how can edit code, display message according click? right on writing existing message.i dont want on write.i want display previous message also. u should use getelemen

Turn Python Kivy program into C code -

i thinking of developing python program gui library such kivy. program commercial, protect source code. there other methods of protection including license keys , license servers, , these employed well. know cython compiles python code c. possible have code converted c? edit: asked example code. here basic example kivy website : import kivy kivy.require('1.0.6') # replace current kivy version ! kivy.app import app kivy.uix.label import label class myapp(app): def build(self): return label(text='hello world') if __name__ == '__main__': myapp().run() yes. more information, read cython documentation .

html - Jquery drill down menu item binding dynamically -

i need fill jquery drill down menu item dynamically database. in menu number of category has decide per data in database refereed link : http://www.designchemical.com/lab/jquery-drill-down-menu-plugin/getting-started/ <ul> <li><a href="#">mobile phones &#038; accessories</a> <ul> <li><a href="#">product 1</a> <ul> <li><a href="#">part a</a> <ul> <li><a href="#">sale</a> <ul> i need fetch , display database, there way implement ? thanks suchith

php - query with less than and greater than statements in where clause -

select ( sum(r.marks_attained) / sum(r.total_marks) * 100 )as marks, s.name result r, student s r.student_id = s.student_id group r.student_id , order marks desc how can students marks percentage greater 90? can use marks in clause? try this: select (sum(r.marks_attained)/sum(r.total_marks)*100)as marks,s.name result r ,student s r.student_id=s.student_id group r.student_id having (sum(r.marks_attained)/sum(r.total_marks)*100) >= 90 order marks desc i remove query , between , group by, added having clause p.s: >= 90 (if want include 90, > 90 otherwise)

osx - How can I use FFmpeg convert the audio codec of a video file? -

i have large group of videos audio codec of aac , need codec linear pcm . how can without re-transcoding video? command line novice , may need basics explained. i'll using os x thank you! you'd use: ffmpeg -i infile.mp4 -c:v copy -c:a pcm_s16le outfile.mov .

c# - 'System.Data.SqlClient.SqlException' How to fix? Visual Studio 2015 -

this question has answer here: the database cannot opened because version 782. server supports version 706 , earlier. downgrade path not supported 5 answers i'm trying put form variables database, however, i'm still new @ these things , i'm trying random copy pasted code internet learn. thing giving me problems @using webmatrix.data; @using webmatrix.webdata; @using system.data.sqlclient; @{ viewbag.title = "recruta"; } @{ var nome = ""; var email = ""; var tel = ""; var adress = ""; var gender = ""; nome = request.form["nome"]; email = request.form["email"]; tel = request.form["tel"]; adress = request.form["adress"]; gender = request.form["gender"]; var db = database.open("usuarios&qu

[orientdb]: get the current user when authenticating with tokens -

how can rid of current user (ouser) via binary api. using inbuilt token based authentication. expect 2 approaches: a function currentuserrid() or something. looked in documentation found nothing. decrypting token unlock userid/name. tried approach couldn't manage to. looked here: https://github.com/orientechnologies/orientdb/issues/2229 , https://groups.google.com/forum/#!topic/orient-database/6sufsad4lxo i find post now, may late can this: oserver server = oservermain.create(); // exemple odatabasedocumenttx db = new odatabasedocumenttx(bddurl).open("admin","admin"); // admin juste exemple otokenhandlerimpl handler = new otokenhandlerimpl(server); otoken tok = handler.parsewebtoken(yourtoken); ouser user = tok.getuser(db);

Are there ways to format a C source code to contain only one statement per a line? -

i want know automatic way formatting c source code contain 1 statement each line. have tool this? from this, want measure precise statement coverage using gcov. for example, from this 1: if(true) break; to this: 1: if(true) 2: break; any useful comments appreciated. thank you. note: please read want (only 1 statement per line!). have tried astyle , other beautifiers tools not provide function want. also, have searched google, no results have found. gnu indent should achieve desired result. default style --gnu-style . for input: $ cat foo.c #include <stdio.h> void f1 (int a){ printf("%d\n", a); } int main() { if (true) break; f1('c'); printf("%i\n", 'c'); return 0; } indent default options transform into: $ indent foo.c $ cat foo.c #include <stdio.h> void f1 (int a) { printf ("%d\n", a); } int main () { if (true) break; f1 ('c'); printf ("%i\n", 'c

php - preg_match escape for backslashes -

i'm trying value html span element: <span class=\"date-display-single\">1462732200</span> i've tried below mentioned approach seems there issue backslahes used in above mentioned html element. i came know using 4 backslashes can me, didn't! other approach achieve value inside html element mentioned above. i.e. 1462732200 <span class=\"date\-display\-single\">(.*?)<\/span> don't parse html via preg_match() , use php dom document class $html = '<span class=\"date-display-single\">1462732200</span>'; // new dom object $dom = new domdocument('1.0', 'utf-8'); // load html object ***/ $dom->loadhtml($html); //discard white space $dom->preservewhitespace = false; $htwo= $dom->getelementsbytagname('span'); // here u use desired tag echo $htwo->item(0)->nodevalue;

python - create row of date while creating superuser -

Image
models.py title = ( ('classroom', 'classroom'), ('playground', 'playground'), ('staff room','staff room'), ) class location(models.model): user = models.foreignkey(user,null=true) title = models.charfield('incident type', max_length=200,default=title) parent_location_id = models.charfield('parent location', max_length=100, null=true, blank=true) is_active = models.booleanfield('is active', default=true) def location_title(sender, instance, created, **kwargs): if instance.is_superuser , not instance.location.is_active: instance.location.is_active=true instance.location.save() post_save.connect(location_title, sender=user) i want insert default data database conditions.this should happen while creating superuser via manage.py createsuperuser comment. i don't know possible django,but requirement.i tried above code.i getting error "attribut

ssas - Mdx request get the first element of a tuple with datetime -

Image
my mdx request gives me result: for entities, i've multiple years 1 value, need first year entity (and others dimensions). i've tried use function .firstchild in year dimension return value year '2014' (first year in dimension). function .item() returns empty values: select non empty {[measures].[value]} on columns ,non empty { [entitefederal].[entitecode].[entitecode].allmembers* [t].[year].[year].allmembers* [t].[yeardate].[yeardate].allmembers } dimension properties member_caption ,member_unique_name on rows [mycube]; hopefully working - tricky me test: with set [entyr] generate ( [entitefederal].[entitecode].[entitecode].members x , x.currentmember * head ( nonempty ( [t].[year].[year].allmembers * [t].[yeardate].[yeardate].allmembers ,x.currentmember ) ) ) select non em

c++ - Template assignment operator in template class copying inner class issue -

i have template class containing inner class. on operator=() overload want copy instance of inner class error: no known conversion 'const foo<double>::bar' 'const foo<int>::bar' the code looks (you can find example here ): template<typename t> class foo { public: template<typename> friend class foo; class bar { std::string inner_str; public: bar const& operator=(bar const& r) { inner_str = r.inner_str; return *this; } }; template<typename f> foo const& operator=(foo<f> const& r) { value = static_cast<t>(r.value); str_container = r.str_container; return *this; } private: bar str_container; t value; }; moving bar outside foo works fine, inner class should part of foo . how solve issue? thought making bar friend foo friend specializations of foo. don't know how introduce them. si

android - Can i store Credit card in local database in app is it secured? -

hi using payment gateway in may app .i think store credit card no in app.i want ask secured store credit card in app when user revisit use credit card no.i take manual input of cvc no. 1) encypted credit card no in aes user key. it secure in android app the best course of action not store data in app locally, cause there potential data loss great, , trade of speed not seem worthwhile. better store in remote server app can connect.

python - export_media from Google Drive API don't write newlines -

when try export text google docs using export_media method, result bloc of text (correct @ least) without newlines. for exemple, if file contains test and test the display looks like test , test here code: http = decorator.http() service = discovery.build("drive", "v2", http=http) docs = service.files().export_media(fileid=docs_key, mimetype="text/plain").execute() docs = docs.decode('utf-8') edit: i tried export file html content instead of text. problem don't how use html actual html instead of string. here code : http = decorator.http() service = discovery.build("drive", "v2", http=http) docs = service.files().export_media(fileid=docs_key, mimetype="text/html").execute() docs = docs.decode('utf-8') docs = docs.encode('ascii', 'xmlcharrefreplace') h = htmlparser() docs = h.unescape(docs) as can see, docs contains google document in html format. if t

Ampersand conflict in LESS and SASS compilers -

i'm converting less sass , i'm getting error due block of code .navbar{ &-inverse { .brand:hover { color: black; } } } this piece of less causing me sass error: invalid css after " &": expected "{", "-inverse {" "-inverse" may used @ beginning of compound selector. in both languages, & placeholder parent of current level of nesting (so in case .navbar ), problem , how can solve it? in sass & works child/parent/adjacent selector (space, > , + , ~ , ... ignored, if in front, or adds parent after selector) or add class (starting . ), id (starting # ) or pseudo-selector (starting : ). the functionality want not implemented yet, planned v3.3. can read bit more here . you example design mixin appends selector. maybe in direction: @mixin inverse($selector){ #{$selector}-inverse { .brand:hover { color: black; } } } @include

angular - What are zone turns? -

i encountered following error in angular2 application. warning: application taking longer 2000 zone turns. my question: 'zone turns', why warn me when above 2000? (i know can change limit, then, why this?) this error produce angular2/universal. when zones microtask queue processed , after processing 2000 tasks queue there still pending tasks. might caused lots of async work enqueues lots of async tasks. angular expects queue become empty. https://github.com/angular/universal/issues/377#issuecomment-215229702 you can set maxzoneturns 10000 if or higher the source error created https://github.com/angular/universal/blob/9508ac03650ca0439192b8ed49ce8f1e57b6be33/modules/universal/src/node/bootloader.ts#l158

c# - DBTransaction closing when used for another method -

i trying use single transaction multiple different insert/update statements in entity framework repository, whenever pass transaction different method returned closed, see below - objectcontext objectcontext = ((iobjectcontextadapter)context).objectcontext; objectcontext.connection.open(); dbtransaction transaction = objectcontext.connection.begintransaction(); using (transaction) { ipersonrepository personrepository = new personrepository(); context.entry(person).state = system.data.entitystate.modified; personrepository.update(person, objectretrieveddatetime, transaction, objectcontext); if (existingstatus != null) { objectcontext.createobjectset<tblpersonstatus>().attach(existingstatus); existingstatus.enddate = datetime.now; context.entry(existingstatus).state = system.data.entitystate.modified; ipersonstatusesrepository repository = new personstatusesrepository(); repository.update(

git add - Which plumbing commands achieve the same as git add? -

i'd understand git-plumbing better learning happens when entering git add $directory and git add $file how work? a rough idea can gained reading progit's git internals section . if $directory directory, find $directory -type f -exec git add {} \; , i.e. recursively adding files in $directory . then, git add $filename applies each file. a check against .gitignore (and "superiors") a check against .gitattributes , running clean filter if applicable git hash-object -w clean ed contents and then , index gets updates somehow, involves git mktree . happens there? tree directory contain files added or files committed well? , happens next? git add not have single equivalent plumbing command, closest 1 git update-index . progit description correct: replace each directory list of directory's contents. result list of files specified add , special case handling files known not in directory (i.e., removed), , files special index s

android - Saving ArrayList<Map<String, String>> to a SQLite Database? -

i have fragment called historyfragment contains listview . items of listview added class called datamodel . i'm trying save list whenever item added list. (at moment, views in list textview s, later hope add images them, , have multiple lines etc. these need saved well). list is: arraylist<map<string, string>> , called mplanetlist . i think saving sqlitedatabase solution, seems complicated after reading multiple answers/tutorials. some sites i've looked at: http://www.vogella.com/articles/androidsqlite/ http://developer.android.com/guide/topics/data/data-storage.html#db http://stackoverflow.com/q/5482402/2442638 http://stackoverflow.com/q/3142285/2442638 there lots of questions in "question" main question comes in 2 parts: a) database right solution? --> if 'yes' --> b) simple way make one? prefer not use json/gson --> if 'no' --> c) should use instead? sharedpreferences ? assuming database cor

java - Android ClassCastException only in release build -

i have simple code nicknames recipient's list in android app: public void additemstospinner(list<recipient> list) { list<string> nicks = new arraylist<>(); (recipient recipient: list) { nicks.add(recipient.getnickname()); } } it works fine when try debug mode, if release through crashlytics beta, crashes. error this: java.lang.classcastexception: dbu cannot cast lh any ideas welcome.

java - How to mock a class in another class junit mockito -

following 2 classes defined as: class1{ public method1 { class2.getinstance().method2(); } } class2{ public static getinstance() { .... } public method2() { .... } public class3 obj = new class3(); } i need write junit test method1 of class1. need know how can mock getinstance() , method2() of class2. also, please tell me how can mock object of class3. if find hard write test class, should redesign class better testability, that's reason tdd called test driven design . should never difficult write test simple class. however, how mock static methods described here powermockito mock single static method , return object (thanks jorge) how partially mock class described here: how mock call of inner method junit

html - "x Of y" style css, separator in the middle, vertical align to the middle -

i have series of articles displayed in web page. the articles count const number, 100. want display header template: [current_article_index] / 100 the problem when style slash separator , make bigger numbers, numbers not being vertically aligned: #box { font-size: 12px; text-align: center; } .of { font-size: 20px; } <div id="box"> <span class="a">13</span> <span class="of">/</span> <span class="b">100</span> <div> i have tried using table layout, cause whole div being aligned left, instead of center: #box { display:table; font-size: 12px; text-align: center; } .of { font-size: 20px; } .a , .b{ display:table-cell; vertical-align:middle; } <div id="box"> <span class="a">13</span> <span class="of">/</span> <span class="b">100</span>

.htaccess - htaccess rewrite url contains -

i'm trying block urls in site, example want "ban" urls , give them 403 when contains words options, k2 or component. problem htaccess not work properly <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_method} ^(option|k2|component) [nc] rewriterule .* - [f] </ifmodule> is blocking when bot attack www.example.com/option=?asdasdad not blocking when bot attacking www.example.com/index.php/option=?asdad anyone? remove above , put following code : rewriteengine on rewriterule (option|k2|component) - [f]

html5 - How load a image with Javascript -

i'm developing app in android appinventor. need call html page in order run javascript load image. question is: how load image file (with static path , filename) on html page? i've found tutorials explain files selected manually user. thanks in advanced $( ".inner" ).append( '<img src="xxx" />' ); ref: http://api.jquery.com/append/

swift - Changing collisionBitMask according to y value ascending or descending -

swift - spritekit i making first game , have var player = skspritenode() , var platform = sknode() i want detect when player increasing in y direction can turn off collisionbitmask . therefore making possible jump through platforms when jumping , when falling land on platforms. so can have like: if player.position.y = increasing { player.physicsbody?.collisionbitmask = nil }else{ player.physicsbody?.collisionbitmask = physicscategory.platform } i have looked around , cannot find after, unless i'm looking wrong thing. many thanks. edit: solved check emiliopelaez answer , showing how i changed here. declared var lasty: cgfloat? outside functions other variables. override func update(currenttime: cftimeinterval) { /* called before each frame rendered */ // checking y direction if player.position.y > lasty { // player increasing in y direction player.physicsbody?.collisionbitmask = physicscategory.

c# - How to get a business class property value in jquery variable -

i need business class property value java script variable. using value iam doing manipulations. here have tried creating object , string in aspx page unable acess string "val" in java script. how access ? aspx file: <%@ page language="c#" autoeventwireup="true" codebehind="webform1.aspx.cs" inherits="webapplication1.webform1" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <% webapplication1.business obj = new webapplication1.business(); %> <% string val = obj.name; %> <head runat="server"> <title></title> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script> </head> <body> <script type="text/javascript">

android - Application requires a device running 'N' -

Image
i'm trying test app against android n using eclipse. getting error, application requires device running 'n' when try debug it. i have created emulator android device running android n. here's console log: [ttb] android launch! [ttb] adb running normally. [ttb] performing com.mycompany.myapp.mainactivitybasic activity launch [ttb] launching new emulator virtual device 'androidn' [emulator] hax enabled [emulator] hax ram_size 0x80000000 [emulator] hax working , emulator runs in fast virt mode. [emulator] console on port 5554, adb on port 5555 [ttb] new emulator found: emulator-5554 [ttb] waiting home ('android.process.acore') launched... [ttb] error: application requires device running 'n'! [ttb] launch canceled! here's snippet manifest: <uses-sdk android:minsdkversion="n" android:targetsdkversion="23" /> any thoughts on wrong? thanks

c++ - How to reduce the noise and enhance the appearance? -

i using visual 2010 (c++) opencv 2.3.1 construct code background subtraction using mog2. shown in full code here works noise. can suggest on how reduce noise. 1 (thanks him) has told me increase size of kernel instead of using morphological function: void morphops(mat &thresh){ mat erodeelement = getstructuringelement( morph_rect,size(2,2)); //3x3 mat dilateelement = getstructuringelement( morph_rect,size(1,1)); //8x8 erode(thresh,thresh,erodeelement); erode(thresh,thresh,erodeelement); dilate(thresh,thresh,dilateelement); dilate(thresh,thresh,dilateelement); } but not know how because still beginner. 1 (thanks him) has suggested solving contours problem noticed if run code " two tips. seems taking 1 point many contours. try averaging them. damp on time. example damped_x=damped_x*0.9+real_x*0.1; part not know how it. you can see portion of code containing contours in following section, intentionally used have blobs on other small

java - FirebaseRecyclerAdapter doesn't work for me -

i need parent key it's child keys represent list of latitude , longitude in recyclerview. guess need latlngsmodel item in populateviewholder inside firebaserecycleradapter no matter don't right. i loops trough parent keys child keys many parent keys has, , adds list... the json structure: { "users" : { "0057242b-81e2-4f97-bca7-b671212614ba" : { "email" : "kalle@hotmail.se", "waypoints" : { "-kh9uaph5nmljexaua5g" : { "-kh9uaph5nmljexas2s" : { "latitude" : 111, "longitude" : 111.1 } }, "-khb1vjqudo90vxj9xch" : { "-khb1vjqudo90vxj9xci" : { "latitude" : 222.1, "longitude" : 222.11 }, "-khb1zykbwgxm9spnie9" : { "latitude" : 222.2, "longitude" : 222.22