jon jensen's blog

March 18, 2008

Are you with us?

So it turns out that Tom Cole and the NRCC need my help to win back the House and Senate. To that end, they have sent me the "official 2008 Congressional District Survey and [urged me] to participate in this historic project AT ONCE" [Emphasis in original]. Oh, and they also want lots of my money.

If political propaganda is an art form, this little gem of correspondence is a KarlRovian masterpiece. The letter is a breathtaking concerto of fear mongering and straw men, culminating in a melodious orgy of false dichotomies and appeals to emotion. The survey is also an excellent read, full of important questions whose answers will have a substantive influence on the Republican platform in this coming election. Most are non-leading, unbiased questions, along the lines of "Do you support the Liberal Demoncrats' plan to rape old ladies?".

Completing the survey is an important responsibility, since my "answers will represent ALL Republic constituents living within [my] Congressional District". Some people might be a bit surprised that the NRCC would pick a liberaltarian like me to represent the country's most conservative congressional district, but I totally saw it coming.

The multiple-choice options were a bit restrictive, and they forgot to provide any space for write-in answers, so I'm posting my responses online. Also, I have a high degree of confidence that if I mailed mine in, it would never make it past the temp's shredder.

  1. Do you feel voters in Utah's 3rd District support making all of the Bush tax cuts permanent?

    Sure, most of them do. But these are also the people that would vote Bush in a 3rd time if they could, so I wouldn't put too much stock in their critical thinking skills.
  2. Do you support the House Democrats' "slow-bleed" strategy to "choke-off" funding for our troops in Iraq, leading to their withdrawal and a perception of American defeat?
    unchecked box Mu.
    Wow, just wow.
  3. Should Republicans continue fighting for full implementation of a ballistic missle defense system?

    But you guys go do whatever the hell you want. Though I'm pretty sure it won't be a blip on your radar when gas hits $5/gallon this summer.
  4. Do voters in Utah's 3rd District agree with the Nancy Pelosi Democrat Majority's decision to impose massive tax hikes on the American people?
    unchecked box Mu.
    But they'd say no (same goes for #2).
  5. Do you think that House Republicans should continue to push for pro-growth policies that create jobs and oppose tax increases that would add a burden to working families and set back our economy?
    unchecked box Mu.
    Change "continue" to "start" and you've got yourself a definite "Yes, if I can have veto power".
  6. Do you support Congressional Republicans' efforts to decrease domestic government spending in order to reduce the national deficit?

    Their current efforts? No, they are completely one-sided and are negated by our ridiculous defense spending abroad. Start cutting on both sides of the aisle, and then you've got my attention.
  7. Do you support the Democrats' effort to give federal government bureaucrats complete control of your health care costs and choices?
    unchecked box Mu, with No-ish tendencies.
  8. Should Republicans in Congress make expansion of Veterans' benefits a priority?

    Wait, how'd that one get in there? That almost sounds like a serious question to me: "Support Our Troops" vs. "No Welfare, Dammit!". Though I guess for Republicons, Terruh trumps all. jon = fail.
  9. Do you support maintaining anti-terrorism laws that give law enforcement and intelligence agencies the far-reaching powers to track, detail and prosecute terrorists and their accomplices?
    unchecked box Mu.
    Ok, the question is a little vague, guys (intentionally, no doubt). FISA? Yes. Letters of Marque? Why not. USA PATRIOT ACT and signing statements? Hell no, bitches.
  10. Should Republicans in the House of Representatives make securing our nation's borders and enforcing out nation's immigration laws, including combating the hiring of illegal workers and ending the "catch and release" policy a top priority?

    If it's not the gays destroying marriage or the Arabs hating our freedoms, then it's the Mexicans destroying our economy. If only there were some way to harness the awesome power of your irrational phobias, we could be completely energy independent... how about making that your priority numero uno?
  11. Do you think House Republicans should continue fighting for comprehensive education reform to ensure that every child in America receives a first-rate education?

    Though it is an interesting idea. I mean, maybe you could pass an educational reform act, and its name could be something about including every child... Oh. Yeah. You'd better stop before you pass any more turds like that. Whatever happened to cutting domestic spending?
  12. Do you agree that winning back a Republic Majority in the House of Representatives is essential to stopping the Nancy Pelosi Democrats from raising our taxes, destroying our economy and endangering our homeland?
    unchecked box Mu.
    As for your three fears, 1. taxes will go up regardless 2. uh, read the news lately? we're already beyond screwed. 3. neither you nor they would do anything to change this much in either direction.
  13. Will you support our Party's campaign to defeat the Pelosi Democrats and elect a Republican House Majority in 2008 by joining the NRCC with a generous financial contribution today?
    unchecked boxYes! I want to join the NRCC's effort to win back a House Majority, safeguard our values and principles, and keep America progressing towards a strong, prosperous and secure future. I am enclosing my most generous contribution of:
    unchecked boxI cannot pledge my support for this year, but I would like to include a contribution of $11 to help the NRCC fund this survey and its tabulation.
    Damn, I don't even know how to respond to this one. $11 a pop just to fund the damn "survey"? I guess you've got some significant "overheads" to worry about.

