Wednesday, September 29, 2004

How to Design Programs

(and more on QA and Testing)

Program design. This was the topic of my very first computer science class. We were writing in a language called scheme, which is related to LisP so I am told, the language wasn’t terribly important, but the concepts were. My professor, and the authors of the book that we used that semester were obsessive about the method by which one approached programming. All of the exercises in the class were aimed at helping the student understand why program design is important.

What struck many of us, as a new experience was that the actual coding of a program or algorithm was really a very small part of a larger process in bringing about a program; we learned very quickly that there were several steps that would help assure us as programmers that our program would pass the test of time.

In a nutshell we followed a pattern:

1 – purpose
2 – data analysis and design
3 – examples
4 – well formatted code
5 – testing (using the examples created before programming)

Looks simple doesn’t it? In theory it really is. However, when a programmer gets in a hurry, it is often very tempting to skip right to step three and write the program. This is one place where one quickly notices the differences between educational theory, and practiced reality.

The company that I work for has a huge IT department. Millions of dollars are spent on software development, as most of what we use has been home grown now for at least the last 30 years. I am a member Quality Assurance team that develops financial software for the corporation. Some of the code that I test has been around since the early 1980’s. Granted, in that day and age there weren’t great source management systems, and you usually needed to write your own, but you can easily tell that in many instances the above formula was not used.

I sometimes wonder if programmers who know that they have a QA tester to will just compile the code that they wrote and call it good. Yes, the bugs that I find have been that bad. Had the programmer actually run the program, he/she would have seen the errors nearly immediately. Yet at the same time, I can empathize with a programmer trying to maintain code that has been maintained for multiple years without documentation. It really takes time thinking and research to plow through code that you didn’t write before you make a change. There are a couple of programmers here that are very careful to understand before they go, but there are others that just edit, compile, and hope that it will work. I could probably go on for ages about why this style of programming is problematic, but the short answer seems to be that the problem is propagated by not following a plan.

In the world of object oriented programming, the emphasis is on creating code that can be used and inherited, abstraction is the name of the game. One would hope that with more complex source management systems, more powerful programming languages, and programmers that care about their code that more thought would go into design and implementation planning. OOP certainly encourages a programmer to think in this manner, but does it actually happen?

So for the motivation behind my rambling today; while sitting in our weekly status meeting with financial business owners someone says: “What if we were to plan and design each program request before we sent it on to be programmed?” What a novel idea. Certainly there would be some return on investment there, don’t you think? After the question had been asked, my co-workers began to discuss the pros and cons of program design, and in my head I answered YES.

Tuesday, September 28, 2004

Practice Practice Practice

It was a day of mathematics. I worked hard to make sure that I would be ready for my exam in ODE's tomorrow. The test should be ok, provided that I manage to stay calm, and remember that which I have studied. The more that I encounter different math problems the easier they become to solve. This must mean that somewhere after the many hours of tears, stress, and tutoring that I am finally beginning to see the results of invested time. This evening I solved several problems via a method that seemed impossible to me three years ago. Tonight, as I read the same pages from the text book to refresh my memory the concepts and points were clear. I was able to understand what the book was trying to convey. Frightening isn't it? Maybe my brain will be able to do this math thing after all. Hopefully the test that I take tomorrow morning will be a good experience. In the mean time, I am going to call it an early night, as I want to be rested tomorrow morning.

Sometime in the near future I need to write about:

-Algorithm Analysis
-How to design programs
-More on QA and Testing
-Computer Science and Mathematicians

Monday, September 27, 2004

A Quiet Morning

Today is one of those days at work, when it truly feels like you are the only one in the office. Over the weekend, my co-workers successfully completed another step in our hardware consolidation plan, and thankfully things were working as we had hoped that they would. Most of the team was either at the location of the consolidated site to help with incidental bugs, or were taking part of the day off as comp time for weekend work. Quiet in my workplace comes at a premium, so I was glad to have the time this morning to organize the papers that had accumulated on my desk in peace and quiet.

