Friday, February 29, 2008

Week 4. Post 2 (Another one bites the dust.)

Hello fans, no you cannot have my address. Welcome to another post in my superbly awesome blog. Wait? you ask, Does this mean you are in a good mood? No, not really, but I like filler. Anyways, on to the new post. Not much occurred so far this week. I just learned some probability simulations, and am now worried for the new test that is coming up. The last time I had taken the probabilistic simulations test (GR 11) I remember getting the lowest mark in my course, and since I can't quite afford to drop down this close to midterms, going to have to crack the whip and really buckle down and get some work done on it to get it down pat.

So far, we have only learned the method to get a new random number from x to y. R.Next(x,y) is what the code is, and really simplifies the old method of Visual Basic. Couldn't stand using that method, and again C# triumphs over VB. Anyways, other than probability, I finished another question in programming. There was a program that given a random table, format of:
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
5 6 7 8 9

One would be given a spot inside the domain of the table, and then "walk" given the parameters to walk (in this case governed by the remainder) where if one would exit the "border" / leave the array, or reach a 0 value, the walk would end and the total of all number blocks one has traveled on would be accumulated. It was actually quite a bit harder than I remembered. This is mainly due to the fact that I like to skip code when I first start writing code, and this really screws with my ability to code well. I am going to have to fix this, because it may have adverse effects later on, but that's for another blog. I have been looking at the recursion problem which seems easy, going to attempt it probably sometime this weekend. Also, preliminaries on what video game concept to create in C# begin now. If you have any idea, post in comments. Goodbye readers, and come back to another episode of Blake Hates Semicolons, Squiggly Lines and Much MORE!


P.S. I have been listening to this song absolutely constantly recently. The lyrics are absolutely awful, but at the same time I cannot stop listening to it. Awesome song overall and without further ado the video. Also, do not mind the video of what it is played to (Avatar: The Last Airbender, an awesome show):

Wednesday, February 27, 2008

Week 4, Post 1 (and another one bites the dust!)

Hello again, and welcome to Blake hates semicolons. Why is it that I created another I hate semicolons? Because I do. Alot. An incredible amount. More than even broccoli. Why you ask? Because I just wrote my programming test. (well a few days ago, but close enough.) During this test, I had to go over my test at the least 15 times. Not because I made errors, but because I forgot semi colons. To remedy this, I added semi colons to every line. It is at this point that I remembered that you don't put semi colons after squiggly lines ( { } ). Which means I had to go back over my test and take away semi-colons. This happened about 4 times more before I finally finished off. I felt pretty confident as I handed it in.


That only lasted until I recieved it back. I managed to create 2 stupid errors, mainly due to errors. Other than that, the test was pretty good, and I received a 90% on it. Not quite what I wanted, but considering the alternatives, not too bad overall. Was not quite pleased with the last error I made. I had to input data into a 2D array, and I didn't quite know how to. The test said that all arrays had entered in the 3D array section, and not including the 2D array is somewhat strange, but it was only one mark off so it didn't hit me too hard as I still got the guts of the code.

Not much else happened this week of note. I had an assignment to do, which mainly used GCD (greatest common denominators) It wasn't the most interesting thing, but did get you thinking. When you look at the format for getting the GCD, one has to wonder, how in the hell does these Greeks manage to not only not work, but spend lifetimes sitting around playing with numbers. Anyways, to receive the GCD of 2 numbers, one has to do a strange calculation which goes something like this. B/A >remainder > B/remainder > remainder 2 > ... and so forth until the remainder is 0, making your previous dividend your GCD. Quite interesting, not quite sure how it works, but it does. The code for it was simple, the math wasn't too bad. Overall, feel pretty confident about the assignment. And with that, I am going to go crack a few shots at the 3rd programming question ( ascii + binary, God save me). Goodbye dear readers, I shall miss you in the hell that I am going to.

Thursday, February 21, 2008

Week 3, Post 2 (partial cheating for much win)

A new day, a new blog entry. And boy howdy, after looking at 3D arrays for the last hour, a much needed break too. Luckily enough I have my programming test from grade 11, which is somewhat similar to what our test is supposed to resemble.

Looking at the 2d array questions, I didn't see too much that could go wrong, and as such didn't quite put much effort into it. Then I talked to Hippie Jesus, who wrote a program and printed it out specifically to aid him in his pre-writing. Absolutely mind blowing how nuts he is, considering the program we are given is almost identical to what our test should be. Anyhoo, after looking at the 2D questions, I peeked at the 3D. It actually looked decent, and I didn't quite have the mental block with it that I did last year.

