Skip to main content

Gil

I suck at programming.
I'm not a good student.

From here on I'll be posting about software security using the hashtag

Minigames Project

2 min read

For our project we decided to make 2 games, one that will run in the Eclipse console and another one with a graphic user interface. First we decided the two games that we would do, Hangman and Tic Tac Toe. We decided to make Hangman run in the console since Tic Tac Toe would look kind of weird. The Hangman we did can be played by 2 players, in which one chooses the word the other player will try to guess in 6 attempts. The Hangman was pretty easy and we ended up finishing it in 2 days. Then we started doing the Tic Tac Toe, it was overall a kind of extensive process. At first we planned the logic of the game, how to win, etc. We decided that the best option would be to make vectors on the positions that you can put 'X' on 'O' in order to win. Then we thought that it would be better to play vs the computer, since it's really easy to counter the player moves on the game. So basically we did a multiplayer game and a one player one. 

We first tried to make a menu but we didnt know how to link to the minigames so we removed it. This is what it looked like: 

 

 

 

 

 

Hangman: 

Tic-Tac-Toe

In the process of doing our project we learned GUI(Graphical User Interface) implementations, we learned to use arrays, how a GUI works and apply them in the project, also we learned how to divide the work and connect it in Github.

"Making this project was really interesting, because it was one of the first times that I could translate cool ideas (like a videogame) into coding, you really start to notice that programming is like a second logic, another way of thinking. The Hangman was actually easier than we originally thought, but the Tic Tac Toe was a bit harder to implement in a GUI factor. We had to research quite a few things in order to fully be capable to finish the game but we managed to do it. It was really awesome and I wish I had more projects like this throughout my degree."

-Oscar López, 2016.

Luis Eduardo Vargas Victoria A01630086

Oscar Ricardo López López A01229116

Itzel cordero Sánchez A01113123

Gilberto Rogel García A01630171

Metaobject Protocol

1 min read

In computer science, a metaobject is an object that manipulates, creates, describes, or implements other objects (including itself). The object that the metaobject is about is called the base object.

metaobject protocol (MOP) provides the vocabulary to access and manipulate the structure and behavior of objects. Typical functions of a metaobject protocol include:

  • Creating and deleting new classes
  • Creating new methods and properties
  • Changing the class structure so that classes inherit from different classes
  • Generating or modifying the code that defines the methods for the class

Source: Wikipedia.

Course Review

2 min read

This course is not for the weak nor the procrastinators.

I think flipped learning and is good for students who actually want to learn because it gives you the choice to either procrastinate and waste time or organize yourself and your time to do the activities, homework, learn OOP, meet new people who can help you with OOP which is mostly what i did during this course (of course I did procrastinate a little, and by a little i mean ALOT, but I did everything, or at least most of what I was asked to do and some extra stuff which helped me with other courses).

During this course i learned Object Oriented Programming in the almighty JAVA programming language, and how did i did this? Well, first of all, without the help of my classroom partners or Lynda videos/StackOverflow/random websites i wouldn't be able learn the basic concepts of OOP such as what is an object, method, inheritance, polymorphism, delegation, use cases, a little of graphical user interface, etc.

I liked this way of learning mostly because it encouraged me to help myself and not procrastinate, i also liked it because i could ask anyone in the class about any problem i had and i would get help and answers real quick which helped me get my assignments done. I also had a lot of fun reading my classmates blog posts, some of them where funny, sarcastic and they really helped me with my WSQs and learning.

 

Gilberto Rogel García A01630171

sorryforthebadenglish:)

WSQ13 – James Gosling

1 min read

Sir James Gosling or best known as the father of the Java programming language.

So this guy started programming at age 14 because he broke into a --insert university's name here because i don't remember it-- data center and he kept going to that university to read and learn about the machines in that room and noone ever noticed because he figured out that if you pretend you're supposed to be there everyone else will think that indeed you're supposed to be there. When i was age 14 i didn't know what was i doing with my life but i never did something as clever as breaking into somewhere to learn stuff... this guy's crazy smart! But that's not the point here, the point is that he invented the almighty JAVA PROGRAMMING LANGUAGE. 

