Archive for July, 2009

July OSUG Meeting

Thursday, July 30th, 2009

I did my presentation on Django today at the Colorado Spring OSUG. It was the short-talk before Stormy Peterson’s long talk, which was extremely interesting. I can’t believe we got the GNOME Foundation executive to speak at our little meeting!

The most interesting part of her talk was how Nokia ended up creating this ecosystem of open source consultants serving a bunch of different industries and companies.

She also pointed out that open source is a bit behind the curve on cloud computing, which shouldn’t be the case because networking and distributed systems is FOSS’s bread and butter.

I was really impressed, the GNOME Foundation has there stuff together. I’ll post some more about Stormy’s talk after I go through my notes.

The Django talk went off well, a couple of the hard questions were why choose Django (or Rails, or wordpress, or Drupal) for a webframework/CMS, which may make a good topic for a later talk.

There was also a bit of talk on how to scale Django/webframeworks efficiently. All in all it was a great success.

The Sapir-Whorf Hypothesis and Practice

Saturday, July 18th, 2009

I recently read an article about a scientist doing experiments on the Sapir-Whorf Hypothesis that basically should that certain linguistic features correlated with skills or perceptions.

The perceptive associations, such as gender with nouns like keys or death, are probably caused by the consistent differences speakers have in their internal lexicon from their native language. This isn’t unique to language, but to life experience or exposure to different association. For instance, a cardiologist and a sports coach would associate different things with “heart”. The cardiologist would probably focus more on physiology, while the sports coach would associate it with bravery, spirit and tenacity.

The other intriguing difference is the measured difference in perceptual skills depending on the speakers native language. Now the article I linked to earlier emphasized that this proves linguistic determinism (the Sapir-Whorf hypothesis). However, I think that it probably has to do more with how people practice these skills. If you have to perceive something every time you construct a sentence, you would get really good at it!

Corey Haines’ video about practice really hit this home to me. Languages that have differences in how they are constructed just provide excellent opportunities to develop these skills. The same phenomenon happens with non-linguistic skills, be it playing an instrument, drawing in a specific style or programming in a specific language. Practiced skills become second nature, part of the subconscious mental processes we don’t even consciously realize are happening.

An uncrashable OS

Saturday, July 11th, 2009

In my travels around the interweb, looking for cool open source projects, I’ve come across many very cool looking technologies that don’t seem to have much external support yes.

Minix

A small unix operating system with a real working microkernel, it aims to be small, easy to understand (from a technical perspective) and robust. All drivers run in userspace and can be restarted transparently to prevent crashes. Theoretically, something built on minix would be extremely robust and stable.

Cyclone

A (very) C like language with changes and enhancements to allow for writing secure low level programs. A system written in Cyclone would be robust against buffer-overflows and various other ’standard’ attacks. It also happens to compile out of the box on Minix.

TinyPy

A small implementation of python, similar in architecture to Lua.

My Dream

A system as follows:A stack of Minix, Cyclone and TinyPy to make a small, secure operating system that is easy to program in for end users. All the core (or as much as possible) would be written in Cyclone, porting pieces of Minix as necessary. TinyPy would also be ported to Cyclone and would be the primary language for everything that didn’t need to be written in Cyclone.

I’d like to find a small, standard piece of hardware I could test it on (perhaps something based on Arduino?) But I doubt I’ll ever get time to do this unless I become a Ph.D. and make undergrads and grad students work on it.

But it would be totally cool to have a full stack embeddable OS that was secure by default and very robust.

Structured Programming And Single Exit Point

Friday, July 10th, 2009

One of the tenets of structured programming that isn’t followed in modern programming is that of the single point of exit.

Based on the structured programming book I read, single point of exit is required to allow for easy postconditions of program functions and to allow the use of “prime programs” for reasoning about a system. The first one isn’t that big of a deal, you can just “wrap” the program up to get points where you can write postconditions. The only problem is that you end up with a non-tiny collection of prime programs.

I’m going to have to read Knuth’s “Structure Programming With Goto” again to figure out how reasons about code with gotos. This is also important for reasoning about exceptions.

Concurrency

Tuesday, July 7th, 2009

Threads suck! Alright, maybe I’ve been convinced by the Shub, or hung around python people too much, but threads should be considered a concurrency primitive, not a concurrency solution. Processes, actors, mailboxes, however you want to describe, they are much easier to understand and get right.

So when I have some time, or a project that requires concurrency (GUI, game, something like that) I’d like to use Axon and Kaemelia. They seem conceptually smaller and simpler to grasp than twisted. Ideally I’d be able to make a gui through using Axon components with Qt, but I’ll have to investigate how the best way to interface the Axon generators to Qt callbacks would be.