I have really been enjoying the digital camera that I got for my birthday. It has been entertaining to take the camera with me everywhere I go. I find that when I have the camera, I tend to see the world with a different set of eyes. I look for color and interesting shapes, and things that would make neat photos. Digital photography was something that I resisted for the longest time, but as I walk around with that little camera, I don’t know why I was so opposed to it for such a long while. I am finding that it is great fun to work on my online flickr photo album, and sometimes when I am just too lazy to sit down and write a blog entry as they say, a picture can speak a thousand words.

School is feeling ominous and oppressive right now. I will be spending this evening in the engineering computer lab. There I will be able to complete my assignments and prepare for my upcoming exams. It looks like the WB Monday night will have to wait until I am done with school. Maybe Thursday or Friday!

Sunday, September 26, 2004

In which I want to have a productive weekend

I really started out this weekend with the best of intentions of catching my life up to speed in all areas. On Friday morning, I sat in my seven thirty class before it began and wrote up this rather large to-do list, outlining exactly what I though that I needed to finish in order to declare my weekend a success. Some things this weekend have gone really well, and others I can not claim the same level of success.

On the positive side:
I ate some excellent gourmet food.
I finally finished up a recording project for a friend.
I got my laundry done.
I managed to clean my room.
I almost feel like I am ready to face another week at school.
Oh… and the University of Utah won its football game!

In my computer science class right now we are studying the basics of algorithm analysis. It is pretty interesting stuff. Well, truthfully, it is not only interesting but also highly important. As it turns out, I have been taking great advantage of the queries and sorts that I have used at work day in and day out for nearly three years. I am really glad that someone smart took the time to figure out creative and quick sorting algorithms. Yet, at the same time, because at work most of that is done in the background, I wonder exactly how it is being accomplished. It is probably time for a trip to the IBM website, but really I don’t have the time to research it, so I will just mention it and move on. I need to write one more algorithm and then I can say that my CS assignment is done for the week. Then it is time to study and prepare for the upcoming exam.

This week will be a challenge. There are three math assignments due, a discrete math homework set to work on, and exams in computer science and ODE’s. With careful time management I will survive and thrive.

Wednesday, September 22, 2004

The Night Rolls In

The Night Rolls In
Originally uploaded by CodeFin.
It was quite the day today. I feel like I may finally be making some progress. The week is hardly over, but at least I am making progress. I will put Wednesday to bed with this photo. At the University I park my car in probably the largest, but farthest removed parking lot. After an extra help session on ODE's this is the view that was waiting for me as I prepared to leave for the evening. I just had to catch it so that I could share it with you. I really like the way that the clouds are wispy. Salt Lake City isn't the largest city in the world, but it must be one of the most beautiful.

Mid Week Reflection

Sometimes, it is absolutely necessary to simplify your life to make room for what is most important. I am finding that the hardest part about simplification is that I may find that I need to give up something I like in the short term to reap some other long term benefit. I had a discussion with my father about this a couple of days ago. To be honest, I really hate the topic, but it seems appropriate. The fact is that in my day I must eat, sleep, bathe, go to school, go to work, and enjoy some “free-time”. The other fact is, that between school and work, sometimes that “free-time” isn’t so free.

I woke up this morning just a little bit after six. It hadn’t been a restful night; I was too worried about understanding my latest set of mathematical challenges. I read the book until I couldn’t keep my eyes open, and though I was slowly understanding the model, I was unable to figure out how it related to the problem that I needed to solve. I fell asleep wondering how a given exponential term ended up in the differential equation. As I mulled this over in my sleep last night, I woke with some answers, but not all of the ones I needed.