End of thinking capacity...

Gilberto Rogel García A01630171

 

 

WSQ12 Ward Cunningham

1 min read

"It's great to be here" You can see his face full of emotion.

The great Ward Cunningham, inventor of the Wiki, started with a little database made of cards using Hyper Card(It combines databse capabilities with a graphical, flexible, user-modifiable interface.) because his goal was the absortion of technology amongts technologist, and he made a database out of cards that tracked how ideas moved throught his company.

I find it really impressive how can just one person think of an idea to help himself and his company and it ends up being one of the most used tools amongts students and researchers or whoever uses it to find any kind of information, like, almost all kinds of concepts and information can be found there.

At some point of the interview the guy asked what should students learn or something like that and Ward replied that we should learn what a boolean variable is (-.-), jquery and javascript. Now i got more things to do during the summer.

Gilberto Rogel García   A01630171

WSQ11 Library Assignment

2 min read

Of course I'm stupid enough to not to read instructions so i went ahead and made the GravityCalculator Assignment... Code in github

after doing this i went on and read the instructions "again" and noticed i only had to do the Library Assignment, which asked to make two classes: Book & Library. Both classes had a bunch of methods to complete their task, but they were empty and what this assignment asked for was basically to fill in the blanks of every method to fullfil their function.

In the Book class for example it had:

public class Book {

    String title;
    boolean borrowed; 
// Marks the book as not rented public void returned() { // Implement this method 

}

}

And you just had to write the implementation inside the method. In this case it's easy because it only asks you to mark the book as not rented so the result should look like this:

// Marks the book as not rented
    public void returned() {
        this.borrowed=false;

} 

Final result of the class Book: Github link

The class Library was a bit more difficult, at first i didnt understand how should i implement them methods but with a lil help from Jorge Padilla's Blog and Luis Vargas's Blog i noticed that a book array made this assignment (and your life) less hard.

 

Result (NOT FINAL) of the class Library:  Github Link

HOW THE OUTPUT SHOULD BE:

HOW MY OUTPUT IS: 

As you can see i have 2 mistakes: 

  1. "Sorry, this book is not in our catalog" missing.
  2. The Lord of the Rings book shouldnt be available in the first library.

I couldnt figure out how to solve these mistakes... any help is appreciated!!. 

Gilberto Rogel García A01630171

Encuesta de Opinión de Alumnos (ECOA)

1 min read

I destroyed some of my teachers.                                                                                                        JK.

Gilberto Rogel García - a01630171

Can't stop procrastinating. (Second Partial Questions Review)

4 min read

After about 13 hours of trying to start studying i finally managed to do so. Here's a little study guide i made from the help of the Internet and other people's blogs: (INHERITANCE AND POLYMORPHISM ARE ON MY 1ST PARTIAL STUDY GUIDE POST)

Delegation: When an object receives a request, the object can either handle the request itself or pass the request on to a second object to do the work. If the object decides to pass the quest on, you say that the object has forwarded responsibility for handling the request to the second object.

CRC Cards: Class, Responsibilities, collaborators. Although CRC cards were originally introduced as a technique for teaching object-oriented concepts, they have also been successfully used as a full-fledged modeling technique.

Class: represents a collection of similar objects.

Responsibilities: something that a class knows or does.

Collaborators: another class that a class interacts with to fulfill its responsibilities

Overloading (compile time) and overriding (runtime): The most basic difference is that overloading is being done in the same class while for overriding base and child classes are required.

OVERLOADING: Method overloading in Java occurs when two or more methods in the same class have the exact same name but different parameters.

Also a valid case of overloading, since the   //parameters are of different types:   

int changeDate(float Year) ; 