What also appeals to be is since each component is separated, they can easily be unit tested. Also, no global variable or race condition issues, yay!

[As a side note, Hoare actually extended his logic for sequential systems to concurrent systems sometime in the 1980s, either 1980 or 1984, if I do any heavy duty cleanroom development with concurrency, I'll probably have to look those up.]

Goodbye Feedjack, Hello Galaxy

Monday, July 6th, 2009

Alright, just skimming the code, Galaxy seems to be a much better feed aggregator for use as a reusable app than feedjack is.

Now I just have to remember the command-line fu to get pip to install editable packages.

That is all.

Activities

Monday, July 6th, 2009

I absolutely love tutoring people. Especially when they’re smart and excited, it’s really rewarding.

I’m changing strategies with my Pinax project, I’m giving up on using feedjack for the near future and concentrating just on the functionality that I know will work. So, bookmarks and tribes and the “basics”.

I also need to make some CSS changes, a lot of text paragraphs are non-clickable and actually expand into a form. I need to make these show a hand on rollover and be underlined, potentially dashed underline or blue. The forum for edit summaries in the wiki also needs to be decreased. Messaging could do with an auto-complete widget. It’ll be interesting to see if anyone uses the other language interfaces — or posts no-english content. I’ll have to double check google adsense if they have a hissy with such things [UPDATE -- it appears they don't].

The code for tinypy is really simple and easy to follow, at least at a high level. I’m going to use doxygen to generate a “navigable” setup and callgraphs and dependencies graphs for it. From there I can start understanding it more deeply, maybe write some more documentation to be integrated with it.

Pinax

Sunday, July 5th, 2009

I’ve successfully whipped up a Pinax project that only has tribes and bookmarks, and plugged in feedjack as a separate tab.

However, it appears that feedjack isn’t designed to play well with others in the Pinax style. It doesn’t use RequestContext objects on any of the views it returns, or the context processing machinery of Django at all. This means I’ll have to violate DRY and hardcode media URLs in the templates for feedjack.

Besides that, everything seems to be going smoothly. I’ll work on hardcoding the URLs for media later this week and once I get everything using the same stylesheets I’ll work on making up a new theme and CSS.

TinyPy

Sunday, July 5th, 2009

After my last talk at the local OSUG, I’ve thought of a new long-term project/topic I’d like to talk about. TinyPy. I think a talk on tinypy internals and virtual machines in general would be totally awesome.

Now the trick is that I don’t actually know much about them, so I have to go through and learn how tinypy works. To learn tinypy, I’d like to write “elucidative programming” style documentation of tinypy and cleanroom style informal proofs (expected functions, black boxes) of how it works. Definitely a large project, but I’ll start with the core and move outward from there. Since compilers are the core of computer science, I think it’ll be worthwhile. Plus I’ll get to practice using Sphinx and cleanroom re-engineering.

A vague idea I had, which probably isn’t workable, is to make tinypy such a strict subset of bigpy. The things that would primarily change would be the lack of distinction between dicts and object and some of the metaprogramming stuff. This only crossed my mind because it appeals to my sense of aesthetics.

Another crazy idea would be to experiment with type annotations and emitting C code, and eventually making tinypy self-hosting. PyPy is already doing this, but they’re a lot smarter than I am and are working on a tracing JIT, my goals would be much less ambitious. Perhaps I could build something on top of the Apache portable runtime, since that makes C more bearable.

Pinax

Saturday, July 4th, 2009

So I’ve been playing with the Pinax 0.7 beta 3 a bit. So far it all looks good, but I’m running into a few issues:

  • Wikis don’t appear to work correctly for projects. They do work for tribes, though.
  • It’s difficult to add a pinax component to a basic project because they have many interdependencies. Bookmarks (for example) depend on a multitude of seemingly unrelated packages. This is making it much harder to create a simple reddit-like site using the bookmarks app added on top of the basic project.
  • Lack of the documentation that *I* specifically need, I’m sure I can figure it out quickly enough, but this is a point where this could be improved.
  • Lack of tests for components of Pinax. Many of the pinax components don’t appear to have automated tests checked into source control with them, these would be a great source of examples/additional information on how they’re supposed to work.

This means I’m left with a couple different ways I can approach the problem. Just take the social app and disable all the URLs I’m not interested in, or take the basic app and whip something simple togheter on top of it.

In either case I have to continue to retain my current function feedjack planet. An additional feature that I’d like to add is the ability to vote on blog posts and submit new RSS feeds through a form.

I think I’ll go with disabling things and modifying the Pinax setup to do basically what I want. It’ll give me a chance to learn Pinax better and is more likely to succeed. Where success getting a new feature on the website, even if the feature isn’t exactly what I envisioned :D