Posts

Showing posts from August, 2010

android - How to re-run code from my if if else statement -

i have 4 buttons answers , eliminate 1 of buttons. have way of randomly choosing button , using if statement determine if selected button in fact actual answer not want button eliminated. problem have there 1 in 4 chance of button being chosen , if chosen want process start again until if condition false. private int[] myint; public static final random rgenerator = new random(); public void onclickeliminate(view view) { resources res = getresources(); myint = res.getintarray(r.array.ansarray); int ans = myint[rgenerator.nextint(myint.length)]; button button = (button) findviewbyid(ans); charsequence message = button.gettext().tostring(); textview textview = (textview) findviewbyid(r.id.correct); charsequence answer = textview.gettext().tostring(); if (message.equals(answer)) { // here need above process run again log.i(logtag, "keep button"); } else { button.setvisibility(view.gone); log.i(logt

php - Json parsing in Login -

first of newbie in android. have read every similar topic couldn't find specific answers. problem @ json parsing of login activity. can find nullpointexception come from; im stucked on 1 week... in advance i have mention app worked charm. problems began after trying connect localhost fare away wifi. isnt strange; login.java package com.example.tranfer; import java.util.arraylist; import java.util.list; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonexception; import org.json.jsonobject; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class login extends activity implements onclicklistener{ private edittext user, pass; pri

csrf - Laravel csrf_token(); view vs. controller? -

this might seem silly question, of documentation shows csrf_token being echoed in view. there difference between doing vs. generating token in controller , passing token view? is there difference between doing vs. generating token in controller , passing token view? all doing creating step no reason. laravel handles token generation , session side of things. the csrf_token automatically included if use form::open() , dont need echo out yourself.

DateTime changes by Breeze before save changes -

i creating new entity , inside constructor set datetime like function project() { this.created = moment().format(); } which produce result in console current date , time sat jun 07 2014 18:48:41 gmt+0500 (pakistan standard time) as call save changes , see posted date in network tabe changes hour part of datetime 2014-06-07t13:48:41.000z it looks breeze this, may wrong, suggestion how can prevent happen? breeze serializing date transport not transformed @ all. if 5 hours different in utc meaning localize out same when moment.format again. if want re-localize use moment(yourdate).format(ll) or similar. http://momentjs.com/ , go internationalization section

tree - Traverse PreOrder in BinarySearchTree (Java) -

i need help. runned full code via junit still errors. think because of traverse code. the purpose of traverse code create linkedlist in in preorder. for example: junit says wrong assertarrayequals( new integer[]{2, 14, 26, 86, 122, 134, 182}, arrays.copyof(tree.traversepreorder(), tree.getsize(), integer[].class)); @override public object[] traversepreorder() { binarytreenode<t> x = root; linkedlist<object> y = new linkedlist<object>(); if (x == null) { return null; } else { y.add(x.value); y.add(travpreord(x.getleft())); y.add(travpreord(x.getright())); } return y.toarray(); } public linkedlist<object> travpreord(binarytreenode<t> x) { binarytreenode<t> tmp = x; linkedlist<object> space = new linkedlist<object>(); if (x == null) { return null; } else { space.add(tmp.getvalue()); space.add(travpreord(x.getleft()));

plugins - Joomla 3.3: Get data from column 'attribs' in the table 'content' -

i'm using aixeena easy cck-plugin in joomla 3.3-website. it's plugin allows me add custom fields in article edit-page. content fill out there (should) show on website. plugin stores information in #_content table in attribs column. on website, aixeena says have use following code make filled out text visible on website: $attrb = json_decode($this->item->attribs); echo $attrb->fieldname; this code drops following error: notice: undefined property: jdocumenthtml::$item in /applications/mamp/htdocs/buutpot/templates/buutpot.nl-standaardtemplate/index.php on line 123 notice: trying property of non-object in /applications/mamp/htdocs/buutpot/templates/buutpot.nl-standaardtemplate/index.php on line 123 fatal error: call member function get() on non-object in /applications/mamp/htdocs/buutpot/templates/buutpot.nl-standaardtemplate/index.php on line 124 i think written older version of joomla. searched around , found code: $params = $this-&

Node.js + Bluebird + csv: extra item [object Object] -

i have following code downloading csv files: function download_csv(symbol) { var req_url = url + '&s=' + symbol var filename = '/prices/' + symbol + '.csv' return request.getasync(req_url) .then(function(resp) { fs.writefileasync(filename, resp) }) } promise.map(symbols, download_csv, {concurrency: 128}) .error(function(e) {console.error('error ocurred: ', e.message)}) .done(function() {console.log('done')}) when open csv file, first row shifted right 1 column: [object object] date open high low close volume adj close the first column should date, not [object object]. error in code? the value array of [response, body] can .spread : function download_csv(symbol) { var req_url = url + '&s=' + symbol var filename = '/prices/' + symbol + '.csv' return request.getasync(req_url).spread(function(response, body) { // add return statement

How to send request from IPv6 Address from box which has dula IP (i.e both IPV4 & IPv6) -

i have linux box serves client , has dual ip i.e both ipv4 & ipv6. send request client box via ipv6 address. default server receives request ipv4 address. can not make changes server. there easy way/configuration can done on client machine request sent via ipv6 address. in regard appreciated. on client, make sure you're using ipv6 socket, not ipv4 socket: int sock = socket(af_inet6, sock_stream, 0); the af_inet6 specifies ipv6. af_inet specifies ipv4...

java - Save data into ArrayList of other class -

i have class define array list , getter method array list: private arraylist<double> abc = new arraylist<double>(); public void setabc(arraylist<double> abc) { this.abc = abc; } in class try save data array list method: private void test() { abcclass x = new abcclass(); arraylist<abcclass> list = new arraylist<abcclass>(); arraylist.add(3.14); arraylist.add(5.22); x.setabc(list); } whenever try this, prompted with: exception in thread "javafx application thread" java.lang.runtimeexception: java.lang.reflect.invocationtargetexception .... caused by: java.lang.nullpointerexception arraylist.add(3.14); should list.add(3.14) name gave variable initialized in line before (i.e. arraylist<abcclass> list = new arraylist<abcclass>(); )

java - Xuggler errors as soon as you import git -

Image
i downloaded git straight eclipse xuggler ( here git ). loads, there many errors don't know do. of errors "cannot resolved" type errors. description resource path location type import org.junit cannot resolved atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 22 java problem import junit cannot resolved atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 28 java problem testcase cannot resolved type atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 30 java problem import org.slf4j cannot resolved atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 23 java problem import org.slf4j cannot resolved atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 24 java problem method asserttrue(boolean) undefined type atomicintegertest atomicintegertest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 94 java problem test cannot res

c - Why is the generated assembly reordered when using intrinsics? -

i playing around bit intrinsics, needed o (1) complexity function similar memcmp() fixed input size. ended writing this: #include <stdint.h> #include <emmintrin.h> int64_t f (int64_t a[4], int64_t b[4]) { __m128i *x = (void *) a, *y = (void *) b, r[2], t; int64_t *ret = (void *) &t; r[0] = _mm_xor_si128(x[0], y[0]); r[1] = _mm_xor_si128(x[1], y[1]); t = _mm_or_si128(r[0], r[1]); return (ret[0] | ret[1]); } which, when compiled turns this: f: movdqa xmm0, xmmword ptr [rdi] movdqa xmm1, xmmword ptr [rdi+16] pxor xmm0, xmmword ptr [rsi] pxor xmm1, xmmword ptr [rsi+16] por xmm0, xmm1 movq rdx, xmm0 pextrq rax, xmm0, 1 or rax, rdx ret http://goo.gl/etovja (godbolt compiler explorer) after though, became curious whether needed use intrinsic functions or whether needed types , use normal operators. modified above code (only 3 sse lines, really) , ended this: #include <stdint.h&

html - CSS border getting clipped on retina display -

Image
depending on width of browser window border of elements deposit button clipped. when resize width of browser, if move pixel pixel border clipped , unclipped each pixel move, maybe has even/odd pixels on retina display since there 2 real pixels per css pixel? have 15" retina macbook pro @ 1680x1050. here's scss button: .make-deposit { background-color: transparent; border: 1px solid $green; color: $green; padding: 6px 14px; margin-right: 5px; font-size: 12px; position: relative; top: -3px; &:hover { background-color: $green; color: $white; } } just try add box-sizing: border-box; css rule... try new code: .make-deposit { background-color: transparent; border: 1px solid $green; box-sizing: border-box; color: $green; padding: 6px 14px; margin-right: 5px; font-size: 12px; position: relative; top: -3px; } .make-deposit:hover { background-color: $green;

javascript - How to pass data to and from a bpopup jquery window -

i new using jquery , javascript website programming might simple question. implemented bpopup windows webpages , work great far. questions how send data , bpopup window @ though. below code calling javascript. function editpopupbutton(){ $('edit').bpopup({modalcolor: 'grey'}); } this view javascript shows <div id="edit" style="display: none;"> <span class="button b-close"><span>x</span></span> #renders view here using ruby on rails code </div> and finally, here element calls javascript make happen. <button> onclick="editpopupbutton()"> edit </button> so since new of this, not sure how provide data sent popup window/the view being rendered. first guess put in call javascript editpopupbutton(); function parameter, once in method, don't understand how make available view data. if makes major difference in how done, making website in ruby on rails. a

c - HMAC_Init_ex Corrupting Stack Space -

i'm trying create sha256 hash key using openssl's hmac functions. stack keeps getting corrupted (every value set 0) after call hmac_init_ex. i'm using xcode , running os x 10.8.5. running "openssl version" in terminal outputs "openssl 0.9.8y 5 feb 2013". here function , #include s: #include <stdio.h> #include <openssl/hmac.h> char* hash(char *str, char* key){ int inputlen = strlen(str); int keylen = strlen(key); hmac_ctx ctx; hmac_ctx_init(&ctx); hmac_init_ex(&ctx, key, keylen, evp_sha256(), null); // fine here. hmac_update(&ctx, str, inputlen); // time line runs, str , key null, , inputlen , keylen 0. char* ret = malloc(65*sizeof(char)); hmac_final(&ctx, ret, 65); hmac_ctx_cleanup(&ctx); ret[65] = '\0'; return ret; } this code should working. has libraries, don't know what. did wrong when importing libraries? update: found example here uses encapsulate

cython - Extra elements in Python list -

using cython, trying convert python list cython array, , vice versa. python list contains numbers range 0 - 255, specify type of array unsigned char array. here code conversions: from libc.stdlib cimport malloc cdef to_array(list pylist): cdef unsigned char *array array = <unsigned char *>malloc(len(pylist) * sizeof(unsigned char)) cdef long count = 0 item in pylist: array[count] = item count += 1 return array cdef to_list(array): pylist = [item item in array] return pylist def donothing(pylist): return to_list(to_array(pylist)) the problem lies in fact pieces of garbage data generated in cython array, , when converted python lists, garbage data carries over. example, donothing should absolutely nothing, , return python list me, unchanged. function testing conversion, when run like: in[56]: donothing([2,3,4,5]) out[56]: [2, 3, 4, 5, 128, 28, 184, 6, 161, 148, 185, 69, 106, 101] where data coming in code, , how ca

subset - subsetting error in R -

i have large dataframe called dualbeta contains 2 rows , 6080 columns. here sample: row.names a.close aa.close aadr.close aait.close aal.close 1 upside 1.253929 0.9869027 0.6169613 0.6353903 0.1782124 2 downside 1.027412 1.1936236 0.5915299 0.5697878 0.1702382 i trying extract upside >= 1.00 , downside <=1.00. used combinations <- subset(dualbeta, upside>=1.00 & downside<=1.00) following: row.names a.close aa.close aadr.close aait.close 1 na na na na na 2 na.1 na na na na 3 na.2 na na na na 4 na.3 na na na na 5 na.4 na na na na ... it should return 2 x table x number of combinations found. not know why getting bunch of rows? additionally, thought had na values in dualbeta used na.omit(dualbeta)->dualbeta delete

PHP: connect with external mysql database -

i want connect external database using php . but, gives error warning: mysql_connect(): can't connect mysql server on 'server_ip_address' (110) in /home/<username>/public_html/index.php on line 7 can't connect mysql server on 'server_ip_address' (110) here code. define("_config_db_host", "server_ip_address"); /* database host name */ define("_config_db_name", "database_name"); /* database name */ define("_config_db_user", "database_username"); /* database username */ define("_config_db_pass", "database_password"); /* database password */ $con = mysql_connect(_config_db_host,_config_db_user,_config_db_pass) or die(mysql_error()); mysql_select_db(_config_db_name,$con) or die(mysql_error()); i've added entry remote database access hosts in host server please guide me if i'm doing wrong. make sure database_username has access you host (

javascript - Mac app to comunicate to web app in safari -

can point me in correct direction developing mac app can communicate safari site? don't want use web views, want communicate website in safari itself. i have site sending messages native app fine using app url scheme (app name://some/url/). ideally our app provide single sign on our little internal site , trigger in page js events reloading data etc. i havne't been able find documentation on this. so here ended doing, it's quite convoluted if has better suggestion please let me know. my mac app 2 things when starts creates the directory ~/.appwebserverfiles starts simple python webserver above directory it's root the mac app can write token.jsonp directory, one: singlesignoncallback({"token":"sometokenthinghere"}); the website using jquery make ajax call so: $.ajax({ url: "http://localhost:8585/token.jsonp", datatype: 'jsonp' }); when ajax complete, since datatype of jsonp excecute js find

php - convert a string of full path to relative base url path -

my problem when uploading file, retrieve full path c:/xampp/htdocs/public_html/gtc/wc-upload/gallery/ and ( c:/xampp/htdocs/public_html/gtc/ ) root directory. required full path string should relative base url http://gtc.app/wc-upload/gallery/ . how reform string that? you can use this: <?php $stringtofind = 'c:/xampp/htdocs/public_html/gtc/'; $path = 'c:/xampp/htdocs/public_html/gtc/wc-upload/gallery/'; $url = 'http://gtc.app/'; $pos = strpos($path, $stringtofind); if ($pos === 0) { $url .= substr($path,strlen($stringtofind)); } echo $url."<br />";

dataframe - subsetting a large txt file before reading it into the variable in R -

this question has answer here: quickly reading large tables dataframes in r 8 answers i have large txt file (approx 2 mil rows). first column date in format 01/01/2006. values separated ; data <- read.table("largefile.txt", sep=";") datatouse <- data[data$date >= 01/02/2007 && data$date <= 02/02/2007,] example row: 16/12/2006;17:36:00;5.224;0.478;232.990;22.400;0.000;1.000;16.000 above code doesn't work, there way subset first , load data data variable ? since file large, , takes time load ? for subset work, need quotes , 1 less ampersand. datatouse <- data[data$date >= "01/02/2007" & data$date <= "02/02/2007", ] you use subset() function. subset(data, date >= "01/02/2007" & date <= "02/02/2007") next, if date column should date class

datetime - HTML5 empty <time> tag for date of publication -

i'm confused html5 <time> semantic tag. seems me it's tagging strings such "today", "last christmas", "10.10.2010", "2am" etc. machines recognize , understand them. valid examples find on html5 doctor , w3c page like: <p>i have date on <time datetime="2008-02-14">valentines day</time>.</p> <p>we open @ <time>10:00</time> every morning.</p> if want set article publication date (e.g. google robots), without string displaying it? valid have: <article><time datetime="..."></time> content </article> or: <article><time datetime="..." /> content </article> or should other way? (it seems hilarious me have e.g. <time datetime="...">...</time> , css display:none time selector...) the time element contains datetime value in machine-readable (the datetime attribute) , h

java - Get reosurce in a modular project -

i'm working on maven modular project has structure @ following: |-- parent |-- model --pom.xml |-- services --pom.xml |-- web-app --pom.xml no in service module have resources in src/main/resources. when try them: string filename = getclass().getresource("/myfile.txt").getpath(); map.put("myreport",jaspercompilemanager.compilereport(filename)); the file name has following value file:/home/myuser/apache-tomcat-8.0.3/webapps/myapp/web-inf/lib/services-0.0.1-snapshot.jar!/myfile.txt and when try use : caused by: java.io.filenotfoundexception: file:/home/myuser/apache-tomcat-8.0.3/webapps/myapp/web-inf/lib/services-0.0.1-snapshot.jar!/myfile.txt also saw others post (not resolved) get file in resources folder in java said not possible resource different modules. is true? how can fix it?

java - Is there a way to make empty packages visible in Eclipse? -

Image
is there way in eclipse, see empty parent packages? have issue freely viewing/accessing package new.galaxywar.client.resources.images.game contains 2 sub-packages: i tried creating package again, because thought might not have in eclipse project, won't let me: how prevent "views filtering empty parent packages"? in "project explorer" panel, click on "view menu" button (represented triangle). go "customize view..." , deselect "empty parent packages". this should trick.

java - Adding Input to JTextArea to an ArrayList of ArrayLists -

my objective add text jtextarea arraylist of arraylists, such each line of text inputted saved arraylist, words of particular line saved elements within arraylist of line. have idea of how store each line of inputted text element within arraylist, not how have arraylist of arraylists. point me in right direction here? create 2d arraylist , thinking this: arraylist[][] poem = new arraylist[][]; this thinking making arraylist containing each line element, have each of lines seperate arraylist containing respective words elements: jtextarea txarea = new jtextarea(); string txt = txarea.gettext(); string [] arrayoflines = txt.split("\n"); arraylist<string> linesasal = new arraylist<string>(); for(string line: arrayoflines){ linesasal.add(line); } in sum, trying make 2d arraylist, each word inputted jtextarea added own cell within 2d arraylist. your question doesn't have jtextarea -specific, answer won't (i'm assuming know how string

Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version -

can not figure 1 out. i'm upgrading database , i've created function rename column renaming original table temp table , creating new table renamed field, copy data temp table new table, it's failing when getting part of copying data. function performing rename: public void modifycolumn(sqlitedatabase db, string oldcolumnname, string newcolumnname, string[] newcolumnconstraints) { // current table columns string sql = string.format("pragma table_info('%s')", table_name); cursor cursor = db.rawquery(sql, new string[] {}); int length = cursor.getcount(); string[] oc = new string[length], nc = new string[length], c = new string[length]; while(cursor.movetonext()){ int cid = cursor.getint(cursor.getcolumnindex("cid")); string name = cursor.getstring(cursor.getcolumnindex("name")); string type = cursor.getstring(cursor.getcolumnindex("type")); int notnull = cursor.ge

Changing variables in separate Python files -

so found out today can import variables other python files. example, can have variable green = 1 , , have separate file use variable. i've found helpful functions. so, here's question. i'm sorry if title didn't much, wasn't entirely sure called. want program ask player or name is. once player has answered, want variable stored in separate python file, "player_variables.py", every time want player's name, instead of having go from game import name , can use from player_variables import name , make easier. i understand lazy man's question, i'm trying learn as could. i'm still new, , i'm sorry if question ridiculous. :). help, appreciate it. (be nice me!) from question, think you're confusing ideas variables , values of variables. 1) creating python file variable names allows access values of variables defined therein. example: # myvariables.py name = 'steve' # main.py import myvariables print myvariables

r - Plot a legend outside of the plotting area in base graphics? -

Image
as title says: how can plot legend outside plotting area when using base graphics? i thought fiddling around layout , produce empty plot contain legend, interested in way using base graph facilities , e.g., par(mar = ) space on right of plot legend. here example: plot(1:3, rnorm(3), pch = 1, lty = 1, type = "o", ylim=c(-2,2)) lines(1:3, rnorm(3), pch = 2, lty = 2, type="o") legend(1,-1,c("group a", "group b"), pch = c(1,2), lty = c(1,2)) produces: but said, legend outside plotting area (e.g., right of graph/plot. maybe need par(xpd=true) enable things drawn outside plot region. if main plot bty='l' you'll have space on right legend. clipped plot region, par(xpd=true) , bit of adjustment can legend far right can go: set.seed(1) # same random numbers par(xpd=false) # default plot(1:3, rnorm(3), pch = 1, lty = 1, type = "o", ylim=c(-2,2), bty='l') # legend gets clipped: legend(2.8

cypher - Neo4j SPARQL Plugin on node property -

i've got neo4j 1.9.7 sparql plugin working on (sparql 1.0). i've imported .nt file database creating corrispondent nodes , relationship. every node has property value name of node. possible sparql query plugin find node particular "value" ? e.g. node(2) --- value:businessprocess1 my goal query in sparql similar 1 in cypher: start n=node(*) match (n)-[r]-(x) n.value="http://neo4j.org#businessprocess1" return n,n.value, x, x.value, type(r) this query gives me output this: n n.value x x.value type(r) node 2 "http://neo4j.org#businessprocess1" node 5 "http://neo4j.org#applicationprocess2" "http://neo4j.org#run" node 2 "http://neo4j.org#businessprocess1" node 3 "http://neo4j.org#applicationprocess3" "http://neo4j.org#run" node 2 "http://neo4j.org#businessprocess1" node 10 "http://neo4j

android - Why webView.getContentHeight() < webView.computeVerticalScrollRange()? -

i'm working webview , i've come across unexpected behaviour: webview's vertical scroll range higher content height. values debugger: getcontentheight() 5123 computeverticalscrollrange() 6820 how possible? the following expect true: verticalscrollrange + webviewheight = contentheight why webview not in accordance this? computeverticalscrollrange() uses arbitrary units in docs. there no guarantee match other units such pixels.

PHP ODBC sql-server - moving to another server -

on old server have configured php able connect mssql through odbc. use simple function connect database: $connid = odbc_connect('ww', 'sa', odbc_ps); it works on new server doesn't connect. can suggest strange connection string 'ww' means? use sql server 2012 now, before had 2008. error when trying connect is: warning: odbc_connect(): sql error: [unixodbc][driver manager]data source name not found, , no default driver specified, sql state im002 in sqlconnect in(..)

java - Logback rolling file appender - can I zip many logs into one file? -

my current logback config looks this: <appender name="rolling" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>${log.dir}/${log.package}.log</file> <encoder> <pattern>${log.pattern}</pattern> </encoder> <rollingpolicy class="ch.qos.logback.core.rolling.timebasedrollingpolicy"> <filenamepattern>${log.dir}/${log.package}.%d{yyyy-mm-dd}.%i.log.zip</filenamepattern> <timebasedfilenamingandtriggeringpolicy class="ch.qos.logback.core.rolling.sizeandtimebasedfnatp"> <!-- or whenever file size reaches 1mb. --> <maxfilesize>1mb</maxfilesize> </timebasedfilenamingandtriggeringpolicy> <!-- keep no more 3 months data. --> <maxhistory>90</maxhistory> <cleanhistoryonstart>true</cleanhistoryonstart> </rollingpolicy> </appender> this works fine irritatingly cre

unity3d - Changing a character's forward direction based on camera -

in unity i'm attempting change character's forward direction based on looking. if 45 degrees down , go forward, go towards facing. if don't mind character's game object turning, need set character's rotation same camera's rotation. if mind, can either trigonometry , calculate movement vectors, or move camera first, (in same frame) move player camera's location. there's many ways done, depends on want.

Launch Python script in Git Bash -

i'm writing git commands through python script (on windows) when double click on myscript.py , commands launched in windows command prompt. execute them in git bash. any idea how without opening git bash , write python myscript.py ? in top of python file add #!/usr/bin/python can rename mv myscript.py myscript , run chmod 755 myscript . make can run file ./myscript adding file directory path or linking path if want able run anywhere.

JQuery UI slider max value as video duration -

i have html5 video. <video id="video1"> <source src="/media/thevideo.mp4" type="video/mp4"></source> </video> and have jquery ui slider: <div id="slider2" style="width:100%;" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all"></div> jquery: $( "#slider2" ).slider({ value:0, step: 1, animate: true, min: 0, max: 95, slide: function( event, ui ) { $( "#amount2" ).val( ": " + ui.value ); i can video duration, can put <div> like: myvid=document.getelementbyid("video1"); function(){vidduration=myvid.duration;}; function(){document.getelementbyid('time').innerhtml=vidduration.tofixed(1)+" seconds";}; what want do, set slider's max attribute duration of video1. can me this? internet did not tell me

What kind of syntax is this? -

i assume serialized version of html form, past that... o:15:"coloradoreindeer":23:{s:8:"repid";i:166;s:10:"*created";n;s:9:"slumber";s:7:"2398863";s:10:"cucumber";s:10:"73100.000";s:4:"name";s:8:"test pto";s:7:"company";s:12:"test company";s:7:"address";s:35:"1120 avenue of test, 16th floor";s:4:"city";s:8:"new york";s:5:"state";s:2:"ny";s:3:"zip";s:5:"10036";s:5:"phone";s:12:"212 555 5555";s:5:"email";s:17:"aa@example.com";s:12:"serialnumber";s:7:"testing";s:14:"dateofpurchase";s:0:"";s:7:"product";s:7:"testing";s:11:"accessories";s:7:"testing";s:9:"packaging";s:44:" lorem ipsum dolor sit amet, consectetur adipiscing elit..";s:15:"troublereported&quo

include path - Java, How to add library files in netbeans? -

i new netbeans ide , java. have java project shows lot of compilation errors: can not import "org.apache.commons.logging.log" can please me these errors, how add library files in netbeans ide? quick solution in netbeans 6.8. in projects window right-click on name of project lacks library -> properties -> project properties window opens. in categories tree select "libraries" node -> on right side of project properties window press button "add jar/folder" -> select jars need. you can see short video how-to .

javascript - How to test an Ember model's computed property that has relations dependencies? -

i'm writing qunit tests test ember model, having hard time testing computed properties have relation dependency (the computed property triggers model's computed property). the model testing (coffeescript): customer = ds.model.extend firstname: ds.attr('string') lastname: ds.attr('string') phones: ds.attr('embedded-list') phone: (-> @get('phones.firstobject.number') ).property('phones.firstobject.number') fullname: (-> [@get('lastname'), @get('firstname')].join(' ') ) ).property('firstname','lastname') the meeting model: meeting = ds.model.extend customers: ds.hasmany('customer') startat: ds.attr('isodate') status: ds.attr() objective: ds.attr() customerphones: (-> phones = [] @get('customers').foreach (c) -> c.get('phones').foreach (ph) -> phones.push(ph.number)

Correct way to return a C# object to Android via RESTful JSON webservice -

when returning data wcf restful webservice via json android app, i've designed webservice follow request/response pattern, ie public getstoryseedsresponse getstoryseeds(getstoryseedsrequest request) { ... } this ok request, create jsonobject in android , set post body, , wcf seems receive , decode getstoryseedsrequest object. problem when return above response object, contains list<storyseed>() storyseed class has whole number of parameters, including image data. when try , decode jsonobject in android so string responseentity = entityutils.tostring(response.getentity()); jsonobject seeds = new jsonobject(responseentity); it timing out , array length seems blow out ide, i'm assuming i'm handling response android via json incorrectly. what correct way this?

eclipse - Which driver need to install in my android device for running my app? -

i bought intex mobile testing android application in real device. device not present in list of devices provided android in oem usb driver list. checked intex official site not sure driver need install. can please tell me driver need install can run application eclipse in "intex cloud y11" device. website url click here intex website many thanks. if using windows, download latest universal usb driver or whatever want. there file "android_winusb.inf" inside driver pack. open text editor notepad. if using windows 64-bit, search "[google.ntamd64]" inside file. copy 1 of devices listed below that. this: ; ;google nexusone %singleadbinterface% = usb_install, usb\vid_18d1&pid_0d02 %compositeadbinterface% = usb_install, usb\vid_18d1&pid_0d02&mi_01 ; replace vids , pids device's. can find in device manager. right click on device , click on properties. under details tab can find information need. select "hardware