Keeping up with Object-oriented Programming

Programming :))

Let’s face it, programming is not that easy. No, it was never easy for me.But, I think the practice and the training I got from the university made me who I am not–not yet an expert but I think I am knowledgeable enough. I am on the final hurdle of my student’s life. And guess what, I am on the edge of wanting to finish it sooner. Yes, if I have all the capability and the power I would have done it. I want to start facing the real world. And I think when a person graduates from the University or starts to have his or her job, you can have your freedom. This one is applicable only to me. 🙂

But before blabbering about everything that I want, there is one thing that I should say here. OOP is somewhat difficult. At first. Yes, my final system as my Special Problem is all about Object Oriented Programming. Yes, and I suck at this one. I mean, I was trained to do it in the traditional way. So relearning OOP is somewhat difficult. It means tracing the whole code when you want something to be changed. And tracing some more when you want to add a certain function. And messing up a lot of the functions when you add yours. Programming is really tedious.

And something that I learned from this one : “When it’s working, don’t mess it up.” 😉

And so, now after almost a month of reading and testing the codes I now know the basics. :)) yeah. Sorry, but my capability as a programmer is not yet that advance, so I learn things slowly. But, once on track, I want to learn more. And yes, I now know how to make objects, instances and call the get functions and inherit methods and so on. I don’t want to get too technical here, I am not yet an expert in this one.

I wish I could finish them all before the end of September, I still lack three modules. Wish me luck, hope I can squeeze those three in two days. 😀

Advertisements

SEO and Stuffs

Let’s face it, marketing online and business online are among the most popular job or business that people does nowadays. Aside from the fact that they are convenient(you just stay at home, sit in front of your computer and earn money), there are a lot of room for improvements and learning new things from day 1 never ceases and hmm– it’s easy money when you know a lot of things or when you are willing to learn a lot of new stuff.

Let me just clear it I’m not an SEO-expert, not yet. I got this new job with a good pay and I’m glad that I’m learning a lot from it. It’s not easy, but I think this job is better than the previous that I had. I’m a Computer Science major and I think I owe it to myself to learn things like this. I know this is not part of what I have learned from school but learning those things might be good on my resume.

I’m still on the final stage before I graduate. Let just say, the final hurdle. The most crucial part so I’m a bit busy too, but I won’t stop this job. I need this. I want this.

One of the lesson that people should know about SEO and stuffs and other internet marketing and online business and others is that they all requires a lot of patience. And know where you should get your information from. 😉

Disadvantage of having too many username and password

Changing your username and password all the time when you sign up to a new website has it’s own advantage and disadvantage.

Yes, it is advantage due to the fact that it increases your security for a certain site.

But the disadvantage of having too many is that the possibility of forgetting them is high. Well, you need to work on this. You need to remember them or maybe try some back up plans. Gee, this is really a tough one.

But I’m happy now. So welcome me back to my blog. xD

Assembly On-the-Spot Programming

For the past few days, I have been freaking out due to the fact that our on-the-spot programming(otsp) is coming.

OH, by the way otsp is a programming exam, wherein students are given a set of problem that they needed to program in a limited time. The time can range from 1hour to 3 hours. 1 hour if your instructor is a bit of a terror. And 3 hours if he wants to maximize the laboratory time.

Now, after worrying about it over the weekend. I am so happy due to the fact that I made it. I passed our On the Spot programming in Assembly language. And as far as I know, Assembly is the most difficult language that I had encountered in my Computer Science Life.

But, Gee….

Now, I am really enjoying being a comp sci. Though, I need to prove many things.

Learning the Basic

As I tried to learn the basic of Assembly, I realized that my skills in programming is not that good yet. I have to practice my skills. I really think that practicing is my ticket in learning this language. It is so hard. But I think, I am persistent enough to learn it.

Compsci family…..

picz

picz

pic45696_107293180255_553670255_2057735_2641018_n5696_107288835255_553670255_2057637_2693177_n

My comsci family….

Free Microsoft Windows suite

Believe it or not. Microsoft will be giving away for free its microsoft windows suite which includes Word, Excel and Powerpoint. This free windows will gonna be its answer to Google’s docs, the free document and spreadsheet editing tool.

I think this idea is hard for Microsoft to make, because, the windows is one of its most profitable product that they have, according to report, the windows suite gives Microsoft its $9.3 billion profit in their $14.3 billion total software sales.

But, i guess, the main reason for this is of course the competition in the market of computers, which includes the internet, software programs and all those hardware stuff.

