Friday, April 25, 2008

HN Blacklist Now With UI

05/20/2008 UPDATE: Check out the new version of this which is bigger, faster, stronger, and easier to configure.

So someone said something about having a user interface for my little Greasemonkey script that acts as a blacklist on Hacker News.

Done. With it installed, a 'blacklist' link will appear in the top bar next to the 'submit' link, which will allow you to edit the list of blocked domains.

// ==UserScript==
// @name HN Blacklist
// @namespace http://news.ycombinator.com
// @description Removes blacklisted links from Hacker News
// @include http://news.ycombinator.com/*
// ==/UserScript==

// Written by Xichekolas ... do whatever you want with it.
// http://news.ycombinator.com/user?id=Xichekolas

// Just assume the stuff below will work.
var blacklist = GM_getValue('hnblacklist', '')
if (blacklist.length > 0) {
blacklist = blacklist.split(' ');
var xpathnodes = document.evaluate("//a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

for (var n = 0; n < xpathnodes.snapshotLength; n++) {
var thisnode = xpathnodes.snapshotItem(n);
for (var i = 0; i < blacklist.length; i++) {
if ((blacklist[i].length > 0) && (thisnode.href.toLowerCase().indexOf(blacklist[i].toLowerCase()) > -1)) {
var grandpa = thisnode.parentNode.parentNode;
grandpa.style['display'] = 'none';
grandpa.nextSibling.style['display'] = 'none';
grandpa.nextSibling.nextSibling.style['display'] = 'none';
break;
}
}
}
}

// Add link to edit the blacklist.
var submitlink = document.evaluate("//a[@href='submit']", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (submitlink.snapshotLength > 0) {
var slparent = submitlink.snapshotItem(0).parentNode; // We only care about the first one.
var editlink = " | <a id=\"blacklist\" href=\"#\">blacklist</a>";
slparent.innerHTML = slparent.innerHTML + editlink;

var link = document.getElementById('blacklist');
link.addEventListener('click', function(ev) {
var newlist = prompt('Enter a space-delimited list of domains:', GM_getValue('hnblacklist', ''));
if (newlist != null) { GM_setValue('hnblacklist', newlist); window.location.reload(); }
}, true);
}

You can install it from here.

Thursday, April 24, 2008

SICP

My junior year at KU, I happened to take a little course called "Programming Language Paradigms" (EECS 662). Professor Brown has taught this course pretty much forever, and I think it's the only thing he teaches to undergrads (although he might pitch in on EECS 368, since that seems to round robin pretty quickly). Dr. Brown is an interesting character (very much the absent-minded professor), but the course was very eye-opening for me. I didn't realize it right away, but this was exactly what I had pictured my Computer Science education being. This specific class was it.

Later I found out why. The book on which Dr. Brown based the course is called Structure and Interpretation of Computer Programs, which happens to be the introductory programming text written and used by professors at MIT. You know, that school that invented Lisp, arguably the most powerful language in use to date.

I still have this book, and have seriously been considering giving it a run through for a couple of hours each morning this summer. Today I found out that there are video lectures available to go along with each chapter in the book. You can download them (torrents even) here: SICP Lectures.

If any of you feel like becoming a thoroughly adept programmer, this is the book that will do it. The book itself is quite entertaining (filled with jokes and written in a very conversational style), but now with video lectures, it is basically an entire class. (The online version of the book is free, and available at the same link as the video.) Save yourself $25k on a B.S. in Computer Science and just spend time on this instead. It's worth it.

Sunday, April 20, 2008

Startup School (from Kansas)

So I had the fortune to be invited to Startup School this year, and since I'm currently planning to quit my job and take advantage of a summer vacation, the timing couldn't have been better.

Kathy and I flew into San Jose on Friday morning and caught the Caltrain up to Palo Alto. After living in Europe, the Bay Area's public transit seems a bit disjointed, but it really was refreshing to at least have the option. It gets the job done for our three-day visit.

Walking from the train station to our hotel, we passed the Facebook headquarters. There were a bunch of people in suits in the lobby with cameras flashing, but I'm sure that happens every time Mark Zuckerberg enters and leaves the building. That was kind of the odd moment when I realized that this was Silicon Valley for real.

After a few hours and an excellent $9 turkey sandwich, I headed down to Mountain View for the YC pre-startup-school dinner/party. The invite said something to the effect of "investors, press, and some attendees" so I was kind of expecting some kind of sit-down dinner full of business card passing and glad-handing. I mean I know startup culture is supposed to be hip and cool, but he said 'investors' and 'press' ... how cool could it be?

The reality was a nice surprise. If any investors (besides YC) and press were there, they looked delightfully like normal people, and the rest of the crowd seemed to be founders or proto-founders. Free beer was there by the bucketful and tasty things appeared on big trays, so the food obligation was fulfilled without actually disrupting the social aspect.

There was, of course, lots of networking and pitching going on, but it didn't have that creepy used-car-salesman-turned-web-2.0-marketing-guy feeling that I feared. It was just a lot of people genuinely excited about what they were doing and excited to hear about what others were doing.

Of course, people asked what I was doing so I took the easy way out and just claimed Kansas, which usually got me two things: a welcome, and 'when are you moving here?'

I didn't totally cop out though, and gave as succinct a summary of our idea as it exists so far. Comments were both positive and less so, but I figure since we are targeting a niche, it's not going to seem as exciting to people outside the niche. I think what helps us is that we aren't targeting the same niche (namely: other people in the Valley) like a lot of web-2.0ish startups are doing.

It was kind of fun (for a kid from Kansas) to actually meet and talk to all these people I know only as online personas. I got to stand and chat in person with people like edw519, iamelgringo, kirubakaran, alaskamiller, cstejerean, and dcurtis from Hacker News, which was interesting, because I can now put faces with the words.

I even met and shook hands with PG, which for someone in my position is kind of like bumping into the Pope. (Not because he is in any way holy or superior, but just because you don't often meet one of your movement's lead evangelists in the flesh.) He seemed like a genuinely nice guy, and I'm pretty sure he ran a mile a minute the entire night ... the guy definitely has energy.

Part of my personal goals coming to this event was to see how 'startup people' really acted, and if Trevor Blackwell is any indication, the only way to describe it is 'Happy.' His two robots, Monty and Dexter, provided a nice distraction from all the meeting and greeting, and I'm pretty sure no one smiles as much as Trevor does. I can only hope to be that happy someday. Ask most people what they 'do' and you get the name of a position and the name of a company. Ask startup people what they do and they will more than likely try to show you, and failing the ability to do that they will rave for 10 minutes about how cool the product is. Notice the difference: product focus instead of position focus.

Other people I talked to included two guys doing sweet graduate research at MIT, Erik of fluther.com, a Canadian pitching his whydowork.com, two guys that apparently have a really awesome highlighter, and the guys behind Stream Focus. Sadly that wasn't even a tenth of the crowd.

I hit the sack early so I could actually be awake for Startup School itself. The auditorium was about a thirty-minute walk from my hotel room, which was improved by Ghosts and the Stanford campus itself. One thing that no one tells you is that Stanford is huge. It seriously takes over 45 minutes to walk from one side to the other, so everyone bikes accordingly. Not only does it cover a lot of ground, but the buildings themselves are monolithic. I think all the floors are intentionally 50% oversized, just to make the place seem more impressive. It works though, and I came away thinking that, sadly, KU's campus has nothing on Stanford.



The first speaker was David Lawee, who is in charge of acquisitions at Google. He gave an interesting talk about his startup Xfire, which basically boiled down to 'optimize for speed.' I think he was especially targeting the flipping crowd, but was pretty insightful about funding and how it affects your outcome. Big funding means you have to want to grow big, whereas if you just want to flip, smaller funding leaves you more nimble and able to liquidate.



Next up was Sam Altman, of Loopt fame. Sam mostly talked about details regarding getting VC and getting it on good terms. While the details were interesting, I won't regurgitate them here. The two things that really stood out were the following: "don't raise money if you can avoid it, or at least wait as long as possible" and "raise in parallel." He said he couldn't stress the latter enough. Like anything, the more competition there is (between VCs), the more likely you are to get funding fast (so you can get back to work), and the more likely it is to be on good terms.



After Sam came Jack Sheridan, Partner at Wilson Sonsini. While he was a good speaker and raised some valid points, it is hard to make law seem exciting at 10am on a Saturday. His basic aim was to list ways to shoot yourself in the foot legally, so that maybe less of us would do so.



Now Paul Graham takes the stage and asks us to stop using the Internet (for a few minutes anyway, so his slides could download). His talk centered on his theory that doing good things naturally increases your chances of being successful. It sounded like an essay prototype, so I imagine you will see it in full detail at a later date (edit: read it here). One slide that stood out (and garnered a mention in my notes) was that of a cockroach. A good motto for a startup right there.



After a short break, Greg McAdoo (Partner at Sequoia) came up and gave a really great presentation about what VCs were looking for in a startup. If nothing else, the whole talk was made by one slide that listed characteristics of failed investments, which included the phrase "Drunken Parade Leaders" ... which as far as I'm concerned has to be the funniest thing ever hidden on a PowerPoint given by someone in control of hundreds of millions of dollars. More seriously, he made the point that a good one line description of what you do is important, and that as a startup, you can't create a market, but you have to be able to capitalize on an upcoming one.



Right on the heels of Greg was David Heinemeier Hansson. To be honest, I had no idea what to expect from him beforehand, because he seems to be about as polarizing as Zed Shaw.

It turned out to be the best presentation of the day, if for no other reason than the timing. DHH, sticking to his principles, gave an excellent guide to making money online. The secret seems to be charging people money. Whodathunkit? Explaining the whole presentation in words would be difficult, so just watch the video. It was just a refreshing contrast to all the heady talk about VC and liquidity events up to that point, and the delivery was spectacular. It was like he grabbed our collective ankles and yanked us back down to earth.



Paul Buchheit rounded out the list before lunch. While at first he seemed kind of unprepared, I soon realized it was just that this guy has a really dry sense of humor. He is almost sly about his deadpans, and you get the idea he is just waiting for you to get it. His overarching advice (ironically) was to listen to what people really need, rather than what they think they want. Treat requests and advice as an encoded, often distracting, way to communicate an underlying need, and then fulfill that need. An enlightening anecdote was of Gmail, when people were requesting all these quick/batch reply features, which he finally realized were coming in because the site was just slow. He fixed the performance issue, and the feature requests evaporated. If anything, his presentation was a huge success because I made a note to both try out Friendfeed (his current product) and apply there if I like it as a customer.



Next up was probably the richest guy (briefly) in the room, Jeff Bezos, founder and CEO of Amazon. He mostly pitched AWS, which was probably redundant for anyone that has already drunken from the AWS Kool-Aid, but as a sipper myself, I still found a few enlightening things. One blockbuster graph he used showed how a small company doing online video editing was able to scale from 50 servers to 5000 in just four days using EC2. You simply can't fill out purchase orders that fast if you actually had to buy the hardware. A couple choice quotes included "that is way above my pay grade" (referring to US Immigration Policy) and "we try to be customer focused rather than competitor focused" which just seems like it belongs on everyone's wall in 192pt font.



After Bezos came Mike Arrington, of TechCrunch. He talked about getting press and the direction in which TechCrunch is moving. He also spent a few minutes talking about trolls, which was ironic because there was definitely a mic troll there all day. You know the kind of person I am talking about ... the guy who gets up to 'ask a question' and really just wastes a minute of everyone's time trying to show how smart he is. This same guy got up over and over, and by the end of the day it was obvious everyone was sick of him.



Speaking of the mic troll, next up was Marc Andreessen. This guy was the original startup guy, and keeps having success. On Friday he announced a huge funding deal for his new startup, Ning, so he was fresh off success. He talked about quite a few interesting things regarding the economy, but the highlight seemed to come when the mic troll tried to strike again. This time Jessica Livingston (who I swear has an elementary school teacher alter ego, she is that nice) was mic'd up herself, and politely but firmly crushed the troll's dreams in front of the whole crowd (to much applause). Thankfully that was the end of him.


See, that nice.




The last speaker of the day was Peter Norvig, head of Google research. His talk was slightly more technical than most, and really proved quite interesting. The overall idea was that more data was always better than better algorithms, and he illustrated that quite nicely talking about Google image search and tokenizing East Asian languages (which have no spaces between words). I wonder if this guy does video lectures, because if so, I need to watch some of them. I'll at least have to check out his books.

And that was the day. All of the speakers were quite entertaining, often surprisingly so. DHH was definitely the highlight for me, just because he tacked in a different direction and kind of grounded us a bit. The overall theme for the day, mentioned by almost all the speakers, including Bezos and McAdoo, was to look for a problem that bothers you, and build a product to fix it. All this other stuff is ancillary to having a great product you are passionate about.

Now it's time to go catch the plane back to Lawrence. I've got a fresh Economist in hand and some fun things to think about. Overall it was an excellent weekend, well worth the trip, and I look forward to next year.

(edit: Watch all the presentations, and added speaker photos, because Gary Tan took such good ones.)

Monday, April 14, 2008

Teacher

So I found A Mathematician's Lament today. For anyone that really hated math classes, or even mildly disliked them, I very much recommend reading it. His description of math education is uncannily accurate, and disturbing to boot. It actually kind of inspires me to be a math teacher. If you don't want to sit through the whole thing (it's 25 pages), I highly recommend the first couple pages, the section starting at page 14, and pages 21-25.

I put in my six weeks notice today. Summer is finally coming.

Have a firm timeline for the project with Tyler and Scott. Lots will be happening with that in the next couple weeks. Hopefully things will go well.

I'm uber-tired right now, so that is all you get. Go read that link!

Friday, April 11, 2008

Greasemonkey

05/20/2008 UPDATE: Check out the new version of this which is bigger, faster, stronger, and easier to configure.

So I know Greasemonkey is like a billion years old, but I finally found a use for it today and wrote my first GM script.

There was a vote today on Hacker News to ban submissions from Valleywag, mainly because they are all linkbait. For some time I have been avoiding links on HN to certain sites because my experience with them in the past has been less than great. So why not save myself the time of actually avoiding those sites and just hide them to begin with?

I put the script up on userscripts.org as HN Blacklist. Here is the source:

// ==UserScript==
// @name HN Blacklist
// @namespace http://news.ycombinator.com
// @description Removes blacklisted links from Hacker News
// @include http://news.ycombinator.com/*
// ==/UserScript==

// Written by Xichekolas ... do whatever you want with it.
// http://news.ycombinator.com/user?id=Xichekolas

// Edit this list of blacklist terms.
var blacklist = new Array('valleywag.com', 'nytimes.com');

// Just assume the stuff below will work.
var xpathnodes = document.evaluate("//a", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

for(var n = 0; n < xpathnodes.snapshotLength; n++) {
var thisnode = xpathnodes.snapshotItem(n);
for (var i = 0; i < blacklist.length; i++) {
if (thisnode.href.toLowerCase().indexOf(blacklist[i].toLowerCase()) > -1) {
var grandpa = thisnode.parentNode.parentNode;
grandpa.style['display'] = 'none';
grandpa.nextSibling.style['display'] = 'none';
grandpa.nextSibling.nextSibling.style['display'] = 'none';
}
}
}

I started out using jQuery to do this, but converting it to pure javascript was a fun experience and a worthwhile effort in itself, even if nobody actually uses this thing but me.

Tuesday, April 08, 2008

Victory!

This is how happy we were last night...


That is really all that can be said. Rock Chalk!

Thursday, April 03, 2008

Tonganoxie

So last night several of us went with Bob and Jessie to Tonganoxie to pick up their sweet new hot tub. Overall the trip was a success, as they have a hot tub sitting on their patio now. But I feel I must detail the hilarious beginning of the evening.

You see, this is the route we were meant to take:


Desired Route
24.9 miles - about 41 mins

But this is the route we tried to take:

What we tried...
27.4 miles - about 49 mins

Unfortunately the bridge over I-70 was out. So this is the route we did take:

What we ended up doing...
34.3 miles - about 1 hour 7 mins

Notice the nice spiral shape. I'm sure that is mathematically significant somehow.

The ride home was nice and relaxing, and the tacos were excellent, so all and all a good evening. Poor Schwumps on the other hand...

Wednesday, April 02, 2008

Euler

Allan pointed me to a kickass website the other day. Project Euler is an interesting confluence of number theory, geometry, and programming problems. I have done about half a dozen of them so far. I think what I like best about them is that they serve as good warm-up problems. Often it's hard for me to start on something because I'm not entirely sure what to do first. Doing a euler problem puts me into programming mode. Of course, I'll eventually run out of them, but I do have all my computer science textbooks laying around. Maybe I'll finally have a use for those.

In the interest of having something to attach myself to for Startup School, Tyler and I have been working on getting some basic functionality together. I've spent a lot of time the last couple days working with the new merb and jQuery. My javascript skills are coming along, but I'm currently fighting with creating a custom rich text editor. I have somewhat of a reference implementation in jWYSIWYG, but the editing feels buggy at best. There seem to be lots of focus issues and general UI quirks that don't make it feel quite natural yet.

My initial implementation with textareas was quite normal feeling, but that would require users to learn some form of markup, which just isn't acceptable in the age of Word and OpenOffice. On the other hand, do I really want to be reinventing word processing software in the browser?

*couple hours pass*

Op, better finish this post. Just had minor success in getting my own iframe-based editor to work. That will give me a good starting point this evening to make it do useful things.

Currently Listening: Piggy (Bassland Club Mix)