Class started at seven thirty, and we discussed an upcoming assignment that would be due after the exam next week. The assignment wasn’t trivial at all, and I get the feeling that I had better get to work on it this weekend. Following class, I went to the math tutoring center and finally got the help that I needed in order to finish the assignment. The good thing is that the assignment is complete; the bad thing is that I took a day off of work to figure it out. I am really grateful for patient tutors, and kind classmates who are willing to help someone else out. I don’t feel like the brightest crayon in the box right now, but I do feel like the most determined. I am fascinated by the subject, and I really do care to learn it. I will stick it through.

Yesterday, I found myself a tutor for Discrete Structures, and another tutor for ODE’s. It won’t be cheap, but in the past I was willing to spend money to take voice lessons and to be in a choir. I am sure that there is some analogy for this as well. The tutors should be able to help me figure out the concepts that I don’t quite understand. With their aid, I will do better in the classes than I would having tried to do it all on my own.

The other thing I have decided that I really must do is find some people to study with. That is probably a blog on its own, but I think that there is a good dynamic that comes with groups of people. We all have different strengths, and being able to play off of them really helps us all in the end. I was working with a fellow student on the assignment that we turned in today. He didn’t understand how to use Maple, I was able to help him work that out, and together we solved the problem. Kudos for strong team work.

I still have a ton to do this week.
- Test in Discrete Structures tomorrow
- Maple Lab due in ODE’s on Friday
- CS assignment due on Monday
- Various and sundry other side projects that I haven’t wrapped up yet (getting back to simplifying my life)

It was almost therapeutic to sit down and write it out. Time will keep moving forward, the important thing is that I use it to my benefit.

Monday, September 20, 2004

Slope Fields in Maple

So, in my ODE class today I had to turn in this little assignment. Maple is a great computer algebra system. I had never really taken the time to get to know it until this semester. It took some time figuring out how to make it work, but eventually I was able to make this great slope field diagram:

The great thing about this diagram is that it shows you how different solution curves act with respect to the given differential equation. To produce this pretty picture you would use the following maple code:

> solve(x^3*(x^2-4),x);

> with (plots):

> with (plots):
with (DEtools):

Exciting isn't it? These things really do represent a great deal of my life right now. If only I could understand the discrete math as well as these, I would be doing great!

Sunday, September 19, 2004

Busy Weekend

This whole blogging thing is taking a lot more than I thought that it would. Don’t get me wrong, I love the idea of keeping an online journal and having an audience to read it, but it does take a bit of time and effort to try and come up with something fresh and new each day. I am could sit here and think up excuses to explain why I haven’t written in the last couple of days, but I think I will just boil them down to two little points. 1. I have been really busy with school. 2. The thought of sitting down and writing anything coherent didn’t sound like fun, so I let it go.

Autumn is upon us, and the signs are showing everywhere. The leaves have begun to change colours, the air is crisp in the morning, it is getting windy, and for the last couple of nights we have had rain. Football is well on its way, and most people on campus are very proud of the way that our team has played. The newness of being back to school is quickly fading into yesterday, as we all are hit with the reality of what it actually takes to get good grades.

I spent six hours yesterday working on a programming assignment; it was really a lot of work. Though the assignment was long, I think I finally managed to really understand the implementation of the binary search algorithm, and the selection sort. One gains a real sense of satisfaction having programmed something and having it work as you would expect it to. This is probably the first time in my life where I have been willing and interested in spending hours and hours on a homework assignment. It gives me a great sense of accomplishment to finish, and know that I did it correctly and well. Now I just need to find the same love and excitement for ODE’s and Discrete Structures.

Judging by my todo list, the coming week will also be busy and full of challenges. I am figuring out that you just have to stick to it to get it all done. I will try to find a useful tidbit, or anecdotal story to share each day. Even if it is only a paragraph’s worth, it is better than leaving you in the dark for days at a time.

Oh… and I haven’t forgotten that I still need to create my own posting template for this blog, it has just fallen to the back burner for the time being!

Until next time, take care!

Friday, September 17, 2004

