Originally, I was going to name this "First Thoughts on Darwin" or something like that. But that was because I wanted to make this post about a week ago...back when I had my first thoughts on Darwin. Not really accurate to have that now...
Anyway, this definitely seems like an interesting project. It seems like the most difficult project we've had, but also potentially the most rewarding. I might change my mind in a couple of days, but I think I will really enjoy this project, particularly the Object-Oriented nature of it.
I'd like to get started tonight if possible (might have to wait until tomorrow). Usually, I just start coding a solution right away, but I think I might actually do some design work beforehand (of course, I do a little design work for other projects too, but usually just in my head). This is definitely a project where good design will pay off (and bad design will really hurt). I want to make sure I make some good decisions when I'm deciding what classes to make, what they will do, how they interact, etc.
Fortunately, I already found out about a few suggestions (e.g., use a separate container for creatures instead of trying to place them directly onto the grid). I probably would have done something different...and likely more difficult.
If things go smoothly, I'd like to make at least one more post about Darwin, preferably when I am done. As I said, it seems like an interesting project, and I'd like to compare my thoughts before and after. Besides Allocator, this is the only project I've never worked on in a previous class (at least in some form).
Monday, April 13, 2009
Wednesday, April 1, 2009
Ask, and Ye Shall Receive
"Of course, as I read in another blog, I probably wouldn't mind maybe a little more OOP-specific stuff."
"I'm somewhat disappointed by the lack of reading assignments lately"
As the old saying goes, "Ask, and Ye Shall Receive."
Monday, March 30, 2009
Mid-Semester Review
I've been really slipping here lately when it comes to blog posts, although I'll try fix that from now on.
For now, I think I'd like to briefly discuss the course up until this point (about 50%-60% into the course I guess?). So far, I've been doing pretty well in the course (although I'm a little worried about the last project). Even better, I feel like I've been learning a lot. As usual from a Downing course, some of the lessons seem to cover some relatively obscure ideas, but in the end, there is a payoff. For example, the lessons about the Allocator and the Heap/Stack arrays helped to teach us about how memory gets allocated to our programs. Sometimes, the point isn't to actually use what is taught in class, but simply to understand what is going on (e.g., we saw arrays being allocated/deleted, but in practice, we'd want to use vectors).
Of course, as I read in another blog, I probably wouldn't mind maybe a little more OOP-specific stuff. I enjoy learning about C++ (probably enjoy it as much if not more than learning OOP concepts), but I do wonder how the rest of the course will be. I'm assuming we'll definitely get to the OOP stuff eventually (looks like we might get to classes and inheritance soon). Although looking at the remaining examples, it seems like it might be difficult to cover them all before the end of the semester (ugh...test 3 will be fun to study for).
I'm somewhat disappointed by the lack of reading assignments lately...ACK! Did I just say that?!
Seriously, I think it was kind of nice to do a little outside reading from time to time. Nothing crazy (60+ pages a day or anything), but just a little reading every week to supplement the lectures. I think the last reading I did for the class was about 4 weeks ago (I accidentally read Ch.4 in the OOP book a little too early), not counting any review I did for Test 2. And actually...I think I just skimmed Ch.4 since it seemed to review some concepts I'm relatively familiar with. *Edit: Granted, I could always read on my own...but what would be the point in that? Just kidding...think I probably will do that, if not now then after the semester is over (skim/read parts of the OOP book we didn't cover in class). Readings similar to the papers might be hard to find though, and I have enjoyed those (especially the last two papers).*
I think that's about all I have to say for now, but as I said at the beginning, I'll probably try to post a few more blog posts in the near future.
For now, I think I'd like to briefly discuss the course up until this point (about 50%-60% into the course I guess?). So far, I've been doing pretty well in the course (although I'm a little worried about the last project). Even better, I feel like I've been learning a lot. As usual from a Downing course, some of the lessons seem to cover some relatively obscure ideas, but in the end, there is a payoff. For example, the lessons about the Allocator and the Heap/Stack arrays helped to teach us about how memory gets allocated to our programs. Sometimes, the point isn't to actually use what is taught in class, but simply to understand what is going on (e.g., we saw arrays being allocated/deleted, but in practice, we'd want to use vectors).
Of course, as I read in another blog, I probably wouldn't mind maybe a little more OOP-specific stuff. I enjoy learning about C++ (probably enjoy it as much if not more than learning OOP concepts), but I do wonder how the rest of the course will be. I'm assuming we'll definitely get to the OOP stuff eventually (looks like we might get to classes and inheritance soon). Although looking at the remaining examples, it seems like it might be difficult to cover them all before the end of the semester (ugh...test 3 will be fun to study for).
I'm somewhat disappointed by the lack of reading assignments lately...ACK! Did I just say that?!
Seriously, I think it was kind of nice to do a little outside reading from time to time. Nothing crazy (60+ pages a day or anything), but just a little reading every week to supplement the lectures. I think the last reading I did for the class was about 4 weeks ago (I accidentally read Ch.4 in the OOP book a little too early), not counting any review I did for Test 2. And actually...I think I just skimmed Ch.4 since it seemed to review some concepts I'm relatively familiar with. *Edit: Granted, I could always read on my own...but what would be the point in that? Just kidding...think I probably will do that, if not now then after the semester is over (skim/read parts of the OOP book we didn't cover in class). Readings similar to the papers might be hard to find though, and I have enjoyed those (especially the last two papers).*
I think that's about all I have to say for now, but as I said at the beginning, I'll probably try to post a few more blog posts in the near future.
Tuesday, March 3, 2009
Correction on Earlier Post (Eclipse vs NetBeans)
In an earlier blog post, I was mentioning how I was trying out the NetBeans IDE, partly because I believed it had some features that Eclipse didn't offer (or at least didn't offer as easily). While that was more or less true for the versions tried out, it doesn't seem to be the case for the latest versions.
The version of Eclipse I was running is the one that Ubuntu seems to install by default. I forgot what version it is, but it is pretty old. The version is prior to the new naming conventions of the Eclipse IDEs (Europa, Ganymede, etc.). Of course, this was the case for the NetBeans IDE I installed too, but it wasn't as big of a deal (I had 6.1, and the latest was 6.5).
This past weekend, I decided to manually install the newest versions of Eclipse and NetBeans. After doing this, it became apparent that the newer/newest versions of Eclipse do indeed have support for SVN, UML, etc., via plugins or whatever, similar to NetBeans. This was my original assumption, which is why I was a little surprised that I didn't see those options in my original version of Eclipse. Of course, I'm not sure why Eclipse didn't try to tell me to upgrade to a newer version, but whatever...
So in conclusion...these IDEs are really similar. I'm sure each does some things better than the other, but I was actually somewhat surprised at how alike they are. After working with NetBeans for while (well, not that long), I can't really see too much reason to stick with it. Or, conversely, any reason why I should go back to Eclipse (other than familiarity). I think it more or less comes down to how much you like the interface for each one.
The version of Eclipse I was running is the one that Ubuntu seems to install by default. I forgot what version it is, but it is pretty old. The version is prior to the new naming conventions of the Eclipse IDEs (Europa, Ganymede, etc.). Of course, this was the case for the NetBeans IDE I installed too, but it wasn't as big of a deal (I had 6.1, and the latest was 6.5).
This past weekend, I decided to manually install the newest versions of Eclipse and NetBeans. After doing this, it became apparent that the newer/newest versions of Eclipse do indeed have support for SVN, UML, etc., via plugins or whatever, similar to NetBeans. This was my original assumption, which is why I was a little surprised that I didn't see those options in my original version of Eclipse. Of course, I'm not sure why Eclipse didn't try to tell me to upgrade to a newer version, but whatever...
So in conclusion...these IDEs are really similar. I'm sure each does some things better than the other, but I was actually somewhat surprised at how alike they are. After working with NetBeans for while (well, not that long), I can't really see too much reason to stick with it. Or, conversely, any reason why I should go back to Eclipse (other than familiarity). I think it more or less comes down to how much you like the interface for each one.
Friday, February 27, 2009
Templates
In a few of the recent lectures, we've covered function templates and the use of templates for defining new classes. In addition to the lectures, the latest reading assignment from the book (Ch 18) also covers templates (or generics as they're more generally known). For the most part, I haven't really used this to my advantage in the past, but after seeing them in use, it really seems like they can be pretty useful. They do have their drawbacks of course. It may be a little confusing to try and figure out what is going on exactly. What is going on may not be what the user intends. For example, as the lecture on Function Templates demonstrated, making calls to Function Templates can be somewhat confusing (EX: my_max ("stu", "pqr") completely ignores the non-template function that would make it work, but my_max("abc", "def") doesn't). But as shown in the example, it is nice to have a "single" function called my_max that can work with a variety of data types.
Even better is the use of templates for classes. When were producing the code for the stack in class, I thought we were limiting it to just ints (and initially, we were). But by using templates, we quickly allowed the stack to store basically any type T, as long as T supported the various operations stack used. Even further, you could basically pass in a value for the maximum size of the stack using the template syntax. This almost doesn't seem much different that simply passing in the size as an argument, but if there is only a default constructor (which takes no arguments), the max size of the stack can still provided as shown in the example (Stack x;).
The book covers some of the more confusing aspects that might arise when using templates. For example, what is the relationship between two objects that use the same template, but have different types? For example, Stack vs Stack. Or what happens if you extend a templated class in a new class, which doesn't use templates? Things can get a little confusing once you start extending these classes.
In any case, they seem like a pretty nice feature of C++ (and other languages), and I'd like to explore their functionality in the future.
Even better is the use of templates for classes. When were producing the code for the stack in class, I thought we were limiting it to just ints (and initially, we were). But by using templates, we quickly allowed the stack to store basically any type T, as long as T supported the various operations stack used. Even further, you could basically pass in a value for the maximum size of the stack using the template syntax. This almost doesn't seem much different that simply passing in the size as an argument, but if there is only a default constructor (which takes no arguments), the max size of the stack can still provided as shown in the example (Stack
The book covers some of the more confusing aspects that might arise when using templates. For example, what is the relationship between two objects that use the same template, but have different types? For example, Stack
In any case, they seem like a pretty nice feature of C++ (and other languages), and I'd like to explore their functionality in the future.
Monday, February 16, 2009
NetBeans
Over the weekend, I spent some time trying out the NetBeans IDE. Basically, it is an IDE by Sun Microsystems, somewhat similar to the Eclipse IDE, which is what I (and most people I know) tend to use for a lot of our Java/C++ projects. Like Eclipse, it natively supports Java, but plugins can be downloaded to enable functionality for C++ and other languages and/or features. Some of these features are actually what I wanted to try it out. For example, one of the plugins allows you to create UML. I haven't really tried it out yet, but I did check out a sample UML project they had which looked pretty good (although the sample was for a Java project if I recall correctly). If I'm not mistaken, Eclipse doesn't have this sort of functionality, so this is a nice advantage to NetBeans. If it does have that functionality, it certainly didn't seem as easy to enable compared to NetBeans (NetBeans did require a plugin, but it was relatively easy to find and enable).
Additionally, NetBeans has support for SVN and other "versioning" tools. Once you import your project into the depository, you can simply do commits, updates, diffs, etc., all within NetBeans. There are probably some more advanced options available, but those are the basics that I was able to quickly figure out. Again, maybe Eclipse has this sort of functionality and I'm unaware of it, but it seemed pretty easy to work with on NetBeans.
I can't say whether I actually prefer NetBeans to Eclipse, at least at this point. I definitly have grown accustomed to the Eclipse layout, so there has been a bit of a learning curve in figuring out how NetBeans works. I've yet to even use the debugger, which is one of my favorite aspects of Eclipse. I've also just worked on C++ (AustralianVoting), so it isn't like I'm using it for its original purpose (Java development).
NetBeans does seem like an interesting IDE. I don't know if I'll ever give up on using Eclipse, but I think I might at least use NetBeans when it comes to certain projects. It definitely seems to have come a long way. I think I checked it out years ago (maybe 2005?), and it didn't seem nearly as good back then. I almost didn't bother to try it out again due to my past experiences, but I'm glad I gave it another shot.
Additionally, NetBeans has support for SVN and other "versioning" tools. Once you import your project into the depository, you can simply do commits, updates, diffs, etc., all within NetBeans. There are probably some more advanced options available, but those are the basics that I was able to quickly figure out. Again, maybe Eclipse has this sort of functionality and I'm unaware of it, but it seemed pretty easy to work with on NetBeans.
I can't say whether I actually prefer NetBeans to Eclipse, at least at this point. I definitly have grown accustomed to the Eclipse layout, so there has been a bit of a learning curve in figuring out how NetBeans works. I've yet to even use the debugger, which is one of my favorite aspects of Eclipse. I've also just worked on C++ (AustralianVoting), so it isn't like I'm using it for its original purpose (Java development).
NetBeans does seem like an interesting IDE. I don't know if I'll ever give up on using Eclipse, but I think I might at least use NetBeans when it comes to certain projects. It definitely seems to have come a long way. I think I checked it out years ago (maybe 2005?), and it didn't seem nearly as good back then. I almost didn't bother to try it out again due to my past experiences, but I'm glad I gave it another shot.
Saturday, February 7, 2009
Computing Large Prime Numbers...Useless?
I used to think so. In fact, I believe it actually was useless, at least up until the 1970s. But since then, the properties of prime numbers have become quite useful for certain applications. One particular use of this computation is RSA encryption, which was briefly covered in a few of the courses I've taken here at UT.
I won't get into the specific mathematics of it all since Wikipedia/Google can provide a much better explanation than me. The basic idea is that it is easy to multiply two prime numbers together, but it is difficult to factor that product back into the original set of prime numbers. This is an example of a one-way function (also known as a trapdoor function), which basically means that the function is easy to compute but "hard to invert." Of course, given a small set of prime numbers, this isn't too difficult, despite the definition.
And that is why it is important to come up with large prime numbers. The larger the prime numbers, the more difficult it will be to factor the product back into the original pair of prime numbers. For example, could you easily factor 26,636,627 into two prime numbers? Certainly wouldn't be easy to do it with pencil and paper. Perhaps a computer could compute it if given enough time to run, but it might take a little while (certainly slower than factoring 6 for example).
Anyway, thought this was an interesting aspect to prime numbers. Oh and by the way, the factors are 3449 and 7723.
I won't get into the specific mathematics of it all since Wikipedia/Google can provide a much better explanation than me. The basic idea is that it is easy to multiply two prime numbers together, but it is difficult to factor that product back into the original set of prime numbers. This is an example of a one-way function (also known as a trapdoor function), which basically means that the function is easy to compute but "hard to invert." Of course, given a small set of prime numbers, this isn't too difficult, despite the definition.
And that is why it is important to come up with large prime numbers. The larger the prime numbers, the more difficult it will be to factor the product back into the original pair of prime numbers. For example, could you easily factor 26,636,627 into two prime numbers? Certainly wouldn't be easy to do it with pencil and paper. Perhaps a computer could compute it if given enough time to run, but it might take a little while (certainly slower than factoring 6 for example).
Anyway, thought this was an interesting aspect to prime numbers. Oh and by the way, the factors are 3449 and 7723.
Subscribe to:
Posts (Atom)