Tuesday, December 30, 2008

Knit Project Completed

I finished the Knit Project application in time for xmas. My girlfriend loved it and said it was everything she needed. I need to find some cheap hosting so that I can share the program with the world. Cheap hosting would probably come with a database and I'll probably end up modifying the program to use it.

That's okay though. The point is to keep things simple for as long as possible. If I have to revert on a decision I made previously, it doesn't mean I made the wrong decision. Things are always in a flux and the right decision now isn't necessarily the right decision in the future. If I would have tried to use a database the first time around, I probably wouldn't have been able to complete the program on time. So not using the database was the right decision even if I add one in the future.


Thinking about the flash card program. I came across an idea. I'll need a way to store the flash cards on the internet, but I won't necessarily have a database. So I wonder if I could pull the information from my blog. The blog supports ATOM feeds. In theory I could just tag posts with the flashcard data, and the program could just get pull form the ATOM feed. I'm not so sure blogger would approve of it. But if it's only a few posts with just me and my friends, I don't see the problem.

Friday, December 19, 2008

Knit Project

I've been working on the Knit Project application because I need to have it done by xmas. I ran in to a problem once I started to run it as an Adobe AIR application. (It's stupid to call it 'Adobe AIR' because AIR stands for Adobe Integrated Runtime. So I'm really saying Adobe Adobe Integrated Runtime. That's just stupid, but google won't return anything usefull if you just call it AIR. So you have to specify Adobe AIR. Thus, I am going to continue to call it Adobe Adobe Integrated Runtime.)

Adobe AIR uses Webkit to render HTML. Apparently, Webkit doesn't like "for each()" in javascript. So I had to change all of my "for each()" to just "for()".

I also notice that the placement of the controls, which looked OK in firefox, looked like ass in Adobe AIR. My inital thought was to break the controls into their own windows like Photoshop/Illistrator/etc. I've never used windows or popups in my webdesign before. Opening the window was easy, trying to get the windows to comunicate proved difficault.

So I was thinking about how to solve this problem, and I asked myself. Do I need the controls in a seprate window? Does it add anything significate to the program? The answer was a restounding "No." So I threw out the idea and asked, "What would be the fastest/easyest way to group these controls?" Tabs of course! Within a few minuetes I had the controls broken up into tabs at the top of the application. Not only did this look nicer, it make easer to work with the grid. Which is the entire point of the application.

Loading and saving to a file proved to be dead easy. I was able to copy some code from Adobe's API refrence and adapt it to my program. It took less than 10 minenutes.

I did run into another bug with Webkit. I have a table of all the knitting symbols the user can click on. When you click on one of these symbols, it updates the Marker cell. This worked fine under firefox. But for whatever reason, Webkit will only show the image properly if I double click on the symbol. I set the 'src' to the image, which works fine, but when I resize the image. Webkit stops showing the image the first time. Once I've seen it in the marker once, it'll always work properly on the first click. I spent a half and hour or so trying to fix this bug. I couldn't get it working so I just remved the code that resized the image. I can always go back and fix it later if I need to.

I'm thinking I might have to rewrite the zoom function again. If you zoom all the way in, and then zoom out, the knit symbols are tiny. I want to fix it, but I'm not sure about the best way.
I thought about making all of the image one specific size. (right now they are all diffrent sizes). Another way would be to store the orginal size somewhere (probably in the symbol JSON) so I could refrence it. If I do that, I need to keep better track of the "zoom level" so I know how to adjust the image size.

Another bug: In the grid it's self, if there is an image, the user can click on the image and not the table cell, which won't cause the cell to change to the current marker.

Monday, December 15, 2008

Welcome!

Welcome to Zen Software.
*note: I know that some may dissigree with the way I am using the word "Zen" I am using it in the meaning of simple and without excess.

My goal is to develop simple applications that focus on getting the job done. I want to move away from all of the features and bloat. Every decision in designing the software should first ask, "Does this contribute to mission of the application?"

I have two projects right now. One is a knit pattern application that I am making for my girl friend. The other is a flash card program. Both of these applications use Adobe AIR.

Why Adobe AIR?
After playing around with Adobe AIR, I found that it does what I need without making me do anything I don't want to. I can create a page in HTML/CSS/Javascript and it will just work with Adobe AIR. If I don't want anything else, I don't have to use anything else. If I want some extras, like the ability to load and save to a file; it's there. If I want to use jQuery, I can. It just works and stays out of my way. That is why I am using Adobe AIR for these projects.

Does using Adobe AIR contribue to the projects?
Both projects require some way to save and load data. The knit project needs the ablity to save and load patterns. Otherwise it doesn't achive its purpose of allowing my girlfriend to easally view/edit/print knitting patterns. The same deal with the flash card program.

There are many options I could take to solve this problem. The solution that comes to mind first is to use a database. Save the knit patterns in the database, then she could access them anywhere and we open up the possiblity to having people share patterns.

The downside to useing a database is that I would need some kind of server side scripting. And a database. There may be ways to talk to a database without serverside (I didn't look.) But that still doesn't elminate the need for a database. And the need to maintain that database. I'm not saying that these are terribaly difficault tasks, but they don't really fit the zen concept. That's more work that I'd have to do that doesn't really focus on the purpose of the application. There is no real need that anyone other than my girlfriend use the program. There is no real need to allow people to share patterns over the internet. There are other ways to provide those same features (like email) without me building something specific.

This is why I choose Adobe AIR. I can easly save and load the patterns to files on the hard drive. No server side script is required. The only requirement is that the computer has Adobe AIR, or at lest Flash. Everyone has flash (except my iphone) so that's not an issue. (More specifically, my girl friends old laptop has flash.)