Thursday, October 29, 2009

My blogg is hungry...

I have been neglecting my blogg for some time now, probably due to lack of excitement, but Fardad insisted I feed it so it didn't whither up and die. So, to the point, the irc meeting, which was conducted on Wednesday, went down with a fair level of success. Fardad wasn't too strict on how the meeting was to be conducted, so I was allowed to goof around a bit as to keep myself from getting disinterested in the whole affair. He made sure the four of us had a reasonable understanding of SVN and how to organize our group, plus gave us a hand with a few things to prevent future conflicts. He also helped give us a grasp how much our group members understood in terms of SVN and A2 as a whole. While most of this turn out well, I would suggest to everyone that you listen in on other group meetings, as there were a few things he didn't cover with my group that he did cover with others.
When it comes to the actual assignment, I went ahead and grabbed the io_field section to write, which I'll have done by the end of next week. I also plan to write a formatting program in my spare time, because I really hate some of the things my group decided on for the coding standards, so instead of pestering myself by abiding by them while I code, which would wear down my productivity, I plan to just write a formatting program that will swap my code between my format and theirs. If I finish this and it works, I am willing to provide the binary program (to hell with open source XD) to all those who suffer a similar ailment.

Wednesday, October 7, 2009

Bugs in OOP344 As1tester.c V0.9

Hey, just thought I'd point out some bugs that may prevent As1tester.c from running correctly on some Borland compilers and the matrix compiler.

In the ResetStr function there is a line of code that looks like this:

while(str[i] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ Garbage after data"[i++]);

On some borland compilers this will result is messed up data, to fix this change it to:

while(str[i] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ Garbage after data"[i])
i++;


And on the matrix and borland compilers, the function prntextbox is broken. The line:

from = from + len + 1;

Allows the compiler to pass the null char, allowing it to read into data that does not really belong to from. Change it to:

from = from + len;

And it works!

Tuesday, October 6, 2009

An Interesting Discovery With Linux

While this will probably be well known to those familiar with Linux, I made an unexpected discovery while I was figuring out the key codes for the Linux platform for assignment 1. I am not sure if it was because of the shell I was using or the OS itself, as I was using PuTTY to connect with the matrix servers and didn't test any other methods. But I noticed that when I used the restore buttons on the PuTTY window (the small window button and the maximize window button) that the keycode.c program picked up 2 key strokes, much like the function keys in windows. The value returned was -1, so the program itself didn't know what it was looking at, but something was definitely passed through as a key stroke. This may or may not cause problems for our programs, but it definitely holds potential for the text editors projects we will be making later this semester.

It is possible someone may have already blogged about this, or it may even be in the instructions, but it caught me by surprise so I figured I might as well post it here.

Friday, October 2, 2009

Finding Middle Ground

Surprisingly this post will have nothing to do with the fact that it is 5:00 am and I've been programming all night.

I seemed to be having trouble finding middle ground in terms of code readability now. I just don't know how readable I should make it vs how compact and clean it should look. For example, the code in assignment 1. The backspace code Fardad wrote for us to be used in assignment 1 (which btw is broken, because it will corrupt the string if you press the backspace key when cursor is at the beginning of the line (curpos = 0 and offset = 0)(I'll remove this upon request since A1 is individual)) is about 9 or 10 lines of code, but I rewrote it to be less lines even though it included an addition condition statement (to fix the broken code) and I don't know if I have really impeded on the readability of the code. I won't post it due to the nature of the assignment but I know its gonna pester me while I write the code. Any general tips would be appreciated ^_^