Calling all gamers
Apr. 22nd, 2008 | 10:15 am
So I'm looking to start up a D&D night. Now I'm a bit old, I still call it a dungeon master, and I'll looking to run an ad&d 2nd ed. game. I've got some books and will pick up what else I need. If anyone is interested please let me know. I'd like to get something something going in the next month or so. Please also let me know what night(s)? would work best for you.
Link | Leave a comment {2} | Add to Memories | Tell a Friend
So wrong and yet its only 49.95!
Dec. 13th, 2007 | 09:21 am
Link | Leave a comment {1} | Add to Memories | Tell a Friend
Kieran
Jul. 9th, 2007 | 04:30 pm
mood:
accomplished
We do have some photos but I'm going to give Mom another couple of days before I post any of them, would rather let her do it. Thanks to everyone who has wished us well and done so much to support us. We're both very happy to have him and even Eamon is doing pretty well with it.
In an attempt to help Eamon not feel to left out Daddy managed to come home with a wii last week. We've been playing Super Paper Mario quite a bit and he really seems to like it. I haven't really started much on Zelda yet but it's sitting there and I'm sure we'll get into it soon enough. I really must say that the wii is very cool and the way Nintendo has found so early in the systems life to find interesting and fun ways to use the controller is very interesting. After playing so many mature games for so long I'd almost forgot just how much fun a good family game could be. Yay Mario.
More as it comes...
Link | Leave a comment {4} | Add to Memories | Tell a Friend
thetvdb.com: parsing their xml in c#
Jun. 29th, 2007 | 11:44 am
This may not be of any interest to anyone but after refactoring some of my code I've cleaned up quite a bit and ended up with a method called XmlToHash().
Method: ArrayList XmlToHash(XmlDocument xDoc)
The full function is below, after writing a few methods that pull data from thetvdb I got a bit tired of coding the same basic thing over and over again. As I started to refactor the code I found that all the return xml documents are pretty much in the same format
<Items>
<Item>
blah, blah, blah...
</Item>
</Items>
With one or more item entry in each response. So, since this basically comes down to parsing the same document but looking for different end nodes I kept isolating the parsing code until finally I ended up with:
private ArrayList XmlToHash(XmlDocument xDoc)
{
XmlNodeList nodes = xDoc.SelectNodes("/Items/Item");
ArrayList items = new ArrayList();
foreach (XmlNode node in nodes)
{
if (node.ChildNodes.Count > 0)
{
if (! node.FirstChild.LocalName.Equals("SyncTi
{
Hashtable item = new Hashtable();
foreach (XmlNode childNode in node.ChildNodes)
{
if (childNode.FirstChild != null)
item.Add(childNode.LocalName, childNode.FirstChild.Value);
}
items.Add(item);
}
}
}
return items;
}
So, when running this on some xml that looks like:
<Items>
<Item>
<SyncTime>1234567890</SyncTime>
</Item>
<Item>
<ShowName>My Show</ShowName>
<ShowID>123</ShowID>
</Item>
<Item>
<ShowName>My Other Show</ShowName>
<ShowID>456</ShowID>
</Item>
</Items>
what you end up with is an ArrayList of Hashtables that looks something like this:
[
{ ShowName => 'My Show', ShowID => 123 },
{ ShowName => 'My Other Show', ShowID => 456 },
]
I've shown this in what more likely looks like perlish rather then c#ish but you get the idea. I now have an ArrayList (easily loopable as a collection) where each item is a Hashtable of all the nodes in each "item" leaf from the xml document. I'll deal with SyncTime in my next post, for now I'm sure you all can figure out how to include it in the ArrayList
Hope any of you find this interesting.
More as it comes...
Link | Leave a comment {2} | Add to Memories | Tell a Friend
ArrayList (its good and its bad)
Jun. 28th, 2007 | 04:04 pm
Enter ArrayList
ArrayList has an Add() method as well as a Remove() method. So, in short you create one as:
ArrayList mylist = new ArrayList();
and thats it. Your done. adding and removing is by value (dont ask about duplicate values, I haven't looked that up and it doesn't apply to my use of this data type).
mylist.add("foo");
mylist.add("bar");
mylist.add("baz");
Removing is pretty much the same
mylist.Remove("bar");
So. Something that ArrayList doesn't have are useful methods for accessing this data (other then mylist[0], mylist[1], etc). Coming from the perl world I have come to expect things like split() and join().
ArrayList doesn't have either of these methods. But, the Array class does! (they are static functions).
So, you can say
Array mylist = new Array(3);
mylist[0] = "foo";
mylist[1] = "bar";
mylist[2] = "baz";
Then you could do something useful like Array.Join(",", mylist);
This would give you "foo,bar,baz" as a single string. Pretty nifty. So, here I am with my ArrayList and I decide I need to flatten it out for a url. I'm thinking great, I can just use Join() right? Wrong, That is a static function on Array, not on ArrayList. Ok, so I check ArrayList and find that it was a ToArray() method.
Perfect, I should be able to do something like:
string mylistStr = Array.Join("&", mylist.ToArray());
Nope, this doesn't work, the compiler says to me, "Hey buddy, you can't convert an object[] into a string. Oh, ok. So further looking finds that ArrayList has a second version of the ToArray() method that takes a type to convert to. Nice, so then I try:
string mylistStr = Array.Join("&", mylist.ToArray(string));
No again... ok fine. Lets try it again, after some digging I end up figuring out that c# isn't smart enough to accept a data type, it was the name of the data type (not as a string). Ok find, third try it is:
string mylistStr = Array.Join("&", mylist.ToArray(typeof(string)));
?? no... dead again. This time is something about "Hey buddy, you can't convert an object[] to a string[]
? wtf... dammit. This is getting down right personal. After a bit more fun I end up with the final (and working version of this one line of fucking code)... and here it is:
string mylistStr;
mylistStr = Array.Join("&", (string[])mylist.ToArray(typeof(string))
damn, it really shouldn't take that long. Now, to be fair I'm used to perl which is VERY easy on the data types. Casting really only ever comes into play (for me anyway) when dealing with utf8 stuff.
But I have to ask myself, can't the ToArray(type) method do the casting for me? Isn't that why I'm telling it what data type I want back for in the first place? Well anyway, the line is done and it works fine. I still like ArrayList for it's simply ability to hold/maintain lists.
When it comes to using the ArrayList object I actually never lookup via index, I using a loop that looks something like:
// items is an ArrayList object
foreach (datatype item in items)
{
// do something with item
}
Thats all for now, more as it comes
Link | Leave a comment {2} | Add to Memories | Tell a Friend
Vista Media Center is a bitch!
Jun. 27th, 2007 | 11:26 pm
So, Vista it is. I ran Windows XP Media Center (2005) for a while (a little while) but the Vista interface is SO much better that I really had to switch.
So, my issue:
Watching TV shows is something my entire family tends to enjoy. Desperate Housewives for the wife, Invader Zim for the boy, and Battlestar Galactica for myself (the wife likes that one as well). The issue started when I missed an episode from one of the shows I follow and was forced to *locate* it and put it on my machine by hand. This file came in the format of xvid (go look it up if you don't know and have any interest). A short time later I found that I had a directory structure that looked something like this:
\[Series Name]\[Season Number]\[Episode Number] - [Episode Name].avi
Finally the problem statement. When I haven't watched a show for a few weeks but have been keeping up with the files I end of not knowing which episode I'm at. Which one do I watch next? Well, after looking around on the net and trolling through a large number of blogs, forums, and newsgroups I determined that either nobody else is having this problem (unlikely) or (more likely) the people having this problem don't seem to have any coding skills leaving me with nothing to download. Lame.
So, here I am thinking to myself "I should write something to deal with this". Hell, I have a copy of Visual Studio Express C# edition thanks to MS making this available for free download. Now I'm not a big C# fan but I can say it beats the hell out of java, is alot more fun the c/cpp and is cleaner then perl. Well, what the hell. Lets do it.
I managed to come across thetvdb.com which provides free image and textual data for tv shows (user contributed) and they have an xml interface for accessing this data.
XML: damn, its fun to read, shitty to code with. If you think otherwise then your either full of shit, have never done it before, or possibly sick in the head and needing mental help.
So, with C# express, vista media center SDK, and lots of online docs in hand I have begun to write a plugin for vista mce. So, where am I at? Well, its been about a week (maybe 10 days?) and I've got the library code about 80% complete. I can scan drives, catalog shows, seasons, and episodes to disc. I've begun the code to pull and integrate data from thetvdb.com and just about to have this finished up for shows. Still have to finish the episode data but that should all be done by the end of the week.
Naturally this is all beginning tested as I go, adding try blocks liberally as my coding skills in C# aren't exactly top notch. I'm pretty happy with what I have so far. I'll begin posting code samples next detailing the issues I've run into and how I've dealt with them.
Issues such as:
Serialization (xml or binary?),
Lists (arrays) how not to use them since they suck ass in C# (note: ArrayList does the job alot better),
XML parsing (hint: I'm using DOM style parsing, I prefer SAX in perl, but callbacks suck in C#)
More as it comes...
Link | Leave a comment | Add to Memories | Tell a Friend
Damn... watch your back
Jun. 21st, 2007 | 09:59 am
Link | Leave a comment {2} | Add to Memories | Tell a Friend
Amazing video buffalo vs lions
Jun. 14th, 2007 | 11:13 am
Link | Leave a comment {1} | Add to Memories | Tell a Friend
Illegal peoples
Jun. 13th, 2007 | 07:04 pm
"Wanting to come here and work is not a crime", this the (from memory) quote of a young lady on channel 8 news (aired at 5pm on 06/12/2007). I agree with her, wanting that is not a crime. Actually coming here illegally (note the work illegal) is a crime. Many people seem to refer to this as a heated social issue. I'm not really sure how it is a social issue and not a legal issue but I'm sure many of you have your own opinions on the topic.
My views:
1) It is a direct violation of US law, thus the term illegal.
2) Coming here illegally (for any reason) and staying here against the law is a curse in the face of all those who did it the legal way.
3) Doing so you become a drain on and/all social services that you use. If we had extra then I would be the first to offer it to you. The simple fact is that we have many needy and wanting US citizens that should be taken care of with our tax dollars before you should see a penny.
4) Working inside the US as an illegal (as I see it) only helps the corporations. You are working (jobs you claim US citizens won't do) for lower wages that help to increase profits (factor in the fact that the company you work for is not paying taxes on you as an employee) for the companies and lowering the wages of US citizens working either for the same company or in the same industry.
5) Cheating the global marketplace. This is a view that I have considered for some time and believe to be true. The basic idea is that US citizens are allowed to pay less for items that other people in other countries would pay for more simply because US companies keep the prices down by using low wage (non-insured) workers. This keeps the prices down artificially. Our prices on many items would increase "overnight" if all illegal workers were found and deported. But this is only because we as a country have cheated inflation over time by lowering the US wages and the finally just using illegal workers to keep wages as they were 20 or more years ago.
Now, I'm sure there are many other reasons why the US should NOT allow these people to stay in our country, and I'll not go into them all here. To me, the simple issue is that they are breaking the law and simply having to arrest and deport them is using up my tax dollars that could, would, and should be used for other (read better) purposes.
Do you want to come here? Sure you do. Should you be allowed to come here? Sure. Should you be allowed to ignore the law and do it your own way? No, I am a US citizen, I am required to pay my taxes and follow ALL US laws both state and federal. Being an immigrant, I expect and demand the same of you.
Link | Leave a comment | Add to Memories | Tell a Friend
Shale oil? this is the first I've heard of it... fun read if nothing else
Apr. 12th, 2007 | 03:27 pm
mood:
bored
http://royaldutchshellplc.com/2007/04/1
Link | Leave a comment | Add to Memories | Tell a Friend
Daddys home!
Feb. 20th, 2007 | 10:43 am
Take that the to bank!
Link | Leave a comment {4} | Add to Memories | Tell a Friend
Fruit of the Loom advertising slogans?
Jan. 3rd, 2007 | 03:57 pm
* We only pass gas...the shit stays put.
* Don't let a fart keep you apart.
* We pass no shit. Just air. that's it.
* Your gaseous expulsions need not cause revulsions.
* Keep your family, keep your friends, wear Fruit of the Loom on your rear end.
* Your wife is dead, your fart has kil't'er, 'cause you wore no fecal filter.
* Relieve your gut, but cover your butt.
* Do it for those around you.
* It's better than carrying Lysol with you everywhere.
* For the same reason there's water in the toilet.
* Eat Mexican food without being crude.
* Your digestive motor produces such odor, but you could be stoppin' it and also be whoppin' it.
* (The sound of a long, loud fart) There's no other word for it.
* You smell gross. But you don't have to.
* Wear Fruit of the Loom. And be a little social.
* You'll clean up the air with our new underwear.
* Why the stench?
* If I'd known about these, I wouldn't have divorced my husband.
* Give hoot. Don't pollute.
* A fart can be art.
* It's natural gas. Purify your resources.
* God would want you to.
* It's fine to expel it, but you don't have to smell it.
* What, you want to smell like shit?!
* Your neighbors will thank you.
* Farting can be fun...if done safely.
* Go ahead and eat the chili.
* If passing gas must be your fate, take care not to asphyxiate.
* Gas passed. Smell quelled.
* "It smells good in here...did somebody fart?"
* Go ahead and cut the cheese. No one will care, with shorts like these.
* Be reticent and redolent, not noisy and noisome.
* I used to be rank, I mean I really stank; But now I smell good, like all gentlemen should.
* Don't court infamy because you are gamy.
* (in a girl's voice): "If you're gonna be fetid then let's just forget it.
Link | Leave a comment | Add to Memories | Tell a Friend
drum roll please...
Dec. 13th, 2006 | 03:00 pm
what can I say, the death cert. is in: accidental overdose
fuck, I hate you, I miss you
you dumbass
Link | Leave a comment {5} | Add to Memories | Tell a Friend
Round 2 with god
Dec. 12th, 2006 | 03:27 pm
The first being my use of the word god. My intention was not to imply awareness in this god. Maybe a different word might have been better placed, what I really meant to describe was an unknown force of some (any) kind causing influence in human affairs with or without our influence. That is to say that I meant god (please note lower case) only to describe a force, not a being.
The second has to do with destiny, it appears that many people seem to think that we can somehow have some level of influence on destiny. Such that one could decide to ignore it (or something like that). Was a good families daughter destined to suck dick for crack? Was a bad families son destined to rape and murder children? Or did both of these people choose to ignore their destiny? Had some grand design destined them to be who they became or not?
So what if destiny is not for everyone? Is it guided by the person or by the situation? Does destiny influence during war for the greater good? Does it come into play so that a poor child will become wealthy and powerful? It would seem that if it is for the person then maybe that person is better or more important then others around them, is that it? Or maybe the nazis were bad people causing destiny to choose someone (or someones) to do great things in war for the success of those fighting the nazis. These are really just a small set of examples where destiny is often called upon to explain events but the very idea implies that god (some "force") decided that either permanently or temporarily someone or some group of people are more important then the rest and are treated differently by the universe. I call this Rubbish.
Why can life and events not simply be? Why can the earth not simply turn and days come and go? Must there be some great design? Must there be better and worse? And if choices are made, how and why are they made?
Link | Leave a comment | Add to Memories | Tell a Friend
Fate and Destiny
Dec. 11th, 2006 | 04:35 pm
Link | Leave a comment | Add to Memories | Tell a Friend
Are you bored today? Like to watch something almost painful and yet amusing at the same time?
Dec. 7th, 2006 | 01:55 pm
Link | Leave a comment {2} | Add to Memories | Tell a Friend
Not as clear as some suggest, but fairly good
Dec. 6th, 2006 | 11:56 am
mood:
blank
Link | Leave a comment | Add to Memories | Tell a Friend
another one bites the dust (jingle, jingle)
Nov. 14th, 2006 | 03:24 pm
Nik, you will be missed.
For those of you that did know him, you can contact me for his funeral info, it will be on this friday.