int changeDate(int Year); 

OVERLOADING EXAMPLE

//A class for adding upto 5 numbers

class Sum {

    int add(int n1, int n2) {

        return n1+n2;

    }

    int add(int n1, int n2, int n3) {

        return n1+n2+n3;

    }

    int add(int n1, int n2, int n3, int n4) {

        return n1+n2+n3+n4;

    }

    int add(int n1, int n2, int n3, int n4, int n5){

        return n1+n2+n3+n4+n5;

    }

    public static void main(String args[]){

         Sum obj = new Sum();

         System.out.println("Sum of two numbers: "+obj.add(1, 2)); //3

         System.out.println("Sum of three numbers: "+obj.add(1, 2, 3)); //6

         System.out.println("Sum of four numbers: "+obj.add(1, 2, 3, 4)); //10

         System.out.println("Sum of five numbers: "+obj.add(1, 2, 3, 4, 5)); //15

    }

}

Here we have 4 versions of same method “add” which means you’re overloading the method add().

OVERRIDING: An overridden method would have the exact same method name, return type, number of parameters, and types of parameters as the method in the parent class, and the only difference would be the definition of the method.

OVERRIDING EXAMPLE

class Car{
    public int speedLimit(){
        return 100;
    }
}
class lilCar extends Car{
    public int speedLimit(){
        return 150;
    }
    public static void main(String args[]){
         Car obj = new lilCar();
         int num= obj.speedLimit();
         System.out.println("Speed Limit is: "+num); //150
    }
}

Here speedLimit() method of class lilcar is overriding the speedLimit() method of class CarClass.

  • What do you feel are the benefits to object-oriented programming?
  • Why do you think your change to object-oriented programming is difficult or what makes it difficult for the standard student?  

These two questions are more subjective so i'll let them be. 

Usefull Links: Delegation    CRC Cards    Overloading and overriding      More overloading and overriding

 

Gilberto Rogel García a01630171

WSQ10 College Advice

3 min read

"Work is supposed to be something unpleasant you do to get money to do the things you actually like doing."  So wise. Changed my perspective on life.

Joel's Seven Pieces of Free Advice for Computer Science College Students:

 

1-Learn how to write before graduating. (Done (i think so))

"I won't hire a programmer unless they can write, and write well, in English." I think i'm qualified for that job.

Of course, as a programmer you have to know how to write so you can comment and document your code so other programmers can understand it and work with it instead of rewriting it. 

2-Learn C before graduating. (Haven't even started YET)

I've met  a few programmers who have told me C is the base of everything, like the Big Bang of programming, but it is true than in school we don't have any courses that teaches us C so i'll learn it by my own on vacations or some break. 

3-Learn microeconomics before graduating (No thanks(perhaps yes))

Well of course i have to learn to make business so i can make more moneyyyyyyyyyyyyyy.

4-Don't blow off non-CS classes just because they´re boring. (OFC i won't)

I do have to get a higher GPA, my current one is 2.9 and some ot these non-CS classes help me raise it but sometimes this courses can be very time consuming which is the part i have to get used to in order to get a higher GPA.

5-Take programming-intesive courses. (Seems like a good idea)

I haven't taken any intensive courses but i've done some Codecademy courses which are very helpfull to learn the basics that i need for my current classes.

6-Stop worrying about all the jobs going to India. (What?)

 I don't really think that moving to India is the only choice but for me the only thing that is important in order to move to a different country is that there is good opportunities, tasty food and kind and awesome people to learn from.

7-No Matter what you do, get a good summer internship. (Sounds good)

"By the time you graduate, you really should have a resume that lists a whole bunch of programming jobs." I have to inmediatly start working on this, otherwise noone will hire me in the future.

 

In conclusion these 7 advices will help me be one of the most complete programmers in the industry which will help me get a better job and position but first of all enjoy and love my job.

 

 

Gilberto Rogel García A1630171