Posted by jon at 07:50 AM | Comments (0) | TrackBack (0)

April 09, 2007

It really pays to digg — coding deathmatch 2.0

The good news: The coding deathmatch is back, this time with twice the prize money and a guarantee that every finalist will win something.

The bad news: Employees can't compete (obviously), and previous finalists can't win prize money, so that makes me doubly ineligible.

Ok, so it's not really bad news at all. Making previous finalists ineligible helps level the playing field and lets us share the love with everybody else. And as tempting as that $10K+ first prize is, to me it really isn't worth that whole unemployment thing.

So if you are a Utah programmer with nothing better to do this Saturday — let's be honest here, you're a programmer and you live in Utah — you owe it to yourself to sign up. It could be the easiest $10K you ever make in your life (Derek, it might be the easiest $10K you ever make in your life legitimately). Who knows, you might even find yourself doubly ineligible for the next one. Trust me, that's a good thing.

Sign up

Posted by jon at 07:30 PM | Comments (0) | TrackBack (0)

January 15, 2007

Thwarting comment spam

There are a variety of approaches to combatting blog spam. Each has its pros and cons, and none of them is perfect. Three common approaches that I've seen:

1. CAPTCHA's can be effective, but spammers are getting better at finding ways around them. Generally speaking, the better the CAPTCHA is at keeping out spammers, the harder it is for your user to decipher.

2. Bayesian algorithms, keyword filters, and other types of content analysis are good, but spammers are getting smarter. Blog spam is becoming increasingly on-topic, making it harder to filter it out and requiring more manual work.

3. Requiring a login or subscription to a service is a good approach in theory, but in practice spammers have no problem setting up bogus accounts. Then there's the fact that most people don't like creating accounts just to post comments.

Recently I decided to test out a new approach to dealing with comment spam. It occurred to me that most spammers don't necessarily crawl my blog at the same moment they spam it. It seems more likely that they have bots that crawl the web to find comment forms (or even subscribe to services that do this) and then systematically spam it some time later.

So I set up a simple PHP script that ties into Apache's mod_rewrite to manage the URL's for my blog. Basically every day, the URL for the comment form changes. The new URL comtains an effectively random 32 character string, making it impossible to guess the correct URL without actually going to the blog. The end result has been an 80% reduction in comment spam. Combined with MT's junk filters, it has proven to be extremely effective.

The next step will be to adjust the frequency of the URL changes to see how that affects the remaining 20% — if it ends up making a big enough dent, I'll make the source public to give people an additional weapon in the war on spam.

Posted by jon at 01:12 AM | Comments (3) | TrackBack (0)

November 15, 2006

Horizontal CSS bar graphs

Even though I've been doing CSS for years, I still think it's the coolest thing since sliced bread—the novelty hasn't worn off and probably won't until something better comes along.

Last night I gave my CV a much needed update. One neato feature I included in the online version is a horizontal chronology of my work experience. Looking at the source code reveals it's all done in CSS.

CSS bar graphs are nothing new, but my approach is a little unique. By using em's for all measurements, it makes it especially easy to specify the bounds of the various items; a job that lasted 12 months is simply 12 ems wide. This also makes the whole thing scale very nicely as you adjust text size.

Another cool thing is the toggle between outline and timeline views—just changing a class on the body completely restructures the whole thing.

Posted by jon at 07:29 AM | Comments (5) | TrackBack (0)

November 07, 2006