However, I soon came to a small stumbling block. The bonus question. Needed a decently high mark in this class (*hint*) I'm trying to squeeze out every mark possible. Which basically means I have to come up with a few possibilities of questions that could possibly show up. After looking at the Gr. 11 test, I though up questions along a similar vein, which wasn't too bad. But then, I started getting nightmares. Recursion, problem solving using different slices, weighted marks, and the works. And since it is a bonus question, I spent quite a bit of time trying to figure out one after the other, and gave up the moment I got to weighted, or cross products because I doubt anyone would have a chance at them.

As well, I've sort of completed the first programming challenge question. It was to get the word square, or any other word and print it out in a format similar to:

square
q___r (minus the underlines)
u___a
a___u
r___q
erauqs

Had to cheat to complete it (didn't use tabs, but I don't know how. Problem is, I'm not supposed to know how to use strings either, so I guess that excuse doesn't count.) I am probably not doing problem 2, as it looks quite easy. Problem 3, is basically binary, which I do not get at all. May get Eric(Forehead man) to help me out, because I still don't get it. Question 4 seems rather doable, and I really want to attempt it again, but the problem is that I am lacking the data file, and creating 800 dots in a shape is impossible for someone as un-inclined at art as I am.

Ah well, such is life, and if Mr. Chiarelli doesn't seem to have the data file, I guess its back to the drawing board. As well, looking at the Guelph questions, I again need a text file, but I will see how that goes when I get to it. In other news, didn't really learn much this week in programming, which is sort of a bummer and sort of a blessing because due to the lack of homework, I've been doing a lot more of everything else, but since I haven't been doing programming homework, I've been slacking in other areas as well. Anyhoo, going to study for chemistry. Good night blog. Good bye valued readers (and Hippie Jesus.)

Wednesday, February 20, 2008

Week 3, Post 1

Mood: Apathetic.
Dear Blog,

Hello, and welcome to another episode of SCH(Semi-colon haters.) With that done, may I say that now that I am actually getting used to C#, the semicolons aren't as horrible as they used to be. But a new plague has been brought down. Voids. More specifically, voids being passed variables. It's not quite Microsoft's fault, but in a way it is. They give you errors when you do not have an integer being used, a integer used that is not dimmed, but if a integer is dimmed in a different void, and not specifically called into a secondary void, it will not work. What, the, crap. Truly annoying, instead of just telling the user to add it into the call, it will just tick you off.

With that being said, not much new happening in the class so far this week. Learned a little about 2d arrays and its use from having to complete a 2D array assignment. During the process of creating this program, I honestly think I am the only grade 12 not to steal the code straight from the reference folders and build it up entirely on my own. Kind of strange in a way, but at least I may possibly have a better grasp of it now than I did before.

As well, thanks to some side learning I've skipped a few days, and tried looking at some material during the weekend. Looking at strings, substrings, and other uses of it, it appears quite a bit easier than VB. Thanks to its use, hopefully once this wave of ridiculously large amount of homework passes, I am going to attempt the programming challenges questions. Definitely not looking to the questions from Guelph. Although I did find some useful stuff, looking at some of the questions, Still seems kind of retardedly hard. Ah well, guess it just gets harder from here on out.
Good bye, blog. Sometimes, I think you are the only one who gets me.

Thursday, February 14, 2008