Binary Search

In class, we were assigned to program a binary search algorithm. I found two sites on the web that I really found useful. I will just blog them so that I have the links for future reference. I know I owe you a better blog article, and that I have been MIA for a couple of days. I promise tomorrow, or later today, I will write something significant.

Binary Search link #1

Binary Search link #2 with coded examples in Java

Wednesday, September 15, 2004

A Photographic Contemplation

Into the Unknown
Originally uploaded by CodeFin.
Today after work, I had the opportunity to go and see a show at an art gallery that a friend's mother had done. It was really cool to be able to go and spend time looking at some wonderful impressionist paintings. I really left the event inspired, and hoping that somehow I might be able to find more creativity in my photography. As I was walking from the show to my car, I had the moment to catch this photograph. To me, it was an emotional moment. At this point in my life, I can relate to the person in the photograph on several different planes. Going from darkness to light, headed into new and great things, but not totally knowing what lies in the path ahead. One of the greatest challenges in living life is learning how to face uncertainty with courage and sureness. We may not know where the path may lead, but we can brave the unknown, learn our lessons, and become all the stronger for it. My stream of conscious writing probably isn't the greatest, but the photo has a lot of opportunities for interpretation. It has the power to connect with a person on multiple levels.


A co-worker just sent this to me:

You're a loaded cannon -- and you won't hesitate to show everyone around you just how strongly you feel about this. So if you're asked to give your feelings
about a certain situation, don't even try to hold back.

Does this mean that I should lock myself in a closet for the rest of the day? I suppose it would let me go home and study, or sleep. My two closest co-workers have the same sign as I, and we all tend to have similar attitudes. Maybe this kind little snippet from my horoscope, is my co-workers way of telling me that I was outspoken in our meeting today?

Tuesday, September 14, 2004


I was at school this morning shortly after seven. This is usually a good thing, as the perfectionist in me prefers to get to events early so that I have time to acclimate and relax before whatever is going to happen happens. Perhaps it is one of my methods of coping. I perused the New York Times in the twenty minutes or so before class would begin. You could say that those twenty minutes were the most calmed of the entire day. It wasn’t normal ODE class today; we had the teacher’s aid in, helping us with our homework. However, I think there should probably be a rule written somewhere that states that students are not allowed to do calculus before 10 AM. It brought the day off to a frustrating start, as even the TA had a hard time explaining concepts to us. I sat spent the hour quietly in my seat taking notes, and trying to learn, while hoping that somehow the method of solving Differential Equations by the method of Integrating Factors would impress itself on my memory.

Not feeling that I had satisfactorily learned in discussion this morning, I took the day off from work (I only would have been in for three hours anyway), and went to the mathematics tutoring center, where I did get the help I needed, and at the same time was reminded how I really ought to spend some time with integration again, as I am feeling rusty. Two hours in the tutoring center flew by, and before I knew it I was attending my second ODE discussion of the day. I hoped that by getting some additional help in the tutoring center that if I attended another class session, I might be able to follow the lecture this time around. Thankfully, I was able to understand. Now we just need to hope that I remember it well enough now to make final presentation copies to hand in tomorrow morning.

After grabbing a quick lunch at Subway, and walking on up president’s circle where I was able to chat with a friend from high school, it was off to the regular schedule of afternoon classes. Discrete Math, CS2020, Discrete Math discussion. I can say that CS2020 went well. However, I can’t say the same about Discrete Math. In fact, the whole thing has me very worried at the moment. I am not quite sure what to do about it. Proofs are hard, but very important. I guess that it is time to look into finding a tutor, or maybe it is just a matter of more study hours. I will try to talk to the professor, and maybe he will have some advice for me.

I have a significant amount of homework to do tonight, but I figured that after 9 hours at school I was entitled to a couple of hours rest before I attacked the monster pile of homework. Here’s to getting it done.

Monday, September 13, 2004

"U" in the Road

