Older blog entries for wainstead (starting at number 105)

12 Oct 2013 (updated 12 Oct 2013 at 21:09 UTC) »

Wandering around the Stunt ecosystem and GitHub

I've spent some time today compiling Stunt, trying out Improvise and looking at my fork of Stunt on GitHub. Been a long time!

I had little luck playing with the console one gets via Improvise (think: a terminal emulator in the browser), but it was cool nonetheless. The experience was much like loading the Minimal.db that comes with the original LambdaMOO server code: pretty much anything you type ends in a cryptic error.

Reading more documentation cleared things up a bit. I've half a notion to build out a personal website based off of Stunt and Improvise. My recent thinking is to plunge into the Indie Web movement a bit and run a personal site: first, as a WordPress site (just to get going) and then perhaps rolling my own CMS using Node.js or Django.

(The ideation phase is always the most fun, when all things are possible and sound really cool in your head).

But the possibly-meaningless thought of "making a personal web site that is programmable by any user" has the weird appeal of the pre-Cloud days of the Web, and even the weirdness of the pre-World Wide Web days of the Internet. (LambdaMOO was born roughly the same time as the web).

Well, much to think about. I'd like to see Stunt become widely available via various package management systems (Fedora, MacPorts, etc).

Oh, I should note here I've moved to Key West, Florida. This came about after, one day in May, I was looking at the classified ads in the online edition of The Citizen, Key West's local paper. There was a job listed in Help Wanted that was perfect for my wife: Director of Development for the Key West Art and Historical Society. I teasingly sent the ad to her, she applied for it just to show me up, and landed the job. So in short order we moved from Las Vegas to Key West.

This spells the end of my technology-scene-building days for a while. Vegas was a tabula rasa as far as tech scenes go, so I plunged myself into every tech Meetup there was and started one of my own (Las Vegas Developers Meetup, for any software developer regardless of technology). I also cofounded the first Vegas GiveCamp, a weekend hackathon for charity.

But since at least the middle of this year I've longed to get back into open source development. Probably longer. I think the free time is now there to finally finish work on Automake and roll some Linux distro packages. 

Syndicated 2013-10-12 19:38:00 (Updated 2013-10-12 20:57:55) from Wainstead

Stunt is now C++

Over at Stunt.io, Todd Sundsted has released the C++ version of Stunt, his fork of the LambdaMOO server.

Much of my Waverous LambdaMOO went into it, even if not directly: Todd had done so much work on the multiple-inheritance addition to the MOO scripting language that my branch was too far out of sync with the mainline to be merged... but Todd used my branch as a guide.

See the announcment on the MOO-talk mailing list!

Syndicated 2013-06-22 15:49:00 (Updated 2013-06-22 15:49:36) from Wainstead

Long hot summer

I have nothing new regarding the project. I've been super busy running LVDev, participating in the National Day of Civic Hacking (I won the category "Best Civic Hack"), and organizing the first Las Vegas GiveCamp.

Lately I've been longing to plunge into more open source work though!

Syndicated 2013-06-05 20:50:00 (Updated 2013-06-05 20:50:17) from Wainstead

22 May 2013 (updated 22 May 2013 at 17:44 UTC) »

I've longed for an implementation of sdiff for Git, but in the meantime I have something that works great on OS X. It requires FileMerge, part of the developer tools from Apple. Hat tip to my friend Dale.

