Development Underway on Ubuntu!

I've added a new feature this weekend. It would have only taken me about a half hour, but I encountered some major problems on the way. In my ORM system which I call "Dumb", table aliases were previously generated a stupid way. If a table referenced another table, and the two tables were possibly at the long end of a list of joins, it would generate table aliases something like this:

User_UserId_Bio_BioId.BioId

which would be joined from a table with an alias something like this:

User_UserId

This seemed to have worked well for a while amazingly. However, when I tried to build my latest addition, I ran into problems because my User table was being referenced towards the tail end of two different branches in the so-called "join hierarchy". Through much trials and tribulations, I eventually ended up creating a class called "JoinHierarchy" so I could get consistent and unique table aliases. I created a thing called "NewsPicture" which basically links a News item (what you're reading) to a Picture. There's also a "NewsDownload" so I can list downloads as well. Here's what NewsPicture and its join hierarchy looks like:

NewsPicture [PictureId, NewsId, Sequence (for ordering)]
PictureId -> Picture -> PictureAlbum -> User -> Bio
NewsId -> News -> User -> Bio

So as you can see, User and Bio were being joined twice but under the same alias, so MySQL has a problem with that, as well as any database management system out there. Now, each object that can potentially be saved to the database has its own join hierarchy that you can just call up whenever you need a table alias or to get all the joined fields or join statements (including left joins if something could potentially allow null). Take a look at the images and downloads below!! I'll just throw in some random ones this time.

Development Environment Set up on Ubuntu


Wow, Ubuntu rules

It's funny to me, I've always downloaded the latest ISO of Ubuntu Linux, but have never installed it. Frankly because I don't have any blank CDs lying around. So, last night, I fired up Parallels and installed an ISO I had on my Mac, gave it a quick run through, and made the decision to install it on my other laptop which was currently running Gentoo Linux. Jared recently said he was digging Linux working alongside his Mac. He installed Ubuntu, so I figured I'd finally give it a shot. I was just afraid of losing work, but really I didn't get back into it, so it wasn't necessary that I switched operating systems.

Chances are you might not even have heard of Linux (a free open source operating system which competes with Windows, just in case you haven't heard of it), let alone Gentoo Linux, but if you were to install Gentoo Linux, it's like the super user's version of Linux. Say if you were buying a house, Gentoo would be a real fixer upper, and you could even use the analogy of it being all the raw materials and you have to put it together. Basically, I installed it on this laptop and the laptop was crippled for about 3 years (ever since I got the blasted Windows off of it). No sound, no wireless networking, my mouse pad wouldn't work right, and it took about a month to get a screen resolution that I was happy with. Ubuntu on the other hand is like a fully furnished, beautiful, modern house. You just move in and you can start living.

I installed it and fired up a game of Company of Heroes (against only 2 experts and a hard this time on Seine River). It was done before I finished the game in 41 minutes, which I would have hoped anyway. I whomped some ass in the game by the way.

When I backed up my Gentoo stuff, I have this script that I use that sets up a mount to my shared backup drive on my gaming PC with Windows XP SP 2. To do that, you have to use the smbmount command which, once you learn it, is very easy. Then you can browse to the folder that you mounted the Windows share on the gaming PC to, and just start copying files. The thing about Linux, though, is that it is easy once you learn it. But there is that learning curve, and lots of "man" pages that are pretty cryptic, and you have to figure out which options you need, how to format them, and all that other stuff. I don't mind it because I like a challenge.

Getting the files back after I installed Ubuntu, though, was as easy as going to "Places", selecting "Network", going through "Windows Network", opening up my work group, and opening up my Windows PC, "Voodoo2k7". I can then just copy files from there. If I want, which I probably will, I can use the smbmount command to set up a mount point, mount it to /mnt/voodoo, and go into the command line so I can copy stuff using "sudo" into protected directories, like "/usr/local/", since I haven't found a visual "sudo" program on it yet.

The other thing I noticed a short while ago... There's sort of a network button in the top right. I click on it, and it shows me all of the local wireless access points available! Wireless works with no setup on Ubuntu!! That's marvelous. I could have 5 wireless devices running now. In case you missed it, they are : MacBookPro, this Ubuntu laptop, PSP, PS3 (yup, I got one), and the Wii. It's a 802.11n router, so it can handle it. Ubuntu shows the signal strength of it as a sliver away from 100%, but definitely over 90%.

As soon as I restarted it from Gentoo with the Ubuntu disk in, I noticed that it instantly recognized the onboard sound and speakers. It played that nice little Ubuntu, African style introduction chime. I was like "F@#%@ YES!! UBUNTU ROCKS!!!" As soon as I got to a website that expanded beyond the visible bounds of the screen, I tried my mouse pad. It worked. I had spent MONTHS... maybe a couple of hours... trying to get this thing to work on Gentoo. I definitely spent a weekend, actually. Google "set up synaptics mouse pad on Gentoo Linux", and hit up any of the articles returned. You will see it's not easy. The "horizontal scroll" thing was what I couldn't get to work. The mouse pad worked fine otherwise.

I should have installed Ubuntu a long time ago. It wouldn't have ruled out getting a MacBook Pro, though (which is almost paid off, coincidentally), but I would have had a much better experience using Linux, and I might not have stopped using it hardcore in September. Gentoo was way beyond my capacity. I will miss "emerge" though :) Portage was nice, but Ubuntu has a whole graphical software update service. I say, if you're not using Windows for games, throw a Ubuntu disk in the drive and reboot. You won't be disappointed.

My favorite thing about having devices (weird side note... Firefox has a built in spell checker, and it underlined in dotted red, "favorite"... I switched it to "favourite" and it doesn't show any red line. I might have installed the wrong language! Although Ubuntu is maintained in South Africa or something).. oh yeah, so my favoUrite thing about having multiple devices is naming them. My PS3 is named "VoodooPS3", my PSP is similarly named "VoodooPSP", my Windows PC is named "Voodoo2k7" which was mentioned previously. My Mac doesn't have that naming appeal, and shows up on the network as "jasontconnell_s" or something. When I had Gentoo installed on this computer, I named it "gentoovoodoo". I bet you can probably guess what this computer is named... but I'll tell you anyway. "Voodoobuntu"!! Unfortunately, I've retired two computers, the original "Voodoo" computer, and my liquid cooled "LCVoodoo". Oh well.

This f@%@#$ing pisses me off

So, at work, we're working on this site for this company, and it's built on this software called "CommunityServer", which can be found at communityserver.org . The thing that pisses me off isn't necessarily to do with that software package, but in software in general, but it's most relevant with that software right now, because it's what I'm using.

Anyway, so many factors end up determining if something is "visible" or not. For instance, in Community Server, it might be a certain "forum". So, a forum might not be visible if the user isn't logged in, if the user isn't in a certain role, if the forum is the private messages forum. Or, it could be an email address, and it's shown to users logged in who also show their email address, or not shown if no user is logged in, or shown to admin. Et Cetera. There's tons of different variables that might determine if something is shown or not. Which is not my problem. It becomes a problem when you inherit this huge software application, and you have to make something behave just like other stuff that's already on the site.

This can also determine other states of an object, like is it editable? Does it get this certain process applied to it, like if certain versions of it X months old should be deleted, can it be printed, does it have a history, can it be part of an RSS or Atom feed, does it have an image with it? Etc, etc, etc. Tons of other things that could all be generalized, and shouldn't have to be figured out in every single instance.

Alright, maybe their software is poorly designed. I never said it wasn't :) But what I'd love to be able to do is, basically, not have to do anything, as a developer, and have it act like other things like it, whatever it is. I don't want to have to specify that, when selecting it from the database, that the "IsPrivate" bit must be set to 0, and that the "IsDeleted" bit must be set to 0. These aren't necessarily the fields, but examples. Also, I don't want to have to specify that the user has to be in the group that the forum belongs to in order to see it.

When I write software, I make it as easy as I can to write later on down the road. There's two ways to go about software development. #1, get the job done, which is how 99% of software is designed / developed. #2 is then, get it done but make it easier to add / change / remove stuff later on down the road. Software is, in fact, never done. It is a fact, a truth, a tautology. There is always something to add that can make it better. But 99% of the software written out there is so finalized when version 1.0 is out the door. Making changes is, for all intents and purposes, a f@%@#$ing pain in the ass.

Forget that it's never documented. That I can deal with. I can read code like a PhD can read a children's book. Although, it's a lot harder to tell what something *is* versus what something *does*. If you were looking at an engine for a blender, but you know you might find the same type of engine in, say, an electrical drill. You can tell that it probably turns something very fast, but you don't know what it is from the high level. Until you see it in motion. So, the code, along with the running version of the application, I can figure it out. Although, I can still read code like a pro. I am a pro after all :P

Anyway, if there was a way to define behavior in an object, without having to specify and filter and code for every possible variation, my life would be a lot easier. The sad thing is, I can think of hundreds of ways, because my mind has been conditioned, through years of hating to write code, to come up with the simplest, most developer friendly solution possible. I'd create interfaces! Object Oriented Programming is the best. An interface for "this might be private", or "this should be filtered for a role", and "this could only pertain to certain users", and "this could be deleted", etc. You just tag your objects with these interfaces and voila! No code!! Your filter logic would be in your data access layer... "if (obj instanceof IDeletable) then don't get deleted ones." Of course, this application doesn't even make it possible for me to modify this without having to put in hundreds of hours of work into it, and that's simply not an option. Stupid software.

Anyway, time for bed. Got some errands to run before the game tomorrow!

OOXML will fail miserably

Or, at least it should. It will reveal a serious flaw in international standards if that thing succeeds. The basis for my argument is that everyone who opposes it are smart people with no other reason to do so other than the specification is an atrocity. I've literally spent the whole night reading objections to it (simply because advocates for it are few and far between, and also sound like complete morons to me). Here are some links.

Groklaw (which I'm reading more and more every day, written by someone who claims no knowledge of the technical side of the debate, and who seems to side only with the law [not a particular company... a non-biased view])
Rob Weir (an IBM guy who just seems really smart to me)
Miguel de Icaza (who makes no argument at all for OOXML based on how ridiculous the whole thing is)
John Carroll (a Microsoftie who is just blowing his employer... err... his employer's horn.)

This is where it gets interesting. Carroll, in a "blog" post , ignoring all the technical diarrhea that is the OOXML spec (ECMA 367), posts a link to an article by Miguel de Icaza (an open source guy working for Novell which recently inked a deal with Microsoft), about why the OOXML spec should become a standard. Carroll thinks he'll win over MS-haters / Open Source (OSS) advocates because he's posting an OSS person's view on the subject which happens to coincide with his view. So, I start commenting on that post about logical inconsistencies inside of that document, as well as technical concerns I have about OOXML in general, to discredit anything anybody has to say in support of OOXML. On a quest that began after I started posting, I continued reading (I started earlier in work, but had to go home) a document on Groklaw.net that contained all of the objections to OOXML becoming an ISO standard.

When I finished that document, I still needed more ammo. I searched the web, as I had promised to do in a comment on Carroll's post, for pro-OOXML arguments. I couldn't find any on a technical basis besides that it supports old .doc formats all the way back to Word 5 (for which a simple converter could be written to upgrade all docs to the new standard...). So I gave up searching. I did come across a few non-MS employee articles that were pro OOXML, but they well... read for yourself (which, like all Microsoft articles I've read, miss the point ENTIRELY on "CHOICE"). After that waste of time, I somehow wound up on Slashdot.org, reading the comments by those readers (largely anti-OOXML) the same MS letter to IBM that James O'Neill's thing mentions. One of them posted a link to a funny article by Rob Weir. So I immediately liked him. After reading that, I decided to read more of what he had to say. Which is when I came across THIS!! As you can tell, it completely rips Miguel de Icaza's argument a new %@#$hole!! Read the comments on that one too. Miguel is the first to comment, asking Rob if he had ever written any software for OpenOffice.org (the frontrunner on the implementation side of ODF (there are many), the competing standard (yes, already an ISO standard) to MS' OOXML), or if he's just an Armchair General. Later down the page, Rob responds with this comment, which basically says "I am qualified to make that statement, dumbass."

Here's where advocates for OOXML miss the point on CHOICE. When ODF people speak of choice, they speak about different applications being able to operate with each other (interoperate). Meaning, if I save a file using this program on this operating system, I can later open it with this other program on this other operating system. Right now there are a lot (OpenOffice, KOffice, StarOffice, Corel, Google Docs and Spreadsheets, and a few independent apps) that can read and write ODF. Alternative, right now, there is one program that can read and write OOXML, and it was released 1/30/07 (Microsoft Office 2007). Funny timing, by the way, as OOXML went into ISO "fast track" approval on 1/05/07. So they didn't even have a working application to display it. I digress. So there's a difference in opinion of what "choice" actually is. However, when the average user wants to save an image file from their digital camera, should their camera care what operating system they're using, or what photo editing application they have installed? Likewise, there are a few "standards" for image formats. JPEG is highly used for photos because it can contain more colors to the less-lossy (pixel quality wise) but less colors overall GIF format. It has been argued though that OOXML is duplicating much of the same functionality as ODF, whereas JPEG and GIF are very different in their purposes (GIF is much better for small images and transparency, and JPG for high quality compression of larger images... however, both might soon be deemed obsolete by PNG which covers transparency and a good, near-lossless compression algorithm). In the objections document posted earlier, the final note offers an alternative solution. That Microsoft extend the ODF format with any of their functionality that isn't covered in ODF. This is clearly a good solution, since the base functionality is in ODF, is implemented in many standards, and is a good building block. This is what anti-OOXML people would welcome with open arms. Not a year through standardization on a spec that took 12+ years to fully develop!! ODF took 4 years to ISO standardization. 1 year would be ridiculous.

Quality night of reading overall :) Next, there are these gems...

Here are some letters to INCITS (International Committee for Information Technology Standards)...

Some of these letters from the opposition are the same, but all of the letters FOR OOXML are sent as a "joint letter signed by these 20 members of this committee that has 'Microsoft' in the title". To get a joint letter signed, I'd walk around an office and say "Yo, sign this... it's to get free pizza every Friday." There are three letters attached (in the one from "George LaVenture - International Association of Microsoft Certified Partners (IAMCP)"), each from different offices, each signed by 15+ people (but I can't see the signatures for some reason). All of those letters are the same exact thing, and they make no merits on the technical side. Which is fine, I guess. There are many arguments that either would stand up on technical merits. Although, developing an application that uses OOXML would be an absolute nightmare. The spec is 6000+ pages long. The only argument on the Microsoft side that ODF can't claim (not legally anyway :P ) is that there are billions of documents in old formats that this "document format" can support. As I said, write a CONVERTER.

John Hardin's letter makes the claim that if OOXML were to pass as an ISO standard, the reputations of ISO and ANSI standards organizations would be severely damaged. And that "they will be seen as open to manipulation by sufficiently large companies." In no way do we want that to happen. That would be like the US Patent Office! We don't want that situation repeated in standards organizations.

Another post I read somewhere says that if OOXML passes through ISO standardization, it could be the most costly mistake EVER. (Ahh, found the link here)

It's funny that the only people pushing for it are MS people, MS advocates, and some politicians who are paid by Microsoft, whereas the ODF crowd is many many good companies and lots of brilliant people. It leads one (not me certainly) to the conclusion that people who support Microsoft in this area are complete morons, will never be writing the software to support OOXML, or that they're on MS' payroll (either as an employee or accepting donations through politics). Every Microsoft post I've read is a last ditch effort that practically concedes victory to ODF. Not to mention the lies that they tell themselves (e.g. For ISO adoption, 103 companies vote, only 19 opposed on the first round, so they tell themselves and their employees that "We're almost there!!", when, in fact, 16 of those 19 countries that opposed make up HALF of the vote that MATTERS in the final vote, 5 months away!! SUCKERS!!). Just keep telling yourselves that.

Anyway, this was kind of a review of all the reading I did tonight, with no real guiding purpose or goal. Ok, I had a guiding purpose, basically to vent about how bad OOXML is technically, and that's confirmed by no technical merits from anyone that supports it. And, likewise, to convince anyone who reads this to read all the articles and documents I link to, and to convince them of my opinion... like all opinion writers :P The whole thing's probably way too long and filled with typos, but luckily I can only see the last 8 lines I wrote :P I'm going to bed. It's the Wiikend!!!

Web 2.0 isn't so without a new file upload

In writing a web application, I've always found it a pain that no matter how advanced of an interface you try to make, the file upload mechanism is so archaic. This functionality is built into every web browser. It's a text box with a "browse..." button next to it. Upgrading this functionality is the last step, probably, in getting to Web 2.0.

When writing a news post or anything of the sort, where you can include images inline, personally, with my software, I'd have to upload the images before I even attempt to write the news. One way around this is to be able to drag an image from a folder on your computer inline to the document. This works but not as expected. The image shows for you because the URL of that image is pointing to the file on YOUR computer. If you were to save that news and review it, it would look great to anyone who viewed it from your computer, but to anyone else, they'd see the big X placeholders for missing images.

I've read a technical article on including the actual content of the image inside the "src" attribute of the "img" tag. It's the bytes encoded in base64. That makes download times pretty big for an HTML website. This behavior isn't available in the previous example, because javascript can't read the contents of a file on the computer, an that would be the only way you could achieve it in real time. Another downside is that images encoded this way only work in Mozilla and possibly a few other browser, definitely not anything Microsoft based.

Another option would be to upgrade the standard. The W3 standard about how files are uploaded to a website. If I could drag an image, like my example of editing a news post, from a folder on my computer into the text of the news, and have a way that it automatically, and asynchronously, uploads that file to the website, and instead displaying the one on my computer, it displays, after a short delay, the one that's physically located on the server... for lack of a better term, that'd be @#%#@$ sweet. Technically, that would take some pretty complex changes.

Technically, I imagine the only way to accomplish this feat is allowing access to the contents of that file in Javascript. Not to say that when you download a website, Javascript in the website can just access any file on your computer, but when you drag a file onto the web page, a Javascript event is called with the contents (and other specs) of that file. This is a client feature, it would have to be implemented in Javascript. So that cuts out any browsers that a) don't support Javascript, and b) don't have an asynchronous way to make requests to a server (the 'AJ' in "Ajax").

For all I know, the W3 is working on something like this. Right now, there's no way to get this functionality, aside from writing a client app wholly separated from your website code. This is a pain because what do you write it in? With the heterogeneous environment of client computers... there's Java, but still, the whole idea of having to write an app to achieve this functionality is a bad idea, and the way websites do it right now is flawed.

There's nothing Web 2.0 about file uploads today. Any app where you have to upload files to achieve any kind of goal for content will never feel like a desktop application until files can be dragged/dropped in real time. Or pasted for that matter. I'll take anything.

It's been hyped

But I never tried installing Windows on my Mac before. I bought Parallels and entered the name of the VM, my name, and my Windows product key. Clicked "OK" or something, and moments later, I had Windows installed. Parallels is a neat program, I didn't have to do anything after that to install it, it probably got all my settings from the Mac and used that for certain Windows settings (Timezone, etc). It was sweet. So now I can use it to make money :)

I have a project to do with a local school. I needed Windows, SQL Server, and Visual Studio .NET 2003. Luckily, I bought no new software for this. I own 2 copies of Windows (one is still installed on a computer that I haven't turned on in about 8 months, and one on my gaming computer which is running all the time...), I borrowed SQL Server 2000 Developer Edition, and I am using ICSharpCode's SharpDevelop, which is pretty neat. And Open Source. e.g. Free.

I did all the original work while working for a company about 3 years ago now. I tried to instill some better programming practices in them while I was there, but alas, it's been a pain to relearn how to use all the code. It's coming along though.

Fired up the trusty ol' Linux Laptop

Working on something exciting. Everything I wrote in Java, I'm going to convert it to Javascript! That's right. They will communicate to each other through XML/HTTP calls. It will be done in a few steps.

1) Get them talking.
---This involves having objects in JS that correspond to all my objects in Java. Also, a communication protocol, through XML, including updates, deletes, gets, and custom methods.
2) Automate it.
---This involves wrapping each thing in JS functions, like "update(myObj, callback);" which will generate all the XML and make the call, calling the callback function when it returns. Callback will have to have a few parameters, like error message, if it succeeded, etc.
3) Develop custom controls in JS / HTML (Dynamic HTML) for common types (labels, files, to be determined).

4) ???

5) Profit!!

