Posts

Showing posts from April, 2012

c# - Reading APK Expansion Files with MonoDroid -

i working on porting xna windows phone 7 game android using monogame , monodroid. ported game, added in multiple resolution support , ended apk 130 mb. discovered google play not support apk files larger 50 mb, , have use apk expansion files. so read through google documentation expansion files. zipped game's textures without compression setting, renamed zip file to: main.1.com.baller.fivesome.obb i placed obb file appropriate place: http://www.ballerindustries.com/images/path.png my code crashing while trying open obb file: using(zipfile zif = new zipfile(sourcepath)) here's contents of sourcepath: http://www.ballerindustries.com/images/sourcepath.png it results in java.io.filenotfoundexception so guess questions are: 1. missing obvious? 2. have placed obb right location? 3. have built obb correctly? 4. need set special permissions? thanks, angus

algorithm - Inverse convolution of image -

Image
i have source , result image. know, convolution matrix has been used on source result. can convolution matrix computed ? or @ least not exact one, similar. in principle, yes. convert both images frequency space using fft , divide fft of result image of source image. apply inverse fft approximation of convolution kernel. to see why works, note convolution in spatial domain corresponds multiplication in frequency domain, , deconvolution corresponds division in frequency domain. in ordinary deconvolution, 1 divide fft of convolved image of kernel recover original image. however, since convolution (like multiplication) commutative operation, roles of kernel , source can arbitrarily exchanged: convolving source kernel same convolving kernel source. as other answers note, however, unlikely yield exact reconstruction of kernel, same reasons ordinary deconvolution won't reconstruct original image: rounding , clipping introduce noise process, , it's possible convol

asp.net - c# asp - UpdatePanel is causing a full page postback rather than just posting back itself -

i have page generated update panels so: foreach(datarow r in getsteps(id).rows) { updatepanel steppanel = new updatepanel(); steppanel.id = "steppanel_" + r["stepid"].tostring(); steppanel.contenttemplatecontainer.controls.add(generateinnerpanel(r)); stepholder.controls.add(steppanel); } this generates updatepanels , adds placeholder on page: <asp:placeholder id="stepholder" runat="server"></asp:placeholder> inside each updatepanel clickable panel calls javascript function: function stepclick(sender, stepid){ __dopostback(sender.id, stepid); } the javascript posts , check sender , add details clicked update panel on page load. the problem i'm having clicking on 1 of divs in update panel causing full postback rather posting contents of containing update panel. set update panels postback rather full page? maybe not setting, in case how it? many help! set upda

Link Delphi to SQL Server -

i'm using delphi xe4 & sql server express 12 , locally on c drive. can link delphi access db via ado comp. problem when try linking sql server db - it doesn't see server/db . i'm not sure how should specify server name (user-pc\sqlexpress - name created sqlserver) or db name (c:\program files(x86)\microsoft sql server\mssql11.sqlexpress\mssql\data\testdb.mdf) . no passwords used. tried via adotable (sql server native client 11.0 microsoft ole db provider sql server) , tsqlconnection . (i've been using ms access lately - out of touch external db connection...) i found solution. 32-bit (program) , 64-bit (machine) incompatibility. had define odbc/sql native server under 32-bit, default defined under 64-bit. you need provide server information somehow, can use connectionstring used build connection. connection string looks this: connstring = 'provider=sqloledb.1;persist security info=false;' + 'user id=%s;password=%s;data source=%s;us

c++ - where does an automatic object live in( with a demo ) -

i want research in memory management of c++ , it's implementations g++, vc++. the first question automatic object(local object) live in?(built-in type, user-defined type, stl...) i think built-in type stored in stack done in compiling step. , what's fact user-defined type? see somewhere before stl data type in heap memory. wrote tiny function, compiled g++, disassembled using objdump, see compiler did. #include <string> void autovar(){ std::string s; } and result of disassembling follows: 00000000 <__z7autovarv>: 0: 55 push %ebp //push old frame pointer 1: 89 e5 mov %esp,%ebp //ebp point old 3: 83 ec 28 sub $0x28,%esp//allocate stack space 6: 8d 45 f4 lea -0xc(%ebp),%eax//param or something?? 9: 89 04 24 mov %eax,(%esp) c: e8 00 00 00 00 call 11 <__z7autovarv+0x11> 11: 8d 45 f4 lea

sql - What does this query means? -

there table named employee , it's have employee_id, manager_id, salary columns on it. query select employee_id,salary,last_name employees m exists (select employee_id employees w (w.manager_id = m.employee_id) , w.salary>10000) order employee_id asc what query means? a)all managers whom salaries greater 10000 b)all managers whom have @ least 1 employee making greater 10000 if subquery returns rows @ all, exists subquery true , , not exists subquery false . example: select column1 t1 exists (select * t2); traditionally, exists subquery starts select * , begin select 5 or select column1 or @ all. mysql ignores select list in such subquery , makes no difference. in case option b correct.

