Archive for September 2008

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

etc,

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.

Old java project, part I

I spent a few hours on the weekend dusting off an old VoiceXML API project.  It was written in Java, according to the file stamps I haven’t touched it since 2001.  I believe we ran under java 1.2 or 1.3 at the time.  I’m interested to know if it will work under 1.5.  Which is the one I have installed.   The project is java server based, loaded Tomcat to see what happens.  As expected nothing works on first try, Error: 500 – Internal Servlet Error. Hmm, not much help from the stack trace javax.servlet.ServletException: qIVR Error. The internal qIVR System Loader has failed. Then I look at the Tomcat trace, that’s better.

***
qIVR Error. License check failed.
qIVR version 1.4.4
***qIVR Error. Configuration error. The Network address specified in the License file does not match the current environment. Please check the qIVR configuration, and/or contact qIVR support.
***

Except I forgot how to generate a license…  Neither did I remember that I had an old copy of the website running on the Tomcat server, sure enough we used to allow users to generate their own evaluation license.

Now with license in hand, let’s see what happens.  Sure enough it works this time around, nice.

RingServlet:  qIVR will use this logfile: qivr.log
RingServlet:  qIVR has detected a new request for application: HelloWorld and Voice network: Tellme
RingServlet:  qIVR will use this base URL: /qivr/
com.qivr.sample.HelloWorld@18f1d7e Start tracing
com.qivr.sample.HelloWorld@18f1d7e main:
com.qivr.sample.HelloWorld@18f1d7e speak: Hello World
RingServlet:  qIVR session started
snip…

For part 2, I’m going to see how it compiles under Java 1.5, I was not expecting it to compile under 1.5 from untouched source.  Since it works on old version of Tomcat under 1.5 then logically it should compile under 1.5 ?  We will find out on the linux box with Eclipse and a new Tomcat.  Then there is another interesting part.  How well will it work against the voiceXml hosting places.  They have for sure evolved since 2001, are those even around today ?

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.

Delphi to C#

Remember Delphi ?  When it came out it was a killer development environment compared to Visual Basic and Visual C++.  At the time Visual basic and Visual C++ had separate IDE’s.  Delphi was far better than both of them and it didn’t hurt that Delphi is Pascal based.  All around it was very nice, but it never gained any real traction.  Pascal is like a hybrid between Basic and C++, it’s lo level enough yet easy to understand.  MS is always able to half way give away their development tools or at least keep them at a price point were it is very hard to compete.  For that and some other mainstream reasons Delphi never got spread out the way it should compared to features ease of use etc.  Don’t get me wrong it’s used, it’s used by a fair amount of developers and they love it.  Today Delphi supports .Net, C++ and PHP along with Pascal.

From the business side of things Delphi has gone through some changes, the devision was spun of from Borland to CodeGear which then recently was sold to Embarcadero.  Embarcadero is the developer of the powerful ER/Studio data architecture and design software among others.

All of that brings me to a point, as I have been impressed with Delphi and then with C# after working with it for a while.  At first I did not understand how MS got C# correctly on the first try.  The story with MS is that once they have put out three versions of a product it’s finally stable and usable.   This time around there was something different going on.  .Net had been in beta for over 3 years and 1 year behind initial schedule when it was finally release to the masses.  C# was started later on in 1999 and seemed throroughly tested  before release.  It looked rock solid and was and is still today more productive than Java and even faster in execution.  But it only runs on one platform so what do you expect, unless your want to Mono that’s a totally different story though.  Then I read about who was involved and sure enough Andres Hejlsberg had joined MS from Borland and now I started understanding what really happened at MS.  They got some really good outside talent to do the job and do it right.  Not that Andres did it all by himself here is the C# team and reflections from them.

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.

Syncfusion browser control render problems

We got a bug report from a user about information missing in a namecheck hit that he issued.  And sure enough the screen shot shows only part of the data I would expect to see.  The data it self comes from a TCP/IP based service in XML format.  What the app does is to take the XML and transform it with XLST into HTML that is then displayed to the user in a browser control.   In this instance the layout and the data was too much for the Syncfusion control to handle.  Mind you the version of the control that we are using is from 2005.  At the time the control was not very mature, but I’m sure it is by now.  In other words this would probably not be a problem if I used the latest Syncfusion browser control.

However I’m stuck with the old one, it’s been deployed out there all over the world.  Update of the control and  therefor the application is not an option.  I have to figure out another way.   So I go exercising the html to see if there is something I can change in the Xlst transform to fix the problem.  The strange part is that when I change some of the data like 10 to 12 in one place the data will render better in the control.  Not perfect but better.  I run it through html validator and it’s pretty clean nothing stands out that would indicate why the control has trouble rendering the html.  Further to make it more confusing, the same html layout with different data renders just fine, uhhh.  One more experiment to set border=”1″ on the tables in the html yields correct results.

I’m kinda stuck here, I was almost to the point were I would rewrite the XLST to transform into some easy html without tables and such.  But with that limited html functionality it is hard to make it look pretty at the same time.  Something that the client wants of course.  Then I noticed that the controls horizontal scroll bar is active, hmmm, slide the bar to the right and there you can see the missing data. Obviously the fix has been found, tell the user it’s a feature, no no that was a joke 🙂  Tell the user to slide to the right to see the rest of the data when this happens.  It only happens with certain data anyway so it’s very unlikely to happen in the first place.  Secondly I will throw out the Syncfusion control and put the IE control back in as the IE browser control memory leak bug must be fixed by now.  Sure enough with the IE control in place all the html renders correctly.

However It turns out it’s not that easy, as the IE control has not been fixed.

So what about upgrading the Syncfusion control… let’s check with them I sent the email.

We bought essential suite some time back, I’m wondering if we can get a upgrade to the htmlui control. As it’s rendering some html incorrectly. I’m sure a never version of the control will not have the same limitation ?

Below is our license info.
snip….

And the answer came promptly from Syncfusion

Good morning Orn,

As the account manager for our customers in the state of VA, I’m happy to assist.

Adam’s Essential HTMLUI Source subscription expired in 2005, so unfortunately he is not eligible for an upgrade to our latest version. To renew his subscription so that he can gain access to our latest version (along with new releases and support for 1 year), please visit https://www.syncfusion.com/sales/order/renew_expired.aspx. The price is $537 to renew this subscription.

Syncfusion licenses on a per-developer basis, and at this time only Adam Nelson is licensed to use our products (the 2nd license was only for a build machine). If you or any additional developers are using Syncfusion controls, you’ll need to purchase additional licenses at this time, as every developer must have a license. Additional HTMLUI Source licenses are available for $895 each. I can provide you a 10% discount on new licenses purchased by Sept 30th as this is the end of our quarter (online code: disc10).

Please let me know if you have any questions about our licensing. I look forward to receiving your order.

Regards,
snip…

I doubt my client wants to pay for a upgrade on the control.  So I go looking for another alternative, what about a FireFox control which was not ready in 2005 ?  Sure enough the Mozilla browser control is available and  it’s FREE.  The Mozilla control might not get approved by the client, at least there are options.