All in all, it shouldn't be too difficult. The Java part was hard. I've been hacking javascript for about a year straight now. I have to say it's my favorite.

There are a few problems with this method that will hopefully be addressed...

1) Security: People who know my XML scheme and the place that accepts it could just write something that posts to the method with the right format of XML and do disastrous things. I have an idea for this, and it will be done before any site that uses this goes up.

2) Search engines won't see it: With everything being dynamic, there's no content on the page when a search engine browses to the site. There's some placeholder html where everything will go, but no content. Unless I have the atom feeds or some meta data in the html.

3) State saving: I will need a system for generating query string parameters based on the values on the page, and also, when someone goes to that page with those values in the query string, it'll load the page how they remember it. This might be tough, or it could be easy.

I think that's about it. Wish me luck, it should be done before Web 3.0 comes out :D

Embracing more future stuff

Today, I'm going to make it even more of my routine to not use Office software that needs to be installed on my computer. To kick this off, today I created an online spreadsheet at Google Docs. I find it to be very convenient for my purpose, which is updating a client on the hours that I've worked on the current project. I added them as a "viewer" of the spreadsheet, and it's golden. Only problem was that it doesn't currently support Safari, the default browser on the Mac, so I had to install Firefox. Which is fine by me, except that I have two browsers installed. Oh well.

