Special

All

Recent

More Fun Links

Artima

CodeProject

The Hump

trapexit.org

Stuff to Read

Notes on Programming

The Boost Graph Library

People

Alexander

Allan

Ian

Cristian

jjinux

Joel

Paul

Peter

Bruce

Steve

Scott

Guido

Keith

Donald

wreel

blog

More Tasks

  • Get Subversion set up (done)
  • Get Trac up and running (done)

Tasklist

  • Finish binary packer (done)
  • DND inspector
  • Port bsd_socket.hpp to windows
  • Continue work on wimp
  • Figure out a real problem and solution to apply BGL to.
  • Point DtDNS to test server
  • Continue work on sboard
  • Document tasklet.js and talk about coroutines

MinGW and ASIO

Happy Fun Time with MinGW

I've finally retried the MinGW for portable Win32 development and I've been surprised at how well everything has been coming together. That install was hot on heels on yet another failed install of the Visual C++ Express environment and limited success with Win32 digital mars (although I did have fun with the D language). I had done a half-assed attempt at working with MinGW with MSYS a long time ago but didn't really understand what it was all about. It helps if you Read the Fine Manual... and they had developed the minimal set installer for 5.0.2. When that NSIS exe dropped the minimal set tarballs: binutils gcc-core gcc-g++ mingw32-make mingw-runtime w32api I finally understood that you really didn't have to have MSYS to run or even compile executables built by MinGW. Which, going back to the statement about reading manuals, is explained on the download page

If you want to download the minimal set of tar.[gz|bz2] you will need the mingw-runtime, w32api, binutils and gcc tarball packages. You can find the current versions of these in the "Current" section above. These will allow you to create your win32 native packages from the command line or configurable IDE. Other packages that you might need to round out your minimal installation are gdb and mingw32-make.

After some successful compiles, checking it out with Raymond Chen's scratch program, getting Boost to compile using the -sTOOLSET=mingw swith without any problems and creating an exe with the MinGW version of ocamlopt I've pretty much commited to using this environment for Windows development.

Chris is way ahead of you

Well, in doing a little code research with Google's latest lab creations I found out about the one of the recently accepted library's to the Boost family. Christopher M. Kohlhoff's asio. I haven't had a chance to play around with it but it looks like it's going to be pretty darn useful. Looking through it, simple things like resolver and query seemed like overkill at first. I'm a big fan of the lazy host resolver concept of a single instance of an address type that's used in Python. But there's that "A" in ASIO to think about so really using an io_service for what is essentially a DNS query only makes sense. But still, the Proactor pattern itself seems rather large in comparison to the select() or poll() loops that I normally read but I'm sure I can get my head around it. I just need to spend some quality time with it.

Main project

I still need to try to make time for my main project. In the meanwhile I had created a quick random movie selector from a dump of our DVD collection from DVD Aficionado using the hodgepodge framework that I had created. I was happy with the results. Although I am having second doubts about using the Dreamweaver template keywords as the drivers for my template engine so I may change it. But chances are that they will still be based on the HTML comment syntax just so that the templates themselves will be designable in common tools.

Playing with Boost iostreams

I was looking through boost and found the iostreams library. I wanted to see what it was all about so I whipped up a C++ socket operations layer, Code:bsd_socket.hpp, to fit the concepts and applied it to the streams adaptor.

Here's the results: Code:bsd_test.cc

Admin Console

Starting on admin console. Realizing that a general listing structure would be quite useful. Wrestling with how much ria will be used. Do inline edits for listings make sense? Are new entry adds asynchronous? Etc.

Will also need to create a sub-navigation area.

Local Development

Just about to get local development set up. I have just about all the tools and the application replicated. Now all I need to do is configure the FTP account for Dreamweaver and figure out how I'm going to do code migration.

Status: Local development set up. It's turning out to be quite awkward to use the Dreamweaver template controls for both page extentions and server side page descriptions but it'll do for now. Started with the administration controls.

SQL & RDMBS Woes

Well, I have to make a confession to myself. I don't know relational database design. This is mostly due to the fact that I normally work with a different type of datastore that puts the burden of data integrity and data access on the application code (i.e. we use indexed files). This has been a major slow down in progress where I have to make decisions on structure when I don't have the experience to back it up (e.g. like whether or not to use multi-component primary keys on join tables or when to cascade or restrict operations tables with foreign key relationships).