symfony - Symfony2 form choice field -

i have product , category entity. category entity adjacency list/materialized-path model. product has relation category has relation product in producttype class selectmenu categories @ specific level grouped parent name. $builder->add('category', 'entity', array( 'label' => 'category', 'class' => 'test\adminbundle\entity\category', 'property' => 'name', 'group_by' => 'parentname', 'query_builder' => function(\doctrine\orm\entityrepository $er) { $qb = $er->createquerybuilder('c'); return $qb->where($qb->expr()->like('c.path', ':path')) ->orderby('c.path', 'asc') ->setparameter('path', '%/%/%'); }, )); category got getparentnam

rest - is there an equivalent to CoreData and AFIncrementalStore in Android -

our data in our android app has started more complex , being updated. so, need persist relational data pulling our backend via rest json services. i'm thinking should use sql lite data store on android device rather serialized string data store using. is there similar coredata , afincrementalstore ios in android. looking @ green dao sql-lite not sure if there better solution out there specialized orm json rest services sql lite. take @ ormlite . can use robospice automagically retrieve data rest service , persist them inside local database.

debugging - How do I fix my Python sudoku solver bug? -

this homework hello. had make python sudoku solver , came with. http://pastebin.com/jrkaqsed (includes input , output get) however, when run it, first populate call causes error below. seems add 1 2 cells @ same time. 0 5 9 0 0 0 4 8 3 #current row being tested add, 1 #number add 0 5 #row, column 0 5 9 0 1 1 4 8 3 #row outputs i can't figure out why doing that. appreciated. thank you edit: i found bug. generating rowset @ start of each row , therefore didn't know if number had been used. however, code still doesn't finish sudoku grid i can't replicate error get, there's problem how read in sudoku grid. 0 5 9 0 0 0 4 8 3 0 0 0 0 0 0 0 1 2 0 1 0 0 2 8 0 0 0 0 9 8 0 7 4 0 2 0 0 4 0 0 8 0 0 3 0 0 7 0 6 3 0 5 4 0 0 0 0 1 6 0 0 5 0 6 2 0 0 0 0 0 0 0 7 3 5 0 0 0 8 6 0 reading in file way do: fi = open("sudoku.txt", "r") infile = fi.read() grid = [list(i) in infile.split("\n")] this creates grid that

iphone - save multiple images in custom album in ios5 but not in camera roll? -

save multiple images in custom album in ios5 not in camera roll? i using alassetslibrary+customphotoalbum example, can save once in custom album , duplicate in camera roll. i want save in custom album through app. can 1 solve it...... you can't that. albums strictly "smart albums", meaning can have pictures in them somewhere else in library. see same behavior in photos app: if add picture camera roll album, can't delete picture camera roll without deleting album well.

java - What is difference between PORTABLE and Machine Independent? -

this might silly question confused between portable , machine independent. java, c#.net : portable or machine independent? what difference between portable , machine independent? there no real answer this. depends on definitions of "portable" , "machine independent" chose accept. (i pick pair of definitions agree , compare those. don't think that's objective.) what java, c#.net : portable or machine independent? you argue java , c# neither portable or machine independent. a java or c# program runs on platform jvm or clr implementation, , "compliant" implementation of respective standard libraries. ergo, languages not machine independent (in literal sense). there many examples of java (and i'm sure c#) programs behave differently on different implementations of java / c#. due differences in runtime libraries and/or host operating system. due invalid assumptions on part of programmer. point java / c# softwa

c# - FindControl always returns null on dynamically generated table -

i have generated table using following code (snippet): string stable = "<table id=\"editable\" runat=\"server\">\n" + "...\n" + "</table>\n"; table_display.innerhtml = stable; table_win.style.add("display", "block");//show table i then, later in code, try find table using findcontrol() method find table follows: protected void submittable(object sender, eventargs e) { control ctrl = table_display.findcontrol("editable"); } here relevant html: ... <div id="table_display" runat="server"> </div> <asp:button id="submitreport" cssclass="submit_btn" runat="server" text="submit" onclick="submittable" /> ... ctrl null when step through code, despite fact table_display still contains html table. know use datalist , dataview or repeater generate table instead, don't kno

java - Reference of graphics 2d object doesn't work in orphan Thread -