Also, Google has its own web browser, Google Chrome, which is I think is so good.

May the best business enthusiast win this battle to rule over the computer industry.

Technology on the Go…

technology

technology

Believe me or not, but I guess having an iphone, ipod touch, ps3, wii, or even an xbox arcade, can make every teenagers life as adventurous as  ever. And getting those “techy” things can make anyone happy.

Aside from that, in this era of computers, cellphones and technologies that were not possible 100 years ago, having this things nearly reach the Need part. But, 0f course, we should know that this things were wants. *giggles* More

Hashing with Linear Probing

HASHING

To store data into the hash table, one must know that in order to do this, a certain value must be divided. For example if the data is consist of n integers and we have k number of cells. Then the address wherein the data would be stored is the function:

hash= n % k;

The above algorithm will only work if the given data is in integer. How about strings or character datas? For strings of integers this is done by splitting the string into equal numbers of substring, where each substring can be represented as an integer. In this way, the n in the hash function can be found by adding the value of each substring. While in the character scenario, this can be solved by assigning each letter to their corresponding place in the alphabet. For example, the letter A is 1 while Z is 26. In this manner, all letters has their own number correspondence. In the string of character problem, this problem can be solved by just adding the corresponding number of each letter, thus gaining a single number to be hashed.

The main problem that would occur is the collision, this is a scenario wherein, there will be a limited number of memory, and two or more data can collide in a single address. This problem can be solved by a rehashing algorithm

.

Linear Probing

The need to have a rehash function arises when a collision occurs. This happens when two or more information would collide on the same cell allocated for the hash table. Thus, a rehashing is needed.

Since we know that the hash function for storing the information or data into the allocated memory is done by getting the remainder of the data’s numerical equivalent divide by the number of space allocated. Then, the rehashing function is the method for finding the second or third or so on location for the information.

One rehashing technique is the Linear Probing, where the rehashing is done by looking for the next empty space that it can occupy. The function for the rehashing is the following:

rehash(key)=(n+1) % k;

This method works in such a way that if the first location is not free, then it will go to the next location and check if that location is free or not, and so on until it finds a free location or can’t find anyone at all.

For formality and familiarity’s sake, an empty space would be given a -1 value while a deleted data’s space would be -2. In this way, finding an empty space is easy and also the search for a stored item would be easier.

To test this algorithm, the use of the following example is needed.

For example, we have a hash table that could accommodate 9 information, and the data to be stored were integers. To input 27, we use hash(key)= 27 % 9=0. Therefore, 27 is stored at 0. If another input 18 occurs, and we know that 18 % 9= 0, then a collision would occur. In this event, the need to rehash is needed. Using linear probing, we have the rehash(key)= (18+1) % 9= 1. Since 1 is empty, 18 can be stored in it.

To retrieve data, the hash function and the rehash function were also useful. Using the example from above, retrieving 18 is done by using the hash function to find the key and check if the data would coincide to the data needed. If not, then the rehash would be needed. Until such time the correct location is found or an empty space is encountered(that is the value of that space is -1), which means that the data does not exist. This is authentic because, the path of the search function would be the same path that was used in storing the data. In this sense, if an empty space is encountered, it all means that the data does not exist, logical isn’t it?

The use of the -2 value for deleted items is useful in such a way that in traversing the hash table, encountering a deleted cell would not end the traversal.

MORE EXAMPLE(Linear Probing)

For example, 5 spaces for integers. Input: 1,5,27,25 21, 30. Delete 5. Look for 25, 29.

Solution:

INPUT:

*To insert 1, 1 %5=1, therefore 1 is stored at array[1].

*To insert 5, 5%5=0, therefore 5 is stored at array[0].

*To insert 27, 27%5=2, therefore off to array[2].

*To insert 25, 25 % 5=0, since 0 is occupied, rehashing is done, 26%5=1, rehashing is done again, 27%5=2, then 28%5=3. Since 3 is -1, 25 can be stored here.

*30 cannot b e stored for insufficient number of memory allocation.

DELETE:

*Look for 5, using the hash, we found 5 at location 0. Then, we assign a new value -2 location 0 to indicate this value have been deleted.

RETRIEVE:

  • To look for 25, we use the hash key, to find its location. And found 0, but then the value stored I n array[0] is not the same, therefore, the rehashing would be used. Then we traverse the hash table, until we found the right place.

  • To see if 29 does exist, we use the hash and rehash to find if they exist.

calendar

November 2018
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
2627282930