Archive for the ‘School’ Category.

Klippa og klistra

The heading means cut and paste.  Here is another one from the old school days.  One of my best teachers Freyr Þórarinsson told us once that we should cut and paste as much as possible.  From all available sources.  We were just awestruck, we never heard anything like that.  Just cheat, that’s what he means cheating ?  He’s the teacher, how is that possible.  Of course he didn’t mean cheating, what he meant was to use all available sources.  Borrow code give code etc, it’s a common practice today but was less obvious to us then.  As it happened we had created a hang out group at school and needed a name.  Once we grasped the concept of course we ran with “Klippa og klistra”.

Today’s developer spends a lot of time online getting / giving code snippets that can be used to address the normal day to day problems.   Don’t believe me, try StackOverflow, look at how it constantly updates.  If you want to restrict developers productivity yank the internet wire from the devs computer.  Next take away the books on the bookshelf.

The same teacher allowed us to use everything we wanted for our Pascal exam.  It was simple, duplicate an application that he wrote, you had 4 hrs to do the job.  Use whatever resources available to you, can you say cut and paste ?   As it was Dos based Pascal program there was not much that the teacher could change from one program to the other.  We had access to former programs they were something along the lines of.  Create attendance program, needs to hold a list of people for the class, you have one screen to put in the students.  You have another to mark them present or absent another to graph the attendance etc.  The sub screens were always prompted for from the main menu / screen.

1. Create student.

2. Attendance

3. View attendance

4. Graph


8. Quit


F1 for help

Simple enough, so I wrote a program that would generate the code for the main menu and the stubs for the sub screens.  At the start of the exam I ran the generator, it would just ask for the headlines.  After that it would spit out the code for the main screen and the stubs for the sub screens with complete F1 help option.  Load into Pascal and compile.  In about 2-3 minutes I had the main screen working and was able to start filling in the stubs that represented each sub screen.  The generator code was available and in full view on my network drive.  I did not get any kind of warning or downgrade on my score as you could use whatever resources you wanted, the teacher was true to his words.

The said teacher would challenge us to think outside of the box.  On the memorable list recursive and The Towers of Hanoi, Quine ( self-reproducing program ) here in Pascal or just plain C.

Your doomed, your all doomed !

At the university we had C++ class although we were in the lab the teacher would lecture good amount of the time.   Then he let us on the computers.  For some reason we didn’t care too much for this particular teacher and sometimes he was hard to follow.  We started playing Doom on the computers while he lectured.  Your computer screen would be off as he moved slowly your way in the room as he liked to walk around talking.  As soon as he turned his back your computer screen would turn back on, full of Doom action.  This one time the teacher was close so I was paying attention.  Make no mistake one of the guys in the class shouted out “You killed me you bastard!”  Needless to say as the teacher was really close he saw right away what was going on.  Somehow my computer quickly turned off at this point.  Now the lecture changed into something else than just C++ and algorithms from Bjarne Stroustrup there was some shouting and cursing too.  That of course was the last time we played Doom in the lab, unless it was after hours.

RPG is back

I had the pleasure of doing a code review of some RPG code for the AS400 the other day.  That one took me way back in time, I hadn’t seen RPG code since school.  And forgotten most of it, I go looking for some good RPG source, from google to my surprise IBM here in Boulder is the one that came up.

For those who are totally in the dark, here is a sample snippet from a random source.

C                   CLRYY      IFEQ REPYY
C                   CLRMM    COMP REPMM                     11
C   11            CLRMM    COMP FROMM                    12
C   11 12       CLRDD     SUB  REPDD     HOLD
C   11 12       HOLD       COMP 3                         1313
C   11 12 13                  ADD  1            LTFIVE
C                                   END

Nice uh ?  We actually did a final project one semester at school in RPG on the IBM donated AS400.  The AS400 filled a small room downstairs.  That’s how we learned to fight for CPU cycles.  The AS400 was pretty old and slow and the compile queue seemed even longer.  At one time the different groups got into a compile war as groups would pause the job of another while they didn’t pay attention.  Of course that blew up with some shouting and cursing and ended with the teacher putting  a ban on it.  Mind you at the end of the project the wait for your compile was about 30 minutes.  It’s the least stressful project I have been on so far.  The project it self was something about accounting for barrels of Herring for an Icelandic fishing company.