This works when:
  • You are in a branch,
  • the branch differs from master, and
  • the file you're interested in differs in your branch and master.

    The command is:
    git difftool -t opendiff $(git log --pretty=format:%H -1 master -- $1) $(git log --pretty=format:%H -1 HEAD -- $1) -- $1

    (I'm using subshell calls to get the SHAs of the file for the branch and master; a simplified look at the command is:
    git difftool -t opendiff SHA-master SHA-branch -- path/to/file.py).

    I put this in a shell script and call it with the relative path to the file. Git is picky about that relative path; it should be relative to the current directory your shell is in, and a directory that is in the repository.

    Assume you named the script my-sdiff. Example:
    my-sdiff relative/path/to/file.py

    You'll be prompted at the shell with something like:
    Viewing: 'relative/path/to/file.py'
    Launch 'opendiff' [Y/n]:

    Just hit RETURN and FileMerge should open, showing you a side-by-side comparison of the file.

    Vexingly, if you get the relative path wrong, nothing happens! If you don't get the Y/n prompt you probably have the relative path wrong.
  • Waverous patches soon to be integrated into Stunt

    I saw a wonderful message from Todd Sundsted this weekend on the MOO-Talk list:

    Next up, I'm going to start integrating Steve Wainstead's C++ patches into Stunt. This will give us better tools for abstracting away some of the complexity in the current codebase.
    I haven't been doing anything with Waverous for months now and this is a shot in the arm. In part I took a deep dive into Minecraft and spent a lot of time on it -- a few hundred hours of playing time.

    This was a direct result of reading Jane McGonigal's "Reality Is Broken: Why Games Make Us Better and How They Can Change the World." I never knew all those years of playing Grand Theft Auto were making me happier and mentally healthier. I sold my PS3 a couple of years ago and decided I wouldn't sink any more time into gameplay. When my wife took a four day trip to New Orleans I decided to spend the alone-time in a new immersive experience. I loved every minute of it.

    This is related peripherally to LambdaMOO development work in that some people still use MOOs to create and play games. The MOO I reside on does not do this, but one of the projects I want to pursue is use the package management system of Stunt to create some rooms and objects... I think prefabricated worlds (or even just portions of worlds) offer some good potential for wizards and world building. Imagine someone recreated the world of Harry Potter in a MOO: another person could contribute the Hogwarts Express, for example. The world builder might have two or three Hogwarts Express packages to choose from, offering different features. Todd's package management system will allow a level of sharing that was never possible before with LambdaMOO.

    I highly recommend watching Jane McGonigal's TED talk "The Game That Can Give You Ten Extra Years of Life."

    Syndicated 2012-12-09 21:50:00 (Updated 2012-12-09 21:52:54) from Wainstead

    26 Sep 2012 (updated 26 Sep 2012 at 16:41 UTC) »

    I haven't called AppleScript from Emacs in a while. Cooked up an Emacs command today to to make iTunes either play or pause, depending on its state. It's nothing fancy.

    (defun sw-pp ()
    "Make iTunes either pause or play"
    (setq apscript "
    tell application \"iTunes\"
    if player state is paused then
    end if
    end tell
    (do-applescript apscript)

    (An aside: I'm using the code HTML tag here to render the above code, which doesn't honor indentation. Using the pre tag double spaces the code, which strikes me as a bug).

    Formally, I should use (let) instead of (setq) (which creates and sets a global variable) but I'm too lazy to work out the syntax. Writing Emacs Lisp is not yet second nature to me.

    TIL Emacs's "echo area" is a different thing from the minibuffer.

    I was looking for a way to write to the *Messages* buffer only, and not to the "echo area" at the same time. The function message writes to both the "echo area" and the *Messages* buffer, which is too noisy for my little Emacs extension, desktop-auto-save.

    7 Aug 2012 (updated 7 Aug 2012 at 16:03 UTC) »

    How to teach ctags to read Cheetah template files:
    1) Create a file in your home directory, .ctags (i.e. $HOME/.ctags).

    2) Edit it:

    --regex-cheetah=/^#def[ \t]*([a-zA-Z0-9_]+)/\1/d,definition/

    (This assumes your Cheetah templates use the extension .tmpl. Change --langmap to suite your needs).

    This is for Exuberant Ctags, not the stock one that ships on some systems. If you run ctags --version and it doesn't tell you it's Exuberant Ctags you probably have a different version.

    Cheetah is a templating system used in Python programming. I use it at work and yesterday I finally decided to do something about Cheetah template support in my TAGS file (I use Emacs; vim users will use a file called "tags").

    Be sure to run ctags again to generate a new tags file; you may need to tweak the command line flags so ctags picks up your template files:

    ctags -e -R --languages=-html,python

    It's neat that this can be accomplished just through command line flags! I thought about writing an extension or a patch in C, but this small bit of work does pretty much all I need.
    13 Jul 2012 (updated 14 Jul 2012 at 04:10 UTC) »

    A C++ version of Stunt is born


    -*- mode: compilation; default-directory: "~/Sites/projects/moowork/stunt-swain/" -*-
    Compilation started at Thu Jul 12 19:38:35

    [ config.h : config.status ]
    config.status: creating Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    g++ -m32 -O -DHAVE_CONFIG_H -c -o ast.o ast.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o base64.o base64.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o code_gen.o code_gen.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o collection.o collection.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o db_file.o db_file.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o db_io.o db_io.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o db_objects.o db_objects.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o db_properties.o db_properties.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o db_verbs.o db_verbs.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o decompile.o decompile.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o disassemble.o disassemble.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_env.o eval_env.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_vm.o eval_vm.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o exceptions.o exceptions.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o exec.o exec.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o execute.o execute.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o extension-fileio.o extension-fileio.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o extensions.o extensions.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o functions.o functions.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o hmac_sha2.o hmac_sha2.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o http_parser.o http_parser.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o json.o json.c
    bison -y -d parser.y
    mv -f y.tab.c parser.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o parser.o parser.c
    touch y.tab.h
    g++ -m32 -O -DHAVE_CONFIG_H -c -o keywords.o keywords.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o list.o list.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o log.o log.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o map.o map.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o match.o match.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o md5.o md5.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o name_lookup.o name_lookup.c
    touch net_single.o
    touch net_multi.o
    g++ -m32 -O -DHAVE_CONFIG_H -c -o network.o network.c
    touch net_mp_selct.o
    touch net_mp_poll.o
    touch net_mp_fake.o
    g++ -m32 -O -DHAVE_CONFIG_H -c -o net_mplex.o net_mplex.c
    touch net_bsd_tcp.o
    touch net_bsd_lcl.o
    touch net_sysv_tcp.o
    touch net_sysv_lcl.o
    g++ -m32 -O -DHAVE_CONFIG_H -c -o net_proto.o net_proto.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o numbers.o numbers.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o objects.o objects.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o parse_cmd.o parse_cmd.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o pattern.o pattern.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o program.o program.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o property.o property.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o quota.o quota.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o regexpr.o regexpr.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o server.o server.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o sha1.o sha1.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o sha256.o sha256.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o storage.o storage.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o streams.o streams.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o str_intern.o str_intern.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o sym_table.o sym_table.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o tasks.o tasks.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o timers.o timers.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o unparse.o unparse.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o utils.o utils.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o verbs.o verbs.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o version.o version.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl.o yajl.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_alloc.o yajl_alloc.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_buf.o yajl_buf.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_encode.o yajl_encode.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_gen.o yajl_gen.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_lex.o yajl_lex.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_parser.o yajl_parser.c
    g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_version.o yajl_version.c
    g++ -m32 -O -DHAVE_CONFIG_H ast.o base64.o code_gen.o collection.o db_file.o db_io.o
    db_objects.o db_properties.o db_verbs.o decompile.o disassemble.o eval_env.o
    eval_vm.o exceptions.o exec.o execute.o extension-fileio.o extensions.o functions.o
    hmac_sha2.o http_parser.o json.o keywords.o list.o log.o map.o match.o md5.o
    name_lookup.o network.o net_mplex.o net_proto.o numbers.o objects.o parse_cmd.o
    pattern.o program.o property.o quota.o regexpr.o server.o sha1.o sha256.o storage.o
    streams.o str_intern.o sym_table.o tasks.o timers.o unparse.o utils.o verbs.o
    version.o yajl.o yajl_alloc.o yajl_buf.o yajl_encode.o yajl_gen.o yajl_lex.o
    yajl_parser.o yajl_version.o parser.o -lexpat -o moo
    rm parser.c

    Compilation finished at Thu Jul 12 19:38:51

    bash-3.2$ ./moo Stunt.db Stunt.db.new
    Jul 12 19:46:36: CMDLINE: Outbound network connections enabled.
    Jul 12 19:46:36: STARTING: Version 1.8.3+?_ad_hoc_?? of the LambdaMOO server
    Jul 12 19:46:36: (Using BSD/TCP protocol)
    Jul 12 19:46:36: (Task timeouts measured in server CPU seconds.)
    Jul 12 19:46:36: (Process id 39697)
    Jul 12 19:46:36: LOADING: Stunt.db
    Jul 12 19:46:36: LOADING: Reading 11 objects ...
    Jul 12 19:46:36: LOADING: Done reading 11 objects ...
    Jul 12 19:46:36: VALIDATING the object hierarchies ...
    Jul 12 19:46:36: VALIDATE: Phase 1: Check for invalid objects ...
    Jul 12 19:46:36: VALIDATE: Phase 2: Check for cycles ...
    Jul 12 19:46:36: VALIDATE: Phase 3: Check for inconsistencies ...
    Jul 12 19:46:36: VALIDATING the object hierarchies ... finished.
    Jul 12 19:46:36: LOADING: Reading 94 MOO verb programs ...
    Jul 12 19:46:36: NAME_LOOKUP: Started new lookup process
    Jul 12 19:46:36: LOADING: Done reading 94 verb programs ...
    Jul 12 19:46:36: LOADING: Reading forked and suspended tasks ...
    Jul 12 19:46:36: LOADING: Reading list of formerly active connections ...
    Jul 12 19:46:36: LOADING: Stunt.db done, will dump new database on Stunt.db.new
    Jul 12 19:46:36: INTERN: 770 allocations saved, 9815 bytes
    Jul 12 19:46:36: INTERN: at end, 750 entries in a 10007 bucket hash table.
    Jul 12 19:46:36: Loaded protect cache for 177 builtin functions
    Jul 12 19:46:36: LISTEN: #0 now listening on port 7777
    Jul 12 19:46:36: > WARNING: Log-in via passkey is enabled for the following players
    (specified in $passkey_players):
    Jul 12 19:46:36: > WARNING: "Wizard" (#5)
    Jul 12 19:46:36: > WARNING: "Programmer" (#6)
    Jul 12 19:46:36: > WARNING: This is a severe security vulnerability. In a secure
    environment you should:
    Jul 12 19:46:36: > WARNING: disable passkey login:
    Jul 12 19:46:36: > WARNING: ; $disable_passkey_login = 1
    Jul 12 19:46:36: > WARNING: ; $passkey_players = {}
    Jul 12 19:46:36: > WARNING: disable existing passkeys:
    Jul 12 19:46:36: > WARNING: ; #5.passkey = 0
    Jul 12 19:46:36: > WARNING: ; #6.passkey = 0
    Jul 12 19:46:36: > WARNING: and for good measure:
    Jul 12 19:46:36: > WARNING: ; set_player_flag(#5, 0)
    Jul 12 19:46:36: > WARNING: ; set_player_flag(#6, 0)
    Jul 12 19:46:36: > PASSKEY for "Wizard" (#5): 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442 (keep it secret)
    Jul 12 19:46:36: > PASSKEY for "Programmer" (#6): 2B3BE77D36447234AE5AEBB920FC1E3F7B0FDAB8D4169A3FED23C57C0753C398 (keep it secret)
    Jul 12 19:46:54: ACCEPT: #-2 on port 7777 from localhost, port 56831
    Jul 12 19:47:11: CONNECTED: Wizard (#5) on port 7777 from localhost, port 56831
    And connecting:

    Connected to localhost.
    Escape character is '^]'.
    Welcome to Stunt! For information about Stunt, check out http://stunt.io/. To
    connect to the server, type "connect ".
    connect 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442
    *** Connected ***
    In truth, there's one more file that needs modification: exec.c, which uses goto as it was meant to be used but g++ doesn't like it. But that's a small obstacle to overcome.

    UPDATE! Todd sent me a patch for exec.c. I've applied, compiled, tested, committed and pushed it.

    Syndicated 2012-07-13 03:49:00 (Updated 2012-07-14 03:14:00) from Wainstead

    9 Jul 2012 (updated 9 Jul 2012 at 18:09 UTC) »

    The finish line nears!: Merging Waverous's C++ changes into Stunt

    Yesterday I had several blissful hours to hack away, applying patches to the "waverous" branch in my fork of Stunt.

    I had to deal with a few more places in the Stunt code that differed from the Waverous code; namely, Stunt was forked from a later commit of LambdaMOO than Waverous was. (I started with the code base on Sourceforge, whereas Todd started with the code base on Github). There are several places that use a new macro, TRY_STREAM, which in turn uses the original TRY macro. I fixed the compiler error occurring after macro expansion (which didn't turn out to be all that hard, fortunately).

    By midnight last night I had the project successfully compiling, which was quite exciting. But the linking phase was failing; I found I was missing a handful of source files in Makefile.in, like json.[hc], collection.[hc] and a few others.

    I think the Makefile.in is now up to date and I just have to update the files for File I/O to make g++ happy. After that, there's about 100-150 patches to look at but the vast majority of them are specific to my goals with Waverous, like including the LambdaMOO and JHCore databases, removing scripts used during porting, adding documentation, helper tools like Neil Fraser's Moo Database Browser, etc.

    I think there are a handful of patches to apply still that deal mostly with updates to the Autotools but I consider those to come after the milestone of a running "Stunt++" server. Todd announced my work on the MOO Talk mailing list this morning.

    Syndicated 2012-07-09 15:26:00 (Updated 2012-07-09 17:36:08) from Wainstead

    96 older entries...

    New Advogato Features

    New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

    Keep up with the latest Advogato features by reading the Advogato status blog.

    If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!