"U" in the Road
Originally uploaded by CodeFin.
I took this picture on my way home from work today. Just thought that I would share it with you. The Utes moved up to #15 in some polls this week. How exciting for the home team! I may have more to say later tonight, but at least you get a photo for the time being.

Sunday, September 12, 2004

IDE's Good or Bad?

Shortly after I posted my blog last night, I noticed that I had something sitting in my email in box. It was a message from my CS class “chat” list serve, a classmate having problems with the assignment that I had just finished several hours earlier. Knowing how horrible it feels to have an assignment due, but to be stuck, I decided that I would reply to my classmate and try to help him finish up.

Over the next hour and a half the emails went back and forth and we figured out what the issue was. If I had to do it again, I would do it slightly differently. In his email to the class chat list he mentioned the compiler error that he was getting. I really should have started there, as that is where I ended. The complier error messages are a lot easier to understand than we think that they are, and we really shouldn’t be afraid of them.

This brings me to my question of the day though. Though IDE’s (interactive development environments) make a programmer’s life easier, they can become somewhat of a crutch to a budding programmer (speaking from experience). Something I have learned is that the “compiler” error messages that you get from an IDE are not necessarily the same messages that you would get if you compiled the code from the console. Does an IDE actually help a student learn a programming language? It could probably be argued both ways.

Yes, in that it makes life simpler, and depending on the IDE using, can even automate many mundane tasks.

No, in that perhaps it does too much for you, and won’t force the student to really learn the language.

At work, there are programmers who write all of their class files in notepad and then paste them into WebSphere for compiling and project assembly. One of the programmers at work told me that it would be best to stay away form the IDE’s as it would force me to really learn the programming language, because I would need to be conscious of how the compiler would react to my code before it hit the compiler if I didn’t want to spend lots of time fixing errors.

I find that I am somewhere in the middle of the argument. Notepad, at times feels faster and easier; other times I love sitting in front of a good IDE. The shortcuts can really save time in a long project (I probably can’t use the term long project as the largest class I have ever written is probably around 1000 lines—but still the shortcuts of the IDE were nice).

In school they recommend that we use BlueJ. If I use and IDE, I am partial to using Eclipse, because it is basically a free version of WebSphere (which we use at work). Some of my class-mates really like DrJava. Again, I find that sometimes it is just nice and simple to work in a text editor.

When I was in elementary school they said I needed to learn my math facts before I could use a calculator. Maybe this should apply to programming languages too?

What do you think about students using IDE’s?

Saturday, September 11, 2004

A day of Homework

Game Night
Originally uploaded by CodeFin.
Can I just tell you how much I absolutely love my digital camera to pieces? It is one of the most wonderful pieces of technology. Anyway, the U on the mountain was glowing tonight in support of our football team. We won! 23 to 6 against Arizona. I wish I could have seen more of the game, but my homework seemed to think otherwise.

I spent most of this afternoon and evening working on the programming assignment that I alluded to earlier. It wasn't terribly difficult, but it did take about seven hours to finish. Upon finishing the programming assignment, I realized that I had some math that needed to be done for my class on Monday. I tried to run Maple via cygwin here on my computer at home, but it was just too slow, so I had needed to go to school for a bit this evening. In the end I was really glad that I went. I got to take some fun pictures, and also got the assignment taken care of. What is the best news you ask? Well, it is that I don't have any homework assignments to do tomorrow. I can spend some time with that discrete math stuff, but other than that, it will be a nice relaxing day.

Spending hours and hours doing homework isn't so bad as long as you can figure it out. All in all, a good day for my ego.

Isn't it strange how finishing the most obscure project makes me happy?

Friday, September 10, 2004


Originally uploaded by CodeFin.

I am so very excited about flickr! So far I think that it is a great tool. It will index and take care of all of my digital photos for me. Not to mention, with the click of a button I can add photos here to my blog without doing a single thing! Totally awesome if you ask me!

