Zhanga: February 4, 2006

The comments are at the bottom of the page. You can view old posts by clicking the months on the left sidebar. RSS feed.

« Jan 30, 2006 | All February 2006 posts | Feb 10, 2006 »

Saturday, February 4, 2006 (6 comments)

In compsci two weeks ago, we were supposed to make a program that would read in a bunch of words and group anagrams together. For example, consider this input:

teacher
rapes
cheater
with
spear

Given that input, the program is supposed to return all the anagrams grouped together:

cheater teacher
rapes spear

Isn't it awesome that "teacher" and "cheater" are anagrams of each other? I didn't realize it until this course. See what good computer science can do for you?

Anyways, a good way to test this program would be to feed it a file that contains a lot of words. A dictionary, of course. The one the professor gave us had about 40,000 unique words. That only took about a second to process, which was no fun.

I have a different dictionary with 1,680,000 unique "words." They're not really words in the strictest sense because a lot of them are things like "12345" or "qwerty" or words in other languages (it's used as a password-cracking dictionary), but that doesn't matter for the purposes of the program. A huge file like that seems like a good choice for finding weaknesses in the anagram algorithm, since it'd take a pretty long time to process.

Anyways, since it's a big dictionary, it's named bigdict.txt. Ray was so high that during CS lecture, when he tried to open the file, he typed in bigdick.txt. Actually, he wasn't high, but you can tell what was on his mind.

That's actually all I wanted to say.

Just to bore my readers, I'm going to do a few selected questions from one of those dumb questionnaires, but just the interesting ones...

  1. Have you ever gone camping?
    I played laser tag about two weeks ago. Camping is a lot harder than it seems. My legs were really tired from squatting so much.

  2. Have you ever felt betrayed by your "best friend"?
    He'd never do such a thing =)

  3. Have you ever gotten a haircut so bad that you wore a hat?
    It was actually so bad that people thought my haircut was a hat.

  4. Have you ever spied on someone you had a crush on?
    Does it count if I want to spy on the person but haven't actually done it? I always want to know what the fob next door is doing with his other fobs, but I can't actually spy on him/them because I can't understand Korean. The one time I actually saw something interesting was when one of his fob girls was ironing his shirts.

  5. Have you ever seen your best friend naked?
    I think I've seen more of Ronjon than I would like to have seen.

  6. Would you date someone with kids?
    I'd date her kids.

2:40AM

Comments

you have a crush on the fob nextdoor?

mushroom on Saturday, February 4, 2006 at 4:51 PM

This looks so safe:
http://www.synthstuff.com/mt/archives/tesla-coil-sg-75.jpg

yujing on Saturday, February 4, 2006 at 5:09 PM

lol, so wait, you have a crush on the fob GUY next door?!?

Yufei on Saturday, February 4, 2006 at 9:24 PM

loll

Tiffany on Wednesday, February 8, 2006 at 7:20 PM

why is everyone so surprised at david's interest in azn boiz?

pat on Friday, February 10, 2006 at 1:23 PM

Hahaha. Everyone here is gold.

Gene on Friday, February 10, 2006 at 2:31 PM


Add a Comment

Name:

Leave this empty:

Homepage:

Comment:

Comments containing HTML, BBCode, or more than 3 URLs will be silently rejected (damn spam bots).


Older posts can be viewed through the links to the left, under the main menu.
100 hits since April 29, 2008.