Image
i trying design simple game using graphics2d in jpanel. able draw normal objects overriding paintcomponent() method. when reference graphics2d object inside orphan thread, not work. going wrong? public void paintcomponent(graphics g) { super.paintcomponent(g); g2d = (graphics2d) g; g2d.drawstring("sample",60,100); //works fine if(<certain condition>){ new thread(new runnable(){ //some code here public void run() { try{ g2d.drawstring("sample2",60,100); //does not work.. :( system.out.println("test print"); //shows output } catch (exception e) { } } }).start(); } } here complete code reference. 'ping pong ball' game. working not able highlight increase in score when ball hits striker. important part of code highlighted. it's sscce. import java.awt.*

html - Have upload button underneath of previous document uploads -

when clicking add document , <input type="file"> appears right of previous upload. have input type="file" appear underneath previous upload. cheers <div id="test-doc-template" style="display:none"> <input type="file" name="test_doc[]"/> </div> <div class="align-center padding-small-top"> <p class="big-button" id="add_test_doc">add document</p> </div>

iOS UIWebView webViewDidFinishLoad is not called sometimes -

everything works fine, uiwebview did not finish load. guess uiwebview waits long response , not finish load. had have familiar issue? yes, have implemented next methods: - (void)webviewdidstartload:(uiwebview *)webview - (void)webview:(uiwebview *)webview didfailloadwitherror:(nserror *)error - (void)webviewdidfinishload:(uiwebview *)webview yes, setup delegate. said - works fine, not finish load, not receives error. - (void)mytimer:(nstimer *)timer { nslog(@"wv=%@ delegate=%@ isloading=%d", self.webview, self.webview.delegate, self.webview.isloading); } it prints time: [378:c07] wv=uiwebview: 0x755f690; frame = (0 0; 320 416); autoresize = w+h; layer = calayer: 0x755f6f0>> delegate=mainviewcontroller: 0x755b130> isloading=1; i tried setup cache policy , disable it. didn't help. can problem html frame? when loading elements webpage disappear (it happens when webpage loaded, after elements disappeared shows new page, in case not).

Slide specific Fieldset using Jquery -

i have following html 2 fieldsets..i want provide toggleslide functionality fieldsets contains ..if fieldset doesnt contain div tag id "contents" shud not slide. appreciate if can provide fiddler. the html <!doctype html> <html> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <meta charset=utf-8 /> <title>collapse fieldset when legend element clicked</title> </head> <body> <fieldset><legend>awesome</legend> <div id="contents"> <p> hello there </p> <p> awesome </p> awesome </div> </fieldset> <br> <fieldset><legend>awesome 2</legend> <p> hello there </p> <p> awesome </p> awesome </fieldset> </body> </html> the scrip

Transaction of fragments in android results in blank screen -

if helps, want similar done in google tutorial but there fragment created prior transition. if transition works fine; can't use approach ===== aiming api 7+ trying have 1 fragment visible in whole screen , using button (a drawn button, ontouch event) alternate second fragment , viceversa. but either blank screen when replace first fragment second, or if use fragmenttransaction.show , fragmenttransaction.hide; can switch 2 times before blank screen. dont want have on backstack. i creating fragments in mainactivity's oncreate: dicetable dicetable = new dicetable(); logger logger = new logger(); fragmenttransaction.add(dicetable, dicetable_tag); fragmenttransaction.add(logger, logger_tag); fragmenttransaction.add(r.id.fragment_container, logger); fragmenttransaction.add(r.id.fragment_container, dicetable); then on 1 method (called fragments) switch: logger logger = (logger)fragmentmanager.findfragmentbytag(logger_tag); dicetable dicetable = (dicetable)

jquery - How to enable a function after another function has timed out -

i've been learning jquery, , i'm trying create simple game test i've learned far. here's game: a grid of 100 green dots. click any of dots turn 10 of dots blue (at random). 3 seconds later ten blue dots revert green. have click of green dots were blue turn them blue again. it's simple memory game. so far i've got following code: $(document).ready(function() { $('#greengrid').one('click', function() { $('.greentoblue').css('background-color', 'blue'); settimeout(function() { $('.greentoblue').css('background-color','green'); }, 3000); }); }); this turns 10 of blue dots green when click any dot, disables code can't reveal blue dots simultaneously again. now want able turn "secret" blue dots blue again clicking each 1 individually. don't know how this. anyone? in advance help. just bind 1 time click event handler elements @

python - Image getting corrupted while downloading via wget. Where am I going wrong? -

Image
this image gets corrupted when i'm trying download using wget. i'm not sure i'm going wrong. code: command = 'wget ' + '-u "mozilla/5.0 (x11; u; linux i686; en-us) applewebkit/534.17 (khtml, gecko) ubuntu/11.04 chromium/11.0.654.0 chrome/11.0.654.0 safari/534.17"' + image + ' -o ' + path ssh.exec_command(command) command = 'mogrify -auto-orient ' + path ssh.exec_command(command) a priori doing right -u , agent string of browser. this worked asker here : wget -u "mozilla/5.0 (x11; u; linux i686; en-us) applewebkit/534.17 (khtml, gecko) ubuntu/11.04 chromium/11.0.654.0 chrome/11.0.654.0 safari/534.17" http://static.die.net/earth/mercator/1600.jpg so may make sure have in pasted code + image + ' -o ' + path in url form http://static.die.net/earth/mercator/1600.jpg

c# - Why is the checkbox 'Prefer 32-bit' disabled in Visual Studio 2012? -

i came across situation in set prefer 32-bit true. in visual studio 2012, showing disabled. , no matter doesn't enabled. i read any cpu prefer 32-bit default value new projects. so, should assume although disabled set true? how can set any cpu ? in what anycpu means of .net 4.5 , visual studio 11 , in many other posts , questions here in stack overflow says: overall, there 5 options /platform c# compiler switch: x86, itanium, x64, anycpu, , anycpu 32bit preferred what's more, have collegues have mentioned me in past checkbox enabled (maybe wrong?). why prefer 32-bit checkbox disabled, , how can enable again? my processor 64-bit, , have applied update2 visual studio 2012. assuming you've got executable project, if change target platform .net 4.5, should become enabled. it's .net 4.5-only thing, , it's enabled executables.

ios - Invalid token at start of a preprocessor expression in CoreFoundation -

Image
i'm having following issue last 2 days. whenever try build 1 specific app, keep getting errors in of corefoundation classes. specific in classes 1 of macros target_os_iphone or target_os_embedded used. don't know source of problem, happy help... i using llvm compiler, xcode 4.6.2. is known issue, because couldn't find when searching? edit: happened after cleaned derived data. solved: reasons unknown me error kept appearing. after building new clean project , adding files it, compiled without issues! very, very, strange... additional info: had fact folder clone of repository , messed guess. after created new clean project , worked out fine, placed in folder , started showing nasty errors again. had folder it's in...

ios - How do we implement a pull over menu in xcode like in email reply -

Image
i have searched lot find way implement used pull on menu when press button in xcode iphone. see when hit reply button in email app. see options reply, forward, print, cancel. wanted implement same way. there standard framework available in ios6? many excellent users of stackoverflow. below screen shot wanted implement. this uiactionsheet please @ apple's doc

SignalR - sending to a number of clients (not a group) -

i'm using signalr in prototype i'm building. need broadcast messages number of clients, there logic clients message complex enough rule out using groups. instead, i'm checking each connected client - if applicable, they're added list<>. send message using: var clients = determineclients(msg); foreach (var client in clients) client.send(msg); of course, if able use groups, do...: var group = determinegroup(msg); group.send(msg); ... since 'send' method of group appears same thing - enumerate clients in group , call 'send' on those. 'correct' way this? or there way create temporary group on fly? 'dynamic' type of group or singular client makes difficult me determine whether i'm doing right. if there magic going on behind scene optimising broadcast number of clients, i'd rather use that! any advice appreciated. let me know if need more info. if you're trying send same message number of different c

c++ - Character Encoding independent character swap -

i use piece of code when want reverse string. [when not using std::string or other inbuilt functions in c ] . beginner when thought of had ascii table in mind. think can work unicode too. assumed since difference in values (ascii etc) fixed, works. are there character encodings in code may not work? char a[11],t; int len,i; strcpy(a,"particl"); printf("%s\n",a); len = strlen(a); for(i=0;i<(len/2);i++) { a[i] += a[len-1-i]; a[len-1-i] = a[i] - a[len-1-i]; a[i] -= a[len-1-i]; } printf("%s\n",a); update: this link informative in association question. this not work encoding in (not all) codepoints require more 1 char unit represent, because reversing byte-by-byte instead of codepoint-by-codepoint. usual 8-bit char includes all encodings can represent of unicode. for example: in utf-16be, string "hello" maps byte sequence 00 68 00 65 00 6c 00 6c 00 6f . algorithm applied byte sequence produce sequen

java - Not able to access webservice using https protocol (ssl) -

we had webservice exposed on https. when try connect on https using jax-ws client, throws following exception com.sun.xml.ws.client.clienttransportexception: http transport error: java.net.connectexception: connection refused: connect means there problem on socket connection. throws exception when try call operation of webservice using webservice client. http call webservice working fine. the funny thing here problem happens when have deployed webservice , had made our first call access operations using https protocol. make http call, surprisingly after https starts working. please give advice if 1 has faced kind of issue before. in general java client should have ssl certificate in trusted key store. use keytool certificate management: keytool -import -trustcacerts -keystore trastedcert -storepass traustedcertpassword -noprompt -alias trastedcert -file trastedcert.cer your can add trusted cert jvm(cacerts): keytool -import -trustcacerts -keystore cacerts -sto

How to create objects in an array in javascript -

hi i've been coding game in javascript, first, , i'm trying create objects in array. i've written following code i'm not sure if works properly. can verify or correct this? for (i=0;i<10;i++){ objs [i] = '"i" = {x=(i*100),y=(i*100)}' } thanks i assume trying put objects in array. first declare array var objs = []; then like for (var i=0;i<10;i++){ objs[i] = {x:i*100,y:i*100} } you had lot of superflous code in there. you need learn how figure out if code works. interpreter chokes on example written. can open web tools, paste code in, , run it, start figuring out errors. here fiddle might you.

Git - update line-endings without affecting the blame -

this question has answer here: git commit doesn't override original authors in git blame 2 answers i have file has wrong line-endings. i'm wondering if there anyway fix them in commit in such way blame won't show i've modified every single line in file. i'd keep file's line history useful. looks git blame -w ... should trick based on this answer . wonder if github has blame view includes -w

haskell - Parse Array in nested JSON with Aeson -

i'm trying write fromjson function aeson. the json: { "total": 1, "movies": [ { "id": "771315522", "title": "harry potter , philosophers stone (wizard's collection)", "posters": { "thumbnail": "http://content7.flixster.com/movie/11/16/66/11166609_mob.jpg", "profile": "http://content7.flixster.com/movie/11/16/66/11166609_pro.jpg", "detailed": "http://content7.flixster.com/movie/11/16/66/11166609_det.jpg", "original": "http://content7.flixster.com/movie/11/16/66/11166609_ori.jpg" } } ] } the adt: data movie = movie {id::string, title::string} my attempt: instance fromjson movie parsejson (object o) = movies <- parsejson =<< (o .: "movies") :: parser array v <- head $ decode movies return $ movie <$&g

