Posts

Handling standby on iPad using Javascript -

regarding ipad events, how determine if/when ipad changing awake state standby state? what put mobile-safari web app in locked state whenever ipad becomes inactive/standby , ask pin when becomes awake again. i agree there ought signal can hook on to know when application goes sleep , when wakes up, should able figure out when safari wakes indirectly. when webview goes background, safari puts in sleep. pauses video, defers network request, stops updating ui , pauses setinterval/settimeout operations. js never aware (as far can tell) how these things happened, can tell has happened. simplest way use build regularly invoked method , check see if it's been unexpectedly long time since last update. if expect update every 10 seconds , it's been 5 minutes, can sure device has woken up. here's quick example thought up: var inttime = new date().gettime(); var gettime = function() { var intnow = new date().gettime(); if (intnow - inttime ...

performance - My Drupal site uses approx 30mb per page (node & user profiles) load. Acceptable or not? -

i using drupal , website uses approx 30mb per page load nodes , user profiles. website has round 150 contributed modules in addition few core optional modules. of them small , installed improve user experience. my php memory limit 128mb. is 30mb per page acceptable?? , how many page loads can handled in 128mb?? any idea? honestly, @ 30mb app sipping on memory. php memory limits set pretty low. as far how many "page loads can handled 128mb" of memory, well, that's not valid. when request comes in, apache (or whatever server you're using) hands request mod_php or fcgi , php code interpreted, compiled, run, , quit. "application" doesn't act daemon waiting requests come in, memory consumes used duration of request , gets released use other requests/processes. that 128mb limit per request . means long have enough memory (and apache child processes, etc) can handle additional requests. if want see how application performs under load, che...

c# - How to enable Virtual Space in AvalonEdit? -

i want achieve "virtual space" functionality, similar 1 in visual studio, in avalonedit. i.e. caret positioned beyond end of text line, , if press key, there spaces automatically added match. i used feature, neither googling nor studying avalonedit's code gave me clues on how enable it, if supported @ all. if not, suggestions how extend caret handling mechanisms nice. thanks! edit: virtual space support has been added avalonedit in version 4.2.0.8283. set texteditor.options.enablevirtualspace = true; . below original answer. it's not supported. if want try adding it, make sure read "coordinate systems" documentation (in file on codeproject). you'll want extend "visual column" positions after line end valid. , you'll have adjust position<->column calculations (visualline.getvisualcolumn , friends). use textview.widespacewidth figure out columns past end of line. the above should allow use mouse place ca...

php - Generate custom Windows-based EXE installer from *nix webserver on the fly (OpenVPN client custom installer) -

this related this other question . need dynamically generate custom windows exe installer *nix machine (running php, or whatever) contains custom files installed on client's machine. this used generate client-specific openvpn installers based on preferences , authentication information. runtime not important, can done async. some ideas, tried , not working: use scheme similar ninite.com, downloaded executable same, filename different, installer uses information in filename make decisions. using resource editor edit prebuilt installer's resources. not unix resource editors windows executable rare, creates new problems, , don't solve problem of different files being installed. what work best nsis/innosetup compiler (targeting windows) running on unix, other inventive solutions okay. answering own question, seems both nsis (used default on openvpn source code) , inno setup can run on linux. inno setup can used under wine, it's command line utility...

Maven annotation processing with maven-compiler-plugin -

i try compile code contains annotations generate source code. use maven-compiler-plugin , build-helper-maven-plugin . pom looking that: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>2.2</version> <configuration> <source>1.6</source> <target>1.6</target> <generatedsourcesdirectory>${project.build.directory}/generated-sources/apt</generatedsourcesdirectory> </configuration> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>build-helper-maven-plugin</artifactid> <version>1.5</version> <executions> <execution> <phase>generate-sources</...

xcode - UIPopovercontroller detached from UIButton -

i'm running problem detached uipopovercontroller , hoping has seen behavior before. my app runs in landscape mode , offers number of popover elements using presentpopoverfromrect call. launched within top view while others presented view buried deep in display. popovers seem work fine if popover presented upper 2/3rds of ipad's display when attempting launch popover bottom 1/3 of display popover displayed detached uibutton. x coordinate appears correct, y coordinate of popover tends in middle or top of ipad screen. i've played around presenting popover using fixed position creating cgrect object in lower 1/3 of display when ipad renders popover either renders popover in upper 2/3rd of view or bottom of screen (if force cgrect value large y value). at point i'm out of ideas , hoping on forum has seen or can make suggestions try. thanks , help, wes i able fix issue , thought i'd share solution incase else has same problem. the solution add c...

java - How to Insert Image into JTable Cell -

can point me in right direction on how add image java table cell. jtable provides default renderer icons. need tell table data stored in given column can choose appropriate renderer. done overriding getcolumnclass(...) method: import java.awt.*; import javax.swing.*; import javax.swing.table.*; public class tableicon extends jframe { public tableicon() { imageicon abouticon = new imageicon("about16.gif"); imageicon addicon = new imageicon("add16.gif"); imageicon copyicon = new imageicon("copy16.gif"); string[] columnnames = {"picture", "description"}; object[][] data = { {abouticon, "about"}, {addicon, "add"}, {copyicon, "copy"}, }; defaulttablemodel model = new defaulttablemodel(data, columnnames); jtable table = new jtable( model ) { // returning class ...