Sunday, June 8, 2014

java apidocs for websockets

working thru the websocket examples in tomcat 8, and realize that i don't have javadocs for the javax.websocket stuff. this is a chronic annoyance with java - you're using interfaces that are pretty "standard", and they turn out to live in javaEE. and the apidocs are licensed in a way that platforms that implement the standard can't include the apidocs. so you're left with a lobotomized IDE with zero javadocs. it's dumb

for tomcat 8, netbeans 8 and the websocket and servlet stuff:

oracle is evil ...
  • apidocs for standards should be liberally licensed
    • this is "embrace, extend and extinguish" in all it's glory
  • websockets and servlets don't belong in javaEE, they're standard web technologies

Wednesday, June 4, 2014

netbeans "package does not exist" error -- maven considered harmful

upgraded to netbeans 8 and found a bunch of cryptic errors in my projects:
package XXXXX does not exist
in this case XXXXX was a package provided by another netbeans project. it does indeed exist, the jar is being built properly and compiling the "broken" project succeeds and the application runs. so this is purely a problem with netbeans parser / indexer. i tried removing the dependency and re-adding it, cleaning and rebuilding, and exiting netbeans, removing the cache and restarting. nothing helped

looking thru messages.log, i see
WARNING []: Ignoring root with no ClassPath: /home/YYYYY/working/nq0/XXXXX/XXXXX.git/src
didn't find much mention of that warning on the interwebs. looking at the "project properties" page for the project i realized i'd seen this problem before and started fiddling

the problem is that buried in the XXXXX directory, there's a pom.xml. netbeans detects this and somehow modifies how the project is managed. it's a "project with existing sources", not a maven project. but somehow netbeans fails to honor that when it finds a pom.xml

my solution was to deactivate the maven plugin (why that gets installed in the first place is beyond me). which eliminates the issue (i reactivated it temporarily to verify that that was actually the problem). this happened when i upgraded to netbeans 7, and i'm sure this will happen again when i upgrade to 8

maven is terrible, and the plugin makes it worse. it's the wrong metaphor for managing dependencies

Ivy Bridge integrated graphics corruption, small groups of braille-like dots, giving a snow-like appearance

for the last 10 years i've used AMD-based computers that i "built" myself, replacing the mb/processor/mem a bunch of times. for my last upgrade, i switched to intel. i've got 2 similar systems, both with core i3s, one 2105 and the other 3220, both using the integrated "Intel HD Graphics". i run ubuntu linux. after 6 months, the 3220 system started to display a visual glitch. i described it first here: i'd get a shifting pattern of dots overlayed on top of the windows. the dots show up in a screenshot, suggesting that the problem is with the cpu/mb/mem

at first, the problem was manageable - the dots rarely obscured what i was reading and the machine never crashed. i wasn't sure if the problem was hardware or something that ubuntu was doing, so i lived with it and in some ways even liked it, in a "ghost in the machine" sort of way. but over the next year the problem got somewhat worse and at this point the problem had persisted thru several ubuntu versions (including a clean reinstall that i'd done for the sake of seeing if some configuration change i'd made was part of the problem), so i was forced to track down the cause

