500: An Opening Bid

November 14th, 2005

So tonight I\’ve developed a cold. One which I hope to beat by tomorrow morning, but I doubt it… It feels like it\’s still getting stronger, so I\’m probably in for it.

But while I sit here holding in fluids that want to spill out of my noise, I decided it was best to try to get some work done on that project from yesterday (AKA 500). So that\’s what I did. It\’s not much, but it\’s a little more graphical work.

www.rinsefirst.com

It\’s not really all that complicated, but sometimes it\’s the simple things we need to appreciate. One button shows the bid window, one hides it. The bid window is created on the fly, but I was unable to find a way to destroy the window entirely so that I could create it again. Therefore, I had to figure out a way to hide the window. Simple enough… The code looks like this:

if (!BidWindow){

_root.attachMovie(\"BidWindow\",\- "BidWindow\",this.getNextHighestDep- th());

} else {

_root.BidWindow._visible = true;

}

Ok, really thats all I have about the progress on 500. Be sure to check out the previous project: 893archive.org.

This is day 3 of the project posts, which is impressive… I have a hard time focussing enough to figure out how I\’m going to make this a project based website. Todays project of choice was: www.893archive.org

893archive.org is a site that Dan wanted to create after a similiar site went down. It\’s purpose is to record the play history of a local public radio station known as \"The Current\". Dan had sent me an email asking me for a series of things (DNS, oxwaf, etc) and because of that I sort of got wrapped up in the process. Although Dan did the site design and 99.9% of the coding, I helped to bring the google ads and the amazon ads with little to no hassel.

Although there is still some cleanup to be done, most of the site is completed now, and available to the public.

Let\’s talk about some of the site\’s innovation. Dan wrote the code to actually build the list, so I\’m not going to talk about that here… What I will talk about though is how we go about getting the amazon data. As you can tell, many of the songs don\’t have amazon data, so this applies only to the ones it works on.

Ok here goes.

Amazon provides a service for lookup called \"ECS\". It allows people to query their website for data about a product. In this case, we are looking for information about a cd album based on the title of the song.

ECS has a few problems though… You can\’t query by artist and song (as far as we can tell), only one or the other. Because song titles are used by more than one artist, and artists don\’t release just one album, this poses a very large problem.

To get around this, we query for the title of a song against the database, and then search within those results for the name of an artist… It just hit me now that it might be better to go the other direction, so I might have to go implement that now. In either case, the code to get the information looks something like this:

$url2 = \"webservices.amazon.com SUBSCRIPTION_ID .\"&Operation=ItemSearch&SearchI- ndex=MusicTracks&Keywords=\". urlencode($track[\"title\"]) .\"&ResponseGroup=Large\";

$data = file_get_contents($url2);


pretty simple code if you ask me… Of course, that $data is in xml, so you have to parse your way though the search results. In either case though, it makes life pretty simple. Needless to say, it was a pretty cool day long project, and if we can get decent traffic to the site, we might even make some money. Here\’s hoping.

500: A dealers engine

November 13th, 2005

As noted last post, I am going to start focus on whatever it is I am developing at any given moment. I always seem to be coming up with some crazy idea and so this is probably the best place to document progress on those projects, as well as provide you all with some lessons in whatever it is I\’m doing… Why… I don\’t know.

So todays project was to get the first set of rules as well as a framework to start connecting to a server for a game we all know and love called \"500\". John, Nikki, Amber, and I played way to much of this game this weekend and because Nikki can\’t do that every weekend from St. Cloud… It\’s best we find a way to continue over the internet. No one seems to have a good site to do this with though, so that\’s what I\’m starting to work on overall.

So todays, all I wanted to do was get the interface (GUI) done for dealing portion of the game. From there I can start assigning rules as to how to bid, how much cards are worth, and removing weird bids like \"6 no\" vs. \"6 no trump\". If you would like to see how a hand of 500 is dealt (45 cards, 5 ways), or if you just want to see how far I got with the interface before deciding to call it quits for the night, please feel free to visit this URL:

www.rinsefirst.com

All that said, this weekend has been pretty good. With the start of development on sunfox (yesterdays post). Dan\’s development of the 895 thing which I must admit is pretty cool. Blaine\’s development of a possible IRC chat server… and Jon\’s awesome all around work on everything in life (code wise).

Shout out to all the people that i\’ve seem to have lost touch with in the last few months… I can see why a single adult gets more lonely the older they get (and therefore, goes to more bars) vs. a married adult. I can also see why the motivation for having kids comes in as a married couple becomes more married (and moves away from college). Life slows down in the fun aspects, while speeds up in the work area. Go figure.

Plans for this week: purchase Mario Kart DS on Tuesday night (yes, I know it doesn\’t come out til Wednesday).

Sunfox: A Topic to post about

November 12th, 2005

I won\’t mention anymore than this: but I\’m starting a topic called sunfox. Sunfox.net is the new version of OXWAF that will be designed for single site use, easy to install, and include all the features of oxwaf in a fairly fast, compatible way.

That said, I want to start talking about it here to get comments about it\’s individual components. It will be public software, so I\’m not overly worried about others having or making use of the source code. If you want to take a look at the source code visit:

cvs.sunfox.net

So let\’s start with the first major design decision that was made with this version that we didn\’t do with OXWAF.

Major Decision Decision 1)

