Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Saturday, November 22, 2014

The MOOC and Me: Destroyer of Time


I have been remiss in posting to the blog, and much else besides, thanks to the latest homework assignment from my on-line programming course.

The last problem set was relatively easy and a great deal of fun: designing a financial services web page. This set, building a shuttle bus "game" is making me crazy. I just know the solution is much, much simpler than I am able to come up with and my Rube Goldberg construction is an ugly mess. And doesn't work. Right now, it insists on picking up only the passenger at the alphabetical end of the list of possible passengers. Which, admittedly, is an improvement on refusing to pick up anyone at all.

The problem is, the course deadline is the end of the year, and includes a final project which I haven't even begun to seriously think about, and I've already skipped over one problem set that was taking way too long and throwing the schedule into impossibility. The syllabus is not clear on the consequences if I can't submit at least a partial final project in time. I have no idea how the kids manage to do this in a 12 week course (with other classes!). I'd be living in the TA's office.

My consolation is that this is my favorite time of the year for food so when I start to get all cross-eyed at the screen I can just sit back with a large mug of tea, a plate of crackers with a wedge of brie and a pear and another plate of dried figs, dates, pistachios and a section of pomegranate. In a previous incarnation or two I was either French or Persian (or both).

The weather has been cold enough lately that the cats have discovered I can provide other services beyond provisioner of food and water and have started climbing into bed with me to absorb the warmth which is fine except that it's impossible to turn over with a cat wedged behind one's knees.

I just bought four pounds of butter and a new jar of cinnamon. Baking time! One batch of chocolate chip cookies is done. Oatmeal raisin is next on the list and, by then, we'll be well into Thanksgiving week cooking.

Thursday, May 29, 2014

The MOOC and Me: Validation


I received my certificate from the Catholic University of Louvain for "successfully" completing the course Paradigms of Computer Programming.

"Successfully" is in quotes because it turned out I was in over my head and, while I did learn a great deal on the philosophical/abstract side, the practical work was mostly beyond my current skill level and the certificate represents what we used to call, back when college was for wastrel scions (aka "Legacies") who needed a little polishing before entering the family business, a "Gentleman's C."* It certainly doesn't qualify me to do anything other than, maybe, discuss tail-recursion and nod knowingly when others speak of explicit state, data abstraction and object oriented programming.

I downloaded everything I could from the course, mostly lectures and slides and such which I can now review at my leisure, but the problem sets, which were where I fell down, could not be saved.

In the meantime, I can now get back to the Harvard CS50 Introduction to Programing course which I had to suspend because Louvain had a tight deadline for completion. (Turns out it was too tight and they had to extend it by two weeks or risk losing a number of students but I still couldn't do both at the same time. Also didn't help that my laptop crashed right at the deadline for completing the final exam.) CS50 is geared much more to someone of my noobiness and is practically open-ended requiring only that I complete it by the end of the year. Plus the upcoming problem sets look to be much more fun, and less academically mathematical, than the Louvain ones.

Of course, none of the above is hinted at in the Louvain certificate, which will look good on the wall.

*The concept is not entirely obsolete. Cf: W at Yale.

Thursday, May 15, 2014

A Man's Got To Know His Limitations


My laptop seized up a few days ago and I could not figure out how to unfreeze it. It went into hibernation mode for some reason, although the battery was not run down. I dozed off while holding it on my lap and apparently randomly passed my hand(s) over just the right key combinations to make it go catatonic.

I tried fixing it myself, Googling "laptop frozen keyboard." It's dismaying how many sites there are and how full and active they seem to be. I tried the various recommended key combinations, pressing the power button for extended time, with and without the power cord, etc. All to no avail. The consensus seemed to be either a bad keyboard or a bad hard drive and suggested pulling the battery to reset the machine. I got as far as pulling the back off before chickening out when I realized I didn't see any obvious way to reconnect the keyboard and screen cables I'd have to detach to have room to access the battery.

Yesterday, I took it to a local computer repair shop. If you totalled the ages of all the employees there they might equal mine. Fortunately, the young gentleman who repaired my machine in 30 seconds with three keystrokes also had excellent social and diplomatic skills and did not make me feel any more stupid or incompetent than I did (or am) already.

Today I brought them my ancient desktop PC for them to transfer files which I can no longer access because the CRT monitor had blown up. (And the operating system is too ancient to sync up without some intermediate steps.)

Also, the keyboard on the laptop still (again) didn't work (but only not within Windows) which I was pretty, but not entirely, sure wasn't my fault this time. For once, I was right. When he disabled the hibernate function yesterday, my repair guy accidentally disabled the keyboard as well. A couple more keystrokes and everything is back to normal. They even showed me what they did so as to ensure I never touch that part of the OS again.