i "live chatted" with intel support and they told me to run the intel processor diagnostic tool. the standard tool is windows-only, but they include a link to a fedora15-based liveUSB version. the instructions seemed cryptic to me, the utilities were ".exe"s, possibly directed to windows users (though why they wouldn't just use the standard tool ???) and the intel support team stated:
Alberto: the thing is that we are not that familiar with Linux

so they were useless. tl;dr - it took me (much) longer than it should have to run the tool. but eventually i got it running, the "snow" still appeared (ie, the fedora15 system exhibited the glitch), but the tool reported that all tests passed, ie the tool was useless (it didn't verify that the generated images matched the desired values). fwiw, here's the easiest way i found to use the tool:
  • download the iso (eg, this one)
    • i'll call it ipdt.iso for simplicity
  • insert a usb drive (i'll call this /dev/sdX)
    • we're going to overwrite the drive, so *all data* on it will be lost
    • if it automounts, unmount it
    • in my case, it was recognized as /dev/sdd
  • dd bs=4M if=ipdt.iso of=/dev/sdX
  • insert the usb drive into the target computer and boot from it
    • most modern systems support boot-from-usb. if yours doesn't, maybe you could burn a cdrom ???
  • fedora should boot up
  • open up a terminal and type (for a 64bit system)
    • install64
    • click the "ipdt" icon on the desktop
next, intel suggested i swap CPUs between the 2 systems. i did this and the problem (ie the "snow") followed the 3220. the 2105 CPU showed zero symptoms in either machine. at this point, intel agreed that the CPU was probably faulty and they've presented me with two warranty options

  • Standard Warranty Replacement: This is when you send the processor first to us, and then once we receive it, it takes 5-8 business days for you to receive the replacement processor.
  • Advance Warranty Replacement: This is when we send you the processor first, and then, once you receive it you just need to send your defective processor back to us. There is a fee on this option, $25, not refundable, that covers the overnight shipment of the processor to you, and also it covers the shipping for you to send the defective processor back to us. And also for security reasons, we are going to charge the price of the processor to your credit card, just in the meantime, as soon as we get your defective processor we will do a refund for that amount.
those are both pretty horrible options. this is *intel's* poor workmanship resulting in me living with a minor annoyance for over a year, ultimately forcing me to spend 2 work days tracking down the problem, their diagnostic tool failed to detect *any problem*, and now they want me to pay $25 to replace it or else live without a working computer for on the order of 2 weeks. pretty ridiculous

grrr intel. but whatever. they're a monopoly and i don't have much choice. maybe next upgrade cycle i'll go back to AMD (if intel hasn't driven them to bankruptcy yet). i submitted the serial number they requested and am waiting on shipping info

Friday, March 14, 2014

books to read next 2014 edition

note to self ... keep a list of books to read (or reread) here the bell jar frankenstein

Monday, March 3, 2014

ubuntu 13.10 + unity + libreoffice mnemonics == FAIL

ever since ubuntu switched to unity, mnemonics (eg, alt-f to open the File menu) have been a disaster. 13.10 and LibreOffice are perhaps the worst offenders ... mnemonics don't work *at all*

This ubuntu bug report has been open for 3 years with no progress. At various times, mnemonics have worked briefly with some magic ever changing invocation, perhaps installing lo-menubar or some specific version of LO not in the repository. The bug report is labeled "High Priority", but is Unassigned (does that mean "high priority to no-one"). With 13.10 i don't believe that there is any way to make the unity integrated menus work correctly. There is some chatter online that 14.04 will bring menu bar sanity, but i haven't seen anything explicitly mentioning mnemonics

The LibreOffice bug report is closed as NOTOUTBUG, because someone once heard that someone else thought it was a generic Gnome problem. no link to another bug report, roadmap to a fix, no comment from the 2nd hand source, nothing. way to take responsibility. though in general, i'm all for blaming Gnome because *fuck those guys* for forcing gnome-shell on us and it probably is their fault

The workarounds that are proposed are

I haven't tried the first option - it seems pretty drastic since unity is the *recommended* way to use Ubuntu. I'm more inclined to switch to Mint, but that too seems pretty drastic. The second option is completely unusable (and i've tried multiple versions and sources of LO). My current approach is to purge libreoffice and install openoffice (untar and dpkg -i *.deb). OpenOffice seems usable

Evince and some other apps have shown similar issues, but so far i've managed to live with them. Maybe one of them will eventually force me to Mint or to uninstall Unity

As shipped, Ubuntu 13.10 doesn't have a usable office suite, which is one of their key features. I can understand Free Software being buggy, but the false advertisement of claiming things are working is bullshit

Get things done

We understand how important your computer is for day-to-day tasks. Whether it's finding information online, sending emails to colleagues and friends, or creating and sharing documents, Ubuntu has everything you need to get things done. Fast.

I guess they don't mention "use a keyboard". Assholes

Friday, January 31, 2014

ubuntu 13.10 libreoffice menubar lossage

it's 2014 and ubuntu still doesn't have a usable libreoffice package - out of the box, the menubar shortcuts (or mnemonics) don't work. pressing "alt-f" has no effect, the file menu fails to activate, nothing. this is *the* office suite on linux, the most critical package for a business user, lacking perhaps the oldest and most-used metaphor for interacting with a gui

freedesktop calls it "NOTABUG", ubuntu doesn't seem interested in fixing it (no-one is assigned after almost 3 years), and anyone that posts on askubuntu gets closed as "offtopic" with a snarky comment. for now, the options available are:
  • uninstall libreoffice-gnome, leaving an ugly interface that doesn't maximize correctly
  • uninstall libreoffice entirely using apt and install the package from (or maybe from a ppa) ... i haven't verified that this works, but there are some reports that it does
in 2010 when ubuntu introduced unity i understood that it was a new endeavor and expected some rough edges. but even then, this bug seemed egregious ... we're now up to ubuntu 13.10, unity is no longer new, and we still don't have usable shortcuts for libreoffice menus

Tuesday, January 14, 2014

books to read

just keeping a running list here for my own sake wharton watershed down

Monday, October 21, 2013

lightdm invalid session - screen blanks and greeter restarts

in the process of reinstalling ubuntu raring 13.04 (or possibly during the initial upgrade to 13.04 from 12.10) lightdm got confused. it would display the greeter, i'd provide my password and then it would attempt to start my session, ie the screen would go momentarily black. but instead of starting unity, it would fail and restart the greeter. i don't have any of the old logs, but i believe the message was to the effect of "invalid session: xterm". (i believe that i set this session fucking around with settings, but it could also have been an valid session that has since been deleted - when i reinstalled i omitted many packages)

the greeter didn't give an option to choose a session, so i had to talk to dbus directly (which may very well be how i got in trouble in the first place:)

# list the sessions (ignore the .desktop suffix) # note: they might not all be valid, eg because the software hasn't been installed ls /usr/share/xsessions # get the dbus name for the current user user=$(dbus-send --print-reply=literal --system --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.FindUserById int64:$(id -u)) # set the session (replace ubuntu with another valid session if desired) sudo dbus-send --print-reply --system --dest=org.freedesktop.Accounts $user org.freedesktop.Accounts.User.SetXSession string:'ubuntu' lightdm should really provide a means to select your profile. by default, it doesn't if there's only one valid session. however, the session that it uses is the "current session", ie the one that it gets from dbus, which might not be the valid session. little bit of catch-22. in theory, i should submit a bug report. in reality, canonical will sit on it for 7 years regardless, so fuck em

Friday, September 20, 2013

clone root partition via rsync (to handle 512 vs 4k sector size)

my root partition is failing, giving random io errors during boot. it's a 5 year old 180G hdd using 512 byte sectors. the modern replacement is a 1TB hdd with 4096 byte sectors. so a straight up dd isn't an option. need to do a file by file copy instead mount /dev/sdc1 /mnt # -x limits rsync to a single partition rsync -avxHSAX / /mnt/ for ii in /dev /dev/pts /proc /sys /run; do sudo mount -B $ii /mnt$ii; done sudo chroot /mnt grub-install --recheck /dev/sdc update-grub # label the partition for use in fstab e2label /dev/sdc1 mylabel blkid -c /dev/null gedit /mnt/etc/fstab the error messages are somewhat cryptic. from syslog: ata2.00: exception Emask 0x0 SAct 0x4 SErr 0x0 action 0x0 ata2.00: irq_stat 0x40000008 ata2.00: failed command: READ FPDMA QUEUED ata2.00: cmd 60/08:10:d7:00:19/00:00:0b:00:00/40 tag 2 ncq 4096 in res 51/40:08:d7:00:19/00:00:0b:00:00/40 Emask 0x409 (media error) ata2.00: status: { DRDY ERR } ata2.00: error: { UNC } ata2.00: configured for UDMA/133 sd 1:0:0:0: [sda] Unhandled sense code sd 1:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE sd 1:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor] Descriptor sense data with sense descriptors (in hex): 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 0b 19 00 d7 sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed sd 1:0:0:0: [sda] CDB: Read(10): 28 00 0b 19 00 d7 00 00 08 00 end_request: I/O error, dev sda, sector 186187991 ata2: EH complete and fsck shows some errors, eg "Attempt to read block from filesystem resulted in short read" and some unattached inodes
using rsync to clone
installing grub via chroot

Friday, April 12, 2013

MapDB (aka jdbm3++) first look

took a quick look at mapdb today (which is jdbm3++)

looks promising, but not the holy grail

CONS: appears to require a max size on keys. kind of a pain to setup. examples and benchmarks appear very simple. believe it's using mmap (which is fundamentally limited). appears to be a single thread for writes and a thread per read ???

PROS: appache2 license, java interface

i didn't investigate the internals much, in particular the mvcc

Thursday, April 4, 2013

ubuntu 12.10 unity ivy bridge visual glitch

have been running ubuntu 12.10 on ivy bridge for months. last night i started getting weird visual artifacts - looks like a braille patterns superimposed on the screen ...

anyone seen anything similar ?

update: if i leave glxgears running in the background the patter disappears and doesn't come back. also found an *old* post about something similar

Monday, March 18, 2013

webstorm 6 lossage

still experimenting with webstorm and it seems that the underlying javascript language model is pretty good, but the interface is failing to expose some important aspects, crippling the IDE. hoping that things will improve in the 7.0 cycle

the best indication that the language model is working is that for a js file that's been properly jsdoc'd

  • for prototype methods, webstorm displays up and down arrows in the left margin which list (and navigate to) the super and subclass method implementations
  • for most method calls, 'go to declaration' navigates to the correct method (as defined by the jsdoc comments)
taken together this shows that webstorm is modeling the underlying javascript quite well. based on this knowledge, it should be able to implement the standard navigation that IDEs provide for java. however, the UI fails to expose these features
  • 'find usages' and 'rename'
    • list method calls in any object with the same method name
      • should filter by reverse mapping (ie, the one that 'go to declaration' uses)
    • don't have the option to sort by order in the file - iterating the list results in a non-monotonic walk of the documents
    • ignore method implementations with the same name in sub and super classes, ie methods that are overridden or override
      • should find (or have the option to find)
      • rename *must* rename all implementations and causes hard to track down issues when it doesn't, ie it loses the relationships that the model had established prior to the rename (thank god for git)
  • 'go to super method' does nothing (same mapping that is used to provide the up arrow in the margin should be used)
in spite of great promise, the refactoring capabilities are hobbled - i find myself reading in webstorm and switching back to netbeans to do renames since the webstorm versions are destructive and simple text based replacement is superior in many cases

a few other failings
  • no easy way to type unicode characters (in most apps on ubuntu, control+shift+u captures a unicode hex value, eg ᵩ is u+1d69)
  • display of unicode characters using a monospace font aren't monospaced, eg:
  • macros suck, eg scrolling up or down 10 lines is very slow and problematic
planning on buying 6.0 in the hopes that things will improve during the 7.0 cycle (licenses include updates for 1 year)

Thursday, March 14, 2013

the genius of unicode in javascript identifiers

intellisense for javascript sucks !

i've used recent versions of webstorm (jetbrains javascript IDE) and netbeans, and older versions of eclipse and a few others. and i've googled and read extensively - as far as i can tell webstorm has the best support for javascript code understanding (netbeans used to be a close 2nd, but the latest nb7.3 version has been a step backwards and ws6 is a step forwards - leaving a gap)

but even in webstorm it sucks. for the most part 'find usages' just does a text search - it can't distinguish between 2 methods with the same name in unrelated prototypes, even in the simplest cases with enough jsdoc annotations to make it unambiguous. 'go to declaration' works some of the time, but still fails often in cases where plenty of information is available

i spent some time submitting bug reports, trying new IDEs, annotating extensively with jsdoc, refactoring my code to be easier to parse, etc. to little effect and i've ultimately accepted that the only way to be able to reliably navigate in javascript code is by using unique indentifiers

i tried a number of schemes

  • long java-style names, eg setDayOfWeek
  • various prefix schemes using the same prefix for all methods in a prototype, eg for the ViewDiary prototype i might have vdSet and vdMerge or vd_set and vd_merge
  • various suffix schemes similar to the prefixes
long names are ugly, harder to read, and didn't really provide much uniqueness. prefixes are ugly and make code completion a pain ... typing 'set<tab>' didn't provide any options, i needed to remember the prototype prefix to get anything useful. underscore-based suffixes worked the best - they're ugly, but don't harm code completion

taking the suffix idea to the 'logical' extreme, i switched from _XX suffixes to unicode suffixes. a single unobtrusive character (i mostly use subscripts) that a human hardly notices when reading, but allows the IDE to keep everything unique
/** * state representation of a nu.FoodList * @constructor * @augments nu.Stateᵧ */ nu.Stateᵧ.Listᵧ = function() { this.replyᵧ = null; this.termᵧ = null; this.startᵧ = 0; this.kfoodᵧ = 0; this.derivedᵧ = false; this.jumpEndᵧ = false; }; nu.Stateᵧ.Listᵧ.prototype = { setᵧ: function(term,start,kfood) { this.termᵧ = term; this.startᵧ = +start || 0; this.kfoodᵧ = +kfood || 0; return this; } }; they're easy to read, compatible with completion, and easy to keep unique. both webstorm and nb7.2 handle them elegantly - find usages and go to declaration work great. the downside is that they're a pain to type without completion (i copy/paste)

unfortunately, chrome devtools won't do completion with object properties that contain non-ascii characters. firebug works fine

Note: not all unicode characters are valid in javascript identifiers, here is one validator

update - bash support

by default my inputrc (ubuntu 12.10 with gnome classic) doesn't appear to support unicode copy or paste, ie bash doesn't work !!! i needed to enable support for meta characters ... echo " set input-meta on set output-meta on set convert-meta off " >> ~/.inputrc bind -f ~/.inputrc most of the ubuntu apps, eg gnome-terminal and gedit, appear to support typing unicode characters with shift+control+u followed by the hex value of the character and space or enter. unfortunately, neither webstorm nor netbeans support this interface, meaning you need to copy and paste the character from some program that does support them, eg the gnome character map

for a full list of the unicode characters, install the ubuntu unicode-data package or download the raw list

Tuesday, February 12, 2013

stormvz virtual private server

purchased my first VPS today from lowendbox promo - 3G memory for $7. figured it was worth trying out

purchase and the initial setup were painless. but actually getting anything done has been challenging. it comes with ubuntu 12.04 and runs openvz. the base install seems mildly broken. out of the box, sudo doesn't work, maybe i'm just supposed to use root for everything ?

NOTE: replace the "XXXXXX" username or passwords with real usernames and passwords as root on the VPS: useradd admin useradd -m -s /bin/bash lytles usermod -a -G admin lytles chmod u+s /usr/bin/sudo passwd lytles apt-get update apt-get dist-upgrade apt-get install mysql-server mysql -p --user=root # GRANT ALL ON *.* TO lytles@localhost IDENTIFIED BY 'XXXXXXX' locale-gen en_US.UTF-8 update-locale LANG=en_US.UTF-8 from my normal machine: scp .ssh/ scp -r .bashrc .bash_profile .bash_logout scp hackpath hackpath-setup interactive-shell path-setup as lytles on VPS: mkdir .bash mkdir -p .ssh/keys cat >> .ssh/authorized_keys mv .ssh/keys/ sudo apt-get install tomcat6 nano tomcat6-admin sudo apt-get install openjdk-7-jdk sudo update-alternatives --config java sudo nano /etc/tomcat6/tomcat-users.xml # # # sudo nano /etc/defaults/tomcat6 # JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 i wanted a recent java and had trouble installing - the download required cookies and javascript, couldn't figure out how to make lynx work with it (text mode only on the server). so got the download link in the chrome developer tool on my desktop and used wget on the server (obv the auth param isn't good any more) wget ""

Friday, February 8, 2013

sunshine on the north coast

what is the lowest angle of the sun at which the body can produce vitamin D ? production requires UVB radiation, which is filtered by the atmosphere (most solar radiation is UVA which doesn't help), so it's reduced during the winter

  • this "dr" says 50 degree altitude angle
  • this link suggests that you can make vitamin D in atlanta (34 degrees north latitude) during the dead of winter
  • this page (sketchy sounding url but with legit sounding citations) says 34 degrees north (ie, atlanta-ish again)
this page converts latitude and time to the angle of the sun. 34 degrees latitude maps to an altitude angle of 32.6 degrees at solar noon on the winter solstice. the southern tip of lake erie is 41.38 latitude. the first solar noon that reaches the 34 degree equivalent is feb 5th (33 degree altitude angle)

note: if the 50 degree altitude angle is correct (no citations provided) then march 23 is the critical point

Thursday, January 31, 2013

webstorm at 2 weeks

i've been using jetbrains webstorm for 2 weeks now. i'm coming from netbeans so most of my comments are relative to the netbeans 7.2 (or 7.3 beta) baseline
  • supports JsDoc @augments tag - netbeans doesn't
    • this is primarily useful for javascript that simulates inheritance
    • it may also support @lends, but i didn't need the feature and couldn't get it to work in the few minutes i played with it
  • "Go To Declaration" almost always works (if you've given the code enough JsDoc comments so that it is unambiguous - can't ask for more than that), appears to be model based
  • "Find Usages" isn't great or terrible - seems to be primarily based on string matching, eg methods with the same name in different classes are jumbled all together -
    • no way to limit the search to subclasses
    • jetbrains claims that 6360 is fixed in the next beta !!! that only took 11 days ... impressive
  • fails to detect file changes on disk that happen in symlinked directories - this is a major failing, likely to result in lost work
    • WORKAROUND: using the settings dialog, add multiple content roots. i've just converted to this arrangement - will have to wait to see if this solves the "file changed on disk" errors
  • macros are so slow as to be useless - my favorite netbeans macro is "move up/down 10 lines and recenter the screen" which provides emacs-style scrolling. in netbeans this macro can scroll 400 lines per second. in webstorm, it's maybe 10 per second, can't key-repeat, and if you land on a line with a hint it activates the hint instead of the macro. ie, it's worthless
  • changing files in webstorm is somewhat faster and "smoother" than in netbeans
  • "go to super method" doesn't work
    • it does, but the cursor has to be inside the definition, not on the prototype method name
  • many features just don't work - i've googled and tried everything i found but i haven't submitted bug reports. if anyone knows a solution i'm all ears
    • method hierarchy - either grayed out or does nothing
    • call hierarchy - either grayed out or does nothing
    • super method - does nothing (clicking the arrows in the margin works)
    • the "Structure Tool" is somewhat broken - there's no easy way so select the file to show the structure of. WORKAROUND - have the file that you want active in the editor, "Navigate.Select In" and chose "Structure" (i've got it bound to Alt-4, 4)
  • the interface for editing settings is much more responsive than in netbeans (possibly limited to linux ???). this made getting started with webstorm less painful than expected (had many shortcuts to set) but long term doesn't help much
  • visual glitches
    • when iterating thru "find usages", keyboard focus has a tendency to get lost - closing, reopening, and closing the "find tool" seems to bring the focus back
webstorm definitely has some nice features, but also feels amateurish in too many ways. doubt that i'll be using it (or IDEA, the full java IDE - $200) as my main editor, but still on the fence about buying a copy - the $50 might be worth it just as a tool for code understanding of inheritance-based javascript (the only significant area that it's better than netbeans). netbeans is a better editor, has excellent java code understanding (and decent javascript support, eg code completion is good), is free and Free Software, and feels more professional

UPDATE: i'm pleased with the quick response (ie the workaround) on the symlink issue. will keep an open mind for the next 2 weeks (title changed as well)

UPDATE: jetbrains claims that 6360 is fixed in the next beta. it's really a feature enhancement - i was impressed they didn't outright reject it, doubly impressed that they actually worked on it

tl;dr - overall, webstorm is a good editor. webstorm's big wins so far are better support for javascript that simulates inheritance and excellent responses to bug reports

Thursday, January 24, 2013

"git stash save --patch" considered harmful

so you've been editing and it's been a few minutes or hours since your last git commit. you run your test case and bam, it fails !!! your working tree changes touch multiple systems ... you want to isolate the changes to see which one broke things before you commit. the obvious answer seems to be git stash -p (aka git stash save --patch). you mark all the changes that you want to stash and try your test case again. you make a few changes and want to pop the stash nqzero> git stash save -p nqzero> git stash pop error: Your local changes to the following files would be overwritten by merge: nutrweb/web/js/diary.js Please, commit your changes or stash them before you can merge. Aborting nqzero> git add -u nqzero> git stash pop # hard to recover if there are conflicts if there aren't any conflicts this is the bee's knees. but if there are conflicts, there's no obvious way to undo the merge (ie un-pop the stash) - the index has been corrupted. any suggestions ? without this, git stash save --patch considered harmful, ie it's very easy to lose changes


git stash create a backup before popping the stash. maybe git should do this for any merge with a dirty tree nqzero> tmp=$(git stash create) nqzero> git stash pop Auto-merging nutrweb/web/js/diary.js CONFLICT (content): Merge conflict in nutrweb/web/js/diary.js nqzero> git reset --hard nqzero> git checkout $tmp -- .

Wednesday, January 16, 2013

jetbrains webstorm first thoughts

i'm back to working on javascript after a year of java, and missing the excellent navigation and code understanding features that netbeans provides for java. netbeans javascript support is decent, but they just switched to a new language model and parser and it's one step forward, one step back ... in particular, jsdoc support for superclass info is limited. hoping that this improves - the guys working on it seem sharp and responsive

but in the meantime i've decided to try jetbrains webstorm, $50 for an individual license or a free 30 day trial. the code understanding seems better, especially the jsdoc support. still getting it configured, especially the keymap. documenting issues here

  • multiple shortcuts - the actions only appear to support a single shortcut. for some actions, i want more than one ... eg, for end of line i use ctrl-E (i'm an emacs guy), but i also want the "End" key to work SOLVED, in the settings.keymap page, just add another shortcut (i was trying to use the "add 2nd stroke" which creates a compound keystroke instead, emacs-style)
  • jetbrains sells themselves as shortcut friendly. and in general, the support seems pretty good. but the ultimate irony of webstorm is that the keymap settings are totally dependent on the mouse. you can't set shortcuts, delete shortcuts, search actions or search shortcuts using just the keyboard ... it's a clickfest. netbeans is much better in this regard (though at the price of the settings interface being slower and less responsive)
  • the "Structure tool" should be super useful. in fact, this is pretty much my reason for trying webstorm. but i can't get it to change files ... ie, it always shows me the structure for classes defined in one file, but i can't change that file. the navigation bar reverts to the that file whenever i switch to the tool. bizarre
    • WORKAROUND: Navigate.Select In.File Structure ... for me this is the compound keystroke [Alt-F1, 4] and i don't see any way to get there directly, ie with a single keystroke
  • absolutely amazing feature find ... Column Selection Mode. allows deleting a rectangular region - been wanting this for forever !!! i've got to play around and see if you can do anything meaningful other than deletions
    • and now that i know what it's called, it looks like netbeans supports it too (Toggle Rectangular Selection, or the rectangular selection toolbar button)
    • emacs too ... string-insert-rectangle, delete-rectangle
  • as best as i can tell, there is no way to tell if files have been saved or have outstanding changes ... yikes !!!
  • tried to create a macro for emacs-style scrolling (ie, jump a number of lines and recenter the cursor - in my case i want 10 lines). the macro fails completely ... it's slow to replay and if there's a code hint on the line it activates the hint. total lossage !!! netbeans is much better in this regard
  • type inference is pretty weak. if you jsdoc everything, webstorm is pretty good about keeping track of the types, but if you assign a known type to a local variable, it can't infer that the local is the same type. pretty weak. hoping that netbeans improves and can handle this logic
  • lossage - [Navigate.Super Method] doesn't work. clicking on the override symbol works

Saturday, August 18, 2012

more voip notes

tues i realized i couldn't make a sip call from my google nexus s (used to work)
thurs slashdot had an article on Groove IP (a softphone that bridges to google talk)

so today i spent a bunch of time investigating voip again. good news - things have improved. bad news - not that much. notes are mostly just for my own memory


  • this is my sip provider for outgoing calls
  • there's a new option (unless i missed it before) to use localized dialing. i choose this option and set it to USA with 0 for the international dialing prefix. now i can dial from my contacts without having to prepend 0111
  • i'm using a pay per minute account, and believe it only supports pcmu and gsm audio codecs
sflphone on ubuntu linux, amd64
  • still not really working - i can make calls and the callee can hear me, but i can't hear them
  • hostname -
  • proxy      -
  • audio: pcmu, gsm
csipsimple on google nexus s
  • would register with anveo, but couldn't make calls
  • deleted the old account (inside csipsimple)
  • created a new account using the basic wizard
  • copied and pasted the username and password
  • server -
  • works, and audio quality seems better than i remember it (haven't tested much)
sipdroid on google nexus s
  • installed this app
  • couldn't get google voice integration working (didn't want it to use my primary google apps account and couldn't get it to recognize my gmail account)
  • set it up to work with anveo
  • server or proxy -
  • port - 5010
  • works, and audio quality seems ok (haven't tested much)
GrooVe IP Lite
  • mentioned in the slashdot article
  • uses jingle to forward the call to google voice (instead of to anveo)
  • i used my gmail account (instead of my primary google apps account) because i wasn't comfortable giving them access to my primary account
  • i enabled 2-step authentication so that i didn't have to give them my password (not sure how much this buys me)
  • it works, and call quality seemed similar to what the gmail phone widget achieves
  • this is a big deal
  • the only downside is that it can't be registered at the same time as the gmail widget (so i have to choose which one to have active prior to receiving a call)
  • haven't tested call quality much, but if it ends up being decent, i'll buy the "Pro" version for $5
incoming calls to sip - google voice forwarded to ipkall to callcentric
  • this still seems to work
  • call quality has always been marginal

the holy grail is to be able to run something like the gmail phone widget on both my desktop and my phone and to be able to answer from either (and even move the call from one to the other). still a long way from there - but this is a big step

Monday, July 23, 2012

the damp knight rises

at times a pretty movie, but overall terrible

  • not enough civilians on the streets of gotham - place was deserted
  • bruce's despair over rachel's death and hunt's betrayle wasn't convincing
  • talia was an f'ng mess - in love with bruce and bane and rambling about fulfilling Ra's destiny
  • talia and bane preach revolution and class warfare - victims in the pit of the entitled. they run the tribunal, which actually does off some of the corrupt rulers of gotham. and then, "oh by the way, we're gonna blow the city up". which they could have done on day one. f'ng nonsense
  • bane and talia put batman in the pit *knowing* that he's gonna rise up and escape. they want him to, need him to, aren't at all surprised when he does ... so what the fuck for ?
  • bruce can't tell that talia is *talia* ??? even after he's heard the stories in the pit ... he, the protector of orphans never asks "what happened to the child's protector". ftloc
  • nobody has a plan for anything in the movie, there's no game of chess, no strategy
  • pre-revolution, gotham is corrupt with the rulers dividing the spoils and everyone save kyle seems oblivious to it
  • the police force has been pussified
  • why the fuck don't bane and talia kill kyle. or fall in love with her. or at f'ng least realize that she exists
  • one schoolbus of orphans is all blake, our hero-in-waiting, can muster to the bridge

a few good moments
  • crane is awesome at the tribunal ... "death by exile !!!"
ok, make that one good moment. some of the stunts were fun, the cops-vs-thugs battle at the end had a nice buildup, bane and kyle were decent (if inconsistent) characters, bane's voice was awesome. in hindsight, i now realize that the only thing that saved "the dark knight" was ledger - he took a grenade for that film and paid the ultimate price - killed by nolan's tunnel vision

Wednesday, May 16, 2012

"upgraded" to ubuntu precise pangolin

well, i skipped oneiric (11.10) all together, so straight to precise (12.04) from natty (11.04). calling it an upgrade is a huge misnomer. in a lot of ways it's good, but it's like switching from a nice car to a nice boat. or a giraffe ... i'm a programmer and spend most of my time in netbeans, gnome terminal, chrome, and i run a command line internet radio app and use google voice as my phone. i run everything full screen and start it all from the command line

so for me, all i really need the UI to do is show me what's happening with the computer and easily control it. i want to see cpu frequencies, load and temp; pulse audio volume and routing (speakers vs usb headset); switch between windows and workspaces; open a terminal with a keystroke and maximize windows (avoid the mouse as much as possible)

this isn't a review or even a rant. just need to keep track of some of the things that i used with natty that i haven't found good substitutes for yet. the big change with (oneiric and) precise is unity. i'm still not sure if it's a window manager or what exactly. but gnome-panel no longer works which was everything i needed in a UI. they've replaced it with some hybrid menubar / indicator area. which saves a bit of vertical - would be cool if i wasn't running my 1900x1200 in profile, ie rotated :)

ported from panel:
- indicator-multiload -- shows graphs of cpu, memory, net and disk usage in the notification area
    apt-get install, run it, add it to the "startup applications"

- indicator-cpufreq -- displays and allows control of cpu scaling and governor
    actually better than the gnome panel applet (sets freq for all cores, not just one)
    doesn't include the cpufreq-selector, which allowed (easy) command line control of the cpus

- pulse audio mixer applet (allows easy routing of pa sources and sinks)
    pavucontrol seems like the only "easy" way to control audio routing, but it's not even close to pama
- indicator-sysmonitor (available for 11.10 but not 12.04)
    some hack to make it work in 12.04 (not sure what that script is doing)

subpixel ordering:
  gsettings list-keys org.gnome.settings-daemon.plugins.xsettings

  gsettings range org.gnome.settings-daemon.plugins.xsettings rgba-order

  gsettings set org.gnome.settings-daemon.plugins.xsettings rgba-order rgba

workspace switcher applet
my folks like to be able to switch workspaces using the mouse. in gnome2 you could do this in one click with the workspaces applet. unity requires 4 actions, ie bring up the launcher, click the workspaces icon, click on the workspace that you want to switch to, and (if that workspace has multiple windows open) click on the window that you want. ridiculous. and the zoom effect makes me nauseous too boot

can no longer control the arrangement of workspaces. i used to use 3 in a single row. not possible anymore. to control the number of workspaces use:
  gconftool-2 -s /apps/metacity/general/num_workspaces --type int 4
which will give you 4, in a 2x2 grid. i think it always uses 2 rows

one of my machines my parents use and they like it to automatically log them in. this seems to be broken with lightdm - if i enabled automatic login then i was unable to shutdown or restart with any of the graphical controls ("shutdown -h now" still worked). to work around this, i switched to gdm and used the "timedLogin" option. note: gdm used to have an "automaticLogin" and that appears to be broken and cause gdm to terminate silently (only took me 6 hours to track that down)

machine with an asus m2a-vm-hdmi mainboard had problems with mouse jerkiness. seems to be that the driver is constantly probing for a monitor, gets back garbage cause there's nothing there and spams the syslog, which somehow triggers all sorts of issues. it's a radeon x1200 (or x1250, not sure) integrated video card and i'm using the radeon open source driver. adding "radeon.modeset=0" to the kernel command line options seems to have corrected that problem

one thing that is a real pain with unity is that it's not obvious what anything is. with gnome, you could for the most part right click on anything and get an about dialog or see the path of the program the icon represented (ie ran). for the most part, the unity UI is a black box. it does stuff, but you can't easily see the mappings. in the panel you could click on an indicator and move it, remove it, add a new indicator. not so in unity (that i've found so far)

in spite of all that, i'm pretty impressed with canonicals execution with unity. it's a major change, and for the most part, things "just worked". my laptop has seen a significant decrease in power usage. the HUD notifications are improved. dash is bizarre but looks cool. pulseaudio still works. i think they're on the wrong track in terms of trying to simplify things at the cost of configurability. instead they should be working towards making existing things more consistent, and make it straight forward to discover what is going on. but given the path they chose, they've executed reasonably well

interesting ... the netbeans editor seems to be *much* faster after the upgrade. have only used it for a few minutes, but it seems dramatic. more testing / using tomorrow

Wednesday, April 25, 2012

lenovo x60 battery REPAIRED

3 years ago i forced lenovo to send me an replacement for my x60 battery that failed just before the warranty expired. the replacement has now failed - one day it had 2 hours of runtime, the next 5 minutes, which doesn't match my model of how li-ion ages. my gut is that lenovo is artificially shutting them down on a timer (guessing they make $100 profit per replacement battery). or maybe it's a legitimate "bug". who can know. lenovo has to a degree acknowledged that it's a problem (my fru isn't listed, but it's the same symptom):

that page describes an issue with the battery controller that causes premature reports of failure, ie before the cells have died. by premature, they mean in the first year ... but really, any time the battery controller is the cause of death (and not a cell failing) it's premature. so pretty clear to me that it's *intentional* on lenovo's part, but not much that we can do about this. after all, the anti-trust division of the doj is preoccupied with it's witch-hunt against google - no way they can waste time on something as mundane as actual fraud

so i'm working under the assumption that it's a software/controller problem. some other's seem to be on the same page ( so the deal is that if you can trick a lenovo battery into fully discharging, it will reset the controller and take a full (well, as much as the cells will accept) charge and you're back in business

but no pinout for the x60 battery, so i can't use the exact method that javier valero suggests. but i found a *simpler* workaround. while running on battery i put the machine into suspend and left it there, which drains the battery slowly. while suspended, the crescent moon led is solid green. after about 30 hours, the battery was really dead, the machine shut off and the crescent moon led went out

plugged in the ac adapter, started the machine. after a few minutes it told me the battery was 100% (even though i now know it's almost totally discharged). removed the ac adapter and waited a few minutes until the "critically low battery" warning came up and plugged it back in. the battery charged to full (24000mwh - the battery is *somewhat* old after all :) and has behaved normally since

note: during the long suspend, the machine woke up once (presumably because the battery told it that it didn't have enough juice to keep it in suspend for much longer). i plugged it in for a second, clicked "ok" (ie suspend again) and then removed the ac as soon as it went back to suspend. not sure if the ac was needed or not

  • lenovo x60, stock other than 4G ram that i installed
  • ubuntu 11.10 as the primary OS, windows xp still installed and occasionally used
  • battery: FRU P/N 42T4631, ASM P/N 92P1170. fewer than 50 charge cycles (the x60 is usually plugged in). this battery was supplied by lenovo under warranty 3 years ago, but my original battery had a similar failure mode
symptom: one day the battery was fine, with runtimes of approximately 2 hours. the next time i tried it (could have been a month or 2 later) the runtime was 5 or 10 minutes. and the battery would report capacity of 30000mwh slowly decreasing to say 29000, and then suddenly drop to 1000mwh, causing the machine to suspend (in both ubuntu and windows xp). from the lenovo bulletin:

  • Irreparable damage or battery cannot be charged error message from Power Manager or Message Center, or
  • Low battery capacity, as indicated by short battery run time or sudden drops in the battery fuel gauge

tl;dr -- my lenovo x60 laptop battery failed prematurely (running ubuntu). i repaired it by leaving the machine in sleep till it shut down (crescent moon led went out), charging till "full" (only took a few minutes), discharging till "critical" (again, just a couple of minutes), and then everything worked normal, battery would hold 24000mwh

Saturday, April 21, 2012

sflphone 1.0.2 on natty

had a bunch of trouble getting 1.0.2 to build and run on natty (ubuntu 11.04). thought this info might be helpful to anyone else that's trying to avoid unity for a little bit longer

sudo apt-get install:

at first i used libnotify-dev, and got a confusing error
Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
  ldd indicated that was used
  use libnotify4-dev instead (doesn't link against gtk directly)

config file (sflphoned.yml) wasn't automatically being created
  copied my 0.9.2 file and it worked fine
  might have missed it, but didn't see a basic starting point for generating one
  believe this is already fixed in version control

starting the client failed with a segmentation fault - appears that it was failing to get codecs
  may be related to 0.9.2 still being installed
  corrected this problem by starting the daemon explicitly first

Friday, April 20, 2012

async servers

quick list of asynchronous web servers, aka reactor pattern

eventmachine - ruby
tornado - python (webserver)
twisted - python (networking engine, not sure how easy a webserver is)
deft aka apache awf - java, deadish
netty - java, networking engine
jetty - java (claims it's async, but not buying it 100%)

see also c10k on wp:

Friday, December 2, 2011

keyboard navigation on google search (knogs)

knogs 1.0.3 is now available (update 2013.11.09)
  • install via chrome web store
  • google broke userscript installation in chrome 21, see the readme for manual install
  • thanks to YJ Soon for fixing some layout issues
  • now compatible with google calculator (thanks yj :)
knogs 1.0 is now available (update 2012.02.03)

tl;dr - the alternatives worked, but they were no substitute for the real thing, so i wrote my own wrapper

google's experimental search page used to list a keyboard shortcuts feature. it's been deprecated for a long time, and was showing some rust, but was still working, was still an invaluable part of my desktop. a few days ago it finally stopped working. so i tried the google-recommended replacement, the accessibility experiment
  • it's not officially supported for chrome
  • instead of a cursor (a la gmail) it highlights the selected item
    • too large, can't change defaults, leaves artifacts
  • it works, though it's a bit clunky
i sent the usual scathing critique to google begging them to give us back the keyboard shortcuts experiment (i'd actually be willing to pay for search + shortcuts, i should have mentioned that). but i wanted to list some of the good stuff about the accessibility experiment
  • "n" and "p" move to the next and previous item, including to the next and previous page ... this is a feature that was often requested (and at one point worked iirc) for the shortcuts
  • shift-enter is an undocumented shortcut that will open the selected link in a new page
  • just tried it in firefox - the highlight box is still too large and no obvious way to change the default. but it does make a cute clicking and wooshing sound as you move though the results, unfortunately a second or two after moving the cursor
another option is google's standard search. pressing tab provides a small cursor that can be controlled with the up and down arrows. enter or ctrl-enter open an item. it's workable, but kludgey. i also tried the 43131 userscript, but couldn't get it to work on chrome

google still hosts the javascript that does the actual control, they just don't provide a means of injecting it, and it's got a little bit-rot. so i wrote my own wrapper. it looks like a userscript, but it doesn't really work right on firefox, so consider it chrome-specific. the shortcuts conflict with google's instant search, so i have a kludge to fix some focus issues that mostly works. here it is: keyboard navigation for google search on chrome. at some point i'll probably write my own javascript (as opposed to wrapping googles), but in the meantime i hope this works for some people

Sunday, January 30, 2011

voip take two

voip take two ...

sflphone is my softphone
  can't get transfers to work
  0.9.8 phonebook doesn't work right
    built 0.9.12 from source and it's better, but still weak
  tends to drop registration to after calls ...
nexus s
  builtin sip dialer
    seems to loose registration after calls
    my DOD needs the country code prefix, and css can prepend it
  free account, i'm using this one for incoming calls, ie a gateway
  free account, seems a little flaky ... but might just be that i'm trying to use to many providers
  DID: $1.50 per month, DOD/DID calls: $0.01 per minute
  not intended as a sip account ... my sip address is 100 chars long :)
  SMS seems to work, $0.04 per sms
  connects using the nexus/gingerbread sip dialer
  account transaction log is excellent, though it lacks a running total in the report
  outgoing calls to PSTN just by prefixing the country code ... use cSIPsimple filters to auto-prefix
  for both the nexus sip and cSIPsimple, requires a proxy:
  DID: free, can forward to any of the sip accounts (haven't tried anveo)
  google voice won't forward to this number - someone else has already registered it
    might try getting a new number
google voice
  almost the holy grail, free DID/DOD, great service
  no voice service on the nexus
  to forward to sip you need to use a PSTN gateway
  i can't figure out how proprietary the service is ... eg, ekiga ???

google voice can forward to the DIDs. my nexus s (android ginberbread) can connect to both accounts using the builtin sip, and i can receive and initiate sip calls (though if i make a provider the default i can no longer receive calls to that account). call quality over wifi seems ok

i'd like to be able to answer a call on my desktop and then transfer it to the nexus sip stack if i want to roam, but multiple accounts on multiple ip addresses behind my NAT seem to cause problems. so for now i'm giving up on this

Saturday, January 29, 2011

codemash microsoft shills ???

codemash is a tech conference that happens down the road at kalahari each january. each year i'm tempted to go, but it's seemed too microsoft centric for my taste. looking at #codemash i saw lazycoder wrote: With the #WebMatrix launch event at #CodeMash, does CodeMash become just another MS event? Or can it retain it's uniqueness & independence?, and later: Or more generally: is there a connection between vendor involvement and lack of variety at a conference?. the codemash people vehemently denied it, and he ends up retracting the statement, but it prompted me to finally sit down and try to quantify the MS influence ...

the core organizing committee (commentary is mine, based on reading the first few pages of the twitter feeds and blogs, following prominent links, and quick google searches for each of them):

  • Jim Holmes, President, Board of Directors
    sharepoint, .NET, some C# (though it looks like he's at least familiar with java)
  • Brian Prince, Vice President, Board of Directors
    windows azure, silverlight, ASP, and hosts windows bootcamps
  • Jason Gilmore, Secretary, Board of Directors and co-chair, speaker committee
    PHP, mysql, web apis
  • Dianne Marsh, co-chair, speaker committee
    founded SRT: .NET, Visual Studio, C#, microsoft MVP
    mentions a bunch of non-MS tech in passing ... guava, scala, google tools
  • Jason Follas, Sponsor Coordinator
    Twitter Bio: .NET and WoW... Is there anything else in life?
  • Mike Woelmer, VIP Coordinator
    Twitter Bio: Software consultant at SRT Solutions, C# developer
  • Darrell Hawley, Jack of All Trades
    Twitter Bio: C# Developer and Python enthusiast; Blog: C# MVP
  • Jeff Blankenburg, Graphics
    works for microsoft pimping the zune
of the bunch, only jim and dianne acknowledged java. didn't notice anything about linux or android, don't remember seeing anything about iOS (though i'm not an iOS dev, so i could have missed something). lots of C#, .NET, microsoft MVP, and azure. some windows phone 7. 5 guys that are outright pro-MS, 1 pure web play, and 2 generalists that appear to lean towards MS technology

looking at the sessions, 36 .NET sessions. 15 Java sessions, of which most are really Scala or Groovy. and not one mention of linux as a platform (several speakers bio's mention it), vs dozens for windows. the first sentence or 2 in the java sessions abstracts:
  • The rumors of the death of Swing have been greatly exaggerated
  • Java developers are typically hamstrung when it comes to rapid application development and prototyping
  • Are you a Java/Scala/Clojure developer? Are you jealous of all your Ruby buddies using Cucumber to write clean, readable acceptance tests?
  • The state of Java web development is in pretty sad shape
for the most part negative towards Java. the .NET blurbs are much more positive, including this charmer: Windows Presentation Foundation (WPF) is an extremely powerful and flexible framework. the numbers and the tone lean heavily toward .NET and various windows tech.

the codeplex guys responded to the critical tweets that prompted my "investigation" with this defensive tweet: @lazycoder Why does one launch event turn us into MS shills? I think we've got the chops and history to prove we're remaining independent.

no. one launch event doesn't prove anything. but a history of pro-microsoft and anti-linux and anti-java bias does. ignoring and painting Java in a negative light, completely ignoring linux as a platform, a microsoft launch event, and a committee that's loaded with MS technologists does. and denying that bias makes it worse

codemash should either fess up and admit that they're a microsoft-centric conference or acknowledge that they've failed to maintain a proper balance, add a bunch of non-microsoft technologists to their committee and present a balanced view of the technology landscape in the coming years

Thursday, December 9, 2010

pulseaudio mixer applet - building on ubuntu 10.10

trying to build this, i ran into a bunch of errors about build-aux, and install-sh. you need to run the developer build tools
bzr branch lp:pama
automake --add-missing
# omit CFLAGS for defaults
# might also want to pass PKG_CONFIG_PATH, eg to use a debug-enabled gtk+
CFLAGS="-g -O0" ./configure
make install

if you use a custom install prefix, you'll have to copy install/lib/bonobo/servers/PulseAudioMixerApplet.server to /usr/lib/bonobo/servers/ -- gnome-panel looks like a mess. no easy way to "inject" an applet from the command line :(

netbeans 6.9.1 + cnd: create a new C project from existing sources, choose the automatic configuration

Wednesday, December 8, 2010

voip providers - sip, iax2, xmpp

looking for a voip provider. assume that it'll be sip, iax2 or xmpp, but really open to whatever

must have:
sip to sip calls should be freeish, easy to initiate
should be able to call anyone that's on sip using there sip uri ...
need a DID and DOD ... ie termination

want to have:
able to make my DID/DOD appear to be another number (maybe my cell)
some sort of fallthru ... try my sip, then try my cell

pricing should be reasonable, but beyond that it's secondary. not sure what the "fair" price is ???

voxalot/679376 - no softphone registration with the free account (voxbasic)
i guess this is intended as an aggregation service ??? - my test calls to silently terminate
they do show up in the call log, so it's probably possible to do something with them
complicated, and i don't think it's intended for what i want.
signup asked for a lot of semi-personal info - just seems sketchy

sipsorcery -- didn't try this one, but it seems to be more of the same. they all seem to be meta-sip, without actually providing sip itself

anveo/7089916429 - incredibly complicated to do basic stuff, but i think i finally got it to work. but i tried so many things, i can't actually remember :( claims that it does sms, though not to verizon. it sent to my google voice number, but gv wouldn't send back to it. maybe if i had a DID. initial credit to allow testing, but no sip account out of the box. support guy activated it almost instantly :) DOD works with caller id set properly. not enough free credit to get a DID so i haven't tried that. sip to sip seems more problematic - they don't peer with anyone as far as i can tell. no sipbroker. i think i successfully called out, but it was using sflphone to an account ... pretty sure that sip-in doesn't work. all in all, it's the most contradictory service i could imagine - the site is very early-00s, looks amateurish today - just enough javascript to be scary, but not really web-2.0 or ajax or whatever. and doing the most basic things is complicated. but it appears to do everything i could ask for, and then some, and then the kitchen sink

google voice chat is my default option ... everything seems to work ok, if a little inflexible. more time needed to figure out if it really is the holy grail :)

good list of providers: - think that this one is a pretty basic provider. seems respectable and i think i could sip in and out. sipbroker - can send sms, looks reasonable but i didn't try it. doesn't look like they peer with sipbroker. but they're somehow tied to phonegnome, and pg claims that you should be able to sip in and out:

Tuesday, December 7, 2010

google apps transition - new infrastructure

some account features don't transition automatically. rather than wait some indefinite period for the manual transition to happen, i changed my primary email for the google account to an old yahoo email address. this allowed the transition to complete, meaning my google apps user is now a google account. and now i'm moving the "data" back to the google apps account ...

move google voice to a new account using this form, which isn't listed in any official documents. the closest thing to a confirmation from google that this link is legit is this post by ilya 2009 (listed as a google employee as of today 2010.12.07). ie, it appears that it's not a phish, but really poor form for google not to provide a more official endorsement (and heaven forbid that ilya leaves google :) ... don't want to encourage users to blindly provide credentials to unverifiable forms ...

update: happy to report that this was successful - took about a week, but the number and my old smss transfered to my google apps (migrated) google account

Saturday, November 27, 2010

gmail-gchat-gtalk choppy audio on ubuntu / pulseaudio

using the browser plugin for gmail's voice-chat (sometimes referred to as gchat or gtalk, though i think that technically those are other products) on my ubuntu 64bit box with onboard audio (via vt1708s) resulted in choppy sound and lots of dropouts. my typical test was counting from one to ten ... you could hear most of the numbers clearly, but several would be entirely silent. i tried 2 other boxes running 32bit ubuntu and didn't have any trouble

after some googling i found this post that details how to correct the problem (see the answer by grimwisdom). rjincorvia (the asker) has done a good job of letting people with similar questions know that his post is what they need to read, but the keywords don't match the symptoms that i was seeing, and really don't even match the symptoms he describes, which makes finding the answer using a google search difficult. so writing this post to make it easier for others to find

grimwisdom says to enter the shell prompt:
pactl load-module module-null-sink sink_name=myGoogleVoice
pactl load-module module-loopback sink=myGoogleVoice
and then select "monitor of null output" from gmail::settings::chat::voice chat::mic

to make the changes permanent, add those lines (without the pactl) to the end of /etc/pulse/

Monday, November 15, 2010

netbeans c/c++ execution environment variables

running (or debugging)  code using the netbeans c/c++ development module (cnd). i need to set environment variables, eg LD_LIBRARY_PATH. the project properties "run" page has an entry for environment variables which pops up a dialog. "add"ing a variable adds a blank line. but i can't find any way to actually set the variable name or value. clicking, double clicking, pressing space or enter, or just typing all have no effect

as a work-around, you can edit nbproject/private/configurations.xml file and set the section. close and reopen the project (or restart netbeans)
          <variable name="LD_LIBRARY_PATH" value="/opt/local/lib"/>
i'm on amd-64, ubuntu 10.10, java-6-openjdk and i've seen the problem with both nb6.8 and nb6.9.1
here's the forum post, and the bug report

Sunday, November 14, 2010


teddy tso gives a remarkably frank analysis of the ext2 filesystem's lost+found directory -- if only everyone was so straight forward. probably applies to ext3 and ext4 as well. short answer - if the lost+found directory annoys you, just delete it ...

Thursday, October 7, 2010


still trying to find words for today's game ... pretty good result, made it out of the first round. and can't fault the work ethic, the persistence, the effort. but jesus - a few more balls on the ground, an occasional shot that finds the back of the net. and a defense that doesn't crumble whenever a ball goes thru the middle ... these are things that most teams can take for granted. donovan would be a role player on the lakers ... good guy, but he's never going to be a dominant force on the field. we need to let that go. let him be the cog in the machine that he should be, that he's capable of. and look for magic elsewhere, realize that most of his production is cleanup, is reaping the seeds that dempsey and jozy have planted. he gets credit for gettting the job done, but it's a workman's lunch he deserves, not a heroes welcome

yeah, clark f'd up, lost the ball in midfield. but so did donovan, and bocanegra, and cherundelo. and the dependence on the long ball created dozens of extra chances for ghana. so i think it'd be a huge mistake to look to place blame. to think that things were ok. they weren't.

Tuesday, August 24, 2010

creating an empty tar: "Cowardly refusing to create an empty archive"

creating an empty tar archive so that you can append to it is a little harder than one might think. the obvious thing would be to create a new archive with no files listed. but the developers have decided that this is too risky. here's the workaround (reads the list of files from a file that is empty) ...

tar -tf blah.tar
# tar: Cowardly refusing to create an empty archive
tar -cfT blah.tar /dev/null
# success

Monday, August 23, 2010

connecting to nokia 2700 with ubuntu linux

the nokia 2700 is a quad band gsm phone that i picked up unlocked in germany. trying to connect it with linux. the os is nokia series 40, not symbian. uses nokia ca-126 cable, which is a micro-usb connector without power (ie, it doesn't charge from the usb cable). i'm using ubuntu 9.10 (karmic) linux ... about to upgrade

looks the like the modules aren't loading right. i probably need to do something with /etc/modprobe.d, but for now i'm just doing:
gnokii --identify
### Couldn't open PHONET device: Device or resource busy

sudo modprobe cdc-acm
sudo rmmod cdc_phonet phonet

gammu / wammu look great, but i couldn't get them to work reliably with the 2700. fell back on gnokii. created ~/.gnokiirc

port = 1
model = series40
connection = dku2libusb

at this point can copy messages, contacts, calls and browse the filesystem using sudo, but if i tried gnokii without sudo, it failed. copied the udev rules and restarted udev

gnokii --identify
### Couldn't open PHONET device: Operation not permitted

sudo cp /usr/share/doc/gnokii/sample/45-nokiadku2.rules /etc/udev/rules.d/
sudo service udev restart

everything i've tried has worked - haven't tried making calls, sending messages, or copying files. have the cell acting as a modem at one point, but seem to have broken it. will try to document that next

Saturday, April 17, 2010

google-chrome, google's keyboard search and the back button

a recent release of google chrome, maybe this one, broke the google keyboard shortcut search experiment. perform a search in the experiment, eg rattlesnake, select the wikipedia article by pressing "o" or "enter". the page opens as expected. press back ...

you should go back to the search results, but most of the time i don't - instead getting pushed back a little further to the page before the search (in my case that's usually a blank tab). the search shows up in the history ... it just isn't honored by the back button

seems to work ok in firefox, and works fine if you click instead of using the keyboard. i'm seeing the problem on ubuntu 10.04, amd/x64

related google search stuff: adding &nfpr=1 to the end of a search will cause google to honor the search instead of using their "search for blah instead" logic

Thursday, April 8, 2010

please unsubscribe me from obama email list

from the beginning, i believed more in the campaign than in the candidate - i believe in a minimal govt whose primary role is to facilitate commerce. i knew that obama was more progressive than i was, and that his support base was significantly more progressive. in spite of that, obama showed an appreciation of the rights of others, eg he opposed the health care individual mandate, and seemed to respect the right to bear arms, so i entertained hopes that he might be able to walk the fine line.  and the campaign that was at least initially based on small donations was something that i believed in - so i joined and donated and i'm proud that we won

overall i'm reasonably happy with what the president has done from a policy standpoint. i certainly oppose the health insurance stuff and the bailout of the banks and gm, but i recognize that most americans wanted something done. and in the case of the bailouts, that we won't know whether they were needed for years to come. and i'm very happy that we've treated israel as just another country - for as long as i can remember we've treated them as infallible, and given them a blank check. i am disappointed with the strong intellectual property stance that the president has taken, and the inclusion of people with strong ties to the big media companies in the govt

my biggest disappointment has been the president's failure to play the game of politics - the fundamental challenge that a president faces is maintaining his popularity and power. instead of focusing on this, the president has put too much effort into passing legislation. and because of the lack of power and popularity, he's become beholden to the democratic party. eg, instead of focusing on passing the health care reform bill, he should have used it as a bully pulpit - go to the american people and explain that republican filibusters are holding up the bill, that the lack of a bill is costing the american people millions each day. that is, to force the republicans to play ball. he'd be more popular, more powerful, and would have gotten a better bill (though still one i'd probably oppose :)

i'm still optimistic and wish the best for the president and his team. but i don't think i'm part of it any more. please unsubscribe me from this list for now, though perhaps i'll be back in 2012

Friday, March 12, 2010

SOLVED: google experimental search -- keyboard shortcuts

google has an experimental search keyboard shortcuts experiment. i've been using this as my primary search since i've found it a few years ago, and i love it. lets you navigate search results with j/k/o, instead of having to click on everything. stopped working today ...

The experiment you're trying to access is no longer available. Go to experiments overview

the keyboard shortcuts experiment is still listed, so hoping against hope that it's just a bug and that it will get fixed quickly. has anybody heard anything ???

here's an example of how to search for "stuff"

Update (2010 March 17) -- SOLVED
this is working again (since the 12th i think)

alkaline33 from the mailing list suggested an alternative user script. might be useful if google does eventually disable the experiment:

Update (2011 November 30) -- BROKEN AGAIN

i get the "no longer available" message and the shortcuts don't work. there's a bunch of noise on the mailing list to the same effect. and google announced that they were dropping a bunch of experiments and lab projects. so i'm guessing that this really is the end of the road, but holding out hope. i haven't tried the userscript, 

Thursday, March 4, 2010

java to json using a javascript constructor -- classy javascript

i've got a simple class with both java and javascript representations

// java
package foobar;
public static class FoodStuff {
  String name;
  int index;

// javascript
foobar = {}
foobar.FoodStuff = function() {}
foobar.FoodStuff.prototype.blah = function() { return 7*this.index + name; }
foobar.mix = function(obj,props) { for (var ii in props) obj[ii] = props[ii]; return obj; }

i want to convert an java instance to json, and then instantiate it in javascript using the javascript class as the constructor. normally the json might look like '{name:"Sarah",index:77}'. i'd like to be able to do something like this

'{ food: foobar.mix( new foobar.FoodStuff(), { name:"Sarah", index:77 } ) }'

then i could (in javascript, where data has been assigned the string above, eg by an xhr call) say

var stuff = foobar.fromJson( data );
var magicValue =;

for this simple example i could obviously just augment in javascript, but for a bigger heirarchy of data, i don't want to have to decend and replace the whole thing with a bunch of different constructors. i think that gson is going to support this in the next version by allowing custom serializers to call the default serializer, which should allow me to wrap the obj with my foobar.mix

is there an easy way to accomplish this in jackson or gson ? or another json serializer that does automatic conversion of POJOs (ie without getters and setters) to json ?

note: i don't want to serialize the data myself, i just want to augment it. ideally i'd just set an annotation that told jackson what javascript constructor should be used, but wrapping the default serialization myself would be fine if it was easy enough

Tuesday, January 26, 2010

godaddy .us registrations are expensive, ie godaddy sucks

5 years of a .us domain from $90. i've already got an account with them, i'd be happy to purchase from them again. pretty expensive - quick check of a few other registrars. the price from everyone else: $45.  wtf ?

so i guess godaddy sucks ... blah. used, appears to be fine

Tuesday, December 22, 2009

air fuel ratio for firewood

you're burning wood to heat your home. but the inside air gets dry ... you're pulling in cold dry outside air to replace the air used in combustion. you need to add water to the air. but how much ?

first, how much air is needed to burn a kg of firewood ?

there isn't as much info on firewood on the intrawebs as i'd have thought.


stoichiometry for dry firewood ends up being about: c6h9.5o4.45 + 6o2 --> 6co2 + 4.75h2o, and air is 21% o2. resulting in an air/fuel ratio for firewood of about 6.

all the numbers are very imprecise, wood is heterogenous, moisture varies a lot, combustion probably isn't perfect, hemicellulose is a mixture and lignin isn't well defined, so the result is only approximate (and that assumes i haven't made any errors :). i'm guessing the true mean is plus or minus .5

assuming that you're drawing in cold outside air with very little humidity, and you have to add all the water to it to achieve 50% relative humidity at 25oC (which is 10g water per kg air), you'll need to add 60g water per kg of firewood. realistically, the incoming air has some water, and we don't need to go to 50%, so maybe 30g-40g water per kg of firewood will work

other stuff:
firewood: 15MJ/kg HHV (ie including the energy that's lost with the combustion gases)

found a great pdf talking about some of this stuff

mostly agrees with my calculations
ideal air fuel ratio is 6, but to get decent combustion, stoves run 10-12