Posts

java - Android: Adding a Drawable to an existing LayerDrawable -

i have layerdrawable construct array of drawables of 5 drawables. let’s in run-time want add drawable layerdrawable, in response event. how do without having re-create layerdrawable, time array of drawables of 6 drawables? thanks. after layerdrawable created, new drawables can not added it. see source of layerdrawable : array of drawables saved in mlayerstate.mchildren , set in constructor. however, setdrawablebylayerid(..) can used exchange existing drawable new one.

jquery - Storing HTML or XML code in javascript variables -

i'd store html/xml markups in javascript variable. problem text relatively large. example how can store following xml piece in javascript variable? <questionform xmlns="[the questionform schema url]"> <overview> <title>game 01523, "x" play</title> <text> helping decide next move in game of tic-tac-toe. board looks this: </text> <binary> <mimetype> <type>image</type> <subtype>gif</subtype> </mimetype> <dataurl>http://tictactoe.amazon.com/game/01523/board.gif</dataurl> <alttext>the game board, "x" move.</alttext> </binary> <text> player "x" has next move. </text> </overview> <question> <questionidentifier>nextmove</questionidentifier> <displayname>the next move</displayname> <isreq...

awt - Inserting text into another program's text field using Java -

i've searched website , couldn't find answer problem. i'm trying write program in java input text , submit java program. so far, know 1 option using robot think mean need know program's text box on screen. any suggestions appreciated, , if easier in c++ okay that. thanks in advance help without cooperation other java application, choices (both bad) robot , jni

compiler construction - C++0x TMP compilation speed -

this question focuses on template metaprogramming constructs. have found 2 articles ( one , two , 2 doesn't show hard evidence, trust claims) provide evidence showing c++0x prototype compilers turn exponential compilation times linear compilation times. i have vague inkling auto, decltype , variadic templates have enablers of this. see ground explanation of changes languages , compiler technologies enable this, explaining how , why. in terms of skill level, have used boost tmp library spirit in anger, , toy mpl programs. it's clear first slower process compiler second , there is, say, evidence that . /* first */ template<typename a> void f(a const&); template<typename a> void f(a&); template<typename a1, typename a2> void f(a1 const&, a2&); template<typename a1, typename a2> void f(a1&, a2 const&); template<typename a1, typename a2> void f(a1 const&, a2 const&); template<typename a1, typename ...

osx snow leopard - Mac os x: How to have makefile reference /Applications/application -

os mac os x 10.6.6 emacs 23.2.1 i'm trying install magit on carbon emacs using proposed make solution. i'm complete makefile newby might on complete wrong path altogether. makefile displays: %.elc: %.el $(batch) --eval '(byte-compile-file "$<")' which gets expanded to: emacs -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \".\") load-path))" --eval '(byte-compile-file "magit.el")' what understand. comes with: cannot open load file: subst-ksc what after bit of googling reveals missing libraries. realized emacs referenced in expanded command pointing /usr/bin/emacs 1 big file, don't see normal lisp / site-lisp / etc directories. know prefered emacs carbon emacs located in /application/emacs.app opens when clicking on it, or alternatively, can open in terminal: open /application/myapp.app finally title question: how can make makefile using emacs.app on applications directory...

Modularizing CSS files -

many people keep number of external css , javascript files minimum reduce round trip time. example, google recommends maximum 2 css , javascript files per web site, respectively. the problem is, i've broken css code several files depending on nature part of "modularization". example, i've put css code used in part of application in separate file. result, files have less hundred lines of code. i'm java develper, , recommended practice in java, css totally different creature , don't know css. here questions. does make sense keep many css files see fit readability , maintainability? how many css files manageable in web project? what's average number of css files in web applications you've worked on in past? i agree other have said here, yes when develop have muliple css files, production should merge minify them. however not agree should merge them 1 single file. mean people want visit home page must wait css on pages x,y,z downlo...

java - Other options for lossless image saving in Android? -

my application needs save large images in lossless format. i'm willing sacrifice disk space speed of saving , i'd prefer save in standardised format instead of rolling own. i've found built-in .png encoder slow needs, taking 5 seconds save 1000x1000 image. i've found can save images quicker saving raw pixel values disk (i.e. no compression) , saving raw pixel values compressed java's deflate class tweaked compression settings. unfortunately, there no option alter android's png compression level know of. what options have? i'm prepared use ndk i'm cautious using external library hasn't been tested on android. example, libtiff candidate can't find info on getting working in ndk , how stable is. just throwing out there newest version of opencv 2.2 comes ndk port android. includes several image libraries including libpng , libtiff. i haven't tested use of via jni interface or stability @ least compiles readily android using n...