Everything except the main driver file (index.php), and the config file, (conf.php) shall be classed. But more so, every one of those classes should be able to be extended or replaced by a custom created class. So for example, this is the first 2 lines of index.php:

include \"conf/config.php\";

include $GLOBALS[\'SITE_PATHS\'][\'mysql\'];

So as you can see, the conf file is included straight, but the include of the mysql class is actually a global variable in the SITE_PATHS. These values are all defined by default at the bottom of the conf file with a notice saying that you don\’t need to update those lines unless you really know what you were doing.

So does this sound like a good idea? Should users be able to extend or replace any feature? It gives them the benefits of being able to say, replace the msyql driver with a postegre driver. They could even replace the virtual addressing if for some reason they thought the system was not worth while. The only downside I can think of is that people could try to do things and break the entire system, or introduce bugs that were never ment to be there…

I don\’t think that\’s a big issue though. If they do it, it\’s their fault.

Ok, so that\’s my spiel on that decision… let\’s talk about the two classes that are in place, and doing something already (at sunfox.rinsefirst.com).

Mysql Class:

This is almost identical to one we had in oxwaf, except some minor changes to improve the sql syntax where possible. The goal will be to not use the query function at all, but instead stick to select and insert functions. This way, at some point, in theory you can have as many mysql servers as you want (replication) in order to speed everything up, while only having 1 insert server (the main server).

Virtual Address Class:

This to is almost identical to the oxwaf virtual address class, except for few very key things.

1) I\’ve added the ability for wildcard folders. Something dan had requested and I thought was added into OXWAF, but it doesn\’t look like it.

2) I\’ve removed the the file system class for the moment. This is the only file I believe that was used, and it was used for only one function. I might be wrong, but until we run into a need for more file system stuff, I\’m going to leave it like this. It should be noted though that this is what I did.

3) I\’ve made sure to put the matching in the order they are likely to happen to help speed up filename matching (this was pretty minor).

4) Lastly: It no longer returns the page itself… IE: it doesn\’t make the calls to the blueprint engine. It doesn\’t try to figure out what type of file it is. It does remember what the data_id and data_type is so that another class (not yet developed) can handle the data processing. I\’m not sure why this abstraction was not in Oxwaf… Maybe it just never made sense there…

So that\’s my speil on that.

Feel free to post questions about sunfox while it\’s under development. I\’m sure we\’ll start posting design debates soon (mainly about security). If you want to see the files as they are in sunfox, please checkout cvs.sunfox.net

Thats my speil on sunfox for today.. Enjoy… Oh and Nebraska barely won… yay.

This is enough for a post

November 5th, 2005

www.upc-online.org