Wednesday, October 19, 2011
Port to Coffeescript
A new part of the v7 plan is a port to Coffeescript. I'd like to jump directly to Dart, but that's a long way off.
I'm also looking to write some test code using some of the JS/CS testing frameworks: http://macwright.org/2011/10/18/adventures-in-testing.html, http://docs.jquery.com/Qunit. Refactoring has become more difficult and error prone, and I can't put off best practice forever.
Friday, September 2, 2011
Resumption of Activities
After a long hiatus, development of the Player's Companion has resumed:
http://charmgr.stepnext.net
This version (0.7) is a port to the Pathfinder rules. The Ranger class is complete, and Sorcerer is coming along. Also damage reduction and special saves (eg v petrification, poison, etc) is now implemented. Skills with subtypes (eg. Knowledge, Perform, etc) are now correctly handled.
The application is hosted on a Amazon EC2 instance, served by node.js. The code is now hosted on Github, using (predictably) git for SCM. Development has been massively simplified by these changes.
Also, I got a Macbook Air. It is wunderbar.
http://charmgr.stepnext.net
This version (0.7) is a port to the Pathfinder rules. The Ranger class is complete, and Sorcerer is coming along. Also damage reduction and special saves (eg v petrification, poison, etc) is now implemented. Skills with subtypes (eg. Knowledge, Perform, etc) are now correctly handled.
The application is hosted on a Amazon EC2 instance, served by node.js. The code is now hosted on Github, using (predictably) git for SCM. Development has been massively simplified by these changes.
Also, I got a Macbook Air. It is wunderbar.
Friday, March 18, 2011
SharePoint via Java
God bless you, sir!
http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/
http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/
Saturday, February 12, 2011
Another Scintilla Editor
http://caladbolg.net/luadoc/textadept/manual/1_Introduction.html
require 'textadept'
local keys = _G.keys
local b, v = 'buffer', 'view'
local gui = gui
keys.can = { new_buffer }
keys.cl = { 'char_right', b }
keys.cL = { 'char_right_extend', b }
keys.cal = { 'word_right', b }
keys.caL = { 'word_right_extend', b }
keys.cj = { 'char_left', b }
keys.cJ = { 'char_left_extend', b }
keys.caj = { 'word_left', b }
keys.caJ = { 'word_left_extend', b }
keys.ck = { 'line_down', b }
keys.cak = { 'line_down', b }
keys.cK = { 'line_down_extend', b }
keys.caK = { 'line_down_extend', b }
keys.ci = { 'line_up', b }
keys.cai = { 'line_up', b }
keys.cI = { 'line_up_extend', b }
keys.caI = { 'line_up_extend', b }
keys.ch = { 'vc_home', b }
keys.cah = { 'vc_home', b }
keys.cH = { 'home_extend', b }
keys.caH = { 'home_extend', b }
keys['c;'] = { 'line_end', b }
keys['ca;'] = { 'line_end', b }
keys['c:'] = { 'line_end_extend', b }
keys['ca:'] = { 'line_end_extend', b }
keys.cd = { 'clear', b }
keys.caN = { gui.switch_buffer }
keys.cn = { 'goto_buffer', v, 1, false }
keys.cN = { 'goto_buffer', v, -1, false }
keys.ce = {
function()
buffer:line_end_extend()
buffer:cut()
end
}
require 'textadept'
local keys = _G.keys
local b, v = 'buffer', 'view'
local gui = gui
keys.can = { new_buffer }
keys.cl = { 'char_right', b }
keys.cL = { 'char_right_extend', b }
keys.cal = { 'word_right', b }
keys.caL = { 'word_right_extend', b }
keys.cj = { 'char_left', b }
keys.cJ = { 'char_left_extend', b }
keys.caj = { 'word_left', b }
keys.caJ = { 'word_left_extend', b }
keys.ck = { 'line_down', b }
keys.cak = { 'line_down', b }
keys.cK = { 'line_down_extend', b }
keys.caK = { 'line_down_extend', b }
keys.ci = { 'line_up', b }
keys.cai = { 'line_up', b }
keys.cI = { 'line_up_extend', b }
keys.caI = { 'line_up_extend', b }
keys.ch = { 'vc_home', b }
keys.cah = { 'vc_home', b }
keys.cH = { 'home_extend', b }
keys.caH = { 'home_extend', b }
keys['c;'] = { 'line_end', b }
keys['ca;'] = { 'line_end', b }
keys['c:'] = { 'line_end_extend', b }
keys['ca:'] = { 'line_end_extend', b }
keys.cd = { 'clear', b }
keys.caN = { gui.switch_buffer }
keys.cn = { 'goto_buffer', v, 1, false }
keys.cN = { 'goto_buffer', v, -1, false }
keys.ce = {
function()
buffer:line_end_extend()
buffer:cut()
end
}
Monday, January 3, 2011
Installing a Bluetooth Headset on Windows 7
Thanks to Komeil Bahmanpour I can use my LG HBM-235 bluetooth earpiece with GMail phone calling.
(Windows will install the device but can't find the driver.)
(Windows will install the device but can't find the driver.)
Friday, December 31, 2010
Building a CLASSPATH in Windows
Thanks to Real's How To:
@echo off
setlocal ENABLEDELAYEDEXPANSION
if defined CLASSPATH (set CLASSPATH=%CLASSPATH%;.) else (set CLASSPATH=.)
FOR /R .\lib %%G IN (*.jar) DO set CLASSPATH=!CLASSPATH!;%%G
Echo The Classpath definition is %CLASSPATH%
...
java MyClass
Tuesday, December 14, 2010
Notepad++, The New Editor King (or, jEdit Dethroned)
I finally gave Notepad++ an honest going over, and it is unquestionably the most flexible tool for editing text the internet has to offer. It:
- handles my keybinding scheme
- is fast(er than jEdit)
- handles large files without choking
You can customize it to a ridiculous degree, and because it uses Scintilla for the editor, schemes should be portable across platforms (Geany, others).
Notepad++'s only real deficiency is its lack of full regex support.
Wednesday, December 1, 2010
Generalizing for Pathfinder Compatibility
I've looking at Pathfinder for a while (bought the core rulebooks and a few modules), but since listening the Chronicles: Pathfinder Podcast I'm energized to fix up the Grendel to be compatible with the core rules.
As always, I need knowledgeable testers to validate my suspicions (also some data entry help would be a huge help):
http://backdraft.cs.binghamton.edu:8080/cm-dev/unferth/grendel.html (short link: http://goo.gl/LbwE4)
If you're unfamiliar with Pathfinder, it's essentially a light extension of the 3.5 rules in a well-articulated campaign setting. It's published by the old publishing arm of Wizards of the Coast, Paizo Publishing.
Interesting fact about Paizo: the publisher writes modules.
Monday, October 4, 2010
Fixing XP
Here's a list of utility programs that make Windows XP a little nicer:
Power Menu: Window always-on-top
Power Resizer: Windows 7-style window resizing (half-screen on edge)
WizMouse: Scroll the window under the mouse
Alwact Clock: Onscreen click-through clock
AutoHotkey: keyboard mapping and scripting
PathTooLong: If you can't delete a directory because the path is too longSetCapsLockState, AlwaysOffCapsLock & a::IfWinExist jEditWinActivateelseRun C:\PROGRA~1\jEdit\jedit.batreturnCapsLock & q::IfWinExist ahk_class Chrome_WidgetWin_0WinActivateelseRun "C:\Program Files\Chrome\chrome.exe" --enable-accelerated-compositingreturnCapsLock & s::IfWinExist xplorer²WinActivateelseRun "C:\Program Files\zabkat\xplorer2_lite\xplorer2_lite.exe""return
Power Menu: Window always-on-top
Power Resizer: Windows 7-style window resizing (half-screen on edge)
WizMouse: Scroll the window under the mouse
Monday, September 6, 2010
Also, Character Sheets
Here it is, a character sheet:

The nice thing is, if you don't like it, they're easy to make and easy to fill in with character data.
Saturday, August 14, 2010
multi-class in motion

Help me test v0.6!
This version is undergoing regular development, so the usual caveats apply. If you find what think is a bug, please create an issue on my Google Code project site, or leave a comment on a recent blog posting.
Batch upload script for CouchDB (using curl and jsawk)
I looked all over for something small and simple like this, but couldn't find anything.
Dependencies:
spidermonkey (required by jsawk)
libmozjs2d (required by spidermonkey)
jsawk (for parsing CouchDB response)
curl
Ubuntu doesn't include spidermonkey in the repositories (it uses rhino instead) so you'll have to grab spidermonkey from the Debian.
Copy the below script (change http://localhost:5984/cm-dev/hrothgar to your server/db/document) and save yourself a lot of clicks in Futon.
Thanks to Micha for jsawk.
Dependencies:
spidermonkey (required by jsawk)
libmozjs2d (required by spidermonkey)
jsawk (for parsing CouchDB response)
curl
Ubuntu doesn't include spidermonkey in the repositories (it uses rhino instead) so you'll have to grab spidermonkey from the Debian.
Copy the below script (change http://localhost:5984/cm-dev/hrothgar to your server/db/document) and save yourself a lot of clicks in Futon.
Usage: upload.sh [path containing the files to upload]
hput () {
eval hash"$1"='$2'
}
hget () {
eval echo '${hash'"$1"'#hash}'
}
hput js javascript
hput html html
hput css css
directory=$@
if [ -z "$directory" ]
then
directory="."
fi
filetypes="$directory/*.css
$directory/*.html
$directory/*.js"
for file in $filetypes
do
filename=`basename "$file"`
ext=`hget ${filename##*.}`
rev=`curl -sX GET 'http://grendel.cloudant.com/cm-dev/hrothgar/' | jsawk 'return this._rev'`
echo File : $file
echo Current revision : $rev
echo Uploading document: $filename
echo "${ext}"
echo curl : curl -X PUT http://grendel.cloudant.com/cm-dev/hrothgar/$filename?rev=$rev --data-binary @$file -H 'Content-Type: text/'$ext
curl -X PUT http://grendel.cloudant.com/cm-dev/hrothgar/$filename?rev=$rev --data-binary @$file -H 'Content-Type: text/'$ext
echo --------------------------------------------
echo
done
Thanks to Micha for jsawk.
Tuesday, July 20, 2010
Multi-class support
The major feature for v0.6 will be multi-class character support.
Post your thoughts on what to put in the space created by the edit page rearrangement.
chardata.class_name => chardata.classes[name]=level
edit: current look
Wednesday, May 26, 2010
Flexible UI
I'm cooking the new UIs for v0.6, starting with 768x1024 (and 1024x768), since that's the iPad resolution, and I know a couple people with iPads (it also maps nicely to a sheet of paper). Everyone has opinions on what makes a good character sheet and pretty much everybody can draw, I'd appreciate some feedback on the new layout.
If you're feeling particularly contributory, send me a note and I'll add you to the drawing so you manipulate the bits yourself.
Sunday, May 16, 2010
Ideas for v0.6
If I ever get v0.5 to run on an iPhone, here are some ideas for v0.6:
Expandable UI
Depending on the size of browser viewport, the UI will reconfigure itself to better utilize the available space. Thinking the 2-column sections go 3 or 4, eliminate multiple edit screens (leaving just main and edit).

Expandable UI
Depending on the size of browser viewport, the UI will reconfigure itself to better utilize the available space. Thinking the 2-column sections go 3 or 4, eliminate multiple edit screens (leaving just main and edit).
Also, the Google Drawing app is just about "good enough". Still needs connectors.
Multi-class support
See later post for details.
Fast character switching
Currently, switching between characters requires a full reload of the webapp, should be able to change change character data without loading all the application data.
Use Google CDN for JQuery resources
The images for the JQueryUI haven't displayed correctly since I moved to CouchDB. Hopefully will fix that.Friday, May 14, 2010
Firebug to the rescue
Firebug has a more readable and perhaps more insightful profiler than Chrome:
My reckless use of TaffyDB is the biggest offender, with
UPDATE:
It appears the horrendous performance suction was caused my ordering of all static data elements:
I found the offending block by starting and stopping the Firebug profiler between breakpoints. It posts the results in the console, in the context of the logging. Just phenomenal tool.
Down to 4 secs:
This doesn't mean it will work on the iPhone, but it can't hurt.
My reckless use of TaffyDB is the biggest offender, with
isNumeric() way out of proportion (I mean, is it a number, or isn't it?).UPDATE:
It appears the horrendous performance suction was caused my ordering of all static data elements:
spells.orderBy({name:"logical"});
feats.orderBy({name:"logical"});
races.orderBy({name:"logical"});
domains.orderBy({name:"logical"});
classs.orderBy({name:"logical"});
schools.orderBy({name:"logical"});
weapons.orderBy({name:"logical"});
armors.orderBy({name:"logical"});
skills.orderBy({name:"logical"});
languages.orderBy({name:"logical"});
deitys.orderBy({name:"logical"});
specials.orderBy({name:"logical"});
favored_enemys.orderBy({name:"logical"});
I found the offending block by starting and stopping the Firebug profiler between breakpoints. It posts the results in the console, in the context of the logging. Just phenomenal tool.
Down to 4 secs:
This doesn't mean it will work on the iPhone, but it can't hurt.
Thursday, May 13, 2010
localStorage for offline use
I've put in some caching for the static data using the HTML5 feature "localStorage", localStorage is essentially a cookie, but without a cookie's size limit, and it will not get sent to the server (something I didn't even know about cookies). The Player's Companion should now be able to function offline, but unfortunately it does not appear to have any impact on load performance.
Sunday, May 2, 2010
v0.5 in Testing
v0.5 involved a complete rewrite of the data load scheme, and the way rules are handled. Basically, to add feat attack effects before, I had to add some JS to the calc_attack function (messy and does not scale). Now, I ask for all feats with an attack attribute (which is a function), and execute that block of code:
feat description:
While it's probably technically better, an unfortunate side-effect is that it no longer works on my friends' iPhones or my Android emulator. Must be my IBM training to write software for next-next generation hardware (I'm still waiting for a machine to run Lotus Notes).
feat description:
attack: "if(weapon.category == 'exotic') { attacks.weapon_proficiency = 0; } return attacks;",
function calc_attack() {
...
char_feats.get({ attack : { "!is": null } }).forEach( function(feat, i) {
// TODO - can we do this by reference
console.log("attack: " + feat.name);
attacks = feat.attack(attacks, weapon);
return attacks;
});
While it's probably technically better, an unfortunate side-effect is that it no longer works on my friends' iPhones or my Android emulator. Must be my IBM training to write software for next-next generation hardware (I'm still waiting for a machine to run Lotus Notes).
Friday, April 2, 2010
jEdit, Lord of the Text Editors
After a brief dalliance Sublime Text, I'm back to jEdit. Faster with large files, customizable keybinding, cross platform, truly awesome find/replace and it's Open Source (Sublime Text costs $60).
Plugins:
JDiffPlugin
TextTools
FirstMate (http://www.rutherfurd.net/jedit/plugins/firstmate/)
Minimap
Whitespace
Beauty
Two features I'm missing are next/previous recent buffer, and true full screen (a la Darkroom).
Thank you, jEdit!
Plugins:
JDiffPlugin
TextTools
FirstMate (http://www.rutherfurd.net/jedit/plugins/firstmate/)
Minimap
Whitespace
Beauty
Two features I'm missing are next/previous recent buffer, and true full screen (a la Darkroom).
Thank you, jEdit!
Wednesday, March 10, 2010
jEdit Maths
Search:
Replace:
^(\s+)"(.+?)" : ([0-9])(,?)Replace:
_1 + "\"" + _2 + "\":" + (Integer.parseInt(_3) + 1) + _4
Subscribe to:
Posts (Atom)