Week 2, Post 2(I Love C#)

Hello loyal fans, and welcome to another installment of fabricating blogs, or my 4th programming blog post. In this installment I will cover numerous things such as what I learned, what else I learned and finally, an awesome video made of pure awesome with sprinkling of powdered essence of awesome( seriously, watch it.)

To begin with, pace of my programming class is really picking up. What would have taken about a month in VB is occurring in the span of about 3 days. Although the pace is quite fast, I like it, and I actually feel like I am learning something. I learned quite a lot of new code recently. Namely how to get code from a text file. Also, just by looking at the code of how to rip text from text files into an array, or regular variables, I am in love. The easiness of using C# boggles my mind, and I actually looked at one of my older VB programs, and shuddered at the length of it compared to a regular C# program. One thing Microsoft did right, even if they did screw up with semi colons.

As well, we just learned arrays. And let me say, THANK GOD. Having the ability to use variables is going to make my life quite a bit easier. I say this because I have been attempting to make a side project (a calculator of sorts) just to help brush on my C#, as well get practice I need badly.

Lastly, I just learned how to create a error checking piece of code in C#. And let me say, the pizza program that I was working on and wouldn't work, still doesn't work. But now, it'll never bother me with annoying errors again. Oh the joy of silencing stupid error messages. As well, project 2. Look through all my old VB programming challenge papers, and attempt to recreate them in VB. Giving myself 2 weeks before I give up. As well, just like I promised, the essence of Indian Culture in video form (thieving drunks who have no talent, but are funny at stealing.)



Farewell readers, and come back for another issue of Blake is bitter about semi colons.

Week 2, Post 1 (I love my programming teacher)

Hello my fans. Welcome to another installment of my blog. To begin with this blog, may I say that my programming teacher is awesome and should always follow this pattern of test hints. I say this mainly due to the fact that I wrote a test in a record breaking 15 minutes on the computer, and 20 minutes on the written aspect of it.

How you ask? Why I will tell you. With about 3 hours of hard work on errors that magically fix themselves. Roy(Hippie Jesus) and I spent about 2 hours on MSN working on our pizza question. The question itself wasn't the problem. The code itself made perfect sense, it flowed properly, and no flaw in the logic of the program. The flaw was in that for some reason, a public double, a regular double and anything else would randomly not work, and work the next attempt. Literally, I could press play, it would screw up, and the second time around the program would work. The error would be in that a variable would not exist in "that" context. Except that it was dimmed in the location of the error, with a value assigned to it. Thank God for C#'s incredible error support, which did nothing.

Eventually Roy and I decided to just throw away our work and start again, doing the exact same thing to isolate the difficulty. Which did not show up again. At all. Even though it was a carbon copy of the program that would not work. And Christmas was saved. Not really, but my pizza question was. It was also the work of 5 minutes to create a program similar to patient info, and set it up for the test. Again, may I say that I hate semi colons, and squiggly lines, as well as C#'s error system. (Noticing a trend?) Farewell good sirs, and I hope you join me for the next installment of Blake hates [Insert essential code here]......err i mean Blake's programming blog.

Week1, Post 2 (I hate semicolons cont.)

So, as you may have read already, I hate semi-colons. Let me reiterate, i HATE semi colons. My goal by the end of this semester, is to write a program that runs through my code and adds semicolons after every line. Anyways, on to the new stuff. Learning quite a bit of new code, and its actually quite a bit easier to learn than VB was the first time around (Maybe because I have some programming experience.)

One thing I noticed, dimming variables is handled quite a bit differently. Rather than dim x as y, you just dim the variable straight off, and can set it in the dim statement itself, which I like quite a bit more than what VB used, even if it was hard to get used to at first. As well, many of the tools that were previously quite annoying to use, (anything other than a picture / label/ button) have become extremely easy to configure. To create a menu, or list box, you can add items or different options right in the properties, saving quite a bit of time on coding, which will probably come quite useful during tests.

Another thing that is awesome about VB, other than extremely weird input boxes (C# GTA style), to convert a variable from string to integer, is really easy, and helps an incredible amount in printing out solutions. As well, being able to dim variables in the buttons themselves, public variables across forms without the hassles of modules is really quite awesome, and having programs return code form other forms requires about 4 lines of code, which is why C# is awesome, if one ignores the semicolon. One last time, I also now hate squiggly lines with a passion. I spent the better part of 20 minutes trying to make a get statement work, mainly because I didn't realize it needed squiggly lines. And that about sums up my gripes with C# for week 1. Farewell my loyal fans.

Week 1, post 1 (Semicolons suck)

A new beginning. A painful, painful new beginning. Oh so very painful. The first day of programming. Other than the pain of waking up, my brand new nemesis: C#. It's like Microsoft's version of a bad joke (other than Vista, ME, and most of their video games.) A interface designed for easy use, easy access to users of all level. Except for one, massively humongous huge error. Semi colons. What....where.....they....thinking. "Hey, let's create a program so that it will be easy to use, but not only NOT include semi colons, but force it to be used for every thing written." A multi million dollar operation, but they can't auto include a semi colon when the user forgets it.

On the bright side, other than the fact the coding is extremely strange, it looks rather simple to use, and pressing tab and letting the program write the code for you is pretty awesome. Another issue, why force the user to use so many different type of brackets. Clearly simple is bad. And that is all for this issue of I hate semi colons. Good day to you my fans, and may the semi colon be with you.