Friday, 25 May 2012

...

First of all, the class certainly prepared us for the AP, without question. (Not that that's a very big accomplishment, I certainly hope the AP does not accurately represent the content covered in a college class.) Second of all, despite any problems I had with the class, I very much enjoyed it as a whole.


This class should not be any simpler. In the description for the course it says that computer science requires prior knowledge of java/another language. If anybody requires a longer introduction than the one given, then they should take computer programming first. I understand that oop and programming in general can be hard to teach, but if somebody is having difficulty learning about them they should instead take an introductory course. If the course were any simpler, it would seriously deter those who did understand the concepts. 


Although self-motivated projects are inherently engaging, teacher guided projects will always be faster and ultimately more informative. Self guided projects are usually guided through online resources, and thus there is no guarantee I will be able to finish said projects. The guidance of a teacher, or at least a single well-written walkthrough, will both increase the productivity of a student on a project and what a student learns from a project. This leads into my next idea,


Have more projects. Pong was fun to do; having a clear set goal for a project, and the knowledge that I have to finish said project, is extremely fun. More so, everybody was working on the same project, and so getting advice on an issue was extremely easy. Pong itself was relatively simple, more complex projects would certainly be welcome, especially if it required a lot of thinking about how to efficiently code the program. There was little effort actually put into the general method I would use to make pong work, instead the challenge was simply working out bugs.


Not enough focus on efficiency and general coding practices. In the first coding class I took, I was told that the question is not whether you can make a program do something, it's whether you can me it efficient. This isn't really something that was ever mentioned in this class. The use of profilers, for example, to find computationally heavy spots in code should definitely be talked about in class.



Saturday, 19 May 2012

Last 3 weeks

Two weeks ago I was primarily studying for the AP exam, and after taking the AP I have to say that I did not need to. The practice materials had some content I needed to look up: ternary operators, parts of the string class that I don't normally use (a lot of this), and some other miscellaneous code. However, the AP itself had very little even remotely complex content. A specific question I remember quite well had a list of 3 search algorithms which, in theory, found the largest value in an array. One of these, however, used -1 has a default that would be replaced by the next value in the array if it was stated to be the maximum value. Because of this, if -1 was the largest value in the array (there was no precondition that would exclude this as a possibility), then the array wouldn't work. This was the only question that had this small of a problem and thus I thought it might be designer oversight rather than a hard question. Other than this, the AP was fairly basic. This isn't to say that it was badly written, it covered the content it was meant to cover and did it quite well, just that they don't seem to be grading high school APs on too high of a bar. (Watch as I get a 4...)

Outside of class, I've been working on a quadrillateral-based 3D engine. To map the textures I am using affine transformations, a very low-cost method of perspective transformation. The reason this is not used normally is that it isn't entirely accurate and thus must be modified, but this required more processing power. The affine transform is more acceptable on quadrilaterals, thus why I decided to make a quadrilateral-limited engine. A while back I derived a series of equations to run this off of, using perspective matrices. However, I've been experiencing some weird image warping with this, so I need to re-derive the equations. Going off on a bit of a tangent, but learning about the actual application of matrices in computer science has shown me something about how idiotic it is to solve matrices by hand, as taught in algebra 2.

I've also been studying for UIL on my own time... when I read a question which required you to figure out the sorting algorithm a program was using based on the time it took to execute it hit me just how much there was study. Big O notation and sorting algorithms in general seem to be a huge part of the higher up UIL exams, so I'm putting a large portion of the time I spend studying into studying these.

Monday, 16 April 2012

Gridworld

The Gridworld API is really strangely set up and I don't have any other commentary on the subject. The test seemed reasonable and we didn't really do anything else.

Friday, 6 April 2012

Worksheets!

I was sick Monday of last week, so I only came to class on Tuesday, during which I did 6 worksheets and 2 labs, and I don't have a lot of commentary on the subject other than that the worksheets seem very repetitive, and providing the same methods with many different input values doesn't seem to be teaching me anything.

Java, not in 3d

Last weekend, while I was sick, I made a very small 3D engine, using a very primitive method used by very early 3D engines. This bases around the equations
x = x1/z1
y = y1/z1
where x and y are the 2D points to be displayed and x1, y1, and z1 are the input coordinates for the 3D point. This equation simply scales the x1 and y1 coordinates of the 3D point by the z1 position, in order to create a sense of depth. The "camera" is centered at the origin. Then, one does a series of modifications to make this work with alternate directions, camera positions, and field of view. Up until now Daniel has been looking through different forms of 3D rendering and I can definitely see myself going down the same path.

Thursday, 8 March 2012

Code Wars

The problems given at code wars were... interesting. They all had quite a bit of variation between, and the majority of them were difficult but doable. Some of them would be simple to very experienced coders (Maze solving algorithm), but would be out of reach of beginners. In general the questions were very well put together, and favored elegant design over large switch cases. The throw away questions were sparse and didn't get in the way of proper challenges, and the hard questions were appropriately scored. The only problem was the internet, and that's a technical problem, not a design problem.

Most importantly, though, the jokes were only slightly stale.

Wednesday, 29 February 2012

Poing

Last weekend I made a vector class, though it didn't support dynamic vectors. Thus, I threw together some extremely bad code to remake the vectors for the paddles every cycle. This worked well enough, but the hit testing on the sides of the paddles is extremely inaccurate. Generally I have enjoyed this project, having more involved labs I find to be much more enjoyable than the simple ones we have had in the past.

Wednesday, 22 February 2012

Vectors!

Last weekend I derived an equation to find the distance from a line to a point and implemented this into an algorithm in a vector class. In order to do this in an appealing way I taught myself about nested classes (quite simple) and Image IO. (Although I couldn't recite the code, this also proved to be fairly simple.) Currently I'm trying to figure out how to make an efficient and simply way to present a class that will run saving the vectors and generate a corresponding image to run alongside the vectors, with my goal being making a randomly generated top-down game.

I don't have any major commentary on the class except that some of the worksheets did seem superfluous, though I did get a fair amount of the questions wrong so I can't honestly present any criticism on the issue. 

Wednesday, 15 February 2012

Late late post

Last week we learned about inheritance, interfaces, and static classes. These are three things that I have wanted to have formally explained to me for a while, so these presentations were fairly interesting. However, the worksheets felt extremely repetitive; Some of them were the exact same code as another worksheet but with different variables.

Other than that, the labs seem to be getting harder, which is nice as they can serve as more than 30 seconds of quick coding. That being said, I don't see a reason that, at this point, the class can't just write the code entirely from scratch rather than using partially prewritten classes. The only thing that was necessary for the pong lab that hasn't been taught yet was graphics, and it wouldn't be hard to provide a graphics library.

Monday, 6 February 2012

Arduino

This week we reviewed oop, nothing I can comment on there.

SO I got an electret microphone with the intent to use it with my arduino, however I found that my arduino would not pick up the signal from the microphone if I hooked the mic up the same way I would a button or photoresistor. Thus, I did a little more research and purchased a 386 amp to amplify the signal, as well as capacitors and resistors to regulate the voltage. The arduino is now picking up the signal to a degree, though it still is not responding to sound. What I did notice, after reading the datasheet, is that the mic gives the raw audio waveform, with values alternating and varying 0 to 100 or so.

Monday, 30 January 2012

Reference variables

Although not immediately useful, the last week definitely contained some very important information. The use of references vs pointer is fairly intuitive in java, though I can see this being a roadblock if I were to, say, teach myself C++. I don't have a lot of commentary on the subject, and I haven't been working on many programs recently, so this blog entry is going to be fairly short.

I have, however, been working more with arduino. I am using an electret microphone to detect sound, though the resistance it provides is not significant enough for the arduino to pick up, so I ordered an LM386 amplifier to amplify the difference.

Monday, 16 January 2012

ArrayLists, JFrame, and Eclipse

Something I realized while at UIL was how insanely useful eclipse. Eclipse shows the user things that they might not be introduced to otherwise by suggesting fixes for errors. Eclipse makes it easier for a user to write without memorizing methods and also allows the user to learn new classes much easier. It seems unnecessary to memorize so much in programming and have to think about so many things when a computer could very easily do that for you.

Arraylists I had already taught myself and they're very straightforward if you understand how normal arrays work.

I've been trying to teach myself how to use PFrame and JPanel, though there is something I clearly don't understand in the classes, probably involving inheritance and the super() method. I've been procrastinating on teaching myself how to use inheritance so I'm probably going to do that soon.

I also finally realized what the difference between static and nonstatic is, and I have to say that the online sources for it make it much more complex than it is.