Wednesday, March 29, 2006
Wednesday, March 22, 2006
Pragmatic Programmer Quick Reference
I highly recommend buying the real deal. And if you like that also get this one.
Welcome to the war
And so I present you with a vi vs. emacs link fest:
An impartial view with good factoids on both sides.
Bullet lists sucks.
An emacs guy takes some pot shots at the VI crowd.
I have to wonder though did he think before he used the subheading, "Emacs: the tool of tools"? This is typical of the war-time volley, here's a sample smithering:
"I often tell people that you only need to know one vi command: :q!. This way, if you ever accidentally start up vi, you can get right back out. You might want to follow that up with rm /bin/vi to keep it from happening again. In reality, I know just enough vi to get the system up and running and to get Emacs installed; I'll then leave vi behind and never look back."
The vi lovers guide
If the title didn't give you enough of a hint of the flavour perhaps this will:
"I use Vim because I simply don't know of a better editor, but, admittedly, I haven't seriously tried anything else."
He makes up for this with a great set of links to useful information and a concise history of vi in the beginning.
A study of novice and regular users usage of the two editors.
"There appears to be no advantage for a regular user of one editor to switch to the other."
However novices liked emacs better.
References
to actual 'scientific' research into the perfect editor.Yes there are actually people trying to have a scientific discourse about this stuff.
Tim O'Reilly uses VI.
I have to admit that although I'm not a big Tim supporter lately the fact that he uses VI almost makes up for his web/mix 2.0 conferences but his response here is high on the rubbish factor. Shenanigans!
A funny little rant.
"Emacs is for people who desperately want to get drunk, but feel guilty doing so without a reason."
A typical flame war.
Taking a poll of public published net opinion.
An emacs user admits that emacs key bindings make you retarded.
You can always bat for either side.
Conclusion:
If you're a programmer and you've never given your editor any serious thought it would benefit you to think about the tools you use to ply your craft. I don't encourage people to select one editor over another but whatever you use you should invest at least some invest some time into your tools. My preference is vi, I've used it for 10 years and it feels like a natural extension of my brain at this point. It pains me to see people programming by using the mouse to select words from an intellisense drop down menu.
Tuesday, March 21, 2006
Justin Frankel is not dead
MDX On the Xbox360
Here's a few links to some related blogs.
Saturday, March 18, 2006
Croquet: 3d collaboration environment video
Ruby Hacking Guide
Friday, March 17, 2006
Game development on rails
I am trying to determine what the right user interface for this game would be. Currently I'm leaning towards an abstract, hex based board that is implemented using javascript. I haven't really had much experience in client side javascript but seeing what people are doing with ajax these days makes me wonder what kind of interactive environment one could build with these technologies. First step would be to produce a proof of concept and see what kinds of ideas that sparks.
Writing this stuff in ruby is a blast.
The little game world is fun to play in so far I can do the following:
Farming: Fish, wood, metals, plants
Crafting: No recipe parsing yet just old shoes are created for any recipe
Movement: Move to any linked location
Respawn: Materials are respawned at variable rates
Skills: Object actions are tied to skills, you level the skill based on difficulty
Inventory: All items can be stored in inventory and then added to a recipe and crafted
At some point combat would probably be a requirement but I'm so bored with combat systems anyways that it's just fun to play with harvesting, crafting and exploration.
Anyways, this is all just mental gymnstics.. Here's a little sample log of fishing in the opening instance:
>> Welcome proj
>> Got 5 Potions
>> Got 2 Pickaxes
>> Got 2 Axes
>> Got 1 RabbitsFoots
>> Got 1 BasicFishingRods
/mats
>> Executing command: 'mats' nargs: 0
>> Material: Stream 2/10
>> Material: Stream 2/10
>> Material: Stream 2/10
>> Material: Lake 2/10
>> Material: Stream 2/10
/use BasicFishingRod
>> Executing command: 'use' nargs: 1
>> Use requires target, please /target 'thing-name' or 'self'
/target Lake
>> Executing command: 'target' nargs: 1
>> Targeted harvest location for material: # 2 resources left
/use BasicFishingRod
>> Executing command: 'use' nargs: 1
>> Got one RainbowTrout
/use BasicFishingRod
>> Executing command: 'use' nargs: 1
>> Got one RainbowTrout
/target Stream
>> Executing command: 'target' nargs: 1
>> Targeted harvest location for material: # 3 resources left
/use BasicFishingRod
>> Executing command: 'use' nargs: 1
>> Failed skill test for 'fishing' (level: 1) on Stream (difficulty: 15)
Thursday, March 16, 2006
I want PyChecker for Ruby
http://pychecker.sourceforge.net/
I wonder what work from the ruby2c folks could be used in this endeavor.
Singletons considered harmful to your health
Here's the conversions that I've made in order of difficulty:
First conversion, helping compiler remove .data segments with const:
static uint [] card_seq { ... }
Becomes:
static const uint [] card_seq { ... }
static const char * string_table {}
Becomes:
static const char * const string_table {}
Second conversion, removing uninitailized data in the .bss segment:
void single_threaded_converter(byte *buffer, uint32 size) {
static byte more_than_buf[1024]; // becomes stack variable or input variable
...
}
Third conversion, converting singletons to explicit initialization:
class MyEngine {
static MyEngine &instance();
};
Becomes:
class MyEngine {
static MyEngine *create();
static void release(MyEngine *p);
};
... There is lots of references to cleanup here since lots of stuff likes to refer to engine (yeah I know I'm lazy)
There is a single exported entry to bootstrap your application in SymbianOS. It now creates the engine. There is still the issue of getting sub-system pointers to objects that need them in a clean way. I have to visit the whole object heirachy at this point to clean this up. The funny thing is that I really don't like singletons that much anyways. This is similar to the wake up call I had when I thought it would be a good idea to use STL in a large production server.
Slow movement is better than no movement
Wednesday, March 15, 2006
The evolution of a programmer
Tuesday, March 14, 2006
GameHack March 2006 - Gspace Postmortum
Last weekend a few friends got together for a game hack party. Nothing too formal just sitting down and working on some game ideas. The idea was to use scripting languages to build the games. I feel that the success of the projects that we undertook had a lot to do with this choice.
I've been pretty addicted to ruby since I picked it up recently and so I was pretty determined to build a game with it.
People started showing up between 2 and 3 and after eating some food and chatting it was time to get down to business. John decided that he wanted to work on the game with me so we started brainstorming. We both are interested in board games, tactical rpgs and sci-fi so it comes as no suprise that we decided to put together a little turn based space game.
John is well versed in the lingo and logistics of interstellar warfare so I let him drive a lot of game design. I focused on asking the correct questions and focusing these ideas into a working game.
Quickly I had drawn a sample game board and some units on the whiteboard.
We drew up some tables for unit strenghts, sketched out the flow of the game, round and turn transitions and talked about how combat would resolve.
At this point John had never written a lick of ruby so I worked with him directly to begin defining the game. Step one was the game model. I coded up the game base classes: Game, Player, Location, Unit, Weapon, Defense, AttackType, DefenseType. Once we got this out of the way John went off and started creating tons of different weapons, ships and defenses. I wrote a game loop driver to test the turn logic and make sure the basic objects were working together then I went off to write all the graphics for the game. It took a few hours to get this stuff pounded out. I basically just created the units out of 2d primitives. I created a selection cursor and enabled the user to select and move units using a simple arrows and spacebar as selector control scheme.
John's wife Leslie had some dinner waiting for us at their house so we went over there ate and I spent some time writing a zoomer that would interpolate scale and translate of the board to a selected unit. This was supposed to be for the unit information HUD but I ended up scrapping it. It still looked pretty cool though (you can press 'I' on a selected unit to zoom in on it). The fact that all the units are vector based and not little sprites makes this look really cool.
After this we quickly got the HUD working showing unit stats: hull strength, movement points, arament and owning player. John and I worked closely on this part of the project quickly iterating features until the game was playable.
At this point we could spawn whatever ship we wanted on our turn and use it to attack the other player. The weapons that John created were great: Tactical Nukes, Microwave Lasers and Auto Cannons.
What went right
1 Using ruby for prototyping
This was an awesome language for a project like this. We were able to use very clean object-oriented code to easily visualize the game. The keyboard handler took a hash of key ID to blocks of code which made adding new keyboard logic super simple. Since we weren't using source control it was great that ruby allows you to write new methods in a seperate file that are added to an existing class. John could iterate on his battle mechanics adding methods to the Unit class while I was cleaning up the Unit movement in game.rb. As an experienced programmer John was able to get productive in ruby under an hour.
2 My graphics extension to ruby 'RubyCube'
I had spent some time before the party closing the gap in terms of game programming for ruby by writing a very high-level graphics programming extension that hid all the low level details like movement, updating animations, render queue etc. This made it super-simple for me to write all the graphics code in a few hours in ruby.
3 Pair programming
John and I worked very closly in this and picked each others code apart. We were able to catch tons of little problems in the game logic just by sitting down for a few minutes and writing code together.
What went wrong
1. Wasted time on polish like the zoomer
I spent an hour working on this code without even ending up using it.
2. Using a non-compiled language
It was often very painful to know if some branch of your code would break because of a mis-named variable or other small error. This made testing each feature interactively and right after it was written very important. However, in a game things get complex quick and as more code started to interect we ran into more and more problems. We probably spent the majority of our time fixing little errors like this in the game logic. It would have been really nice to have a ruby lint type program to find all the little misspellings.
3. Only working on the game for 12 hours
If this was one of the 24-72 hour game competitions we could have gotten a lot more done like this. I think with more time this game could be even more fun.
Conclusion
It's a great feeling to have a finished game up and running in so short a time. Having a game prototype up and running that exercises the milestones of the game design something that I will continue to do in the future, even if the game will be re-implemented in C++. It's great to have free tools like ruby to do this. I'm looking forward to the next opportunity to do this type of rapid game programming.
You never catch up
Monday, March 13, 2006
On10 Covers KEXP
Quotix Software Updated their Lua IDE
Spore demo video from 2005 GDC
On Large Scale I/O
Something to try
2. Open the book to page 123.
3. Find the 5th sentence.
4. Post the text of the sentence in your journal...along with these instructions.
5. Don't search around for the "coolest" book you can find. Do what's actually next to you.
Neither the cashier nor the customer would be able to leave until the "trasaction" is completed.
From 'The Best Software Writing I'
Sunday, March 12, 2006
GameHack March 2006 comes to a close
1 combat shmup done in LuaSDL (LuaChiea) with Xbox 360 controllers
1 turn-based tactical space game done in Ruby with custom engine bindings (RubyCube)
Not too shabby :)
Wednesday, March 08, 2006
All your innovation are belong to us
Alternate universe: WoW as MUD
Could it be that MMOs are designed for noobs?
FFXII Scores 40/40 in Famitsu
Just don't forget to drink your potion.
10 Personas for Innovation
The Learning Personas
Individuals and organizations need to constantly gather new sources of information in order to expand their knowledge and grow, so the first three personas are learning roles. These personas are driven by the idea that no matter how successful a company currently is, no one can afford to be complacent. The world is changing at an accelerated pace, and today's great idea may be tomorrow's anachronism. The learning roles help keep your team from becoming too internally focused and remind the organization not to be so smug about what you know. People who adopt the learning roles are humble enough to question their own worldview, and in doing so, they remain open to new insights every day.
1. The Anthropologist brings new learning and insights into the organization by observing human behavior and developing a deep understanding of how people interact physically and emotionally with products, services, and spaces. When an Ideo human-factors person camps out in a hospital room for 48 hours with an elderly patient undergoing surgery, she is living the life of the anthropologist and helping to develop new health-care services.
2. The Experimenter prototypes new ideas continuously, learning by a process of enlightened trial and error. The Experimenter takes calculated risks to achieve success through a state of "experimentation as implementation." When BMW bypassed all its traditional advertising channels and created theater-quality short films for bmwfilms.com, no one knew whether the experiment would succeed. Its runaway success underscores the rewards that flow to Experimenters.
3. The Cross-Pollinator explores other industries and cultures, then translates those findings and revelations to fit the unique needs of your enterprise. An open-minded Japanese businesswoman was taken with the generic beer she found in a U.S. supermarket. She brought the idea home, and it eventually became the "no brand" Mujirushi Ryohin chain, a 300-store, billion-dollar retail empire. That's the leverage of a Cross-Pollinator.
The Organizing Personas
The next three personas are organizing roles, played by individuals who are savvy about the often counterintuitive process of how organizations move ideas forward. At Ideo, we used to believe that the ideas should speak for themselves. Now we understand what the Hurdler, the Collaborator, and the Director have known all along: that even the best ideas must continuously compete for time, attention, and resources. Those who adopt these organizing roles don't dismiss the process of budget and resource allocation as "politics" or "red tape." They recognize it as a complex game of chess, and they play to win.
4. The Hurdler knows that the path to innovation is strewn with obstacles and develops a knack for overcoming or outsmarting those roadblocks. When the 3M worker who invented masking tape decades ago had his idea initially rejected, he refused to give up. Staying within his $100 authorization limit, he signed a series of $99 purchase orders to pay for critical equipment needed to produce the first batch. His perseverance paid off, and 3M has reaped billions of dollars in cumulative profits because an energetic Hurdler was willing to bend the rules.
5. The Collaborator helps bring eclectic groups together, and often leads from the middle of the pack to create new combinations and multidisciplinary solutions. Not long ago, Kraft Foods and Safeway sat down to figure out how to knock down the traditional walls between supplier and retailer. One strategy--a way to streamline the transfer of goods from one to the other--didn't just save labor and carrying costs. The increased efficiency sent sales of Capri Sun juice drinks, for example, soaring by 167% during one promotion.
6. The Director not only gathers together a talented cast and crew but also helps to spark their creative talents. When a creative Mattel executive assembles an ad hoc team of designers and project leaders, sequesters them for 12 weeks, and ends up with a new $100 million girls'-toy platform in three months, she is a role model for Directors everywhere.
The Building Personas
The four remaining personas are building roles that apply insights from the learning roles and channel the empowerment from the organizing roles to make innovation happen. When people adopt the building personas, they stamp their mark on your organization. People in these roles are highly visible, so you'll often find them right at the heart of the action.
7. The Experience Architect designs compelling experiences that go beyond mere functionality to connect at a deeper level with customers' latent or expressed needs. When Cold Stone Creamery turns the preparation of a frozen dessert into a fun, dramatic performance, it is designing a successful new customer experience. The premium prices and marketing buzz that follow are rewards associated with playing the role of the Experience Architect.
8. The Set Designer creates a stage on which innovation team members can do their best work, transforming physical environments into powerful tools to influence behavior and attitude. Companies such as Pixar and Industrial Light & Magic recognize that the right office environments can help nourish and sustain a creative culture. When the Cleveland Indians discovered a renewed winning ability in a brand-new stadium, they demonstrated the value of the Set Designer. Organizations that tap into the power of the Set Designer sometimes discover remarkable performance improvements that make all the space changes worthwhile.
9. The Caregiver builds on the metaphor of a health-care professional to deliver customer care in a manner that goes beyond mere service. Good Caregivers anticipate customer needs and are ready to look after them. When you see a service that's really in demand, there's usually a Caregiver at the heart of it. Best Cellars, a retailer that takes the mystery and snobbery out of wine and makes it simple and fun, is demonstrating the Caregiver role--while earning a solid profit at the same time.
10. The Storyteller builds both internal morale and external awareness through compelling narra-tives that communicate a fundamental human value or reinforce a specific cultural trait. Companies from Dell to Starbucks have lots of corporate legends that support their brands and build camaraderie within their teams. Medtronic, celebrated for its product innovation and consistently high growth, reinforces its culture with straight-from-the-heart storytelling--patients' firsthand narratives of how the products changed or even saved their lives.
Tuesday, March 07, 2006
Does language influence thought patterns?
I have been learning a new language every year for awhile now. Even before I read the pragmatic programmer I had been doing this out of curiousity and just being a over-zealous hacker. I noticed that I would cross polinate a lot of ideas, objects in C, message systems in C++ after doing Objective-C, data driven design and the idea of ubiqitous associative arrayness from Lua. This year I have been fortunate enough to find Ruby.
Today I found this quote in a nice Ruby presentation:
Sapir-Whorf Hypothesis
The Sapir-Whorf Hypothesis theorizes that thoughts and behavior are determined (or are at least partially influenced) by language. […] To this day it has not been completely disputed or defended, but has continued to intrigue researchers around the world.
A language that doesn’t affect the way you think about programming is not worth knowing — Alan Perlis
The Takahashi Method
I first heard about the takahashi powerpoint presentation style at the last Seattle.rb meeting. I'm not much for powerpoint but this idea is entertaining to me in a deconstructionist-wordplay as art way. Takahashi Masayoshi wrote a book on this and is also involved with Ruby in Japan.
Here's some, more, info ..
I think this method works best in Japanese.. Latin characterset is just too bland.. perhaps wingdings would be more appropriate! Or perhaps the 'Lessig method'.
This method may suck for any kind of material that would be reviewed later unless accompanied by synchronous audio/video.
Interface mockup as design doc
Xara Xtreme
Friday, March 03, 2006
The wonder of Cell Dynamics
Wednesday, March 01, 2006
Feb 28th Seattle.rb meeting
There were some other interesting people there that I didn't get to spend much time talking with like Geoffrey Grosenbach.
Later on there was some interesting talk from people involved in ruby VM improvement and language design.
Anyways, a lot more community activity than I had envisioned!