Also, I'll be using the word processor found at that site. That can be convenient for getting my ideas into English format, which could then be shared with anyone, but more importantly, I don't have to use the excuse "Oh, that document is on my computer at home... sorry." It also happens to be a great place to keep my resume.

Only thing is "Lock-In". We all hate it. Buy a song on iTunes and you can only play it on Apple stuff and with your account (lest you strip DRM from it). Buy a PS3 game and you can only play it on PS3s. Buy a car and you can only drive it on the road and within the limits of the law. That kind of stuff. It sucks. But oh well. As long as I can export it. That would be a good idea for Apple too. To be able to "export" purchased songs into another form of DRM, if you were to switch. It goes the other way as well. Buy songs on xyz, export to Apple format. Just recently, the cell phone companies allowed you to carry over your phone number to another provider, this wouldn't be much different (not technically, of course). Freedom is great.

Working Today

Have to help pay for certain recent purchases (see previous post...) I can't wait til that thing gets here.

Basically what I plan on using it for was everything that I used my Mac Mini for (until it blew up), which is like watching my X-Files DVDs at night to fall asleep to (as well as any movie I have), recording music on there using Garage Band, keeping my photo collection, editing movies from my digital camera (I have a Quick Time Pro 7 license that's currently not being used), browsing the internet, chatting, and getting started with Ruby and Rails.

So basically my other two computers currently in commission will only be tasked with one responsibility each. Actually, the Linux Laptop will be my primary Java programming machine as it is now, and the gaming PC will no longer have any software installed on it other than games, but that's also my large capacity storage machine, since it's the only one I can actually add hard drives to, seeing as the other ones are laptops. It's got about 330 GB of HDD space. Right now it holds my music collection, all the backups of everything I've ever done with computers (including my original websites, both in ASP and Perl! They're a blast from the past), and tons of other random stuff like images and screenshots from college. The new Mac will have 160 GB of HDD space, so I might have to get a dedicated backup drive to put in the gaming PC.

It's funny too, because most people are all about having multiple monitors for a PC, as it leads to higher productivity since you can read a spec on one screen and program on another. Everybody at work has multiple monitors. I fear that I'll need to do that at home if I get used to it, so I'm the only one in work that has a lone monitor. That and my current video card setup can't support more than one. It could get expensive, since right now I'm using a 19" Sony that I bought for 350 bucks a few years ago, and it works marvelous for my purposes. I'd much rather have multiple PCs than multiple monitors. A network leads me to be very productive. A KVM switch is wonderful. It's all about how quick you are on the computer. I can switch between computers in a bat of an eyelash, depending on the KVM switch.

Although nowadays with multiple cores in CPUs (my first multi-core CPU will be the Mac), you can easily run two computation-intensive apps at the same time. But still I'd much rather have two multi-core computers, and KVM between them in order to get shit done :D

It's on the way

MBPRO 15/2.16 CTO
2.16GHz Intel Core 2 Duo
2GB 667 DDR2 SDRAM-2x1GB
160GB Serial ATA Drive@5400rpm
SuperDrive 6X
15" Widescreen Display
BkLit Keyboard/Mac OS
Country Kit

That is one fine piece of machinery, right there.

I make a lot of posts after midnight

And I mean, RIGHT after midnight.

Here's what the last few items of news look like if I select just NewsDate from mysql...

| 2006-08-29 00:00:19 |
| 2006-08-30 00:00:11 |
| 2006-09-05 00:00:41 |
| 2006-09-07 00:00:43 |
| 2006-09-08 00:00:13 |
| 2006-09-08 00:00:46 |
| 2006-09-10 00:00:03 |
| 2006-09-23 00:00:22 |
| 2006-10-05 00:00:53 |
| 2006-10-07 00:00:07 |
| 2006-10-10 00:00:40 |
| 2006-10-11 00:00:29 |
| 2006-10-16 00:00:19 |
| 2006-10-16 00:00:19 |
| 2006-10-17 00:00:22 |
| 2006-10-17 00:00:27 |
| 2006-10-19 00:00:11 |
| 2006-10-20 00:00:33 |


Don't ask me, I just write the sh@#%.

Actually, I know exactly why. Time didn't matter before I had the feed, but now all my items are showing up as "12 AM" and I hadn't the foggiest. Well, I had an idea, but it needs to be fixed, that's all. Time is of the essense.

So I'm finally writing a feed

I plan on using just "Atom" as it is the W3 standard. As you can see here:

public class AtomSource {
private AtomCategory category;
private AtomPerson contributor;
private AtomGenerator generator;
private AtomUri icon;
private AtomUri id;
private AtomLink link;
private AtomUri logo;
private AtomDefaultText rights;
private AtomDefaultText subtitle;
private AtomDefaultText title;
private AtomDate updated;
}


Implementation to follow, and I'll have a link up of the feed and some readers, although I highly suggest Google Reader. I'm just implementing the bare minimum to be valid and readable by Atom readers because I have more important crap to do.

I know how to save the world

World world = WorldFactory.getWorld("Earth");

I have the world... now all I need to do is save it. Is the world capable of saving itself? Can it be as simple as

world.Save();

??

I don't think so. I need a World Saver.

WorldSaver savior = new WorldSaver();
savior.setNeedsSaving("Everything");
savior.setPriority(10);


Now I have the world saver. We just need to save our world.

savior.save(world);

Phew!! Just in time too, the s@#$ was about to hit the fan.

Hello Ruby Universe

The last two days I jumped into Ruby. It's a programming language. It's pretty easy to use, although I have to get used to it since I went like 3 hours yesterday without being able to do anything! But it's just different.

I wrote a solution to the dining philosophers problem (it shows threading and synchronizing access to data using mutual exclusion in Ruby), which you can find if you go to my downloads and search for the label "ruby". Its output looks like this:

Socrates is thinking...
>>>p=Socrates:s=thinking:lh=None:rh=None:to_l=Utensil:to_r=Utensil
Plato is dining...
>>>p=Plato:s=dining:lh=Utensil:rh=Utensil:to_l=None:to_r=None
CC is thinking...
>>>p=CC:s=wants:thinking:lh=None:rh=None:to_l=None:to_r=Utensil
DD is thinking...
>>>p=DD:s=thinking:lh=None:rh=None:to_l=Utensil:to_r=Utensil
EE is thinking...
>>>p=EE:s=wants:thinking:lh=None:rh=None:to_l=Utensil:to_r=Utensil


It'll loop indefinitely. The philosophers will decide whether they want to think or dine, and then they'll do it if they can! See, there's 5 philosophers at the table, and only 5 utensils, one between each of them. So, only two can be eating at the same time, but two will only be eating at the same time if they're not right next to each other, and two want to eat at the same time.

Here's another loop. It shows what happens when a philosopher wants to eat but can't:

Socrates is dining...
>>>p=Socrates:s=dining:lh=Utensil:rh=Utensil:to_l=None:to_r=None
Plato is thinking...
>>>p=Plato:s=thinking:lh=None:rh=None:to_l=None:to_r=Utensil
CC is dining...
>>>p=CC:s=dining:lh=Utensil:rh=Utensil:to_l=None:to_r=None
DD wants to eat but can't (CC has Utensil <--> EE has None)
>>>p=DD:s=wants:dining:lh=None:rh=None:to_l=None:to_r=Utensil
EE wants to eat but can't (DD has None <--> Socrates has Utensil)
>>>p=EE:s=wants:dining:lh=None:rh=None:to_l=Utensil:to_r=None


Download ruby at ruby-lang and a whole bunch of other places if you want to play with it. It's a pretty decent language so far.