Blog | Admin | Archives

Strange Google Droppings

Google seems to have deemed Checksum Arcanius unworthy. As a result, this site is no longer #1 in a search for “Arcanius” (as mentioned earlier). That alone was not too disconcerting to me (although I was not particularly happy either). What did begin to concern me, however, was when I googled for Titan Robotics, as I sometimes do, and Arcanius was nowhere to be found on the first page. Just a month ago, I remember my site being second in that list. Now, a fellow silverfir.net’er, The Deliverator, has taken up that spot. And I have nothing against The Deliverator (heck I like him, and read his blog, and hang out with him fairly often), but why did I lose the spot? What is going on here?

My search for an answer led me to this interesting article on slate. Ok, it’s silly (and scary) to even think about regulating Google. People who have suggested need to go and choke on a slurpie or something. Seriously, government is not a solution. It is a problem that can, when used in extreme moderation, solve a few worse problems. But moving right along, the article, while interesting, didn’t really answer my question. Clearly, Google has judged this site unworthy. But why? That is the rub.

Half-Life 2 Part 2

For a while now I have been meaning to pick up on my game of Half-Life 2. It had lagged for quite a while due to the fact that I mostly only played Counter-Strike on the computer, and just never got around to started up the game again. Well, today I did start up the game again, and I had forgotten how nice it is as a single player game. I was able to advance a fairly good ways, although I ran into another (this is the third) place where I found an alternate olution that clearly should have worked but was disabled by artificial game boundries. These things I find very annoying in a game that is otherwise so well done.

Nevertheless, I have now met the giant city-eating machine up close and personal, I have found that ant lions are pretty good pets to have around (and I even feel bad when I send one into a booby trap… but not that bad). On the other hand, this new thrust into Half-Life 2 means I’m still not done with my UW personal statement for my transfer application… not good. So, I stopped just now, and its back to the grindstone.

WordPress 1.5 Anti-Spam is teh Sux

Need I say More?

I rest my case.

Update: Of course, thats only if it isn’t enabled. I’m actually quite happy with the antispam features on WordPress 1.5 these days.

FreedomDown.net Under Investigation

I have never entirely shared Erik’s passion to provide internet filter bypassing services to the masses, but it is something that is important to him, and I am one who strongly believes that, in general, more information is good. On the other hand, I can understand the district’s filtering for, say, pornography or pirating sites, or anything else that many taxpayers (who support the schools and pay for things like the internet to the school) would generally object to funding access to.

But why, for example, are email sites filtered? In this digital age, filtering email is like breaking a tennis player’s legs and expecthing her to win. Email is vital, especially to clubs like the TRC where it is the primary form of communication. Blocking email at school is a good way of ensuring that team leaders are kept out of the loop until they get home, not the most ideal of situations. Nevertheless, the long and short of it is that while I don’t share Erik’s passion, I don’t mind it, and I certianly don’t mind spreading the word the the wonderful Bellevue School District has suspended Erik’s student account while investigating his site, FreedomDown.net.

I suggest that you go read about it at Erik’s blog, “Unknown Rebel.

SQL Case Statement

I just learned how to use the SQL ‘CASE’ statement, and my respect for Relational Databases and SQL just about tripled.

At issue was the TRC scouting program – I had implemented a system to extract all sorts of information from the data that the scouts had input, including average scoring per game. It was especially nice that we could sort based on any category. Then I added average score of the alliances per game, but I did not know how to fold that into the same SQL statement, because team colors switched between red and blue between matches. There was no single column to sum or average. So what was I to do? The solution I came up with worked well enough to win the PNW regional at least – it was to write sepearte select statements to extract the alliances’ average scores in the following manner.

First I would get the initial data dump (I know this is insecure; you can be quiet and sit down now, thank you):

$sql = "SELECT `teams`.`team_number`, `team_name`,
`carries_initial_tetra`, `teams`.`notes`,
COUNT(*) AS 'matches',
MAX(`caps`) AS 'max_caps',
MIN(`caps`) AS 'min_caps',
AVG(`caps`) AS 'avg_caps',
AVG(`contains`) AS 'avg_cont',
MAX(`auto_points`) AS 'max_auto',
MIN(`auto_points`) AS 'min_auto',
AVG(`auto_points`) AS 'avg_auto',
(AVG(`auto_points`) + AVG(`contains`) + 3 * AVG(`caps`)) AS 'avg_scoring'
FROM `teams`, `team_match`
WHERE `teams`.`team_number` = `team_match`.`team_number`
GROUP BY `team_number` ORDER BY $orderby";

