Well, I'm back home, but wish I wasn't. Had a wonderful vacation and have a wonderful tan thanks to the beaches of the US Virgin Islands. Flew back to Ohio in the midst of a snowstorm, which sucked ass pretty hard, and I'm really wishing I could have stayed on vacation until, say, June. But alas, there are important things that need tending to here before I can enjoy warmer weather again, mainly doctor appointments.
Today I get my knee drained again. I am not looking forward to this at all, and really, really hope the doctor numbs me up well and good today. I don't know how successful he's going to be if the pain is as harsh as the last time. He only got 7 cc's of fluid out then and he thinks there's at least another 40 in there. But, if I can walk normally in a couple of days, so be it. And if I can't deal with the pain maybe he'll go with a steroid shot or something. Anything to kill the pain that normal walking tends to cause.
Tuesday, December 29, 2009
Saturday, December 26, 2009
Best games of the past decade
Since everyone else and their brother is doing a best games of the decade list, I thought I'd go ahead and do one myself. It's not like anybody else is actually right, anyway, so I figure why the hell not. Besides, while my taste in games may be slightly different than the average person's, it's still my list, and if you disagree that's fine, just keep in mind, nobody's asking you to play them. They're just the games that I liked. So here we go, in no particular order.
- Microsoft's Flight Simulator X: As much as I hate Microsoft under the leadership of Steve Balmer, this is one product that Microsoft has never failed to do right. The improvements to the physics and graphics were incredible, and the AI was light years ahead of its predecessor FS9. Even better, many of the mods made for FS9 worked as well or better in FSX, and that's where Flight Simulator really stands out. Throw in new aircraft, flight routes, and AI carriers from countless different sources, and you felt like you were living in the world of commercial air transportation. Of course, I was just happy that the jetways actually moved and connected to your plane at the airport, so I suppose I'm easy to impress. I would have preferred a more instructive flight training simulatiion, more along the lines of what FS9 had, but it wasn't a big deal to just go back to FS9 and learn how to fly again. Other than that, the only thing I was really hoping for out of the followup to FSX was people on the ground. Airport workers, people walking to and from the airport terminals and near the hangars, even kids watching the airplanes from inside the terminal. That would have been cool, but sadly it will never be since Microsoft killed Flight Simulator's production team and laid off all of it's developers. One of many reasons I wish Steve Balmer a thorough anal probing by aliens.
- Portal: An FPS with no weapons, no enemies, but just amazingly thought out puzzles and one of the most hilarious narrative stories I have come across in video games. When we are old and wrinkled, when our grandchildren come to us seeking sage wisdom from our long, experience-filled lives, we will look at them with a tear in our eye, smile at them with the compassion of one who has seen it all in our long years, and say "the cake is a lie". They will look at us and think we're fucking nuts, but we know what we're talking about. Our own grandparents suffered through hard years of economic disaster, wars that killed millions, and untold suffering for generations, yet we were fortunate enough to learn all of life's lessons in 19 puzzles created by a computer construct trying to tempt us with cake.
- Company of Heroes: I generally don't like many strategy games, but Company of Heroes is one of a few exceptions to the rule, and I'm not even sure why. Yes, the graphics are pretty frickin' awesome, and the gameplay is somewhat realistic, but usually that's not enough for me to fall in love with a game. What matters most, though, is that the game is quite simply fun to play. I really can't place my finger on a single item that makes this game stand out in my mind, but it simply is one of my favorite games from the last decade. I even have this strange sort of addiction to it that is beyond explanation. I'm dead serious about this, too. It's triggered almost every day, when I'm putting the dishes away. As I'm taking the silverware out of the dishwasher and putting it in the drawer, I always, and I mean that literally, I always get an extremely strong urge to stop what I'm doing and go play Company of Heroes. I doubt a team of the world's greatest minds will ever figure out what makes that connection in my brain, but there it is, and any game that can do that has to be an outstanding game.
- EVE Online: Otherwise known as making spreadsheets fun. Seriously, that's essentially what this game is, a giant fucking spreadsheet with pictures, but it's a blast, and has some of the most unique qualities I've ever seen in a video game. Admittedly there's an awful lot of grinding if you don't want to pay to play, and the LONG process of leveling up can, I admit, take some of the fun out of the game, but if you're willing to be patient, put in the time, and not get mad when someone flips a can on you, then you can have a blast with this game. Besides, it's still the only game where everyone is playing in the same universe. You don't choose a server to play on, you log in, and literally everyone is there where you are. I haven't played it in a while, I admit, but I waisted far, far too many hours in that game simply mining ore, and I liked it.
- Auto Assault: This game got short shafted big time. I will probably never understand why it didn't take off any more than it did, but sadly it had a short lifespan, even for your average MMORPG. I mean, you're a battle car, in a future apocalyptic world, and your job is to go out and kick ass. What's not fun about that. I know, a lot of people complained that the populations were too low on the servers, that finding people to campaign with was too difficult, but I disagree. Then again, I'm not your typical MMO player, either, even though I like to play MMO's. I liked Auto Assault because in all actuality I could play it as a single-player game. I liked the fact that I could be out doing a quest, and some random person, another human, could be lying in wait to kick my ass. I never got worked up over the crafting bugs in the game like other people did, but then again crafting has never been my thing in video games. I much prefer to take all the loot I pick up, sell it, then buy what I need, but that's how I am in real life, too. I don't want to make a sandwich when I can buy one, so why would I want to do that in a game? But that's just me. If I ever get rich and start my own development studio, this is a game that I'm going to try to remake.
- Guild Wars: No, it's not World of Warcraft, and in spite of what GW players typically say, should never be compared to WoW. The only comparison between GW and WoW is the fact that they're both fantasy-based games, but otherwise the gameplay is completely different, and that's a good thing. I like Guild Wars because it has a pretty awesome story line, but mostly because, again, it's an MMO I can play as a single-player game if I want to, and if I don't want to engage in PvP play, I don't have to. Ever. Then again if I do want to engage in PvP, that's easy enough to do also, and I like the way that PvP is structured in arenas, like in some ancient Colosseum. Many argue that Guild Wars is not a true MMO, and there's some merit to that argument, but it's still a fun game that can suck up way too many hours of your life if you let it.
- Day of Defeat/DoD:Source: Easily my favorite game for several years running. The gameplay itself is simple. Shoot the enemy, don't get shot, but it was the first multiplayer game I really got into. I spent far, far too many hours playing this game, but I made some great friends in the process. Graphically, not the best game in the world, but I found it much, much more enjoyable than Counter Strike, for the simple fact that even if you suck and die a lot, you don't have to wait long to respawn and start playing again. I got better, though, so I didn't suck for too awful long.
- Battlefield: Vietnam: Another mod that was, in my opinion as good as or better than the original. Battlefield 1942 wasn't a great game in my opinion, because even though it came with a single-player campaign, it left a LOT to be desired. BF:Vietnam wasn't like that at all. They made no attempt to pretend there was a playable single-player element to the game, the weapons and vehicles were fun to play, and most of the stock maps were big enough that you could play for hours without wanting to change maps. Loved this game, and wish I still had it. Not only that, but the game's soundtrack seriously kicked ass.
Thursday, December 17, 2009
Making charts
So today I took some of that data from the National Weather Service I've been playing with, and I used it to figure out how to make dynamic charts in PHP-based websites. Turns out, it was pretty easy using Libchart with a few tweaks here and there. I don't know how long it'll stay up, but the charts look something like this:
I know, nothing to get overly excited about, but it's a start. As I collect more data (this was only about 5 hours worth) the chart should begin to look a little more interesting, but I'm not completely satisfied yet. Tomorrow, assuming I'm not catching the flu (it feels like it right now) I'm going to play around with JpGraph and see how that works. It looks to be a lot more robust, with a lot more options, like letting me plot temps in Fahrenheit and Centigrade on the same chart with scales that are locked to each other, the ability to set the minimum number on the bottom to something other than zero, and so on.
I'm really not all that interested in learning how to completely code the chart making from scratch. I mean I am, a little, but instead I think I'd rather learn a new language like C# so I can create desktop apps for myself that do similar things. There are a lot of benefits to web-based apps like this, but until I'm able to afford a new gaming rig I don't have a dedicated linux box. Right now I'm stuck running all of this on a vmware image, which is fine since I have tons of memory, but sometimes I need to shut vmware down for extended periods and then all of these nifty little apps I've been working on stop collecting data.
For now, though, I'm just playing around and learning new concepts. Something to keep me occupied in the evenings, at least.
I know, nothing to get overly excited about, but it's a start. As I collect more data (this was only about 5 hours worth) the chart should begin to look a little more interesting, but I'm not completely satisfied yet. Tomorrow, assuming I'm not catching the flu (it feels like it right now) I'm going to play around with JpGraph and see how that works. It looks to be a lot more robust, with a lot more options, like letting me plot temps in Fahrenheit and Centigrade on the same chart with scales that are locked to each other, the ability to set the minimum number on the bottom to something other than zero, and so on.
I'm really not all that interested in learning how to completely code the chart making from scratch. I mean I am, a little, but instead I think I'd rather learn a new language like C# so I can create desktop apps for myself that do similar things. There are a lot of benefits to web-based apps like this, but until I'm able to afford a new gaming rig I don't have a dedicated linux box. Right now I'm stuck running all of this on a vmware image, which is fine since I have tons of memory, but sometimes I need to shut vmware down for extended periods and then all of these nifty little apps I've been working on stop collecting data.
For now, though, I'm just playing around and learning new concepts. Something to keep me occupied in the evenings, at least.
Tuesday, December 15, 2009
Fuck that hurt!
How in the hell I kept from cussing out loud while the doctor was draining fluid out of my knee is beyond me. I have literally never been in that much pain in my life. I mean seriously, that hurt so much I nearly passed out because of the pain. The bad news is, I have to go back in a week or so and do it all over again.
Not blaming the doctor on this one, although it's partially his fault it hurt so much. He did try to numb the area where he was sticking the needle, but where he numbed it he wasn't getting any fluid out. Then he backed out a little, changed angles, and holy mother of every god the universe has ever known, the world went dark on me and it was everything I could do not to scream at the top of my lungs. But I'll be damned if that part, where it hurt worse than any pain I've ever felt, didn't end up being the part where fluid began to flow out of my knee.
We're talking a pain like I have never felt anywhere in my body. It didn't feel like when you cut yourself or slam your fingers in a car door. This felt like a deep, hollow, explosive pain that is almost impossible to describe. I really wish I could put it into words that do it justice, but the closest I can come is it felt like he was right under the edge of the patella and set fire to the back side of the bone. Fire started from potassium, or thermite, in the bone. That's kind of what it felt like.
In all, he gave it three tries. The first try didn't hurt at all but he didn't get any fluid out. The second try was the one that hurt like a motherfucker. That time he got 7 cc's of fluid but stopped when I nearly passed out. The third time he tried a slightly different area that didn't hurt as much, although it still hurt, but he didn't get any fluid. That's when we decided to give it a rest. He used a lot of lidocane but he numbed things up before he stuck me, which in retrospect was a bad choice on my part because it was the wrong area and he didn't feel comfortable using more. That's why we decided to stop, even though he thinks there's another 40 cc's or more he can get out.
Chances are we're going to go through the entire process again in a week or so. He's ordered an orthopedics consultation, which he wants me to have before my primary care appointment on Jan. 4, but if I can't get the ortho consult before then (unlikely in my opinion) he's going to stick more needles in my knee and try to get the rest of the fluid out. I'm hoping like hell I'll get that ortho consultation next week, though, because I really, really don't want to go through that pain again. I will if I have to, but damn, I'd prefer to avoid it if at all possible.
Not blaming the doctor on this one, although it's partially his fault it hurt so much. He did try to numb the area where he was sticking the needle, but where he numbed it he wasn't getting any fluid out. Then he backed out a little, changed angles, and holy mother of every god the universe has ever known, the world went dark on me and it was everything I could do not to scream at the top of my lungs. But I'll be damned if that part, where it hurt worse than any pain I've ever felt, didn't end up being the part where fluid began to flow out of my knee.
We're talking a pain like I have never felt anywhere in my body. It didn't feel like when you cut yourself or slam your fingers in a car door. This felt like a deep, hollow, explosive pain that is almost impossible to describe. I really wish I could put it into words that do it justice, but the closest I can come is it felt like he was right under the edge of the patella and set fire to the back side of the bone. Fire started from potassium, or thermite, in the bone. That's kind of what it felt like.
In all, he gave it three tries. The first try didn't hurt at all but he didn't get any fluid out. The second try was the one that hurt like a motherfucker. That time he got 7 cc's of fluid but stopped when I nearly passed out. The third time he tried a slightly different area that didn't hurt as much, although it still hurt, but he didn't get any fluid. That's when we decided to give it a rest. He used a lot of lidocane but he numbed things up before he stuck me, which in retrospect was a bad choice on my part because it was the wrong area and he didn't feel comfortable using more. That's why we decided to stop, even though he thinks there's another 40 cc's or more he can get out.
Chances are we're going to go through the entire process again in a week or so. He's ordered an orthopedics consultation, which he wants me to have before my primary care appointment on Jan. 4, but if I can't get the ortho consult before then (unlikely in my opinion) he's going to stick more needles in my knee and try to get the rest of the fluid out. I'm hoping like hell I'll get that ortho consultation next week, though, because I really, really don't want to go through that pain again. I will if I have to, but damn, I'd prefer to avoid it if at all possible.
Today's the day
Today's the day I see the knee doctor. Been a long wait, but it's finally here. Leaving in about 10 minutes or so, even though my appointment isn't until 2:30 but I need to get there early so that I can find his office. My knee seems to sense the impending visit, because it's swollen pretty good and I can't straighten it out very much. Stairs are almost impossible unless I take them one step at a time, and if I've been standing for a few minutes I have a hard time bending my knee again just to sit down.
It's amazing how, when we have a long-term injury (in this case osteoarthritis) we learn ways to cope and get around the pain without even thinking about it. When I stand after sitting, I put all my weight on my right leg because I can't support any weight left. Chairs have to be higher than your average chair, so on non-adjustable chairs I have extra pillows I sit on. Little things like that, things that I barely notice most of the time, are what makes me realize just how much of a problem my knee actually is.
Hopefully today I'll get some answers, though, and it won't be a problem for much longer. I hope. I really, really hope. :)
It's amazing how, when we have a long-term injury (in this case osteoarthritis) we learn ways to cope and get around the pain without even thinking about it. When I stand after sitting, I put all my weight on my right leg because I can't support any weight left. Chairs have to be higher than your average chair, so on non-adjustable chairs I have extra pillows I sit on. Little things like that, things that I barely notice most of the time, are what makes me realize just how much of a problem my knee actually is.
Hopefully today I'll get some answers, though, and it won't be a problem for much longer. I hope. I really, really hope. :)
Friday, December 11, 2009
Dreamkiller
Looks like Valve is having a free weekend of play for Dreamkiller. Never heard of the game until today, so I think I'll give it a shot and see what it's about after it finishes downloading. I like trying new games, so hopefully this one will be good. If it is, maybe I'll buy it when I finish Dragon Age: Origins.
Weather Messages Done!
Sweet! I managed to write a script that collects weather forecasts from the National Weather Service and sends them via text message (MMS actually) to my cell phone. I realize it's been about 24 hours since I first mentioned this little project, but I really didn't get started until about 9:00 last night, then slept and started on it again late this morning.
The only difficulties I ran into was with the raw XML data from the National Weather Service. When I started last night, it listed minimum temperatures (the low) first, then in the next section it listed the high temps. No big deal, I just grab them in order, insert the lows into the database, then the highs, and I'm good to go. Right?
Fat chance. This morning I started working on it again and the first thing I noticed is that that low temps are about 20 degrees higher than they should be, so I look, and my low temps are in the high databases and the high temps are in the low database. I ended up having to write a whole new routine to first figure out which temperatures I was dealing with before inserting them into the database. I got it figured out, though, and it really wasn't difficult but was annoying because I had to take a few steps backwards.
I also ended up sending the messages via MMS rather than SMS to get around the 140 character limit Verizon places on you. I understand why they set it at 140 characters, because of the extra stuff they add in, but I wanted to send the full forecast for both today and tomorrow so MMS it was. I don't get charged for either, so it's not a big deal, really.
But at least it's done, and it works much better than I expected it to. So I'm a very happy girl right now :)
The only difficulties I ran into was with the raw XML data from the National Weather Service. When I started last night, it listed minimum temperatures (the low) first, then in the next section it listed the high temps. No big deal, I just grab them in order, insert the lows into the database, then the highs, and I'm good to go. Right?
Fat chance. This morning I started working on it again and the first thing I noticed is that that low temps are about 20 degrees higher than they should be, so I look, and my low temps are in the high databases and the high temps are in the low database. I ended up having to write a whole new routine to first figure out which temperatures I was dealing with before inserting them into the database. I got it figured out, though, and it really wasn't difficult but was annoying because I had to take a few steps backwards.
I also ended up sending the messages via MMS rather than SMS to get around the 140 character limit Verizon places on you. I understand why they set it at 140 characters, because of the extra stuff they add in, but I wanted to send the full forecast for both today and tomorrow so MMS it was. I don't get charged for either, so it's not a big deal, really.
But at least it's done, and it works much better than I expected it to. So I'm a very happy girl right now :)
Labels:
geek stuff,
Miscellaneous,
rambling,
text messaging,
weather
Thursday, December 10, 2009
Wx via SMS or MMS using PHP and XML
Heh, I love acronyms :)
Anyway, playing around with the Bing API the other day got me in the mood to play around with web-based data once again, which happens on rare occasions. I find data, then I want to find out if I can import that data and make it useful to me, personally, and maybe a few of my friends. That was part of my motivation behind messing with the Bing API (not to mention porn) but now I've moved on to other areas.
Way back earlier this year I started working on a project to grab weather data from the National Weather Service and was planning on creating a way to send short-term forecasts to Twitter. I already started a way to send news headlines to Twitter, using the free Daylife API, and I've long thought that getting the local weather via Twitter would be cool, too. I may still do that, but now I have other plans.
When I first started looking at the weather data, figuring out how to use it was way beyond my capabilities. I only knew how to deal with PHP-REST data, and had no idea how to deal with plain old-fashioned XML data in PHP. Once, a long time ago, I was able to write a script that imported and parsed RSS feeds, but that was a few years back and had long since been forgotten. But messing with the Bing API taught me a few more tricks so I started playing around a little more.
Before the weather idea came up, however, I had a more immediate need. I'm on your basic residential DSL connection at home, and it serves my purposes quite well until FiOS is available in my area. But being on a residential DSL circuit means I have a dynamic IP Address, which makes it difficult to remotely connect to my home machines if the lease expires and my IP changes. So the question was, can I monitor my home IP address and send a text message to my cell phone when it changes?
The answer was a surprisingly easy yes. Sort of. Writing the script to send the message was extremely easy, but the difficult part was configuring sendmail and apache to send an email through Verizon's smtp servers. That's a long story and not really pertinent to this discussion, but let's say that spammers have made life much more difficult for us honest folks.
Anyway, if you have a Verizon cell phone, here's the little script I use to send a text to my phone when my IP changes. Note, I don't have telnet or SNMP access to this cheap-ass router they provide, so I have to grab the IP from an external website. I store it in a database so that I can check it frequently but only send a text message when there's a change:
Once that was done, I had another idea. Some strong winter weather was moving through the area (the whole country almost) and I noticed on the National Weather Service website there was an alert issued for my area. So the little lightbulb goes off and I think it would be really, really nice to have those sent by text to my phone as well.
That, of course, was a little more difficult, but I managed it. I won't post all of the code here because I'm not done making changes to it, but basically it's very similar to the code above except instead of just grabbing an IP from a web page, I now have to parse a potentially lengthy XML response.
Parsing the XML was a little bit of a learning experience. In all honesty, it was pretty easy once I figured out what I was doing, but I did run into a problem with namespaces. Parts of the XML document I use for severe weather alerts is based on the Common Alerting Protocal, but the document didn't provide a reference to the namespace schema, so I had to learn how to deal with that. It would have been ok, but the prefixes used in the document weren't completely consistent with the CAP schema, so I had to come up with a workaround.
Well, I didn't have to come up with a workaround. I didn't need the CAP messages for what I was trying to do with the data since I'm only sending the timestamp and the first 120 characters of the alert summary to my cell phone, but I definitely wanted to be able access all of it regardless of its current usefulness. In the process of figuring out how to use the CAP data in the weather alert messages, I found that there are all kinds of agencies using that same protocol. That resulted in the realization that I could grab tons and tons of XML-based data relating to emergency situations and use it in dozens and dozens of different ways. Send it to Twitter, send it to cell phones, display it on the web in maps or develop mobile applications.
I even saw where the Department of Homeland Security uses RSS to disseminate alert information, including the famous color-coded terrorist threat level, although I could easily fake that and just send out a message every day saying the threat level is orange. California's emergency management agency uses CAP, as does the USGS and some Canadian provincial governments. The amount of XML emergency data sitting out there on the web, relatively unused, is tremendous, and I'd like to find a good, preferably profitable, use for it.
Will I? Probably not. I'm not sure I have the inclination or the energy to set about another project that huge, at least not by myself. I don't really have the skill to do it properly, either. For now, I'm just satisfied playing with the data for my own personal interest as a way to teach myself new things. I'll figure out how to parse some of the more complex weather XML documents and grab useful information from them over the next few days, and if I'm not entirely bored with it by the time I'm done, maybe I'll sit down and figure out what it will take to start a small company that mines emergency data from the web. It could be fun, it could also be a headache, so we'll see how it goes.
Anyway, playing around with the Bing API the other day got me in the mood to play around with web-based data once again, which happens on rare occasions. I find data, then I want to find out if I can import that data and make it useful to me, personally, and maybe a few of my friends. That was part of my motivation behind messing with the Bing API (not to mention porn) but now I've moved on to other areas.
Way back earlier this year I started working on a project to grab weather data from the National Weather Service and was planning on creating a way to send short-term forecasts to Twitter. I already started a way to send news headlines to Twitter, using the free Daylife API, and I've long thought that getting the local weather via Twitter would be cool, too. I may still do that, but now I have other plans.
When I first started looking at the weather data, figuring out how to use it was way beyond my capabilities. I only knew how to deal with PHP-REST data, and had no idea how to deal with plain old-fashioned XML data in PHP. Once, a long time ago, I was able to write a script that imported and parsed RSS feeds, but that was a few years back and had long since been forgotten. But messing with the Bing API taught me a few more tricks so I started playing around a little more.
Before the weather idea came up, however, I had a more immediate need. I'm on your basic residential DSL connection at home, and it serves my purposes quite well until FiOS is available in my area. But being on a residential DSL circuit means I have a dynamic IP Address, which makes it difficult to remotely connect to my home machines if the lease expires and my IP changes. So the question was, can I monitor my home IP address and send a text message to my cell phone when it changes?
The answer was a surprisingly easy yes. Sort of. Writing the script to send the message was extremely easy, but the difficult part was configuring sendmail and apache to send an email through Verizon's smtp servers. That's a long story and not really pertinent to this discussion, but let's say that spammers have made life much more difficult for us honest folks.
Anyway, if you have a Verizon cell phone, here's the little script I use to send a text to my phone when my IP changes. Note, I don't have telnet or SNMP access to this cheap-ass router they provide, so I have to grab the IP from an external website. I store it in a database so that I can check it frequently but only send a text message when there's a change:
@mysql_pconnect("localhost", "username", "password")
or die(mysql_error());
@mysql_select_db("ip_monitor")
or die(mysql_error());
function mailIP($ip) {
$headers = "your email address \r\n";
$headers .= "Cc: another email address \r\n";
$headers .= "Content-Type: text/plain;\r\n charset=iso-8859-1\r\n";
mail('your verizon phone number@vtext.com', '', $ip, $headers);
}
$ip = file_get_contents('http://www.biranchi.com/ip.php');
$time = time();
$lastRow = "SELECT * FROM addresses ORDER BY id DESC LIMIT 1";
$numRows = mysql_query($lastRow);
while ($row = mysql_fetch_assoc($numRows)) {
$id = $row['id'];
$epoch = $row['epoch'];
$oldIP = $row['ip'];
if ($ip == $oldIP) {
break;
}
else {
$insert = "INSERT INTO addresses SET epoch='$time', ip='$ip'";
$insertAction = mysql_query($insert);
if (!$insertAction) {
//echo "Old IP ".$oldIP." matches Current IP ".$ip; //just a visual reference
die(mysql_error());
}
else {
//echo "time= ".$time." IP= ".$ip; //just a visual reference
mailIP($ip);
}
}
}That's it. Easy as pie and now I get a text message whenever my IP address changes.
Once that was done, I had another idea. Some strong winter weather was moving through the area (the whole country almost) and I noticed on the National Weather Service website there was an alert issued for my area. So the little lightbulb goes off and I think it would be really, really nice to have those sent by text to my phone as well.
That, of course, was a little more difficult, but I managed it. I won't post all of the code here because I'm not done making changes to it, but basically it's very similar to the code above except instead of just grabbing an IP from a web page, I now have to parse a potentially lengthy XML response.
Parsing the XML was a little bit of a learning experience. In all honesty, it was pretty easy once I figured out what I was doing, but I did run into a problem with namespaces. Parts of the XML document I use for severe weather alerts is based on the Common Alerting Protocal, but the document didn't provide a reference to the namespace schema, so I had to learn how to deal with that. It would have been ok, but the prefixes used in the document weren't completely consistent with the CAP schema, so I had to come up with a workaround.
Well, I didn't have to come up with a workaround. I didn't need the CAP messages for what I was trying to do with the data since I'm only sending the timestamp and the first 120 characters of the alert summary to my cell phone, but I definitely wanted to be able access all of it regardless of its current usefulness. In the process of figuring out how to use the CAP data in the weather alert messages, I found that there are all kinds of agencies using that same protocol. That resulted in the realization that I could grab tons and tons of XML-based data relating to emergency situations and use it in dozens and dozens of different ways. Send it to Twitter, send it to cell phones, display it on the web in maps or develop mobile applications.
I even saw where the Department of Homeland Security uses RSS to disseminate alert information, including the famous color-coded terrorist threat level, although I could easily fake that and just send out a message every day saying the threat level is orange. California's emergency management agency uses CAP, as does the USGS and some Canadian provincial governments. The amount of XML emergency data sitting out there on the web, relatively unused, is tremendous, and I'd like to find a good, preferably profitable, use for it.
Will I? Probably not. I'm not sure I have the inclination or the energy to set about another project that huge, at least not by myself. I don't really have the skill to do it properly, either. For now, I'm just satisfied playing with the data for my own personal interest as a way to teach myself new things. I'll figure out how to parse some of the more complex weather XML documents and grab useful information from them over the next few days, and if I'm not entirely bored with it by the time I'm done, maybe I'll sit down and figure out what it will take to start a small company that mines emergency data from the web. It could be fun, it could also be a headache, so we'll see how it goes.
Labels:
data mining,
geek stuff,
PHP,
rambling,
weather,
XML
Wednesday, December 9, 2009
Someone needs to tell MSNBC Tiger Woods is not a politician
Just a quick gripe before I head out for the day. I'm at MSNBC.com reading an article about the Afghan war, and I see their typical, and often amusing, link to the political cartoons for the week. I figure hey, I like political cartoons, especially when they agree with me, so I'll click on it. What do I see as the first cartoon? Tiger's wrecked car.
Folks, Tiger is not a politician. There's nothing political about him. Making fun of him does not constitute political commentary. Yes, it is social commentary, and if a cartoonist wants to poke fun at him, that's fine, but that would be an editorial cartoon, not specifically a political cartoon. So folks at MSNBC, leave the sports figures out of your political cartoons, please, and try posting more political stuff instead.
kthxbye
Folks, Tiger is not a politician. There's nothing political about him. Making fun of him does not constitute political commentary. Yes, it is social commentary, and if a cartoonist wants to poke fun at him, that's fine, but that would be an editorial cartoon, not specifically a political cartoon. So folks at MSNBC, leave the sports figures out of your political cartoons, please, and try posting more political stuff instead.
kthxbye
Tuesday, December 8, 2009
Google Real TIme Search and Tiger Woods
It's a horrible situation this morning, and let me preface this post by saying that my heart goes out to Tiger, his wife, or whoever has been hurt by this situation. Maybe not so much Tiger but I include him because there are so many conflicting reports this morning. Chances are by now many of you have heard that a woman, or someone, was rushed to a hospital from Tiger Woods' home this morning. Some reports are saying that it was Tiger, some say his wife, others simply say it was a blonde woman. Whoever it is, my hope is that everyone will make a full recovery.
But in spite of the horrible news, this is an opportunity to show just how important Google's Real Time Search released yesterday is. Doing a search for Tiger Woods and clicking on latest (remember to add &esrch=RTSearch to the address if it isn't showing up for you) has the results literally flying in. At the moment (7:00 AM right now) many of the results are from Twitter, which is literally abuzz with talk of what's happening, but it's not just Twitter results showing up. Just within the past few minutes there have been dozens of Twitter posts, but numerous Facebook updates, and as news articles come in, they're showing up in the timeline as well.
I have to say that, sad as this particular story is, Google's Real Time Search is absolutely shining. As an example, if you were one of the millions following the Iranian election protests earlier this year, you know that it was a royal pain in the ass trying to use some of the third party live searches that relied heavily on large amounts of javascript or (gasp!) flash, that you frequently had to shut down your browser and reload the page, and the tools, while great at the time, were really rather clunky. Most of them required you to be logged into Twitter in order to make full use of them as well, which meant sharing your account information with a possibly not-so-honest group of people. It worked, but it wasn't the ideal way to handle information.
Besides the problem with services like Twitterfall, if you wanted information from other sources, you had to have multiple tabs or browsers open, flipping through them frequently to keep abreast of the latest information. You had to watch each news site individually, follow blogs in separate windows, and follow each and every social media site separately as well. Those days are now officially over.
Now, it is all in one place. Blogs, Twitter, Facebook, news organizations (haven'st seen any Newscorp stories though :) ) are all streaming into my browser on a single page, updating every second. Google's Real Time Search quite literally takes all the work out of information gathering on breaking news. Who needs wire services (I'm looking at you, AP) when I can do a simple search in Google and have access to more information than I can possibly use.
The only downside I've found so far is that after ten minutes or so the feed seems to stall out. I don't know if this is a result of my browser or if there's a timer built into the code on Google's end, but it's not a horrible inconvenience. It may also be based on the number of entries on a single page. I'm not certain, and it could be a feature designed to prevent your browser from soaking up all of your memory.
But regardless, real time search has finally come of age, and in my opinion has absolutely revolutionized the way people will think about search from now on. Admittedly, I'm something of a Google fanboy, but nobody can deny how game-changing this technology is. I have a feeling that I will be using this feature a lot from now on, and so will a lot of other people.
On a side note, the real time search seems to be enabled by default when using Chrome, however when I use Firefox I have to manually enable the feature by pasting the string above into the address bar. Word is they're rolling this out a little at a time, but if you can't get it to work otherwise, try it out in Chrome.
But in spite of the horrible news, this is an opportunity to show just how important Google's Real Time Search released yesterday is. Doing a search for Tiger Woods and clicking on latest (remember to add &esrch=RTSearch to the address if it isn't showing up for you) has the results literally flying in. At the moment (7:00 AM right now) many of the results are from Twitter, which is literally abuzz with talk of what's happening, but it's not just Twitter results showing up. Just within the past few minutes there have been dozens of Twitter posts, but numerous Facebook updates, and as news articles come in, they're showing up in the timeline as well.
I have to say that, sad as this particular story is, Google's Real Time Search is absolutely shining. As an example, if you were one of the millions following the Iranian election protests earlier this year, you know that it was a royal pain in the ass trying to use some of the third party live searches that relied heavily on large amounts of javascript or (gasp!) flash, that you frequently had to shut down your browser and reload the page, and the tools, while great at the time, were really rather clunky. Most of them required you to be logged into Twitter in order to make full use of them as well, which meant sharing your account information with a possibly not-so-honest group of people. It worked, but it wasn't the ideal way to handle information.
Besides the problem with services like Twitterfall, if you wanted information from other sources, you had to have multiple tabs or browsers open, flipping through them frequently to keep abreast of the latest information. You had to watch each news site individually, follow blogs in separate windows, and follow each and every social media site separately as well. Those days are now officially over.
Now, it is all in one place. Blogs, Twitter, Facebook, news organizations (haven'st seen any Newscorp stories though :) ) are all streaming into my browser on a single page, updating every second. Google's Real Time Search quite literally takes all the work out of information gathering on breaking news. Who needs wire services (I'm looking at you, AP) when I can do a simple search in Google and have access to more information than I can possibly use.
The only downside I've found so far is that after ten minutes or so the feed seems to stall out. I don't know if this is a result of my browser or if there's a timer built into the code on Google's end, but it's not a horrible inconvenience. It may also be based on the number of entries on a single page. I'm not certain, and it could be a feature designed to prevent your browser from soaking up all of your memory.
But regardless, real time search has finally come of age, and in my opinion has absolutely revolutionized the way people will think about search from now on. Admittedly, I'm something of a Google fanboy, but nobody can deny how game-changing this technology is. I have a feeling that I will be using this feature a lot from now on, and so will a lot of other people.
On a side note, the real time search seems to be enabled by default when using Chrome, however when I use Firefox I have to manually enable the feature by pasting the string above into the address bar. Word is they're rolling this out a little at a time, but if you can't get it to work otherwise, try it out in Chrome.
Labels:
geek stuff,
Google,
real time search,
Tiger Woods
Monday, December 7, 2009
Google's Real Time Search
Way back when I was doing news aggregation, I would have killed for real time search capabilities. Now that Google has launched real time search, I'm tempted to delve back into that wild world. Well, maybe not, but the real time search is pretty nifty, in my opinion.
Take, for example, a Google search for Nathan Fillion. Your standard search shows you the expected results, such as imdb page, wikipedia page, image results, all that good stuff. Now click on Show options above the results, and then click on Latest when the sidebar opens, and bam, a whole wide world of wonderful.
What's that? Latest doesn't show up for you? There's an easy fix for that. Up in the address bar, scroll all the way to the end of the address (the right end, not the left) and add &esrch=RTSearch to the end. Hit enter, and "Latest" should show up in the sidebar. Click on it, and there you go.
At the time of this writing, the oldest item listed on that page is 44 minutes old, and several twitter posts occurring within the last minute. The Twitter part may not be so useful, but it's kinda cool, especially if you're not logged into Twitter at the moment and are curious what people are saying.
Personally, I like it. Now... I wonder if I can access real time search through the Google API and craft my own custom pages to play around with. I also wonder if the real time search works with images because seriously, who wouldn't love a continuously updating stream of midget porn right there in your browser :)
Bing Image Searching Script
So I wrote this script to download images from the web using Bing Image Search. It's nothing fancy, just searches Bing for whatever terms you input, gets the results, and either displays them in your web page or downloads them to your hard drive. Very basic.
Now, before I get to the script itself, note that this is not a tutorial on how to write your own script. My programming skills leave a lot to be desired, I know, and I wouldn't dare instruct anyone on how to write any kind of script other than maybe a simple hello world script. So in case someone downloads this script and wants to comment about how much my coding skills suck, I'll save you the time. I already know that, so go away.
A few notes about the script itself. First, this script is absolutely NOT INTENDED FOR USE ON A PUBLIC SERVER! Hopefully I've made that clear enough. If you put this script on a public server and something bad happens as a result, then you suck, not me, because I've warned you. Feel free to run this on your own personal linux box on a home network, however, or better yet get the VMWare Player and run it on a virtual machine so as not to expose anything vital. I suppose it's possible to run this script on a Windows machine running apache, php, and with wget installed, but I haven't attempted it myself and don't intend to.
Specifics about what this script does: You enter a search term in the box. Then you tell the script how many results you want it to return (max 1000). Then, because Bing will only allow you to retrieve 50 results at a time, you tell it how many results per page you want to return. This is just to tell Bing how many results you want to process at one time. The script will continue to run until it reaches the total number of results you have indicated and then display them all on a single page.
You can set the adult content (Safe Search) filter level just like you can on the Bing website. There are three filtering options, none, moderate, and strict. You can also tell the script what size images to download (all, small, medium, large). The sizes are determined by Bing, not me, so don't complain if you select large and you get a bunch of tiny images, but for the most part it's pretty accurate.
Now for the important part. Display/downloading options. You have three choices:
That's pretty much it. Here are some screenshots so you can see what it looks like:

Now, before I get to the script itself, note that this is not a tutorial on how to write your own script. My programming skills leave a lot to be desired, I know, and I wouldn't dare instruct anyone on how to write any kind of script other than maybe a simple hello world script. So in case someone downloads this script and wants to comment about how much my coding skills suck, I'll save you the time. I already know that, so go away.
A few notes about the script itself. First, this script is absolutely NOT INTENDED FOR USE ON A PUBLIC SERVER! Hopefully I've made that clear enough. If you put this script on a public server and something bad happens as a result, then you suck, not me, because I've warned you. Feel free to run this on your own personal linux box on a home network, however, or better yet get the VMWare Player and run it on a virtual machine so as not to expose anything vital. I suppose it's possible to run this script on a Windows machine running apache, php, and with wget installed, but I haven't attempted it myself and don't intend to.
Specifics about what this script does: You enter a search term in the box. Then you tell the script how many results you want it to return (max 1000). Then, because Bing will only allow you to retrieve 50 results at a time, you tell it how many results per page you want to return. This is just to tell Bing how many results you want to process at one time. The script will continue to run until it reaches the total number of results you have indicated and then display them all on a single page.
You can set the adult content (Safe Search) filter level just like you can on the Bing website. There are three filtering options, none, moderate, and strict. You can also tell the script what size images to download (all, small, medium, large). The sizes are determined by Bing, not me, so don't complain if you select large and you get a bunch of tiny images, but for the most part it's pretty accurate.
Now for the important part. Display/downloading options. You have three choices:
- Full Size: This will display each search result at its full size in your browser, one above the other. It's fine for a small number of search results, but can use a ton of memory if you're trying to display a thousand large images all at once. This option does not save the images to your hard drive, however, so if you want to save any of them you have to right-click to save.
- Thumbnails: I put the most effort into this option, because it's what I prefer. It will display thumbnails of each search result, along with the dimensions and file size of the actual image, and the type of image (ie. jpg, gif, png). Clicking on the thumbnail will load the full size image in your browser. You can also check the box beneath each image that you want to download, then click the button at the bottom of the page to save the checked images to your hard drive. How fast that happens depends on your internet connection. The images are downloaded into the same directory where you placed the script.
- Display None/Direct Download (not recommended): This option doesn't display any images, but will print out the url of each image it is downloading. Images are downloaded to the directory where the script resides. This option is semi-dependent on how your permissions are set, because it first writes all of the urls to a text file, then executes wget to actually download the images from that text file. Not the ideal way to do it, but I never went back and changed it when I realized how stupid it was to do it that way. A final note on this option: Be very careful, because you can accidentally download scripts instead of just images this way. Some servers that disable hotlinking will replace the image with a script that can then be executed on your machine and wget seems to not know the difference.
That's pretty much it. Here are some screenshots so you can see what it looks like:
The first one is the initial search page:

This one is the thumbnail results page:
UPDATE: I removed this image because I realized that I left some debugging code in that shows my app id. I'll replace it with a different image tomorrow.
And that's pretty much the gist of it. You can download the full script from http://www.mediafire.com/?qwvd3damnwg. Have fun.
Saturday, December 5, 2009
Dragon Age Origins
Ok, this game pretty much rules. It is, in my opinion, the true heir to Baldur's Gate and Planescape: Torment, which every serious gamer should have played through at least twice. I literally spent all day yesterday playing this game, and I'm 11% complete. When they say there's 100 hours of gameplay in this game, they aren't kidding at all. I can see easily spending 100 hours in this game, because I know I've barely scratched the surface.
Admittedly there are a lot of cutscenes in the game, which do take some time. But that's ok. I actually like the cutscenes because they're important to the story itself. So far, I haven't noticed any truly detrimental consequences to my actions, but I can see where some of the decisions I've made may end up making a difference later on. A couple of my party members don't appear to be too fond of each other at the moment, and I'm wondering if that may end up causing problems later. Whether or not that type of interaction is built into the game I'm not sure, but if it is, it could make life really interesting down the road.
Now, time to start playing again.
Admittedly there are a lot of cutscenes in the game, which do take some time. But that's ok. I actually like the cutscenes because they're important to the story itself. So far, I haven't noticed any truly detrimental consequences to my actions, but I can see where some of the decisions I've made may end up making a difference later on. A couple of my party members don't appear to be too fond of each other at the moment, and I'm wondering if that may end up causing problems later. Whether or not that type of interaction is built into the game I'm not sure, but if it is, it could make life really interesting down the road.
Now, time to start playing again.
Wednesday, December 2, 2009
Just bought Dragon Age Origins
Went and bought Dragon Age Origins today. Hadn't paid any attention to the game until I saw that the lunatics at World Net Daily were all up in arms because of a gay sex scene. Thanks wingnuts, you just made the creators more money :) Said video below:
Labels:
Dragon Age Origins,
gaming,
geek stuff,
teh gays
Sucks to be SyFy tonight
Just heard the news that NBC, which includes SyFy, Bravo, and countless other TV networks, is being sold to Comcast. That news absolutely, positively sucks donkey balls. I mean for NBC itself, I really don't care. There aren't any shows I currently watch on the broadcast network. Ever since they destroyed Kings I've refused to give them a single moment of my attention. But I do watch SyFy and sometimes I watch Bravo, and I'm really not looking forward to losing any of the other shows I watch. With Comcast in control, I honestly can't see shows like Sanctuary or Stargate Universe being allowed to continue, not to mention anything as conspiratorial as Warehouse 13.
I know I'm being a speaking doom before it happens, but there aren't words to express my hatred of Comcast. It nearly rivals my hatred of Clear Channel. I'd rather be buttfucked with a scimitar than give Comcast any praise, and if they fuck up my channels, I'm going to be even more pissed.
Oh, and I have no doubt that MSNBC will quickly become a competitor to Fox News under the new ownership, considering the bastards that run Comcast. Fuck them.
Can you tell I'm pissed?
I know I'm being a speaking doom before it happens, but there aren't words to express my hatred of Comcast. It nearly rivals my hatred of Clear Channel. I'd rather be buttfucked with a scimitar than give Comcast any praise, and if they fuck up my channels, I'm going to be even more pissed.
Oh, and I have no doubt that MSNBC will quickly become a competitor to Fox News under the new ownership, considering the bastards that run Comcast. Fuck them.
Can you tell I'm pissed?
Tuesday, December 1, 2009
Gaming problems fixed
Yeah, so it wasn't so much the USB headphones that were causing my gaming problems. I assumed it was CPU related because I've noticed a number of other things bogging down when there was heavy audio usage, not just in Day of Defeat:Source. Other games, like Civilization 4 would massively slow down the longer I played, especially on huge maps, and some games that used to be playable weren't so playable any more. But I've found the problem, and it is now fixed, albeit temporarily.
The problem was dust. Yep, good old-fashioned dust. I hadn't cleaned out the inside of that machine for quite some time, and the heat-sink on the GPU (among other things) was simply caked with dust. So I took the card out, vacuumed everything really well, plugged it back in, and there she was. Working just fine.
After my initial post on the problem last night I got to wondering what my GPU temperatures were like. The CPU temp was fine, that much I knew in advance, but I didn't have any real way of checking the GPU temp. So I did a little searching and found a handy-dandy little utility called GPU-Z that is basically a video card info tool, ran it, and just about shit myself when I saw that the idle temp while doing absolutely nothing was 80 degrees Celsius. That obviously wasn't going to cut it, so I went to bed, slept like hell because I kept wishing I'd fixed the problem before going to bed, then got up and first thing I did was take a good look inside the case.
Yuck. It wasn't pretty. I had good airflow into the chassis itself because I have the sides & top off the box, but the machine was down on the floor and pretty much out of sight most of the time, so I had no idea how dirty it was in there. Took me just a few minutes to vacuum all the dirt and dust out, put my video card back in and fire it up. Instantly I noticed that the temp came down to about 55 degrees. It rose to about 60 degrees after a few minutes, but then it pretty much leveled off. Now, one thing I did notice in the monitoring software is that the fan speed was locked at 26% regardless of the GPU temperature, but I don't know if that's actually the case or just bad reporting on the part of the hardware or software. Just to be on the safe side, though I set a little box fan beside the case and I've got it blowing air directly inside, cooling everything off, and now my temp is holding steady at 55 degrees.
Personally, I'd like it to be a little cooler so maybe later on today I'll take the card out, pop the cover off the heat-sink, and do a more thorough job of cleaning it out, but at least now I know what my problem was. I'm much, much happier now, and will probably sleep better tonight knowing that I won't have to worry about upgrading my hardware anytime soon.
Oh, and another thing. I ran a test by playing the Left 4 Dead 2 demo with the video settings on high, and while I didn't get great framerates, it was definitely playable with no lagging or stuttering. Yesterday, I couldn't even play it with the video settings set on low. But I managed to play through the entire demo with no problems today, so that's really all I can ask. Now we'll see how Flight Simulator X responds to my newly cool video card :)
Subscribe to:
Posts (Atom)