javascript - Fuelux datagrid on Backbone js NAN error with no data -

Image
i'm using backbone, require, fuelux, bootstrap single page web app , i'm trying fuel ux datagrid work , can see correct object sets returned fine data not inserted table nan under page count other fields in table empty. the thing being returned correctly number of objects returned. how can possible? define([ 'jquery', 'underscore', 'backbone', 'fuelux', 'sampledata', 'datasource', 'bootstrap', 'qunit', 'bootstrapdatepicker' ], function($, _, backbone, fuelux, sampledata, datasource, bootstrap, qunit, datepicker){ var initialize = function(){ var reportmodel = backbone.model.extend({ urlroot: '/careersandjobs/cnj_report', initialize: function(){ // console.log('test'); }/*, defaults: function(){ return { fromdate: new date(),

dataset - Filtering data in R (complex) -

i have dataset 7 million records. i need filter data show 9000 of these. the first field dmg primary key , take format 1-apr-123456. there 12 occurrences of each dmg value. another column o_y , takes value of 0 or 1. 0, 1 on 900 occasions. i return rows same dmg value, @ least 1 of records has , o_y value of 1. i recommend using data.table doing ( fread in data.table quite handy in reading in large data set have enough ram). i not sure following best way in data.table but, @ least, should started. hopefully, else come along , list idiomatic data.table way this. can think of right now: assuming data.table called dt , has 2 columns dmg , o_y . use o_y index key dt , subset dt o_y == 1 ( dt[.(1)] in data.table syntax). find corresponding dmg values. unique of these dmg values keys.with.ones . succinctly done follows: setkey(dt, o_y) keys.with.ones <- unique(dt[.(1), dmg][["dmg"]]) next, need extract rows corresponding these values

php - This XML file does not appear to have any style information associated with it -

trying work on website using dreamweaver , php development. on live site, found error: this xml file not appear have style information associated it. document tree shown below. <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"> <channel> <title> abcded </title> <cf:treatas xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005">list</cf:treatas> <link>http://events.sjsu.edu/default.aspx</link> <description>rss feed abcd events calendar</description> </channel> </rss> actually, are echoing xml file php page ? $xml = simplexml_load_file('url'); foreach ($xml->channel->channel $value){ $var1 = $value->link; $var2 = $value->description; } echo $var1."<br>".$var2; display in php. hope works!

Visual studio: set a data breakpoint at a memory ACCESS (i.e. when data is READ) -

i need figure out when fortran project reading element of vector. use data breakpoint on daily basis not find way set data breakpoint when code access (i.e. read) memory address, while set breaking when address modified. there way on visual studio 2010? (i use intel visual fortran compose xe 2011 compiler). or maybe updating more recent visual studio? note, saw here gdb can set breakpoint on 'memory access' in gdb? a. ps: emaild guys gdb , said not possible it.see answer below: hello, type of created watchpoint hardcoded "write". because visual studio has no support other types of watchpoints (in gui , infrastructure). perhaps possible enable read watchpoints in gdb console, require hack, console works "through" visual studio (it not pass commands directly gdb). not sure whether feature works in gdb. gdb has lot of commands have limited target scope, e.g. work single threaded programs, or linux , not when using gdbserver, etc. read watchpoint looks

jquery - HTML/JS Bootstrap Datetimepicker change format base on js event -

i working datetimepicker using bootstrap, okie me create datetimepicker difference format startpicker = $('#datetimepickerstart').datetimepicker({ format: time_format, language: 'en' }); time_format valid string datetime format. but, question: there way change format after datetimepicker initialized. example. have radiobutton change format, once radiobutton clicked, need change format correctly. have tried: $('#range_include_time_option .btn-small').click(function () { if ($(this).attr("value") == 'range_dateonly') { startpicker.format = 'yyy-mm-dd'; } else { startpicker.format = 'yyy-mm-dd hh:mm:ss'; } }); but datetimepicker still same initialized. have tried if ($(this).attr("value") == 'range_dateonly') { $('#datetimepickerstart').datetimepicker({ format: 'yyyy-mm-dd', language: 'en' }); } else { $(&

php - escaping sybase query with hexadecimal of single qoute -

i working sybase database (not of creating) , php, , see single quotes in database stored hexadecimal representation of single quote "\x16". don't believe common because i'm finding information saying escape single quote single quote sybase. escaping single quote not working database replacing ' \x16 is. question if sufficient enough do: str_replace( "'", "\x16", $search ); it works, safe replace incoming single quotes \x16? will protect against injection? should same insert, update etc. ? in sybase, there other characters need worry about? (i see double quotes , slashes stored literals (i believe word is) ) what think storage of single quotes in general?

tidesdk - Trouble Opening External Web-Page -

i'm trying open external webpage in child window using following code var secondwindow = ti.ui.createwindow("http://www.google.com"); this used work fine before stopped working, , tried open using window.location.assign("http://www.google.com"); but doesn't work either. application console output is [ti.network.analytics][error] failed url https://api.appcelerator.net/p/v1/app-track : couldn't connect server can explain me what's happening here? as far understood (just started learning sdk) can't this. define own window in app package writing html file, open using ti.ui object , external html content using httpclient of ti.network namespace. load needed html content or other json maybe , implant window html dom. example: first, create new window using own html file: ti.ui.createwindow("app://special-window.html") in file execute javascript external resources html: //request url var url = 'http://m

Bootstrap-datetimepicker-rails -

i trying make bootstrap-datetimepicker-rails work i'm having issues. followed instructions on https://github.com/lubieniebieski/bootstrap-datetimepicker-rails however, when try put in these lines @import 'bootstrap'; @import 'bootstrap-datetimepicker'; into boostrap_and_overrdes.css.less file, says bootstrap.less , bootstrap-datetimepicker.less can't found. @import 'twitter/bootstrap/bootstrap' works when manually add bootstrap-datetimepicker.less file tarruda, doesn't work because first line in is @import "variables.less"; @import "mixins.less"; and don't have variables.less or mixins.less file things @whatever , .border-radius not work. installed twitter bootstrap twitter-bootstrap-rails , added gem less-rails. github: https://github.com/ninajlu/videos you should read documentation on github page more precisely: or if you're having problems (or using less) require in main stylesheet

How do I find the number of given days between two dates in Javascript? -

this question has answer here: how number of days between 2 dates in javascript? 27 answers i have 2 arbitrary dates, lets april 1st 2012 , january 15th 2013. want calculate number of sundays, mondays, tuesdays, wednesdays, thursdays, fridays, , saturdays between 2 dates. is there surefire-quick way without crippling users cpu/browser? thanks update the premise of is, have defined average number of events given day of week. need calculate number of events happen in time period, partials (like 1/2 day of sunday half number of events added total) ok, here possible untested solution date1 = new date("2012-02-10"); date2 = new date("2012-03-10"); daysinbetween = (date2.gettime() - date1.gettime())/1000/3600/24; dayoftheweek1 = date1.getday(); weeks = parseint(daysinbetween/7, 10); extradays = daysinbetween%7; you have weeks + 1

navigation - When navigating on a site, how can i make animations complete fully before browser jumps pages -

i want use animate.css in webpage, on navigation menu. e.g menu flies out of screen navigating. main problem is: how can delay page load i'm clicking until animation complete. right animation cut off because next page loads. $(document).ready(function(){ $('#list').click(function(){ $(this).addclass('animated shake'); window.settimeout( function(){ $('#list').removeclass('animated shake'); }, 1000); }); }); there promise() in jquery > 1.6 . can queue request of going further waiting promise(). $("button").on( "click", function() { $("p").append( "started..."); $("div").each(function( ) { $( ).fadein().fadeout( 1000 * (i+1) ); }); $( "div" ).promise().done(function() { $( "p" ).append( " finished! " ); }); }); http://api.jquery.com/promise/

scroll - Stop Javascript .scrollBottom function -

my .scrollbottom button works, once auto scrolls bottom can't manually scroll because active , scrolling down. need scroll absolute bottom , stop? javascript var timeout; function scrolltobottom() { if (document.body.scrollbottom!=0 || document.documentelement.scrollbottom!=0){ window.scrollby(0,20); timeout=settimeout('scrolltobottom()',10); } else cleartimeout(timeout); } html <a href="#" onclick="scrolltobottom();return false">button</a>

Plot multiple histograms in R with prob=TRUE -

i want plot multiple histograms in r not show frequency, density instead: a <- rnorm(100) b <- rnorm(100) hist1 <- hist(a,prob=true,breaks=30) hist2 <- hist(b,prob=true,breaks=30) plot(hist1, col="red",lty=0, xlim=c(-4,4)) plot(hist2, col="blue", lty=0, xlim=c(-4,4), add=true, main="example") lines(density(a)) however, 'prob=true' option apparently doesn't go through when plotting objects. can explain me doing wrong? leave prob=t out of hist() command hist1 <- hist(a,breaks=30) hist2 <- hist(b,freq=f,breaks=30) and put freq=f plot command. plot(hist1, col="red",lty=0, xlim=c(-4,4),freq=f) plot(hist2, col="blue", lty=0, xlim=c(-4,4), add=true, main="example",freq=f)

html - Need my div dropdown menu to hide text when not hovered -

i'm trying dropdown menu div. transition on div fine , working great. don't know how text that's in dropdown area hidden when i'm not hovering? html code. not droping down should. don't want menu hidden text writen below it. <div class="dropdown">menu <br/>games <br/>food </div> css code. transitions , all. div.dropdown { position:absolute; width:920px; height:20px; top:110px; left:50%; margin-left:-460px; z-index:1; background-color:gray; -webkit-transition: height 2s ease; background:black; text-align:center; color:white; } div.dropdown:hover { height: 45px; -webkit-transition: height 0.1s ease; } you can use css: overflow: hidden; in .dropdown class. this allow hide displays outside of elements bounds. here's fiddle

vb.net - FileSystemWatcher - Reduce Multiple Event Raising (or Reduce Results of Multiple Events) in Visual Basic (VS 2012 V11) -

i'm trying reduce number of events raised 1 when filesystemwatcher changes (or @ least display text in textbox once when event raised, either removing duplicate text or other method). is there fix in visual basic , or @ least anyway remove duplicated text have being appended status log textbox (when onchange sub called)? i've done decent amount of research on , looks there no "simple" fix. here list of resources: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx (the microsfot documentation includes notification filesystemwatcher may raise more 1 event.) http://weblogs.asp.net/ashben/archive/2003/10/14/31773.aspx (an article states, "to correct problem [two events being raised], remove explicit event handler (addhandler ...)." there no further explanation "...remove explicit event handler (addhandler ...)." means.) why filesystemwatcher fire twice (this question asked states "what "remove expli

e commerce - how to autogenerate transaction ID during checkout in Opencart? -

i trying integrate payment gateway (www.sslcommerz.com.bd) in opencart requires submit transaction id @ time of checkout. transaction id needs stored in database , gateway save transaction id sort of future queries , cross checking online store system verification of payment completion. new opencart. can please give idea how should approach achieve that? in advance. take @ 1 of other modifications payment gateways in version(s). paypal standard best option. see order id set in session variable generated checkout , can accessed in payment gateways' template file/through controller file. session variable is $this->session->data['order_id']

Android Webview loadUrl works but not loadDataWithBaseURL -

i have files downloaded app's storage @ file:///data/data/<myapp>/files/folder/ . files downloaded folder include html, css, js , image files . when using webview's loadurl, following code works me: webview.loadurl("file:///data/data/<myapp>/files/folder/filename.html"); but need download html file because need encrypt before storing it. problem not encrypting information (at moment). trying download html content string , use webview's loaddatawithbaseurl load webview. when trying this, getting "uncaught syntaxerror" , "uncaught referenceerror" web console. i'm not sure these errors coming from. i'm using following code download html string: url url = new url("myserver/filename.html"); inputstream input = null; input = url.openconnection().getinputstream(); bufferedreader br = new bufferedreader(new inputstreamreader(input)); stringbuilder sb = new stringbuilder(); string line; while((line = br.re

using php or javascript to see if it's "my iPad" -

is there easy way check via php or javascript whether it's "my ipad". basically, i'd mobile testing , hope use function: if (itsmine()){ //do stuff } (i know 1 way check ip address, great if there ipad specific) i'm not familiar ipad, surprised, scratch that, i'd flabbergasted if there such option. such option mean ipad individually trackable without owners consent or knowledge. if there such option woild not remain long. your best option use cookies. create page on site leaves specific cookie on device , test it.

gawk - Latin characters in AWK -

i have question latin-1 characters in awk, example ï (an 2 dots above (239)). when replace ï in string created in awk (i replace 2 dots one), works: a="aïda" a=gensub("ï","i","g",a) but when do, awk ' { $0=gensub("ï","i","g",$0) }' \ <(cat units.csv) where string "aïda" in file units.csv, ï not substituted, apparently not in awk. don't understand. don't know how see is awk instead of ï. thanks, eric j. awk won't write change original file (input), have output tmp file, in awk script, didn't output anything the cat part not needed awk '..' file gensub not necessary in case, gsub may work requirement. both work fine see example: kent$ cat file ï ï ï ï ï kent$ awk '{$0=gensub("ï","x","g")}1' file # (or awk '{print gensub("ï","x","g")}' file) x x x x x ke

MySQL unknown column (is in table) -

my table structure: inventory_items: create table `inventory_items` ( `id` int(10) unsigned not null auto_increment, `name` varchar(50) default null comment 'usually used invoice number', `vendor_id` int(10) not null default '1', `item_type_id` int(10) unsigned default null, `item_model_id` int(10) unsigned default null, `condition_id` int(10) unsigned default null, `item_functionality_id` int(10) unsigned default null, `color_id` int(10) unsigned default null, `quantity` int(10) unsigned default null, `original_qty` int(10) default null, `note` text, `zone_id` int(10) unsigned default null, `rack_id` int(10) unsigned default null, `shelf_id` int(10) unsigned default null, `bin_id` int(10) unsigned default null, `status` char(1) default null comment '1:checkedin;2:transferred', `reserve` tinyint(1) not null default '0', `log` text, `user_id` int(10) unsigned default null, `created` datetime default null, `modified` datetime d

ios - Having trouble getting the date from a JSON call -

i pulling date json in format of "1900-01-01t00:00:00-06:00" the code trying (and failing parse with) this nsdateformatter *formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss.ssszz"]; tempdate = [formatter datefromstring:trimmedstring]; i want display pull in mm-dd-yyyy format after date in correct format. i not sure of how many sss , zz's need @ end, , have tried multiple combinations no avail. suggestions? you need 5 "z"s [dateformatter setdateformat:@"yyyy-mm-dd't'hh:mm:sszzzzz"];

java - Displaying all XYSeries at once in jFreeChart for improving speed -

Image
suppose need display multiple xyseries in single xyseriescollection . problem every time add xyseries , jfreechart wants update chart , slows down process of displaying multiple xyseries . what want similar this: // not update chart xyseriescollection.add(xyseries1) xyseriescollection.add(xyseries2) ... xyseriescollection.add(xyseries10) // update chart how can this? construct new xyseriescollection having desired series, , invoke setdataset() on xyplot . generate single datasetchangeevent . addendum: here's sscce updates n series, each having n 2 values. performance question, example may helpful in profiling . import java.awt.borderlayout; import java.awt.dimension; import java.awt.eventqueue; import java.awt.event.actionevent; import java.util.random; import javax.swing.abstractaction; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; import org.jfree.chart.*; import org.jfree.chart.plot.xyplot; import org.jfree.dat

azure - Why does it take so long to get through first level retries? -

i've started playing around nservicebus on azure, , reason takes long time through first level retries when message handler throws exception. retries set 5 takes 20+ minutes before second level retries kick in. what causing delay? here's how i'm configuring bus: configure.transactions.advanced(s => { s.disabledistributedtransactions(); s.donotwraphandlersexecutioninatransactionscope(); }); configure.with() .autofacbuilder(container) .definingcommandsas(t => t.iscommand()) .definingeventsas(t => t.isevent()) .xmlserializer() .messageforwardingincaseoffault() .azureconfigurationsource() .usetransport<azurestoragequeue>() .azurediagnosticslogger() .azuremessagequeue() .azuresubcriptionstorage() .useazuretimeoutpersister() .unicastbus() .runhandlersunderincomingprincipal(false); fyi: i'm using nservicebu

java - Adding an element to a singlechained linked list -

Image
okay, solution easy don't understand @ moment. code: listelem<t> first; int size = 0; public void add(t value) { if (value == null) return; listelem<t> elem = new listelem<t>(value); elem.next = first; first = elem; size++; } how add element @ beginning of singlechained linked list? create new element given value. what happens in next 2 lines? understand process of inserting element in list i'm not able relate code. and first? head? before adding stack looks : first -> next -> next -> ... -> end; you create elem. then said "the next elem of elem first elem". elem.next = first; have elem -> first; finally set first elem elem. stack looks : elem -> first -> next -> ... -> end; and first id elem return first state : first -> next -> next -> ... -> end; (first new elem added) this schema may helpful :

java - jsoup : Absolute path while working with files -

i got page repository html files. want process them using jsoup, when try absoloute paths of links jsoup gave me empty strings (""). there possiblity set baseuri file path ? solution : link.get(i).baseuri + link.get(i).attr("href") not sufficient me becouse need how recognize link relative or not. the jsoup documentation says : there sister method parse(file in, string charsetname) uses file's location baseuri. useful if working on filesystem-local site , relative links points on filesystem. but doesn't work on pc. you can use absurl()-function in jsoup elements. string path = linkel.absurl("href");

android - Accessing images saved by Chrome -

i'm writing folder watcher, have had working on devices, not devices seem save same location. i'm trying allow users save image web app, using chrome, presence of new file should kick off process. on samsung galaxy tablet, images saving /mnt/sdcard/download/ , have no problems monitoring folder. but on samsung galaxy iii phone, going here /storage/sdcard0/android/data/com.android.chrome/files/download i'm having permissions issues monitoring folder. so guess question 2 fold. there simpler way of detecting these images saved to? using internal_content_uri , external_content_uri, doesn't me there phone. if there issue accessing folder on phone, can resolve this? i ended hard coding path following external_content_uri. final string protectedpathtowatch = android.os.environment.getexternalstoragedirectory().tostring() + "/android/data/com.android.chrome/files/download/"; then read path, had add special permissions. <uses-permission an