Now I'm waiting to hear back from them about the transferred files. The whole episode should cost me $35.

For anyone reading this who happens to be in the neighborhood: PC Support Group. I recommend them.

Tuesday, February 4, 2014

The MOOC and Me : It Lives!


I may be able to do this after all!

I just completed the second problem of the second week's set of two. That's Week One for those keeping score. The first week was Week Zero. It's a twelve week course ending with Week Twelve. There is no eleven. Harvard math. It's a self-paced course, however, so it's all cool as long as I finish before the end of the year.

The first problem was Build a Pyramid and, although I knew what I wanted to do and thought I knew how, I didn't, and it frustrated me for weeks until I finally broke it into little components that I could test individually. Can I make it print the hash marks? Yes. Can I make it print the spaces? Yes. Can I control the number of each per line? Yes. Can I control the number of lines printed? Yes. (I say, "Yes," now but the answer was frequently, "No," while I was struggling along.) Finally, it all clicked.

I used that same technique on the second problem "Counting Out Change." First, I tested the request for user input. Then I tested each variable independently and together. The new skill was casting a floating point obtained from the user into an integer to count down the change owed. Once that worked, I built and tested a single while loop to count down the money owed and count up the coins given out. Since this project only took a couple of days, I'd say that's a system that works for me.

I realize these are itty bitty baby steps but, although I've been around computers for a long time*, use them daily and understand the theory, programming has never worked for me before. Now, maybe it will. If nothing else, at least my confidence level is growing. My coin counting solution is clunky and repetitive. We've just discussed modulus and now I think I know how to make a new, more streamlined version using that.

The next set of problems involves cryptography.

*My first serious exposure came while I was in college. During the summers I worked in a printing plant in New Haven and one year we were all sworn to secrecy (as in Ultra-Top-Secret-if-one-unauthorized-page-leaves-this-building-getting-fired-will-be-the-least-of-your-worries secret) when the company got the contract to print the in-house manual for IBM's brand new operating system: COBOL. I'm old.


Saturday, January 25, 2014

The MOOC and Me: Building From Scratch


I'd like to think I'm making progress.

I've watched three weeks worth of lectures so far. Weeks 0, 1 and 2. For some reason it's a 12 week course going from week 0 to week 12 with no week 11. Apparently, Harvard math. There's a project assigned at the end of each week but, since the deadline for completing them all is the end of the year, I'm taking my time to ensure I understand what I'm (supposed to be) doing. One of the problems I've run into is that the Harvard students get more information on campus that is not made explicit in the videos. I found out about a whole on-line file of downloadable study aids including slides and notes and such only because it happened to be mentioned in passing in one of theWeek 2 (i.e., third week) lectures (Not, "Be sure to check out . . ." but, "Oh, yeah, that's addressed in the study guide."). I've gone back over the beginnings and become aware of a few other assumptions that are not obvious to non-resident students (i.e., references to things in lectures 5 and 6 that were never covered in the previous lectures).

The first week's project requires building something--anything--using a visual training language called "Scratch" which was developed by MIT and uses colored puzzle pieces to assemble a program. Since only certain pieces can fit into others it kind of limits the damage one can do. I've built the basics of an adorably stupid little "game" involving a parrot and a polar bear. Periodically, the parrot flies across the screen left to right. If it gets to the other side a palm tree grows on the spot. As the number of palm trees grows they begin to fill in the space forcing the polar bear to shift away. The polar bear can stop the destruction of his habitat by leaping up and hitting the parrot causing the bird to go back and start over. So far so good/inane.

The problems are these:

1) The characters are sprites from a library. Some of them have multiple images, called costumes, that can be used to simulate motion but the polar bear's costumes merely make him blink. There is another bear in the library composed of multiple parts that I could manipulate to create more costumes and make it not only jump but reach up to hit the bird, but it's an ugly bear. And the parts are extremely difficult to manipulate. And even then don't do exactly what I want.

2) When the bear hits the bird right now, it just goes back to the edge of the screen and starts over. I want it to fall to the ground so I can introduce a third character, a cat which will run across the screen, pick up the bird, announce the number of points it is worth and carry it off before the next parrot starts. Just because. I can get the bird to fall down O.K. when the bear hits it but the next parrot merely starts at the usual place and flies straight down.

3) I really want the parrot to speed up as the "game" progresses but, so far at least and with the puzzle pieces I can find available, I don't see how to do that. I can manually change the variable for speed but I don't seem to be able to make it change itself while the program is running. Within the structure of the puzzle pieces I don't see how to make Speed = Speed + 1.

But, at least I'm having fun. And maybe learning something. Next week's problem set requires some actual coding in C.