It pays to digg — the deathmatch that wasn't

Whereas spam is the leading cause of lost productivity for many people, digg is my Achilles' heel. I spend more time on digg (and slashdot and fark) than I'd like to admit, so it's nice to see it finally paying off.

Last Friday I found this gem—a local programming contest with a $10K grand prize. This was the first I'd heard of it, even though it had received quite a bit of local media coverage. So I went to mozy.com and registered for the competition, and the next morning my $10K quest began.

Round 1 took place online and began at 10 AM, with six 10-minute programming challenges. Nothing overly complex, but the time limit left little room for error. Fortunately I got all of my solutions in, and shortly after was informed that I made the cut for Round 2.

Round 2 was also online, with 4 questions spread across an hour. Here's where things got a little more complicated and the technical difficulties began. One of the tasks required you to open a socket to the mozy.com server and read some data. Seems like everyone tried connecting at once, and a mini-DDOS ensued. In the end, I was able to connect, read the data and produce the correct output, but others weren't so lucky. At this point, I thought I had done pretty well, but I wasn't sure if I had made the final cut. Much to my surprise, I got an email shortly thereafter informing me I was one of 8 finalists.

We gathered at the mozy.com offices at 4:00 PM for the Ultimate Showdown of Ultimate Destiny. I was nervous—being a lapsed undergrad, I was going up against college faculty and professionals with far more experience and knowledge than me.

I should also point out that I had done all of the exercises in PHP, even the one with the O(2^n) algorithm (shudder). Everyone seemed a bit surprised that a PHP programmer had made it this far, and I can't say I blame them. PHP is looked down upon by many—it lacks the elegance of Java and the speed of C, and the language itself looks something like the mutant spawn of C++, Perl and Retarded. You might call it the short bus of programming languages, in large part due to the caliber of the average PHP programmer. Nevertheless, good programmers are rarely constrained by languages, and PHP is no exception. It kicks ass if you know how to use it.

Our final task was to write a server that would accept 10,000 connections. Each connection would send 9K of data - over 2000 4-byte integers. We would have to then sort the 20+ million integers and return the 100th, (n-100)th, and (n/2)th ones from the list. Whoever could do this the fastest would win the $10,000 prize.

And so it began. Sockets are easy, and there is only so much optimization you can do there, so I saved that for last. My main concern was making the sort as fast as possible. Rather than try to sort all 20 million numbers, I stored them in a 4-level tree—one level for each byte, meaning each node had at most 256 children. Memory was not a concern, only speed—I didn't actually sort anything unless I had to. That means I sorted at most 1024 (4*256) elements for the first lookup and 784 elements for subsequent lookups. Each node cached how many numbers it contained, making it easy to find a number in the tree once the relevant nodes had been reordered. The sorting itself incurred no real cost—the only consideration was the time to receive the numbers and populate the tree, which was constant relative to n. O(n) is nothing compared to O(n log n).

Once I had that squared away, I set up my simple server to handle the requests. I had overheard other people running into difficulties, and I soon discovered why. Windows doesn't like too many simultanous connections, and everyone hit a wall right around 300. Even with a 20 minute time extension, nobody was able to get it 100% working. Things were not looking good.

We had a quick powwow to figure out what to do. Several of us wanted to try running our programs on a Linux machine to see if they would fare any better. That helped a bit, but none of us were able to get much past a couple thousand connections—nowhere near the 10K target.

So after a brief debate, we decided there was no clear winner and the best thing to do would be to split the prize money 8 ways. Thus died the deathmatch, but everyone got something out of it in the end ($1,250 to be precise).

True, it was a bit of a letdown, but I really can't complain. The whole experience definitely piqued my interest in learning more about how TCP/IP connections are managed by the OS. It was especially interesting to see the working low-level prototype written by a mozy employee. It handled all 10K connections effortlessly, something none of our C++/Java/PHP/Ruby servers could do, due to shortcomings in our implementations and/or limitations of the OS.

I really would have liked to see how my sorting algorithm stacked up to everyone else's. I suppose there's always next year's competition. Guess I'll keep digging in the meantime.

Posted by jon at 01:12 AM | Comments (3) | TrackBack (0)
March 2008
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Search
Archives
Recent Entries
About
jenseng.com is the home page of Jon Jensen, software engineer and ultimate frisbee addict... more