Blog Closed

This blog has moved to Github. This page will not be updated and is not open for comments. Please go to the new site for updated content.

Friday, February 29, 2008

Wikibot

I spent some time today working on my wikibot program. I got a lot of problems fixed, a lot of details ironed out, and a lot of new features added. I'm probably getting close to the next release, and when that happens I'll probably upgrade the project from alpha to beta.

I used the bot yesterday and the day before to help with some edits to the [[Muggles' Guide to Harry Potter]] book on Wikibooks. That book has over 780 pages, and the bot worked without any kind of problem or complication. My algorithms ended up missing some important corner cases which I needed to go back and fix later, but the bot worked 100% like it was supposed to.

As I get the basic functionality written and stabilized, I find myself looking forward to what kinds of cool features or additions I would like to add to it. I've begun writing up a "to do" list for features that I want to add. I am trying to keep the program--overall--relatively quick and light weight, so some of these features might never be implemented, however.

There are a couple more things I want to do before I move the project into beta. I definitely want to create an installer for it, and I want to improve a lot of the documentation too. A lot of this is administrative, like creating manifests, readmes, makefiles. I need to be more diligent about including the text of the GPL in my distribution too.

Thursday, February 28, 2008

Jeopardy

In the first round of Jeopardy there is 18,000 dollars available in 30 questions. However, there is also one "Daily Double" hidden in there too, which gives you the opportunity to wager some or all of your money. This gives you the chance, if you bet it all and get it right, to double your money. If the Daily Double is located under one of the 200$ questions, and you just happen to pick that question last, you can come out of the first round with a whopping $35,400 and two very unhappy competitors.

In the second round all the prices double, so there is the opportunity for you to earn an additional $36,000. However, this round also has two of those magical Daily Doubles. If you answer every question in the second round except the Daily Doubles, and those magically happen to lie under two 400$ questions, you can earn up to $140,800 dollars in the second round. However, if you do the same thing, but have also played a perfect first round, that money doubles in each of the Daily Doubles too. Play perfectly through the second round, and you are walking into the final jeopardy with $282,400.

Final Jeopardy gives you one last chance to double your money, if you risk it all and get the answer correct. Since you're on such a roll until this point, you may as well, right? Get it right, and you've walked out of Jeopardy with a one-day winning total of $564,800.

I have my suspicions that if the second round ends, one player has a perfect $282,400, and the two other competitors have zero or less, they probably won't even have Final Jeopardy.

Reports

I've come to the startling conclusion that your average engineering student can't follow simple instructions, and can't write even a basic report. Ignoring the fact that most of them cannot seem to master the mechanics of the spelling or grammar check buttons (put mouse over button, click, release), the reports that I've been getting are overwhelmingly terrible.

The previous lab assignment was to emulate a pulse width modulation (PWM) controller using an embedded computer and a simple program, written in C. PWM is, if I may be allowed to terribly oversimplify, the process of sending out pulses of different widths onto a wire. The width of the pulse represents it's value, so a pulse of 5 milliseconds could be considered to have a value of "5". PWM is no longer a common technique, but it can be useful for controlling certain servo motors. The task was broken into four parts:
  1. Determine the absolute fastest rate at which a program written in C can cycle the output port on and off. In other words, what is the smallest that our pulse widths can be.
  2. Depending on the findings in part (1) above, determine whether a specific set of pulse-width specifications can be met by your system.
  3. Write a program that outputs pulses of specific widths. Pulse widths are specified as fractions of a constant cycle time. Pulses of 8 different widths are required.
  4. Measure the actual width of the pulses using a logic analyzer, and calculate the percent error between your system output, and the specifications.
One student wrote the following code snippet (I've added a few simplifications for readability) for part (1):

while(!kbhit()) {
outportb(PORT_A, 0x01); //turn bit0 on
printf("PORT A Value is: %X\n", (int) inportb(PORT_A));
outportb(PORT_A, 0x00); //turn bit0 off
printf("PORT A Value is %X\n", (int) inportb(PORT_A));
}

The student, after running the above code, found that the pulse cycle time was several orders of magnitude higher then the maximum specification value. Can you see why? These students are assembly language programmers, and they're used to instructions executing, more or less, in a single "instruction time". For that reason, many of them don't have the conceptual understanding that the printf command is not some small atomic command, and that it doesn't execute in a reasonable amount of time. The printf function has a number of tasks to perform:
  1. Output characters from the format string to stdout, checking whether every character is a "%" character.
  2. If the character is a "%", determine what type of argument is needed.
  3. Pop an element off the stack, convert it into a string depending on what type it is.
  4. Print that string to stdout as well.
  5. Count and return the total number of characters printed (although this return value is rarely used)
printf likely calls some kind of lower-level i/o routine, such as putc or puts, which in turn needs to interface with the display driver. Cutting the printf statements out of the code snippet above decreases the output cycle time from slightly above 15 milliseconds to less then 15 microseconds, which is well within the required range for the assignment.

I'm not a stickler for formatting or details. In my lab, I require students to only have three sections in their reports:
  1. Introduction: A short description, of one or two sentences, of what the assignment was. What problem are the students trying to solve? Being succinct and accurate shows that the student understands the problem and is able to rephrase that problem in their own words.
  2. Procedure: A description of the program that the student wrote, including explanation of algorithm, structure of code, etc. This is one of the most important parts of the lab report, because it gives the student an opportunity to explain that they know what's going on, even if their code does not work. Describing what you are trying to do demonstrates that you understand the necessary concepts, and that you understand how to solve the problem, even if your code did not "work".
  3. Results: Did your program work? If so, how well? If not, why? Explain what the results of the lab were, describe how it could be made better. This shows that the student's code worked, how well it works, and whether the students are able to learn from their mistakes.
Even with these very relaxed requirements, I still find myself needing to write "Explain more!" in big red letters. I don't ask for much, but I need to see something. One student wrote, as his entire procedure section, the following paragraph:

First write program that using loop to turn on and off the port continuously. Then using logic analyzer to see what pulse width and cycle time values are. To get pulse width = 0.2 cycle time. Puts another loop in program to modify the time of pulse on and off.

It puts the lotion on it's skin.... Now, I don't grade based on spelling or grammar (the engineering department says specifically that I am not supposed to), but this is basically illegible. Besides that, it doesn't explain what his code does. When I read through the code, I see very quickly that his code doesn't actually do anything. It doesn't output any data to any I/O port. It doesn't have any loops to modify pulse times. In short, he described a program that he didn't write for his report, and handed in a program that he didn't describe.

Wednesday, February 27, 2008

MATLAB wishlist

"Did I ever tell you", he said and then paused to glance at his computer screen, "how much MATLAB sucks?". He clicked his mouse once, then again, then a third time much harder. "Damnit!" His muted yell caught the attention of passers-by. "I'm going to do my dissertation on how much MATLAB sucks. I've got plenty of data already".

MATLAB has a number of great features that engineers and scientists can use to model systems, analyze data, and verify designs. What's great about it is that non-programmers can pick it up quickly and use it to solve complex problems. There is an immense library of builtin functions and optional toolboxes that solve most common problems, and creating a new simulation is typically as easy as cobbling together these existing pieces. Here are a list of features that I think engineers appreciate:
  • Data Types: Matrices and vectors are really the fundamental units of data. Because of this, they are easy to define and use. Variables are all dynamically typed. "Polymorphism" (i put it in quotes because it is not true polymorphism as most people know it) is handled inside the functions themselves, so for most operations the size and type of operands can be safely ignored.
  • Do What I Mean: Most functions are vectorized. This means that if I pass in a vector to a function instead of a scalar, the function will loop over all elements of the vector, as should be expected. Functions are all global. Engineers don't want to worry about namespaces or libraries. We want everything right here, right now, whether we are using it or not. We want to be able to call a function without having to search the documentation for where it's located.
  • Do Everything: MATLAB is a complete environment, and once you enter, you will never need to leave. It's got file browsers, a command prompt with command history, an integrated editor, integrated everything. You can dock everything together, so the things you want can stay where you want them. MATLAB has commands to interface with the system shell. All you need to do is type an exclamation point, and everything following it is passed to the shell. MATLAB comes bundled with Perl too, so if you need that, BAM! there it is. You can program MATLAB in C, C++, FORTRAN and Java, if you have legacy code lying around, or if you can't be bothered to learn M script. MATLAB does everything, so we don't need to worry about bringing together a whole collection of programs, or worrying if our multiple software tools are going to interoperate properly.
Now, I like MATLAB well enough, but there are a few issues that I have with it now. I've slowly developed a wishlist from my time using it. This isn't a complete list, just a few of the things that are on the top of my head right now.
  • Proper Object Oriented Features: MATLAB has object-oriented programming capabilities, but they are far from what most programmers would know as being "standard" practice. I would like to see MATLAB's object system be given a complete overhaul. Much of this could be done with simple source filtering, if modifications to the parser would be too difficult. Saying "x.field = 5" is much easier and more intuitive then having to say "x = set(x, 'field', 5)". This illustrates another point too: It would be nice if complex objects could be passed by reference instead of passing everything by value. A different calling syntax using the "." notation would help to make this difference explicit.
  • Namespacing: Even if it was optional, and even if most things were in the main namespace by default, I would still like to see a robust namespacing system implemented. This way, we could allow overloading of common function names like "size" or "length". Keeping most things global by default keeps the convenience factor high for most users, but allowing namespacing would be a handy extra bit of flexibility for more advanced users.
  • Threading: I know this is a common complaint, but I would love to see a multi-threaded version of MATLAB.
  • Code Embedding: This is a relatively minor wish, and it probably wouldn't affect too many people, but considering how MATLAB supports interfaces with several other programming languages, I would like to see some kind of ability to directly embed code written in other languages into MATLAB script files. Some sort of directive, like "IN_M", or "IN_FORTRAN" that would tell the interpreter to compile the following block before executing it, would be really handy. Having to write code into separate files, compile them individually, and then write M functions to interface with them seems like a lot of work considering MATLAB's level of integration.
I have been kicking around the idea for some time now of creating a MATLAB/Octave port to the Parrot VM. This whole wishlist of mine (except embedding FORTRAN, because there isn't a FORTRAN port to Parrot yet) could easily be implemented using that system. Maybe when I have some more time in the future, I'll work on implementing it. Until then, all I can do is dream.

Tuesday, February 26, 2008

Thesis Progress

I've been working like a mad man on my thesis for the last couple days. On friday, I handed in a first draft that was 40 pages long. Monday night I was up to 60 pages. This morning, I've hit 95. I was hoping to hit the 100-page milestone today, but I'm quickly running out of steam from my little marathon here. 100 pages is huge, and I'm dreading having to spend time proofreading and formatting it all.

100 pages seems like a huge amount, and it's certainly the longest paper I've ever written for school. However, When you consider that I've written over 230 pages in the [[Control Systems]] wikibook, and over 100 pages on several other books as well. However, those efforts were spread out over long periods of time: I've been working on [[Control Systems]] and [[Reverse Engineering]] and other books for years now. A little bit here, a few details there. Adding notes from classes as they come. To be fair, I could have been getting down to serious work on this thesis earlier then I did, and so I can't lament my current situation too much. I'm not even at the point yet where I am worried, I feel like I'm ahead of the schedule I have set for myself and, if I can keep up a brisk but comfortable pace, I will be fine.

Next week, the week before my spring break, I am planning to complete the first draft with some omitted results. During spring break, I plan to put most of the finishing touches on the software, including finishing the implementation of three processors, and writing short test programs for proof-of-concept. The project is going to be 100% finished by the end of March, and I can start worrying about all the administrative details in the beginning of April. "Administrative details", here, means: printing and binding copies of my thesis for the library and for my advisor, getting approval from my committee, scheduling my presentation, etc. It's going to be a lot of running around and paper work, but it shouldn't be overwhelming.

Monday, February 25, 2008

Lucky Charms

Lucky Charms has always been one of my favorite breakfast cereals. When I was younger, I created a little game, or a pattern that I would try to follow as I ate. The game has a few small rules, and is partially a game of chance:
  1. Every spoonful must have at least one marshmallow in it. It's just not Lucky Charms if you aren't eating marshmallows in every bite. Plus, they put in plenty of marshmallows, so this shouldn't be a problem.
  2. Every spoonful should have as many of those little grain pieces (you know, the stuff in Lucky Charms that isn't marshmallowy goodness) as possible. The goal is to end up with a bowl with just milk and 'mallows. At the end.
  3. Once all the little grain pieces are gone, the number of marshmallows left should be divisible by three. If it is, you win at breakfast! The easiest way to count this is to eat spoonfuls with three at a time until there are none left, or until there aren't enough left to form a complete 3-piece spoonful.
There are always difficulties, like what to do when one of the marshmallows (especially those brittle horseshoes) breaks in half? Do you count that as a whole marshmallow? I'm not interested in adding fractions in my head while I eat breakfast, to I tend to round down and treat the whole issue with integer arithmetic. I don't play this little game every time I eat Lucky Charms, but it always amazes me how something so small as cereal brings back these little memories from my childhood.

Thursday, February 21, 2008

Programming Fantasticism

A few code snippets from the lab reports this week that I would like to share. I won't even comment on them right now.

The first one:

if(key == '1')
value = 1;
else if(key == '2')
value = 2;
else if(key == '3')
value = 3;
else if(key == '4')
value = 4;
else if(key == '5')
value = 5;
else if(key == '6')
value = 6;
else if(key == '7')
value = 7;
else if(key == '8')
value = 8;
else if(key == '9')
value = 9;

The second one:

if(input == 'C') goto getnextvalue
else goto exit;
exit:
return 0;

And finally:

char inputs[7] = "+123456";
...
printf("%c%c%c%c%c%c%c\n", inputs[0], inputs[1],
inputs[2], inputs[3], inputs[4], inputs[5], inputs[6]);

Should give you a bit of an idea what I'm working with here.

Monday, February 18, 2008

Chess

You'd like to think that the more you did something, the better you would become. Software is a great example, where you would hope that the more experience a person has doing it, the better a programmer that person should be. However, unfortunately this isn't the case. Doing something a lot doesn't necessarily mean that your performance is improving over time, it could simply mean that you have fallen into a rut and are doing things in the same bad way until you finally get fired.

Playing chess is a lot like software, in that doing something a lot does not necessarily mean you are getting better at it. This is especially true in chess, because if you play poor opponents, you can never progress beyond their level. I play chess online sometimes, I find that it can be a fun and short diversion from an otherwise hectic work day. However, far too many of the games I play are against players who seem to play a lot, and continue in the same lousy patterns. Here's an example of a game opening that I have played literally dozens of times, against players to are reported as being ranked 1400 and higher:
  1. e4, c5
  2. Bc4, Nc3
  3. Qh5
I play the Sicilian every time I'm faced with 1.e4. I do this for several reasons: because I know that many really good players do it, that it's a solid opening with good theory behind it, and because if I focus my attentions on it, I can start to anticipate better move patterns from experience. Maybe this is a bad strategy, and I should be more diverse in my openings. However, I've made my decision on this matter, and am going to play it out.

The move pattern above is a common amateur opening. By positioning the queen and the bishop just-so, the opponent hopes I stumble into a mate on move 4. Surprise! I beat you using an old trick! I begin to wonder sometimes whether people who are rated 1400 or higher have reached that rating just because they beat so many careless opponents using this simple trick. I reply, by necessity, with: 3. ..., g6 (3. ..., e6 never seems to do me any favors), which is typically followed by 4. Qxc5. Now, I'm down a pawn, but my opponent has brought out his queen far too early and is going to have to dance her around the board avoiding my attacks as I develop at my leisure.

It's hard to remember how many games have started like this, because I typically don't keep count. However, I will tell you that I win the majority of these games.

In chess, every game that you play--win, lose, or draw--should teach you something. Likewise, every software project, whether it's a success or a failure, should be a learning experience. You should always ask yourself, "What did I do wrong last time?", and avoid those things. Then ask yourself "What did I do right last time", and try to repeat those. Finally, ask "What can I learn overall?" and use that information to improve yourself. Writing bad software for 10 years is never going to make you into a good programmer, in the same way that playing bad opponents is never going to make me a great chess player. Being confined to chess mediocrity isn't so bad, however, since I only play about 5 minutes each day, don't get paid for it, and never have to do it in public.

Thursday, February 14, 2008

First Patch

Follow up to my post about my first patch to Parrot: 25684.

CSS

No, not Cascading Style Sheets, "Computer Services & Solutions" is the name of the company that's been fixing geoff's laptop, and they're doing a hell of a job. The place was a little hard to find, and the inside of the building is a little skeezy, but I'm glad that they are doing the work on the laptop (and i'm double glad that I'm not monkeying through it myself here at home). Total cost is going to be about 185$. That covers labor costs, a new hard drive, and software installation. Plus, according to their expert diagnosis, I didn't screw anything up royally with my little soldering expedition. Maybe they just left that part out because they're so sweet and it's Valentine's Day today.

The problem, as it turns out, is not the known DC power supply bug that's so common with that laptop model. This is good, because repairing the DC power supply problem involves replacing the entire motherboard: a 500$ repair.

The problem was that the software on the drive was corrupt. The computer shut down during reboot, not because of a power problem, but because of corrupted software in the boot sequence. This, in and of itself, is not a big deal, because the software can be reinstalled. I really should have diagnosed this problem myself, but because I knew about the common DC power problem, and because our symptoms mimicked those so well, I didn't take the time to try and diagnose any further. However, the point is moot: even if I had diagnosed the problem it wouldn't have mattered. When the guys at CSS tried to reformat the drive, it died completely. Even if I had diagnosed it properly, we would still be in the market for a new harddrive, and the laptop would likely be up at school now with geoff where I couldn't get to it. So, in short, it's good that it died while it was in for service.

I'm going in to the city tomorrow, probably to pick up the computer. I'm very happy with the service in this place, so next time I have a computer problem (they service both IBM and Toshiba!), I'm going to them first.

Wednesday, February 13, 2008

Languages and Wikimedia

I got called a "dick" the other day on the foundation-l mailing list. Of course, it was framed in the favorite "Don't be a dick" way, as if linking to the Wikipedia policy somehow made the insult not an insult. Insinuating that a person should not be a dick is really analogous to saying that they currently are one. It's a little bit less direct, so that people can say "Don't be a dick" to somebody, without having to worry about angry retaliation. Don't get angry about it, it's just a Wikipedia policy after all.

The topic we were discussing at the time was languages. The question, specifically, was whether or not it should be a goal of the foundation, albeit a secondary one, to support and preserve small, dieing, and extinct languages? The thread did diverge a little bit to include topics from other language-related threads. I have a few thoughts on this, which I'll try to canonize here:
  1. We can do one thing well, or we can do many things poorly. If we lose focus of our current goals, and start to pursue all sorts of other aims, we are going to fail on all fronts. Preserving languages should be a secondary effect, at best, in the pursuit of our primary goals. Languages which can satisfy the viability and localization requirements are not likely to be effected in any measurable way by the existance of a Wikimedia project anyway.
  2. Saying that creating a new project doesnt cost much money to operate and maintain is not the same as saying that the project will be viable in the long term, or saying that there is significant potential benefit in having the project. One fewer reason why we shouldn't is not one more reason why we should.
  3. The localization effort of a particular language is not really a good barometer to determine the viability of a project. Localization only measures the size and motivation of the population of speakers who are bilingual in english and the language in question. With over 1500 system messages to translate, providing a complete localization is a highly daunting tasks that many of our volunteers might simply not be interested in performing.
  4. Conlangs, with precious few exceptions, shouldn't be given their own projects. I won't expand on this point too much here, because I might say too much, and never get back to my point.
  5. The incubator should be used to greater effect. There should be a simple and easy process to move projects from the incubator, and to move projects back to it when they need help. The incubator is used for this purpose, but I'm not under the impression that it's easy enough to do, or that it is utilized properly. Plus, there are a few projects that I can think about that really need to be moved there, because they were created before the incubator existed and never got off the ground.
I get motivated, in part, because so many non-viable projects have slipped in under the radar in the past. I'm still a little miffed about the Simple.Wikibooks project, which hasn't shown any signs of growth, activity, or progress since the discussion to merge with en.wikibooks was ended. Of the editors who were most outspoken against the merger, not one of them have made any edits whatsoever on simple.wikibooks since the discussion ended in November. Of course, this is a topic for a different blog post, so I won't dwell on it any further here.

Tuesday, February 12, 2008

Yay! I'm being helpful!

Well, I would say that I have satisfactorily figured out SVN, and have been using it to great effect. Tonight, I created and submitted my first patches! I'm officially a (minorly) productive member of the open source movement!

I submitted a few small patches to the parrot project. 1 or two were documentation, the rest were simple patches for unresolved bugs. It took a while to figure out the patch submission proceedure (and I think I really borked the first few submissions), but I'm starting to get the hang of it now. Yay, I'm learning!

Tonight is a bit of a rare occasion, I can't afford to spend much of my time on any non-school-related pursuit, at least not until the end of this week. This really is hell week, and I've been working all day and all night just trying to get the necessities covered. After working almost all day today, I really needed to kick back and relax (and it turns out I relax by programming more).

I just saw that one of my patches got committed. It was only a small one, but that's a milestone nonetheless. This has been a very fruitful night, and I'm glad I took a break from my schoolwork for it.

Teaching Assistant Finances

I've decided recently that being a TA is really a lousy decision as far as personal finances are concerned. There is the old caricature of the "poor graduate student", but somehow that caricature is slightly less funny now that I'm living the part. Temple graduate students, I'm told, have it decently well-off compared to students in other colleges, because we're unionized and have negotiated better rates. "better", of course, is relative.

I make a little over $16K per year, divided into two semesters. I'm paid monthly, 9 months a year. That's 9 paychecks with an after-tax net of 1,600$, give or take. Included in that deal, however, I get free* tuition and free health insurance.

I put an asterisk besides "free tuition" above, because Temple covers my tuition, but not included in the tuition price are a number of auxiliary fees that I must pay myself, out of pocket. These fees amount to approximately 550$ per semester, due before I've even received my second paycheck. Failure to pay these fees on time results in a 50$ late fee. Add in an estimated 200$ per semester in textbooks (I really need to convince more professors to use Wikibooks instead, if for no other reason then because of my finances), and we're up to 750$ out of my pocket at the very beginning of the semester. That's about half of my first paycheck that goes directly back to the friendly folks at Temple. I won't even mention how many times a month the Temple Alumni Association calls looking for a donation, or the fact that I need to pay another 35$ fee just to graduate.

What's funny about the financial situation is that if I don't pay the fees in a timely manner, I can be unregistered from my classes. If I'm not in good educational standing, that is, if I am not enrolled for a satisfactory number of credits and am not making "progress" towards my degree, I can be fired from being a TA. In a round-about way, I can be fired from my job because my job doesn't pay enough. This, of course, would leave me with no income.

Since I live so far away, I have to take the train into the city. This costs between 10-12 dollars per day, depending on the time of day, and what mood the ticket seller is in. To my knowledge, there are no student discounts available. If I only go in to campus three times a week, that's about 35$ I pay, plus 5$ per day for lunch is 50$ per week, 200$ per month. Counting these expenses up, plus my fees and books, I have to pay approximately 3,300$ per year, or 20% of my yearly pay just to keep my job. Not factored into this are the cost of car, car insurance, and gas that I need to get to and from the train station every day.

The cost of tuition, if you are taking 3 classes per semester, is about 5000$ per semester. Including this amount into my salary as a type of "bonus", I'm making the equivalent of $25K per year. The primary benefit to this situation, of course, is that I am able to take three classes per semester, which I likely wouldn't be able to do if I had a full-time job. This means fewer semesters at school and a faster graduation. For what it's worth, i've done my time and I'm not going to be a TA anymore after this semester. It's just not worth it, and after I've gotten by MS there simply won't be any way to justify doing it anymore.

Monday, February 11, 2008

The Pirate Bay

I was working on a homework assignment for my communication's class today that was a total pain. The task was to simulate a highly-contrived form of duobinary signaling (that wikipedia article is very short and highly inaccurate, and if this weren't the week from hell I would already have updated it). Frustrated because my output signals weren't correlating, and I couldn't find an algorithm to decode it, I went off to google reader to read some news stories.

Today being like any other ordinary day, there was a story about thepiratebay.org, and the mountains of legal problems that group find themselves in. For those who don't know (as if anybody in the world doesnt), The Pirate Bay is a group based out of Sweden, that helps to distribute copyrighted materials. I say "helps" here for a very important reason, which I will discuss later. To preface this discussion, I feel it prudent to mention that I am not a file pirate. I do not and have never used thepiratebay.org to obtain any files, much less illegal ones. I do not download, illegally or legally, copyrighted videos or music files.

I went to The Pirate Bay to see what it was all about. Here is what I have learned:
  1. They are based in Sweden, so US or UK copyright laws do not apply to them.
  2. Sweden, apparently, has a relatively relaxed attitude towards file sharing, as The Pirate Bay apparently is not in violation of any Swedish laws.
  3. thepiratebay.org does not itself host or distribute any files. This part is key. The website is a very large bittorrent tracker that members may use to distribute files. In other words, thepiratebay.org isn't hosting and sharing illegal files, they are simply giving easy access to other individuals who are sharing and hosting those files.
Now, I'm a big fan of Bittorrent, at least when it is used legally and legitimately. It's an altruism protocol, in that helping other people save some bandwidth is built into the system. When you use Bittorrent, you are helping other people, and you don't have to do a thing. It's this kind of stuff that people really get behind, because people generally like to do nice things for other people, so long as they don't have to go to any special effort to do it. It's akin to "Whenever you buy this product that you buy anyway, for the same price that it's always been, we're going to donate some profit to charity!". It's a round-about way of saying "Do what you do normally, and we'll do something nice on your behalf". Altruism without having to lift a finger, who doesn't love that?

Bittorrent is just as simple: Download that file you were going to download anyway, and in the background the bittorrent program will use your bandwidth to upload that same file to other users. Thus, all the users contribute a little bit of bandwidth, and the main server can save itself some strain. It's sort of like contributing bandwidth, it's sort of like hosting a mirror, and you don't have to do anything special besides click "download". For things like large programs, torrenting is really ideal: Linux distros, large software distros, and other large downloads are really ideally suited to torrenting. The community is willing to help mitigate your server bandwidth, so long as they don't have to do anything special. If you build altruism into the system, people will use it and will be happy about it.

I read a few of the pages on thepiratebay.org, but I didn't even look at any of the available torrents (tempt me not ye devils!). The About page was very informative, and I like the fact that they have a strict policy concerning filenames. How many times have I wished that files were named more accurately and descriptively from legitimate download sites! I went to their page with various "Legal Threats" they've received, and their responses to such threats. I thought that most of the responses were short, dissatisfying, and immature. However, I also thought that many of the threat emails were poor too. You should have a serious talk with your legal team if they are sending DMCA take-down notices to a Swedish company.

On a side note, I've just scheduled my presentation here at Temple. I have a room reserved at 12:40-1:30 for March 5th.

Saturday, February 9, 2008

This week

A lot of things need to be done this week, so I'm going to be pretty busy. Here's a quick run-down:
  1. Homework: Not a lot of it, but I have some work that needs to be done by wednesday for my communications class. We talked a little bit about duobinary signalling and line codes, things that aren't too hard to simulate.
  2. Grading: The first batch of lab reports are in, and I need to go over them with a fine-toothed comb. Also, I want to write up some solutions for the second lab, because a lot of students had trouble with it. I'll probably write more about this later.
  3. Graduation: I need to apply for graduation this week, if I want to graduate in May. I do want to graduate in may. Applications are due on the 15th.
  4. WritersUA Slides: They're mostly finished, but I have a little bit more work to do before I have to send them in on Friday. I also want to do a dry run of the presentation, to make sure that the information flows, and that I am not omitting anything.
  5. Wikimedia Chapters: I have to draft up some proposals, or at least help draft them, concerning the role of chapters in the USA. Also, Wikimedia Canada is having another meeting on Wednesday that i'm going to attend. I'm supposed to review their bylaws beforehand, but I haven't seen a final copy of them yet.
  6. Thesis: It's the elephant in the room, but I'm making regular progress, and need to keep up my motivation. A lot of finishing touches need to be completed now. I also need to start full-scale system testing eventually.
I'll be sure to post updates about all of these as the week progresses

Thursday, February 7, 2008

Programming Lab

I'm teaching an embedded systems lab this semester, to senior and junior EE students. The lab covers C programming on embedded i386 hardware, and Verilog design on small FPGA boards. Programming is what I do. It's what I like to do, and it's something that I feel I've grown pretty good at over time. In the department I'm pretty well known as the "programming guy", and most people would think that I would relish the chance to teach what I love to my students. In reality, this course is shaping up to be the most depressing I've ever taught.

It's depressing to me to see how little my students know about computer programming, what their attitudes are towards it, and how poorly they perform on even simple tasks. Here's some background about our program. The EE department is broken down into two specialties: the "regular" EEs who have a smattering of programming background (1 low-level introduction to C "for non-majors", 1 class on microprocessors with some x86 assembly, and 1 class in digital logic with some verilog) and students taking the "computer option" who have it slightly better (The same classes as the "regular" group, and two additional classes in Java). Some students have also taken a course in MATLAB programming, although it's optional.

It's my experience that the "computer option" students do better when it comes to problem-solving, because they have experience in data structures and algorithms, and they've also taken classes that were devoted to programming. I also know that the CS department, which hosts the java courses, does a good job of instilling proper code formatting and some basic best practices. However, as has been said in other forums before, java programmers lack any kind of knowledge about basic constructs like pointers, strings ("what's null-terminated mean?"), binary operators & | and ^ ("Doesn't ^ mean exponent?"), basic console I/O, etc. I can always tell a java programmer in my class when they have well-formatted code, but a very convoluted algorithm that goes out of it's way to avoid low-level constructs. One student wrote:

printf("%c", &myChar);

He didn't know what the problem was. I asked him why he used the ampersand in front of "myChar", to which he replied "I don't know, don't you do that kind of stuff in C?". Yes, occasionally we do "that kind of stuff", but we don't do it everywhere.

The alternative are the "regular" EEs, who have only a basic introduction to C and x86 assembly, and write code that looks terrible, is filled with "goto" statements, and never use subroutines or loops. It's like they are programming in assembly, in C. These students have a slightly better conceptual understanding of pointers, but still can't use them properly in their code. "How do I pass an array to a function?", I was asked. "By reference", I replied automatically. "What does that mean?".

In a class of 14 students, I would guess that only two or three have any understanding of the fact that C code is converted into machine code, or that C code can be translated--by hand if needed--into equivalent assembly-language code. One student asked if he could just write the assignment in Java; I told him that he could if he could find the VM on our little embedded computer. He didn't know what a VM was.

It's depressing to me because many of these students are going to put "C Programming" on their resumes, and next time I apply for a job i'm going to get an email back saying "Sorry kid, the last engineer we hired from your school was dismally incompetent, we're not even going to give you an interview". Of course, nobody would ever send an email like that out, most people never send back a reply at all.

Wednesday, February 6, 2008

Work, Work, Work

Spent some time today working on my homework for communication's class. It took longer then expected because I was getting a strange error in my system that I was having difficulty explaining. The simulation in question involved a unipolar pulse train, passed through a band-limited lowpass channel. The problem came from the fact that I used a regular square wave for the input signal and not a PN sequence as I likely should have. For a narrow-enough band, all frequency components were filtered out, and I was left only with a steady state DC value. Needless to say, my simulation always had exactly 50% error, because the received signal was a constant. I spent some time helping one of my classmates with the assignment as well. This is my fifth semester of communications, but this poor girl is having a very rude introduction to it.

I spent some time working on my slides for Portland. They are due by 15 February. They are mostly done, and when I am finished I am going to convert them to a suitable format (PDF or ODP) and post them online. I didn't work on them too much today, but I spent a lot of time last night working on it, and am mostly done with them. I need to practice my presentation once or twice to make sure that all the information is being presented in a logical order, and that I am not omitting anything important. I'm going to sign up to give the presentation here at temple some time, probably in the beginning of march (3-4 weeks). That should make a great trial run of it, so I dont make a fool of myself 3000 miles from home.

Didn't get a lot of work done on my thesis today like I wanted, but I am going to try and get some work knocked out later tonight. Much of my remaining work involves writing some verilog modules to handle tasks that the system generator is not capable of. An ALU is pretty worthless if it can't set any flags. Once I get the verilog modules set up to finish these tasks, I need to go back over some of my older notes and make sure that all my control signals are set up correctly. I still don't have a concrete way to populate the instruction memory yet, but I'm not worried about details like that.

I received an email about the SMART fellowship today. The deadline has passed for applications and application materials, and now the decision process begins. "All submitted applicants will be notified of their award status" by March 31st, so I should know by then that I didn't get it.

Monday, February 4, 2008

LALR Parser Generator for Parrot

I've been kicking around the idea since last night about trying to implement an alternative grammar generator scheme for Parrot. The current implementation is based on a Recursive Descent parser, very similar to Parse::RecDescent (which is to be expected since they are both written by the same developer, Damian Conway). Recursive Descent here is an LL(0) technique, at least I assume so because I haven't looked deeply at how lookahead is implemented. LL grammars, with the exception of predictive parsers utilize "Backtracking" to try certain productions and return to the last good parse position if a particular production fails. Backtracking, as I know from experience, can be very costly especially in certain grammars. On the other hand, LALR parsers which are LR(1) are bottom-up, so they don't require backtracking and can be more efficient then LL parsers in many situations.

I would like to try my hand, in the coming months, at writing an LALR parser generator utility for Parrot, that would operate similarly (and possibly even plug-in seamlessly) with the current compiler generator tools. Maybe the two could be differentiated by some kind of argument or pragma. This will be, I think, good practice for me, and a good way to get my hands dirty in the Parrot project.

Sunday, February 3, 2008

Microsoft Visual C++ Express Edition

I finally broke down and decided to install a "real" C/C++ compiler to my work laptop. I had an old version of Borland C++ (4.52) that I use to teach my students about embedded software development, but I would hardly say that compiler is enough to suit my modern needs.

I searched for "Microsoft C Compiler cl.exe Download", sorted through a million or so results, and found a link on MSDN for "Windows Server 2003 Platform SDK R2". Last time I downloaded the platform SDK, it was exactly what I wanted, and though that was several years ago, I figured that a package with the same name would be the same product. I was wrong. I tried to do the "web-install", but that didn't work. The small installer program would open, initialize for a few moments, and then die with the error "This program does not appear to be a valid Microsoft Windows Installer." It told me to verify the download and try again. So I did, I re-downloaded and tried to run the web installer three more times, all with the same error. So I switched strategy, and went for the "Full Download" install, which required downloading several hundred megabytes of CAB files, unpacking them to reveal another set of CAB files and then a setup program to install the software. After several minutes of install, I come to find out that this isn't what I wanted. The only C compiler in that package was the 64-bit variant. So, I deleted this package and started over.

Second time through, I found the right install: "Microsoft Visual C++ SDK Express Edition". So I download the installer, tried to run it and... Error. "Could not download .NET Framework 3.5. Please exit the installer and try again". In the installer, you have the option to install Microsoft's Silverlight SDK along with the Visual C++ SDK. I choose to not install the Silverlight SDK because I simply don't need or want it. The second time, I again de-selected this option, and again the install failed with the same message. Having my suspicions (and knowing enough to know that Microsoft likes to bundle software you don't want in with the software you do want) I decided to try the install again, this time choosing to install Silverlight as well. Surprise! it works this time, and the ".NET Framework 3.5" was able to download sucessfully now that the system knows i'm also installing silverlight.

This whole process has taken up just over an hour of my evening, and while that might not seem to be too much time, it's still just another annoying interaction with Microsoft.

Everybody has a cause

Everybody has their own cause, that's something I've been saying for a while now. People, in general, are willing to volunteer their time and their energy to specific causes. This is a lesson that people learn quickly on Wikibooks, because even though people are all ostensibly there to help write books, our volunteers will tackle that goal very differently. Some people write, some people edit, some organize, some protect against vandals, and some people do other tasks entirely. While it's tempting to say that having all these different jobs available reduces focus and causes unnecessary divisions in productivity, that's just not the case. If all our books were perfectly organized, the people who focus on organization would not switch over to become authors or editors. Put simply: if we had no need for organizers, they would likely all leave Wikibooks. People come to Wikibooks because they can perform the specific tasks that they are the most interested in performing. People leave when those tasks are available to be done.

I have a few personal problems that really prevent me from getting too involved in a project like Perl6, or MediaWiki, or any of the other cool open-source projects that I've grown interested in. The first, of course, is that I just don't have a lot of time to spare for these projects, so it's hard to justify getting involved in a half-assed kind of way. Once I have time, I plan to be spending more at Wikibooks anyway, so it probably won't free me up to do more coding work. Second, It's hard to jump into the middle of a big project. There is simply too much code to read through in projects like MediaWiki, Perl6, Parrot, Octave, or other similarly-sized projects. Many of these don't have accurate and prioritized lists of things that need to be done anyway, so in addition to familiarizing myself with the enormous code bases, I have to try and deduce the kinds of things that are considered "bugs" and the places where desired features are missing. I'd be willing to write documentation for projects like these, but I figure that if I'm going to be writing large amounts of documentation on these subjects, I may as well just cut to the chase and write a wikibook about it.

I would like to write books about Parrot, Perl6, and MediaWiki, and once I have more time I will likely try to get into projects like these. I am still interested in getting into Perl6/Parrot eventually, but it just isn't feasible until my thesis gets complete.

Friday, February 1, 2008

Textbook Season

Regardless of all my work on Wikibooks, we still aren't at a point yet where when the semester starts I can expect to be downloading the required textbooks for free. However, despite the ridiculous price of modern textbooks, I'm still always a little bit happy when textbook season rolls around. I get a lot of my purchases through Amazon, so I do save some money off the sticker price, and that always helps the situation. It certainly beats giving more of my hard-earned money to Temple.

I'm taking a communications-heavy semester (relatively speaking), with both my classes being based in that subject. "Analog and Digital Communications" and "Communications Networks" are likely to have significant overlap in many areas. The latter course is focusing more heavily on particular implementation technologies (WiFi, WiMax, 3G, etc) while the former is going to be more theoretical. I expect to spend a lot more of my life sitting in front of computers running endless numbers of simulations.