On the Downside to Thirty

Have you ever wondered what it would be like to have a summertime birthday? In my growing up years, I always envied my brother and sister that enjoy a birthday in June. Why you ask? Well, it all has to do with this thing called school. Having celebrated my 25th birthday yesterday, and having to go to work and school (like I do most years), the “what about a summer birthday” thought did cross my mind. I guess in the “adult” world it doesn’t matter much, as you will still go to work, but somewhere I got this idea in my head that it would be wonderful to have my birthday all to me.

Do not misunderstand I had a great day yesterday, but like many other days, I had to do the routine stuff that makes life happen. I worked in the morning, went to school in the afternoon, and did my homework in the evening. There were some exceptional moments in the day though. My mother made a great dinner. We enjoyed two different kinds of wonderful gourmet birthday cakes (one white, the other chocolate), and I got some amazingly awesome birthday presents: A nice article of clothing, a great little digital camera (which will allow me to share more of my world with you), some toys for my cubicle at work (Acrobots from, and a wonderful set of web programming reference cards. What more could a kid ask for? Not much I tell you. Unless, of course, someone out there is giving away days void of responsibility for people with fall birthdays. I would be one of the first to sign right up.

I am a lucky man.

When I get home today, I will figure out how to share pictures with you all!

Wednesday, September 08, 2004

Because You Asked For It

Seven hours into a nine hour day at work I get an instant message from a friend.

FRIEND: Only one blog in a week?
(Followed by some other stuff that I can’t remember, so I won’t try to make it up)

ME: Well I have been really busy.
(And I think something else about how I decided to take Labour Day week off)

SO because I have this friend who decided to take the time to give me a nudge, I will sit here in front of my word-processor writing up a blog entry for today. Did I mention that I just worked NINE hours at work? I didn’t take lunch either. It was the day that never ended. If it wasn’t one thing it was another. Sometimes I wonder if people realize that I actually have my own work to do other than doing theirs. That is probably a story for another day.

A few days ago I talked about RPG (report programming language) as a black box. I made that comment because I was testing a bugged program and was having a great deal of difficulty in finding the bugs. Well, I am STILL hunting down this bug, and it is getting really old now. Over the weekend we made some programmatic changes that should help us to at least isolate the problem. However, the fact that there is still a bug in the production code is a great stressor to me. Hopefully in the next couple of days we will get it resolved, and I can move on with my testing.

Ordinary Differential Equations as a class is turning out to be very different from what I had originally anticipated. It feels like almost overnight someone opened up my mind and poured a bunch of math into it. I understand more and more, and the concepts appear to be understood more easily. This is a good thing, as time is one thing that I don’t seem to have enough of.

The Java assignment this week deals with Inheritance, Abstract Classes, Interfaces, and multi-dimensional arrays. It is due this weekend. I don’t think that I will be getting to it much before Friday. When I do, I am sure there will be something exciting to share.

My brain is much too fried to continue right now. This is probably one of the worst things you have ever read, so I will just quit with what dignity I have left.

Monday, September 06, 2004

The Code that Saved the Day

Long weekend. Pleanty of time to forget school. Did I do my homework until today? No. Was it a good idea? No. I am sure that I will still be working on discrete structures for a few more hours, however, I feel like such a smart little budding CS student that I thought I would post my happy solution. I am sure that any programmer with half of a brain cell would have figured this out faster than me, maybe there is even a better way to prove it with out compters, but I didn't find it.

The problem:
Consider the polynomial n^2 + n + 41 Disprove: If n is a positive integer, then n^2 + n + 41 is prime.

Here is my answer (the programming):
public class Proof {

static int n = 10;
static boolean prime = true;
static double formula;
static double mod;

public static void test (){
while (prime == true){
formula = (n*n) + n + 41;
double a = formula / formula;
double b = formula / 1;

for (int i=2; i<>{
mod = formula % i;
if (mod == 0.00) {
double div = formula / i;
System.out.println( i + " divides non-prime " + div + " times");
prime = false;
if (a == 1 &&amp;amp;amp;amp; b == formula && prime != false){
System.out.println("Value of n: " + n + " Value of prime: " + formula + " A: "+ a + " B: " + b); } n = n + 1;
n= n - 1;
System.out.println("Value of n: " + n + " Value of non-prime: " + formula);

public static void main (String[] args){

Here is the output:

C:\CS2100>java Proof
Value of n: 10 Value of prime: 151.0 A: 1.0 B: 151.0
Value of n: 11 Value of prime: 173.0 A: 1.0 B: 173.0
Value of n: 12 Value of prime: 197.0 A: 1.0 B: 197.0
Value of n: 13 Value of prime: 223.0 A: 1.0 B: 223.0
Value of n: 14 Value of prime: 251.0 A: 1.0 B: 251.0
Value of n: 15 Value of prime: 281.0 A: 1.0 B: 281.0
Value of n: 16 Value of prime: 313.0 A: 1.0 B: 313.0
Value of n: 17 Value of prime: 347.0 A: 1.0 B: 347.0
Value of n: 18 Value of prime: 383.0 A: 1.0 B: 383.0
Value of n: 19 Value of prime: 421.0 A: 1.0 B: 421.0
Value of n: 20 Value of prime: 461.0 A: 1.0 B: 461.0
Value of n: 21 Value of prime: 503.0 A: 1.0 B: 503.0
Value of n: 22 Value of prime: 547.0 A: 1.0 B: 547.0
Value of n: 23 Value of prime: 593.0 A: 1.0 B: 593.0
Value of n: 24 Value of prime: 641.0 A: 1.0 B: 641.0
Value of n: 25 Value of prime: 691.0 A: 1.0 B: 691.0
Value of n: 26 Value of prime: 743.0 A: 1.0 B: 743.0
Value of n: 27 Value of prime: 797.0 A: 1.0 B: 797.0
Value of n: 28 Value of prime: 853.0 A: 1.0 B: 853.0
Value of n: 29 Value of prime: 911.0 A: 1.0 B: 911.0
Value of n: 30 Value of prime: 971.0 A: 1.0 B: 971.0
Value of n: 31 Value of prime: 1033.0 A: 1.0 B: 1033.0
Value of n: 32 Value of prime: 1097.0 A: 1.0 B: 1097.0
Value of n: 33 Value of prime: 1163.0 A: 1.0 B: 1163.0
Value of n: 34 Value of prime: 1231.0 A: 1.0 B: 1231.0
Value of n: 35 Value of prime: 1301.0 A: 1.0 B: 1301.0
Value of n: 36 Value of prime: 1373.0 A: 1.0 B: 1373.0
Value of n: 37 Value of prime: 1447.0 A: 1.0 B: 1447.0
Value of n: 38 Value of prime: 1523.0 A: 1.0 B: 1523.0
Value of n: 39 Value of prime: 1601.0 A: 1.0 B: 1601.0
Value of n: 40 Value of prime: 1681.0 A: 1.0 B: 1681.0
Value of n: 41 Value of prime: 1763.0 A: 1.0 B: 1763.0
Value of n: 42 Value of prime: 1847.0 A: 1.0 B: 1847.0
Value of n: 43 Value of prime: 1933.0 A: 1.0 B: 1933.0
43 divides non-prime 47.0 times
Value of n: 44 Value of non-prime: 2021.0


Well... the formatting is all messed up. I really should spend some time here so taht I can make formatted code part of my style sheet. Anyway, cheers to the number 44 for making my homework problem go away!

Thursday, September 02, 2004

Into the Home Stretch with a Long Weekend Ahead

Go Utes! I have been looking forward to that game all week. It is interesting how a little success can make fans out of the most unlikely people. I thoroughly enjoyed watching the game tonight. I am proud of my school, and my team. I have a lot to learn about football, but I think it is going to be a new hobby. Well... not playing, but watching.

On other fronts:

Yesterday I talked about the black box with regard to RPG programs. I still feel that way. I was only at work for half a day today as I had classes in the afternoon. The pressure is on to figure out this program, and without going into too much detail, I really need to get it solved. Hopefully tomorrow afternoon will prove worthwhile, and the problem can get solved shortly after labour day.

I am looking forward to the long weekend. It will give me time to really dig into some of the projects that I have been putting off. Hopefully I will actually manage to lock myself away long enough to get a good dent into some of them. Mainly I MUST work on the Discrete Structures homework, and it would be good if I made some progress on an ODE assignment involving the computer math system, Maple. I had originally hoped that Labour day would be a time to go on a photojourney, or maybe create my own for this blog. There may still be time. I will take each day as it comes.

In Discrete Structures we talked about circuit design today. Specifically we talked about how circuit design relates to Boolean algebra. It was really an interesting lecture. I think my appreciation for the computer increased about ten fold today. Somewhere in my mind I always knew that computers worked in base two, and that everything needed to come down to an on or an off I just hadn't ever really thought about it. Pretty amazing.

What a jumble this blog has turned out to be. From college football to circuit design, what more could you want!

Wednesday, September 01, 2004

The Black Box

I wish that older languages like RPG were more kind to the user/programmer with regard to testing/debugging. When working with large complex programs, an RPG program can become a black box. Put data in; get data out, who knows what happened to it while it was in the machine. It is really frightening when you think about it. I spent the greater part of my day today trying to debug that which was impossible to debug. It was easy to notice the symptoms, but finding the cause is another problem all together. RPG as a programming language has really served its purpose. Keeping track of billions of dollars, and saving people years of work. However, at some point, one needs to ask the question: Is maintaining 20 year old code worth it?

Where I work, we haven’t completely answered that question yet. Though more and more we appear to be moving to Java web based solutions. The results thus far:
- Cost Savings
- Programmers that know and understand the process
- Less maintenance (long term)
- Less support (long term)
I decided to talk to one of my co-workers, also a QA-tester (but with much more experience than me), he seemed to agree with most of my points. However, he also disagreed that there would be less support and maintenance, arguing that because we add complexity to the product (palm applications, check scanners, receipt printers, credit card machines) that the call for support would be increased. It appears that the jury may still be out on the maintenance argument.

BUT I can say that the debugging is easier in Java. I haven’t seen any “black boxes” yet, and most of the documentation is so new, and so accurate that it would be hard to get into a black box. Perhaps, I should be discussing the need for accurate and representative documentation. Plenty of times in my testing have I had to completely test a program change twice to fully understand what was going on. Once on the existing version, to understand what the program did; and again with the test version to see if the program had been appropriately changed according to the change specifications. Sometimes when dealing with programs that are 20 years old, they have been changed and patched so many times that you may not be aware of every little nuance that the program offers. Really it can be frustrating and frightening at the same time.

Maybe if the 20 year old code was sufficiently documented it would be easier, but in my situation, dealing with so many inter-connected programs it often is a black box.

In my classes at school, when we have a programming assignment, we are graded not only on the code, but our documentation (albeit simple). We are also expected to write code that tests each and every function that we write. It seems to me that this would be a good carryover into the real world. If we could guarantee base functionality then we could spend more time figuring out the “creative” ways to break code, or use it in unintended ways. In the worst case scenario, when there was a bug, it could possibly be easier to break down the final product to figure out where exactly the bug was being introduced.
Being unable to address the problem directly, we begin treating symptoms. Sometimes it is analogous to treating a deep knife wound with a band-aid, in the end the problem continues, but is possibly harder to find because we covered it up. I wish for more comprehensive testing tools! Until then, I shall continue trying to figure out the black box.