Monday, January 12, 2015

Advanced Comp Sci Blog: Ideas for Group Projects

In Advanced Computer Science I have been working on the AVL Tree lab, which I thought was very interesting. I found it fascinating how through rotations the tree could keep itself balanced and therefore be efficient even when inserting a large number of nodes. I would like to continue with the presentations and learning c++, as I think much of what we have been learning as a class is very useful, especially structures, trees, and linked lists. I would like to have larger projects in c++ to more fully learn about the language, but am not quite sure what type of project. Doing a project as a class would be fun and we could potentially work together to make some sort of larger application. The only idea I have is to potentially make some sort of game, but I think we should brainstorm in class to think of an application we could make using c++. I would also be interested in having time to work on personal projects, as I would like to have time to start learning Ruby in class so I don't have to spend as much time out of class. Overall I have enjoyed Advanced Computer Science and am looking forward to the second semester.

Thursday, December 4, 2014

Advanced Blog Post 12/4/14

For the last two weeks in advanced computer science I have been learning more about c++, as well as various other small things. Most recently I completed the general trees lab. I wasn't entirely satisfied by the method through which I generated the tree because, while it was random, there were certain types of trees that it would never generate. For example, it could never generate a tree in which multiple children at the same level had children. So a tree that looked like this would never be created.

A way that it could be improved would be to add some sort of option to either add children to a random child or to go back up to the root and choose another random branch entirely.

As a side note I learned how to make popups in html. It takes forever in blogger because if there's a single mistake it doesn't tell me where the mistake is, it just doesn't work which can be frustrating. But the realization that there is the option to write all of my blogs in html has made writing blogs a lot more entertaining (and time consuming).

I am currently working on the UIL programming problems in class. So far I have been able to do all the problems pretty easily (although I have only done two because I got distracted and had to finish general trees and write this blog). I don't think I will have much trouble completing eight of the problems though. I actually enjoy doing the UIL problems because it is a fun way to practice coding while solving things that occasionally cause me to have to think to find a solution. I've done the problems in java so far but plan on also doing a few in c++ to get some more practice with the language.

Sunday, November 23, 2014

Webapp Blog Post 3

The Google App Engine eliminates the need to worry about web servers interacting with data that is spread around two many different locations around the world. The data repository is called a High Replication Datastore and uses the Paxos algorithm to replicate data across datacenters. Entities are data written to the datastore. Each entity has a key that uniquely identifies it in the database. There is also the option with each entity to designate another entity as a parent entity, making it the child of the parent entity. In this manner the datastore entities form a hierarchical structure. The hierarchical structure consists of ancestors, descendants and root entities. Ancestors are anything above the entity (its parents or its parents parents, etc.), descendants are anything below the entity, and a root entity is an entity without a parent. An entity descending from a common ancestor with another entity is said to belong to the same entity group as that other entity. These groups have a parent key, which is the common ancestor's key. This key identifies the entire group and ancestor queries which query of an entity group refer to the parent key instead of the specific entity key. A primary strength of the datastore is that it is very resilient in the face of catastrophic failure.

Sunday, October 19, 2014

HTTP GET vs HTTP POST Requests

The primary difference between HTTP GET and HTTP POST requests is that HTTP GET request asks for data from the specific resource while the HTTP POST request submits data to be processed. For example, in the Guess Number lab the get() method in my code responded to the HTTP GET request from the browser by writing a response that output "Good luck!" with a form asking for the initial guess a submit button. The form then uses an HTTP POST request to provide the guess to be processed by the post() method in my web application.

There are also other differences between HTTP GET and HTTP POST requests. HTTP GET requests include the parameters in the URL, are used for fetching content, have a maximum length dictated by the maximum URL length, are okay to cache, and should not change the server. HTTP POST requests include the parameters in the body of the request, is used for updating data, has no maximum length, is not okay to cache, and can change the server.

Tuesday, October 14, 2014

Vectors and Arrays Advanced Computer Science

After working with both arrays and vectors in c++, the primary difference I see between the two is that while arrays are of fixed length, vectors can constantly be added to by inserting new elements. This naturally inclines both of these different data structures to be effective for different tasks. While arrays are very good for programs in which I know exactly how long of an array I need, vectors are good for performing operations in which the length of the vector either changes or depends on the value of an alternate variable. For this reason, I find vectors to be much more useful. They also are useful in that they store with them their size and their capacity (how many elements could potentially be stored in the currently allocated memory block). Vectors also change the amount of memory they are allocated as their size changes and the memory they took up is freed when they are destroyed. The trade off of all of the benefits of vectors is that for small, short-lived arrays vectors are not as efficient. One example of when vectors came in handy was when doing the lab that the group presenting vectors designed. In the lab I had to iterate through thousands of triangle numbers to find the one that had over 500 multiples. This would have been impossible to do with arrays because I didn't know how many triangle numbers it would take to come to an answer (it ended up being a lot). However, with vectors, I was able to continue to add triangle numbers to the first position of the vector and expand the size of the vector until I reached the triangle number I wanted. Overall, I like using vectors more than arrays, but both data structures have their own advantages and disadvantages and which one to use depends largely on the situation at hand.

Sunday, September 28, 2014

Web Applications Blog Post 1


Learning HTML/CSS

I think that the way in which we learned HTML and CSS in the class was fairly effective. I enjoyed the different projects and think that those were the most helpful things we did. The powerpoints were also beneficial, but sometimes felt like an information overload because we went through them very fast. I didn't like using codeavengers. While it was sometimes helpful the majority of the time it was just regurgitating what was taught in the powerpoints and was not particularly innovative in how it did so; I didn't really like that codeavengers felt very tedious and was very particular about what it wanted. I would frequently do things correctly but not exactly how they wanted it, which was very frustrating. It felt a lot like busy work when we were doing it. I think that doing projects is the best way to learn to code because it forces me to figure out how to do things and I learn as I look things up while I go along. While the html projects were a little frustrating, I still learned a lot while I was doing them and think that they were worthwhile.

I learned the most when doing the Stanford assignments we did in class because they were very challenging. I had to spend a lot of time googling things and working with others to figure out how to make the assignments look right. The biggest thing I learned while doing the projects was the importance of divs, classes, and ids in organizing html to make for cleaner code and easier css. While these things are not necessarily visible on the page, they are very useful in organizing the page. Overall, I think that I learned a lot about HTML and CSS formatting and am much better prepared to use it effectively on projects in the future.