Then for each alliance score I ran another SQL query (this code was more or less repeated four times):

$points = 0;
$sql = "SELECT sum(`red_score`) AS 'red_points'
FROM `matches`, `team_match`
WHERE `matches`.`match_number` = `team_match`.`match_number`
AND `alliance_color` = 'red'
AND `team_number` = '{$row['team_number']}'";
$result2 = mysql_query($sql);
if(!$result2) print mysql_errno() . ': ' . mysql_error() . "n";
else $row2 = mysql_fetch_assoc($result2);
$points += $row2['red_points'];
mysql_free_result($result2);

While this worked, it didn’t allow sorting based on the average score column, which was unfortunate but didn’t end up mattering. But the Championship (aka “Nationals”) is a whole diofferent ball game. We’ll need better analysis tools. And I had heard about this ‘CASE’ statement, and thought it might be able to help me out. So today, I learned myself how to use it. And it is truly extraordinary how much simpler it is. Check it out:


$sql = "SELECT `teams`.`team_number`, `team_name`,
`carries_initial_tetra`, `teams`.`notes`,
COUNT(*) AS 'matches',
MAX(`caps`) AS 'max_caps',
MIN(`caps`) AS 'min_caps',
AVG(`caps`) AS 'avg_caps',
AVG(`contains`) AS 'avg_cont',
MAX(`auto_points`) AS 'max_auto',
MIN(`auto_points`) AS 'min_auto',
AVG(`auto_points`) AS 'avg_auto',
(AVG(`auto_points`) + AVG(`contains`) + 3 * AVG(`caps`)) AS 'avg_scoring',
AVG(CASE WHEN `alliance_color` = 'red' THEN `red_score` ELSE `blue_score` END) AS 'avg_points',
AVG(CASE WHEN `alliance_color` = 'blue' THEN `red_score` ELSE `blue_score` END) AS 'opp_points',
AVG(CASE WHEN `alliance_color` = 'red' THEN `red_score`-`blue_score` ELSE `blue_score`-`red_score` END) AS 'diff_score'
FROM `teams`, `team_match`, `matches`
WHERE `teams`.`team_number` = `team_match`.`team_number`
AND `matches`.`match_number` = `team_match`.`match_number`
GROUP BY `team_number` ORDER BY $orderby";

As you may be able to see, the CASE statement allows me to do a conditional sum. And now I can sort, and yes, the TRC does appear at the top, yes, yes indeed.

My Firefox Extensions

I recently “upgraded” my desktop computer to a development environment, specifically for the task of working on the TRC scouting app, which was a fairly large project. The hardware did not change for this upgrade (although I have recently added hardware, but that is another story). Instead the main additions were gVim, SmartFTP, and some Firefox extensions. While I normally do most of my coding projects on my laptop (my “productivity” machine), I was finding the screen resolution and touch pad too confining and was literally feeling stifled by the system for the size of the project I wanted to take on. So I put a two-monitor, 4-disk RAID, Gigabyte Dual Channel PC3200 DDR RAM, P4E 2.8GHz HT with 1MB Cache on the job. And it did the job well.

But, I began to become concerned about the differences in extensions between my three main installations of Firefox – on my laptop, at work, and on my desktop. So, to help rectify things, I thought I would share here what extensions I have installed on this, my desktop machine from which I publish tonight. Then, I can post comments on what I have on my other machines, and bring them to some happy middle place, so I have more or less the same base functionality, with whatever additional functionality might be useful on each computer. As an added bonus, you too can comment on what extensions you use, and why. Lets call the effect “Synergy…” or something like that.
Read the rest of this entry »

Useful Linux Command

Today I was searching for a good way to change permissions recursively, but only on directories or only on files, because of the vast difference in meaning for the executable flag between the two. Google is a great friend, and led me to a site, whose address I do not exactly remember, but whose advice was perfect:

find . -type d -name public_html -exec chmod 0755 {} \;

Just strip out the -name argument, and change between -type d and -type f to chmod only files or only directories, recursively from the current directory. A great way to correct past misconceptions about the setgid and setuid bits!