Python Data Access Ideas

Nice style

Just a nice style

Administration, CRAM, Design Mode & Logging

  • Create administrative application.
  • Minimize index server start-up script.
  • Look into db-connection pooling as a middleware component?
  • Parameterize base package name for application dispatch.
  • Parameterize template directory.
  • Figure out how to integrate DreamWeaver into template creation using site FTP synchronization. (Sort-of Working)
  • Implement logging facilities using the Python logging module. (specifically the RotatingFileHandler) (Done)
  • Create CRAM authentication using client side hasing. (Done)

PostgreSQL & Python in UTF-8

Things to do:

  • Create unicode database and test schema. (in progress)
  • Check what encoding translations are required.
  • Finally get around to learning locale settings.
  • Test the available PygreSQL module. (done)
  • Create a more enticing test template. (done)

Streaming HTML Render

Things are starting to come together. flup is doing it's thing and I'm slowly understanding WSGI. Now the real point of interest right now is the ability to stream html as it's being processed back to the client browswer (to increase the feeling of immediacy for the web-site as a whole). The template system I've built is a tree structure of segments and text-insertion-points with the possibility of repeating sub-components and conditional segments. That template structure is then merged with a data set (yet another tree structure of attributes representing the page's runtime data) which is rendered to a list for WSGI.

Now I want to up the ante. My intent is to send an iterator/generator directly back to WSGI for the internal write() loop. I have to restructure the merge system completely and push the component renders to an iterable system. The Compiled-Template-Tree will probably need a new interface that's unaware of the entire data-set being feed. That responsibility will be forced to a new Render component which will now be in charge of merging the template and the data-set.

After the new Render system, I want to create an application system that will sit in for the data-set dictionary. I'm still not sure if I want to keep the dictionary interface or go with an object interface. Basically __getxxx__ will be overridden in a base class to allow for components to be literal strings or callable components of the application object(s) (as outlined by the class).

Status: I've got the Render system working now and I feel pretty comfortable with it. Basically the end result looks like:

def handler(environ, start_response):
    template = loadTemplate('main')
    dataset = #... load map based dataset
    start_response(#...
    return Render(template, dataset)

The Render object is just an interator which will return processed fragments on demand (i.e. on next()). To test this I created a generator that created 30,000 lines and sent that as a repeating component in the data-set to Render. When the page was being served up the first thousand lines were rendered immediately and I could watch the scrollbar shrinking and moving as the rest of the page was being feed back over the next couple of minutes. Groovy.

I've decided to keep the incoming data-set as a Dictionary protocol. I think that's the most straitforward interface that should be both flexible and minimal. The only interfaces that the incoming data would have to honor is __getitem__, __contains__, and, if there are repeating members __iter__. This should be able to work for dictionaries, objects, generators, iterators, custom sequences, custom maps, etc.

Status: I like the map interface for the data-set. The ability to do this:

def appOverview(env, form):
    dataSet = {}
    template = loadTemplate('main')
    dataSet['title'] = 'Overview Page'
    dataSet['tabs'] = tabs
    dataSet['overview'] = {}
    return Render(template, dataSet)

or this:

class PageOverview(CachedMapping):
    def __init__(self, tabs):
        CachedMapping.__init__(self)
        self.title = 'Overview Page'
        self.tabs = tabs
        self.overview = True

def appOverview(env, form):
    return Render(loadTemplate('main'), PageOverview(tabs))

is pretty nice.

ErlFcgi

I knew that Erlang was not totally devoid of FastCGI support. It turns out they have header support for incoming messages embedded into the standard OTP distribution. I saw the switch in inet:setopts/2 for {packet,fcgi}. They leave the rest up to imagination but I did find the references to it in erts/emulator/drivers/common/inet_drv.c

The header information is included in the Packet data but Erlang's bit syntax is so mind-numbingly easy and expressive, processing the record will barely be an issue.

Now I'm taking a crash course in Erlang programming conventions (gen_server, supervisors, trapexit) but I did find a wonderful site that going up on the sidebar. http://www.trapexit.org/ is looking like a very good resource for Erlang programming.

Gentoo and Erlang? Awesome.

I'm running off of the Fast Web Server example which is somewhat parallel to what I want to do.

I'll see how far I can get before I get distracted by something shiny.

Status: First I was sick, then I moved. Hopefully I can get back to working on this but I still need to setup my machines.

Dynamic Calender

Create a dynamic calender for navigation of blog (or as I like to call them, reverse chronological online journal) entries. I've already pulled the the atom feed so the data is there already. I just need to dive into the fascinating world of time and calendering.

FastCGI

What the heck is FastCGI and what can it do for me?

I don't know if it's annoying or funny that I search for "erlang fastcgi" and this page is in the first set of hits.

Update: I think I'm starting the really appreciate flup. I can see why web.py uses it. In any case, I'm starting to figure out what FastCGI (a.k.a. FCGI) is all about. It really didn't start clicking for me until I read about the mod_fastcgi process monitor. Up until then I was confused about who was actually invoking the persistent service (at least in the Apache world). It may not have helped that I was also trying to figure out mod_python at the same time (the single script handler for any resources path ending in .py is still very confusing if you don't get the heads-up first).

I haven't really learned the ins and outs of configuring mod_fastcgi but, at least with first impressions, I'm not that excited about the process manager. With the type of hosting that I'll be targeting, I would prefer to manage my own processes. As in processes running as my login account. I know of of a pretty good tool that could do that already but I'm not too sure on how flexible the external service configuration support is in mod_fastcgi. We shall see.

Update: I'm very very tempted to create an Erlang fastcgi interface. I did get FastCgiExternalServer with the -host option to work on my quick tester daemon. By the way, I wont be able to do that on the hosted platform (external server definitions are only allowed in the Server context) which means that I'm going to have to do something to the extent of create a FIFO or domain socket that will serve as a controller to the server process. Or I may just have to let the mod_fastcgi process manager do it's thing (which will probably be the option I go with). Of course that's all under the assumption that the hosting center will expose FastCGI capabilities. I should probably check that soon.

Update: Hosting service has all the hooks and flup worked like a champ. They don't, of course, allow persistent processes to stick around for that long though.

Python parser

See what the Python parser module is all about. More importantly, would it be possible to generate native Python data structures and code from an HTML template? How would that be different from meta-class creation?

Status: Terrible idea. It turns out that pickle will do everything that I need. Although it was pretty interesting to see the parser drop an exceptionally deep tree for a + 5.

Another side effect is that I've taken to be quite keen on the idea of yielding lexemes. Now I just have to learn the ins and outs of setting up grammar tables.

Blog Index

Might want to do an internal blog index using the same method of scraping that I'm doing for this front page. Cookies are used to save the subdomains of interest. The side bar would be the list of subdomains. Onclick for those items would populate the id="application" section of the main page.

Cross sub-domain requesting. So painful.

Status:Yeah. I'm close to giving up on this one.

Make Time for BGL Experiments

I need to make time for trying to to use the boost graph library to validate antenna path configurations (directed graph).

Status: It turns out there is quite a bit of adaptation involved to get the compatibility for your pre-existing data structures. But that's fine. At least the possibility of using a C style data-structure that already exists for a non-trivial dependencies tools is possible and it certainly beats having to create parallel data-structures.

  • Check connectivity
    • Antenna paths, normally, should be leaf-less for simulations
  • Look for dead ends
    • (simple case finds is easy. just look for nodes without out-edges. don't even need the BGL for that)
  • Spot islands

Side Effect: source-highlight is pretty cool.

Idea

AJaX out the blog feed to the front page? I might do a mini-schema trick for the incoming feed xml.

Things to do
  • Feed Requester (done)
  • Schema Binder (done)
  • Entry Template (done... sort of)
  • Fader Timeline (later)
  • Fix Feeder for IE (done)

What am I going to use this for?

Well, I have a personalized infogami. Now I have to figure out what to to with it. I've taken a liking to infogami because it's free, spartan, new, and wiki-esque. I was highly pleased to see the Javascript infogami hit a spike in popularity but I think it's popularity was due more-so to an enticing title rather than the content itself (although it was helpful to me when I was writing it). That fun is over so now it's back to work.

Chances are that I'm going to use this space for myself as a log of projects. It'll just happen to be public.