Category - Programming
Vim and vigor
Mon Aug 22, 2011 23:43 (UTC -7)
(Nerd Alert: Non-nerds can safely ignore this post.)
I’ve been around the Internet block long enough to know that programmers tend to care a great deal about what program they use to edit text—usually for writing programs, but potentially for anything. For decades now, they’ve been arguing over which family of text editors is better: vi or emacs.
When you use Notepad, or Word, or whatever the kids are using nowadays, you use the mouse for pretty much everything except when you’re typing. Programmers often work on the command line, either because they want to or because they have to, so everything that you could do with a mouse they have to do with the keyboard. Vi and emacs have so many features that this becomes a problem, and this is where the two classes of editors diverge.
GNU Emacs and other emacs-style editors give each operation a unique shortcut that’s often fairly involved, consisting of multiple keystrokes. In Vim and other vi-style editors, different operations may have the same shortcut—but never at the same time. Shortcuts have different meanings depending on the mode of operation you’re in. For example, in the default mode, “w” moves the cursor forward through whatever text you have open. Typing “:” will put you in command-line mode, where “w” saves the file. And then typing “i” puts you into insert mode, where “w” inserts the letter “w” into the file; i.e., you’re typing. The advantage of this (arguably) is that you spend less time entering commands and more time getting things done. (Plenty of emacs users believe otherwise; it just comes down to a matter of preference.)
So, what does all this have to do with me? I had always been content to use graphical editors like gedit or, if I really needed, a very simple text editor like nano with all of the major commands listed on the screen. But a lot of my friends used Vim on a semi-regular basis, and in my upper-level classes, I even saw people taking notes in it. And finally, I happened upon my friends’ hacking club meeting, where people were wowing everyone with all the cool tricks they could do in Vim. It was intriguing.
In November, halfway through a big project for my Artificial Intelligence class, I decided to learn Vim by using the vimtutor command that comes with it. After a few days, I was able to move the cursor around and edit text pretty easily, and I used Vim to finish the project. As cheesy as it sounds, I haven’t looked back.
Vim’s commands are really intuitive, so it’s easy to apply what you learn. The commands are like the building blocks of a language, as others have put it. And I find it very satisfying to change hundreds of lines of a file at once or move large blocks of text hither and thither without having to take my hands off the keyboard. I also like being able to edit different files side-by-side or even the same file side-by-side. There are really no limits to what you can do with Vim.
As if that weren’t enough, Vim is very configurable. There’s a ridiculous number of options and settings that can help you get things exactly the way you like them, boosting your productivity. I’ve put my .vimrc file online mainly so I can download it for use at work, but you’re welcome to look at it and take stuff from it or just make fun of whatever preferences I have set that you think are weird. (“Ewww, tabs??” That’s a holy war for another time.)
Everyone who’s a master at Vim thought it was weird at first but decided to give it a try anyway, just like I did. I won’t say I’ve mastered it, though; there are so many features that I can’t even remember all the ones I’ve heard of or even used. But over time, especially if I use Vim a lot for work, I could become super-productive. That would be pretty awesome.
If you use Linux, you probably have Vim installed. You can find out more about getting Vim at the official site. The Vim Tips Wiki is also helpful, and Vim’s own documentation is extensive. Because I’m crazy, I’ve shrunk the quick reference guide and the index of commands down to one page apiece (front and back) and printed them out. Now you can do the same if you don’t mind reading 3-point text!
Any other Vim users out there? Have any cool tips ‘n’ tricks to share? No holy wars, please!
Plain Text Offenders tries to shame websites that store their users’ passwords in plaintext. (Via waxy.org)
Amazin’
Thu Jun 30, 2011 23:57 (UTC -7)
I work at Amazon.com (but I don’t represent the company here, and the opinions expressed are not necessarily theirs… just in case you weren’t sure about that). I’ve been there for almost a month now, and I know you guys are probably pretty curious to know what it’s like. Even if you’re not, I’ll tell you.
First, a little background: Amazon is headquartered here in Seattle, but it’s grown so fast in its short life that it has office space in buildings around the city. A few years ago, Amazon decided to build its own campus in South Lake Union, a formerly industrial neighborhood close to downtown that’s on its way back to being cool for the first time in, like, forever. Those plans have finally come to fruition, and most people are working in the new campus now. (It’s an urban campus, so it’s really just a set of buildings among some other unrelated buildings and they call it a campus. It’s not like the sprawling suburban campuses like Microsoft and Google have.)
Anyway, my first date was May 31, and I was due to attend New Hire Orientation in the morning. A whole bunch of us new people had an ice breaker about Amazon trivia and got information about health benefits and pretty standard stuff like that. One of the guys in my session had also come from the University of Florida, but with a master’s degree. He said he recognized me, but I didn’t recognize him. I hate when that happens. Each of us also got an ORCA card paid for by Amazon, so we can use most of the region’s public transportation on their dime.
When New Hire Orientation was over, I met my supervisor. It was lunchtime. Since more and more people are working in South Lake Union these days, especially with Amazon moving in, a number of restaurants have sprung up to cater to the weekday lunch crowd. Near the building where I work, an enterprising local restaurateur has set up three new restaurants, so we went to one of them for a quick bite. My supervisor told me about the kind of stuff I’d be working on and asked me about myself. I was pretty nervous, it being my first day and all, but I didn’t collapse into a heap or anything.
I had chosen to work in Retail Systems, so within that area I was assigned to a team that’s working on software to manage inventory orders. My supervisor leads the team but isn’t detached from it; he’s a member of the team like everyone else. At first it was kind of intimidating being around so many adults all the time, but everyone’s cool. I’m not the only young and new person on the team, either. An intern started at the same time as I did, and another one joined us last week. If I had to guess without counting, I’d say there are about ten of us at this point. We probably won’t get too many more people because Amazon likes to have what it calls “two-pizza teams.” It seems like a good rule of thumb.
So, what’s a typical day like for me? I can get in whenever I want; I don’t even have to clock in or clock out. (As long as you’re doing your work, they don’t mind.) Actually, I like to leave my apartment between 7:40 and 7:45 so I can make it to my desk at 8:00 AM. And then I work on software, mostly fixing bugs or adding features I’ve been asked to add. I like to take an hour for lunch, and I usually eat at one of the restaurants within a few blocks of my building. Then, if I have time left over and the weather is nice, I go to Lake Union Park and just sit and watch the seaplanes, sailboats, geese, or whatever else happens to be hanging around. I can’t believe the park is less than a year old; it’s a real treasure.
In the afternoon, it’s back to coding. Some afternoons, I guess about every week or two, a band or author will come to Amazon to plug their latest album or book, respectively, so I figure that’s a fun thing to look forward to. (I’ve been to one so far: The Airborne Toxic Event gave an intimate performance and even had an opening act.) But invariably, at 4:30, my team has its daily stand-up, where everyone fills everyone else in on what they’ve done during the day and what they plan on doing next. I think other teams do this in the morning, but we do it in the afternoon so we can teleconference with one of our teammates who works in Amazon’s Beijing office. And with that, my day at work is over, so I walk back to my apartment, where I arrive 15 to 20 minutes later.
I’m loving it so far, especially because I got my first paycheck today. Yes, I get paid monthly. The check (well, direct deposit) includes half of my signing bonus (the other half comes in a year). It’s been kind of a tough month for me since moving-related expenses were draining me dry. But I don’t have to worry about that anymore.
If you have any other questions about what it’s like to work at Amazon, fire away!
And on an unrelated note, the answer to a question you’ve been wondering about: When did prisoners start dressing in orange?
What I learned in college
Sat Apr 30, 2011 11:22 (UTC -5)
I’ve taken a lot of courses in college. I majored in computer science with a minor in business administration, but I also took a few liberal arts-type classes that had nothing to do with what I was actually there to study. They were interesting, though. Each one tended to have an overall theme that was present throughout the course, and once I got a grip on that main idea, I’d have a better understanding of everything I was supposed to be learning about.
Eventually, I realized I could probably summarize the main message of each of my college courses in a single statement… or at least recall one thing from the course that stuck with me. Here’s what I’ve come up with:
- MAC2313 (Calculus III): Like Calc I, but in 3D!
- CHM2045 (Chemistry I): At first glance, atoms seem simple. But they’re actually not.
- CHM2045L (Chemistry I Lab): “‘A’ for effort” is a real thing.
- AMH3931 (America in the Fifties): The ’50s were crazier than everyone remembers.
- GEO2410 (Social Geography): People like to have lots of space, but they’re better off living all close together.
- MAP2302 (Differential Equations): eπi = -1. I forget why, but I think it has to do with circles.
- BSC2008 (Biological Sciences: Evolution, Ecology, and Behavior): The food chain gets narrower at the top because some energy goes to waste when animals eat each other. Mind = blown.
- CIS3022 (Programming I for CIS Majors): Getters and setters!
- PHY2048 (Physics I with Calculus): If your professor hangs a bowling ball from the ceiling, stands up against a wall, holds the bowling ball up to his face, lets go of it, and remains perfectly still, he knows it won’t hit his face when it comes back, but he’ll flinch anyway.
- PHY2048L (Physics I with Calculus Lab): Not everything is a frictionless box in real life.
- IDH3931 (Sultans, Seafarers, Slaves, and Spices: The Indian Ocean in Antiquity): The people in East Africa, the Middle East, India, and Southeast Asia had their shit together way before the Europeans.
- ENC3254 (Technical Writing for Engineers): Never use a long word when a shorter one will suffice. But for some reason, you can’t say “since” instead of “because.”
- CIS3023 (Programming II for CIS Majors): Subclasses! Interfaces! Abstract classes!
- PHY2049 (Physics II with Calculus): The tesla is an impractical unit of measure.
- PHY2049L (Physics II with Calculus Lab): Having a really early class can help you avoid early-morning fire alarms in your dorm.
- EEL3701C (Digital Logic): Anything that involves soldering is not for me.
- ANT2301 (Human Sexuality): Whatever you’re into is probably okay.
- COT3100 (Discrete Structures): If Mark is a zebra, and all zebras have stripes, then Mark has stripes.
- CDA3101 (Computer Organization and Design): If you have to program in assembly, then you may as well just shoot yourself.
- ECO2023 (Principles of Microeconomics): As you get more and more of something, each one is worth less and less to you.
- MAS3114 (Computational Linear Algebra): MATLAB sucks.
- STA3032 (Engineering Statistics): People still look up numbers in tables instead of using calculators.
- COP3530 (Data Structures and Algorithms): A tree is a kind of graph!
- ACG2021C (Introduction to Financial Accounting): Debits go on one side, credits go on the other.
- CIS4301 (Information and Database Systems I): Use joins for everything.
- CEN3031 (Introduction to Software Engineering): Brooks’ law is correct.
- COT4501 (Numerical Analysis): Image compression is all math!
- FIN3403 (Business Finance): I’m not going to have a pension or Social Security, so I’d better start saving for retirement now!
- SPC2608 (Introduction to Public Speaking): I have nothing to say about this class because I never want to think about it again.
- COP4600 (Operating Systems): Kernels are complicated things.
- MAN3025 (Principles of Management): Be nice to your peons.
- CAP4621 (Artificial Intelligence): Lisp probably makes perfect sense if you have brain damage.
- CGS3065 (Legal and Social Issues in Computing): You can find a legal or moral gray area in just about anything.
- CNT4007C (Computing Networking Fundamentals): I have a new respect for the people who came up with Wi-Fi. That’s complicated stuff.
- MAR3023 (Principles of Marketing): People put a lot of thought into getting you to buy things.
- CIS4930 (Introduction to Computational Intelligence): Handwriting recognition is all math!
- CIS4930 (Natural Language Processing with Python): Python is actually pretty intuitive. It should be called the anti-Lisp.
- CIS4914 (Senior Project): Don’t procrastinate.
Thanks for reading. That’ll be $20,000.
The BBC reports on the secrets of Britain’s abandoned villages.
The college years are over
Thu Apr 28, 2011 10:58 (UTC -5)
These past few months, while I haven’t been writing about my trip to Russia, I’ve been focusing on my studies. It was my last semester of college, and I had a lot of stuff on my plate, so I wanted to make sure I did a good job with everything. In my case, I needed to take a full course load this semester to satisfy all my requirements.
One of the things I had to do was complete a senior project. I chose to develop a ride-sharing website in a similar vein as CouchSurfing. I need to make sure the university doesn’t own the rights to it; otherwise I’d like to roll it out myself sometime later.
Since I work on campus, this week is my last week of work. (I think I’ll have to come in on Monday for a little bit, but probably not for long.) At this month’s meeting, on April 14, the other graduating seniors and I were honored with certificates, windbreakers, and catering from Olive Garden. Three of my favorite things right there. They’re going to miss me at work, and I’ll miss being there, but I can’t pass up the opportunity to move out to Seattle and work at Amazon.
I can’t pretend that I haven’t been thinking about the move—I’ve been obsessing over it, actually—but I’ve been trying to reflect on the past four years as well. You know, to wax poetic the way I usually do. I’ve done some fun stuff and made a lot of friends. I don’t think I would have done anything differently if I could do it all again. Maybe I would have gone out more (I played a lot of Minesweeper my freshman year). I think I’ve turned out okay, though.
Right now, I’m kind of in a weird place: My classes are over, but instead of heading home as I usually would have done by now, I’m staying in Gainesville, going to work every day, and waiting for the graduation ceremony. My sister is graduating on Saturday; I’m graduating on Sunday. (Surely she’ll brag about this for years to come, just like how she tells everyone that she’s a minute older than I am.)
I can already tell that college graduation is different from high school graduation: it’s not mandatory, no rehearsals you have to attend, no maximum number of people you can bring, no bullshit. Well, there is some bullshit: Herff-Jones is back and selling college rings. But you and we that have free souls, it touches us not.
So, on Sunday, I shall stride across a stage wearing funny clothes and pretend to receive a diploma. Call it what you want, but I call it closure.
And hey, if you can’t make it or just want to be a total creeper, you can watch my graduation online! Click that link at 5:00 PM EDT on Sunday; that’s when it’s supposed to start.
And while I have your attention, it’s time to bust the myth that fast-food burgers don’t rot because they’ve got nasty stuff in them. Actually, it looks like homemade burgers don’t rot either. (Via The Presurfer)
It happened at the career fair
Tue Mar 29, 2011 23:00 (UTC -5)
It’s my last semester of college, and for the past few weeks, I’ve been busy working on my senior project. But earlier this semester, something else was keeping me busy.
Every day, I spend some time in the Dungeon, the main computer lab in the Computer Sciences and Engineering building. One day in January, I noticed a banner on the wall advertising the Career Development Workshop. I foolishly assumed that it was some sort of career development workshop, but I soon found out that it’s a career fair just for students in my department (Computer and Information Sciences and Engineering) and a few related ones. Basically, you dress up and chat with representatives from these companies, and later, if they like you and your resume, they’ll ask you for an interview.
Since I had no idea what I was going to do with my life after graduation, I decided I should check it out. So, on Monday, January 24, I broke out my suit and resumes and headed to the Career Development Workshop. I thought I wouldn’t have to get there right when it started, but I was dead wrong. There was a huge line of people waiting to get in—way more than I had imagined.
And for all those job-seeking students, there were only 10 or 12 companies represented. Some were small, local companies, and the others were huge ones located elsewhere. When I finally made it inside, I realized that most people were waiting in long lines to talk to recruiters from Disney, Microsoft, Bloomberg, and Amazon.
I had done some research on the companies that were there, and Amazon was the one I wanted to talk to the most. They had sent out an e-mail before CDW with details on the position that they were looking to fill. I seemed surprisingly qualified, so I sent them my resume and did a little bit of research. I’d been really pleased with the dealings I’d had with Amazon as a customer, and I figured it would be a fun company to work for.
I decided to warm up by talking to some local companies. I didn’t have to wait very long to talk to them, which was good, because I bombed. The first guy I talked to worked for a local software company, and he asked me some questions about things I didn’t remember. That was awesome. He said he’d pass my resume on to the HR people for their consideration. The second company was even worse. That guy just looked over my resume and said thanks. Clearly I was not what they were looking for.
Then I decided to wait in line for Amazon. After about two hours, I had moved less than halfway up the line, but I was still at the end because hardly anyone had gotten in line behind me. I was wondering if I would even get a chance to talk to them at all, and I was also wondering how I could try to stand out from everyone else, most of whom seemed to be graduate students.
At that point, it was almost 10 PM, so CDW was almost over. One of the Amazon people came to the back of the line to talk to us poor souls who had been waiting for so long. She told us that they still wanted to talk to everyone who was in line and that they could continue talking to people in the CSE building that night or at Career Showcase, a much larger student job fair, two days later.
We said we wanted to be able to choose, and she said that was fine. But for the students who wanted to wait until Career Showcase, she wanted to make things fair: She didn’t want them to have to wait in a long line all over again, and she wanted to keep everyone in the same order as they were in this line. So she asked us for ideas on how to do that. Right then, I knew that this was my one chance. If I had a good idea, I could stand out from everyone else.
Somebody suggested that she write our names down, and then we could just tell them our name later, and they’d know who we were. She said that that wouldn’t solve the problem of keeping everyone in order, so she went away to the other Amazon people and came back with the idea of having a time slot for everyone who was interested.
I thought that was a terrible idea. People are always late for things, and some of them might decide not to show up, or their chats might last too long and make other people have to wait or whatever. Fortunately, by that time, I had a better idea.
“I have an idea,” I said to her. “Give each of us a card with a number on it. The first person in line gets number 1, the second person gets number 2, and so on. Then, at Career Showcase, when you’re ready to talk to someone, pick the person who has the lowest number.”
She said she really liked that idea and thanked me for it. Soon, she was giving everyone a number written on an Amazon business card (and she thanked me again as she was doing it). I was delighted.
By that time, everybody had to leave because CDW was over. The Amazon people were giving us the choice of talking to them right after CDW or at Career Showcase, so I decided to talk to them that night while my idea was fresh in their memory. I went to the CSE building with a few other students and waited for the Amazon people to arrive.
Once they got there, they used the numbered cards to keep people in their original order. One of the other Amazon people talked to me when it was my turn. He asked me some questions that weren’t too hard. I thought it went pretty well even though I needed a little help. We also talked about some of the projects I had done for my classes, like my artificial intelligence project. When we were done, I made sure to mention to him that I had the idea for the cards.
The next day, Tuesday, Amazon had an information session in the student union. There, they talked about what it’s like to work for Amazon and about the application process and stuff like that. They also talked about how much they liked Seattle.
I had found out that Amazon was based in Seattle, but since I didn’t like the idea of living there (too much rain, I figured) and because I knew they had offices in other places, I wanted to ask about working for them in another city. But during the info session, they managed to convince me that Seattle is a pretty neat place. I guess I’m easily convinced. Also, I figured it would be best to work at their headquarters so I could have a lot of opportunities to advance and try new things.
Career Showcase was the next day, and once again, I was wearing a suit. There were a lot more companies there because it was for all math and engineering students. I spoke to people from a few other companies, and I happened to see some of the Amazon people walking around. The HR woman saw me and told me that the numbered cards were working great. She gave me her business card and then said something like, “We’ll have to see what we can do about you!”
About an hour later, I got an e-mail saying that I had been accepted for the first round of interviews. They would be next Wednesday, February 2, on campus.
My boss had been very supportive of me in my search for a job after graduation, so that Friday, he took me out to lunch and talked to me about what I should say at the interview. He also said I should get a new suit—the one I had didn’t fit so great, and he made a case for it being the most important article of clothing you can have—so the day before the interview, I did. I went to the store in the mall where my sister works, and she helped me pick out everything. She even paid for it.
The first round consisted of a 45-minute interview for which I was snazzily dressed. I had done research on the types of questions to expect (mainly by reading blog posts written by people who had interviewed with Amazon and failed). My interview consisted of questions about design, algorithms, and scripting, the last of which I wouldn’t have been able to answer at all if it weren’t for my Linux experience.
I was feeling pretty good about the interview, and fortunately, I wouldn’t have to wait long to find out if I passed: they were going to be calling people for the second round that very night. I waited and waited until I was sure that they must have called everybody they were going to call, but… they called. They told me that my interviews for round two would be tomorrow.
So, I found myself in the same place the next day, but this time I had a different shirt and tie (I got two of each), and I would be facing three 45-minute interviews with other people. I thought I’d be really nervous, especially since the interview rooms were so tiny and it was just me and the other person in there, but it actually wasn’t that bad. I was pretty composed the whole time. The questions were similar to what I had been asked the day before: algorithms, design, scripting, and so on. One interviewer just asked me how I would design a particular system and spent the whole time pressing me for all kinds of details about everything. I enjoyed it.
The interviewers were pretty cool. The last one I talked to was himself a UF graduate, and once he was done with his questions, I asked him some questions about living in Seattle. He said that it was good that I was an undergrad because most of their applicants were grad students, and the undergrads were apparently too afraid to apply.
I wasn’t sure how well I’d do compared to the grad students, but one week later, I got the e-mail saying that I was being offered the position of Software Development Engineer. I officially accepted the position on March 9, and soon afterward came the best part. I talked with the HR woman, the one I had given the idea about the cards, and she asked me about my strengths and interests. Based on that, she got some managers to contact me and ask me to join their teams. I ended up picking Retail Systems, which deals with pricing, ordering, and things like that that are central to Amazon’s business.
I’m graduating on May 1. My start date is May 31. Between those two dates, I’ll be moving to Seattle!
Crappy limericks
Sat Jan 29, 2011 21:57 (UTC -5)
I’ve been really busy lately; here’s one of the many things I’m doing.
For one of my classes, I’m writing a program that writes limericks. It references a pronunciation dictionary to find sets of rhyming words and a collection of newspaper articles (apparently from the 1950s) to put words in a random but plausible order. The program doesn’t really have a sense of meter yet. If it comes up with something that actually vaguely makes sense, it’s just a coincidence because each line is written independently of the others.
Here’s a selection:
Her polo grounds is cheap
And grand champion 4-h sheep
Last night at noon
Agreements calls soon
Only marvel at a 2-inch deep
And city fashion show at bat
The streets and miss pat
A baseball writers’
In cigaret lighters
Agree on the byer-rolnick hat
New president also could have rated
The question of dimes and waited
Because the 10-hour daily
Ex-mrs. bud daley
It appeared to end a feted
In right center and down
Like that 60,000 old towne
Katanga and beads
He avidly reads
Schools and conservative barriers around
Break the farm income is known
President eisenhower administration and aaron cohn
Grow up pops
A small shops
150,000,000 would not the phone
Here from 1951 through a wreck
The bills of texas tech
The rev. mr. werner
Mrs. h. merner
Aggies got a 17-1/2-inch neck
Bring the united states to send
A way of communist north bend
1954 but it took
The 21st and cooke
Camera in what this would lend
1956 but also admitted killing
People are having a tilling
To his hands
Before 5777 fans
Is aiding them with caramel filling
Can’t afford the main dining
Bill which actually owns and mining
A zinc mine
Is asking the fine
And 7 last year after signing
And sons and dave mills
Bill was reached the bill’s
The arithmetical sum
Was the rum
For months ending in beverly hills
Was and out a peak
Away the prospect of chic
He made the nuns
Library and submachine guns
To a whopping 8% next week
Photographs that show the value of a dollar.
Artificial intelligence
Sun Dec 05, 2010 23:59 (UTC -5)
I bet you’re wondering what I’ve been doing for most of the last two weeks. Well, I’ll tell you.
I’m taking a class called Artificial Intelligence. Well, something like that. It’s probably officially called Introduction to Artificial Intelligence or Principles of Artificial Intelligence or something like that. I have the course syllabus next to my desk, so I could easily check, but to add an air of mystery to this post, I won’t.
Now that you’re intrigued enough to keep reading, I will describe how this class has been keeping me busy. It’s one of those classes where a lot of your grade depends on a project that you work on for much of the semester. In this case, we have to write a program to play a game intelligently.
Specifically, the game is a Tetris-like game called Letris, which is not like any of the Letrises you’ll find if you Google it. I think the professor just made it up. Instead of blocks, you have sequences of letters (read in from a file) that you have to put on a board, and whenever there are three or more letters in a row horizontally, vertically, or diagonally, they disappear for points and the letters on top of them fall to take their places. The game ends when you run out of sequences or you’ve filled up the board and can’t play any of them.
Our programs are allowed to peek up to three moves ahead to decide which move to make, but they’re only allowed 10 CPU seconds per move. They can be written in any language (that the instructor approves), but extra credit will be given for programs written in Lisp.
I wrote mine in Java… Hey. Don’t give me that look. Just don’t. You know what? If you’re going to act like that, why don’t you just leave? It’s just a choice of programming language, not a life-or-death situation. And you know what? Maybe I’m really good at Java. Maybe I figured out how to make it work well with Java. Did you ever think about that? Huh?
I didn’t, but it seems to work well enough. The hardest part, and what I spent the better part of two weeks on, was the lookahead stuff. For some reason, I couldn’t wrap my head around that very easily. It was so complicated (to me) that I actually spent days and days just coding and coding without even having anything ready to compile and try out.
Once I got that working, the only thing left was the evaluation function, i.e., how the game decides which move is a good one to make. It’s good to score a lot of points, but in the long run it seems like it would be better to keep the letters (blocks) low so you can score even more points in the future. However, I was on such a time crunch by then that the little testing I was able to do proved in. I ended up weighting those factors and several others equally.
The interesting part will come when the professor stages a “tournament” of all our programs, ranking them by how many points they score on certain data sets. I have absolutely no idea how my implementation will fare against everyone else’s, especially those who had the smart idea of using C or Lisp, so we’ll see how that goes.
Every time Bruce Schneier opens his mouth, amazing words come out. Actually, well, this is written, but it’s good nonetheless. Schneier half-jokingly proposes that we close the Washington Monument due to security concerns. When it comes to security, this guy hits the nail on the head.
How the classes are going
Wed Jul 07, 2010 20:55 (UTC -5)
Two summers ago, I stayed home and hung out with friends. Last summer, I went to Europe. But if I want to graduate in Spring 2011 while taking a relatively light course load along the way (which I do), then I have to take a summer semester (which I am doing now).
Here at old Florida, there are three summer semesters. Summer A is six weeks long. Summer B, which follows Summer A, is also six weeks long. Summer C spans both Summer A and Summer B. I took Intro to Public Speaking during Summer A, and during Summer C, I’m taking Operating Systems and Finance. Summer A has ended, so the latter two classes are the ones I have left.
Summer course offerings are more limited than during the Spring or Fall semesters, so for my computer science major, I had no choice but to take Operating Systems with one of the department’s more infamous professors. He claims that the average score on his exams is 60%, which includes 20% extra credit. He also gives lots of homework, and he’s just assigned the term project.
The flipside, as I’ve been told by my friends who have survived his classes, is that you learn a lot from him. And I seem to be doing just that. I didn’t think I would do very well on the first exam, but I got a 77 (which I first misread as 11, my mind precluding the possibility of such a “high” grade). The next exam is on Tuesday night, which also happens to be my birthday. I hope the exam makes it a good one.
The other class I’m taking right now is for my business administration minor. It’s Finance (properly, Business Finance), and it’s one of the classes that the business college has done a great job with. They record the lectures and post them online, so there’s no need to actually attend class. Instead, I download the lectures and watch them at my leisure. The quizzes are also online (but the exams, alas, are not).
I chose to be a business minor because it would give me valuable skills (and because my major requires me to take a minor, but never mind), and this class hasn’t disappointed me. I’ve learned, among other things, the importance of saving for retirement. Plus, I’ve been doing very well in the class. The way things are going, I could end up with an A. Yay.
I was actually very worried that I wouldn’t do well in either of these classes (Finance is said to be the hardest class in the business minor), but I’ve been busting my hump for them, and it shows. I just hope I can keep up the good work.
I’ve been linking to a lot of infographics lately, some good, some not so good. Here’s a parody of pointless infographics. (Via waxy.org)
Another one of those montages of clips from movies and TV shows: We’ve Got Company! I first saw this before watching Avatar and groaned upon hearing the line in the movie. (Via The Presurfer)
Stupid Fight compares the spelling and grammar of celebrity Twitterers’ fans to see whose are dumber. (Via waxy.org)
Attack of the parasites!
Tue May 25, 2010 20:37 (UTC -5)
A few months ago, my sooth-seeking friend Andy took in a stray cat. He named him Tucker and kept him in his bedroom in our apartment. I would go in once in a while and see Tucker there. He was affectionate but unfortunately never very healthy. After about a month, Andy and his vet decided to let Tucker go to the great scratching post in the sky.
Three weeks later, Andy and his friend Scott, who was visiting, discovered that Tucker had left something to remember him by: fleas.
They took swift action, vacuuming and flea-bombing Andy’s room and the living room. They asked if they should do my room too. I said not to worry about it. Mistake of the Century. Shortly after that, I said:
Andy and Scott left on Wednesday, and I’ve been alone in the apartment. It hasn’t been so great, but not for the reasons I would have expected. I’ll go into that later.
I was left to fend off the fleas by myself. On Thursday afternoon, I went to the front office to ask for pest control to come, and I was told that they only come on Thursdays and that I had just missed them. Andy, who took responsibility for the whole situation, gave the office a call and got the pest control people to maybe come on Monday.
It was a long weekend. I called a vet’s office, and they said to put Borax onto the carpet and vacuum a week later, but I couldn’t find Borax at the grocery store. (Is that something you can get at the grocery store? I don’t want to waste my time again.) I did buy some insecticide for fleas, and it seemed to get rid of them after a few days of spraying. I also did some vacuuming to (hopefully) get rid of the flea eggs.
I don’t like spraying chemicals all over the place. It’s not due so much to my concern for the environment as it is to my tendency to accidentally spray myself (which did happen, as usual). So I made a flea trap by setting a bowl of soapy water on the floor and angling a desk lamp over it. Fleas are attracted to heat (this ordeal has made me a damn flea expert), so they jump toward the light bulb and fall into the water, where they get stuck. It’s also a fire hazard, so don’t try this at home. I won’t do it again.
Needless to say in a world where “yes” means “maybe” and “maybe” means “no,” pest control didn’t come on Monday. They called me on Tuesday and asked if the whole place had been vacuumed up because apparently they wouldn’t even come if it weren’t. I said no and asked them to come on Wednesday. They didn’t. They were definitely supposed to come on Thursday, as usual, but they didn’t even appear then. They finally showed up on Friday, but by then they could tell I had already gotten rid of the fleas, so they didn’t do anything.
(Before you say anything: no money was lost here. The management of my apartment complex hires said company to do free pest control work for residents. We had considered hiring another company, but it would have been too expensive.)
I haven’t seen any fleas in five days, so I think they’re gone for now. Then again, they hid for at least three weeks, between the time Tucker died and the time anyone noticed them. Hopefully they’re not like an STD that pops up from time to time and can never go away. I’ll have to do some more vacuuming.
This is why software is awesome. Someone wrote a Python script that does some time-stretching and -compressing on a song to change the beat. The result: everything swings. Sample tracks include “Every Breath You Take,” “Enter Sandman,” “Around the World,” and “Don’t Stop Believin’.” (Via waxy.org)
Here’s a breakdown of cable subscription fees by network, showing how much you’re paying for channels you don’t watch. (Via The Consumerist)
American kids don’t have a monopoly on stupidity: 10% of British children surveyed thought that the Queen invented the telephone. Some also thought that Luke Skywalker was the first person on the moon and that Isaac Newton discovered fire.
Exams are exciting
Thu Dec 10, 2009 23:53 (UTC -5)
Busy times again. Yesterday was the last day of classes. Some professors decide to have their final exams on the last day instead of during exam week, so I had two exams yesterday. I had studied a lot for them the day before, so they weren’t too hard. I already know that I got an A in Statistics, which I thought would be impossible.
It kind of puzzles me that I’m still having to take classes like Statistics that really have nothing to do with my major. I tell people who go to other universities the kinds of classes I’m taking, and they’re also puzzled, which in turn makes me mad. I don’t want anyone to think I’m getting a bad education. I think I’ve touched on this theme before, but I’m too lazy to find the link.
The professor of my Data Structures and Algorithms class (the most important class I’m taking) says they don’t have time to teach us computer science and computer engineering majors everything, especially when it comes to programming languages. He suggests that we go off and learn some languages on our own. It’s not a bad idea, but I’d like to learn more than one language in school.
Isn’t it obvious why there’s no time? It’s because the university, or whoever tells them what they have to teach, insists that students have well-rounded college education. The Dutch sisters I met on the train from Venice to Zagreb this summer were puzzled by that idea. I could see their point. If I wanted to have a well-rounded education, I would have gone to high school. Oh, wait, I already did!
Sure, it would reflect well on me to learn programming languages by myself (as I actually have). And sure, it’s not the worst thing in the world to write essays about the spice trade on the Indian Ocean during the Middle Ages and early modern period (as I also have). But I daresay that time spent doing the latter when I should be concentrating on the former is not time well spent. And they wonder why they can’t teach us enough of what we need to know…
Anyway, I have an exam on Saturday and my last one on Tuesday. I’m not sure exactly when I’ll be going home yet.
Joshua reports on abuse of authority and endorsement of religion at California public school. He’s started a letter-writing campaign to stop the injustice. I’ve been too busy to write a letter, but I hope to get to that soon if it’s still necessary.
And here’s A Flowchart to Determine What Religion You Should Follow. (Via Pharyngula)