Coder Profile - Show off your skills, get a coder profile.
 
 
 
Intorduction to memoization.
Programming
Memoization(not memorization) is a programming technique often used in dynamic programming. In essence, it just means having your program remember previous calculations and reuse those results in similar calculations later. It's a rather simple technique and yet it can make a huge difference in efficiency. Let's the common task of calculating Fibonacci numbers. Say that I need to output the first n Fibonacci numbers. Well the simplest approach is to use tree recursion: Now although this solution is the easiest to formulate it is extremely inefficient. The reason why it is so inefficient, is because there is a huge amount of recalculation involved. Take fibonacci(6), which is to take the 6th term of Fibonacci. If we trace the recursive calls, we will see a structure similar to this: f(6) f(5) + f(4) f(4) + f(3) + f(3) + f(2) f(3) + f(2) + f(2) + f(1) + f(2) + f(1) + f(1) + f(0) f(2) + f(1) + f(1) + f(0) + f(1) + f(0) + 1 + f(1) + f(0) + 1 + 1 + 0 f(1) + f(0) + 1 + 1 + 0 +... View In Full
4 Comments 8.00 out of 10
Strings in C++
Programming
In C, if you ever wanted to use strings, you would need to use a null-terminated array of characters. It was ugly, unsophisticated, and very susceptible to buffer overflows. C++ and it's STL gives you a much better solution; the string class. Making a string is easy: #include <string> using namespace std; string firstName("Oleksi"); string lastName; lastName = "Derkatch"; Simple, as you can see. Strings keep track of their own size using the length() member: string name("Oleksi"); name.length(); //Returns 6 name = "ma"; name.length(); //Returns 2 As you can see, changing the string value is simple as well. If you need to access individual characters of the string, you can treat the string as a character array in C. That is, you can easily do something like this: string name("Jack"); for (int i(0); i < name.length(); ++i) { cout << name ; } C++ overloads the extracti... View In Full
1 Comments 6.00 out of 10
Vectors in C++
Programming
The C++ STL library defines a vector class which gives you a pre-made generic vector. You can use it in the same way as you would a regular array, only a vector is safer to use and more sophisticated. Creating one is simple: #include <vector> using namespace std; vector<int> myVector; You have now created a vector to hold integers. One of the best things about vectors is that memory for them is dynamically allocated. This is perfect for occasions when you do not know the exact number of elements you may need at compile time. Here's an example: #include <vector> using namespace std; vector<int> myVector; myVector.push_back(42); myVector.push_back(34); Note that I never explicitly tell the compiler how large my vector is. At this point in time, it contains 2 elements, but I can easily add another element to the back of the vector. If I need to get the number of elements in the vector, I can simply use the size()... View In Full
4 Comments 9.00 out of 10
Use Cases
Software Development
Intro Today I will be talking about use cases. This article is not about programming, but rather about planning software projects. A use case documents a feature that a user should have with the program. In a professional project, there are hundreds of use cases, one for every way the user can interact with the program. These use cases are developed with the client and the developers. It is a critical step, because it sets the basis for a lot of the subsequent work for the developers. Ultimately use cases create a list of things your program should be able to do. Developers can then follow this list and deliver software that accomplishes everything that the user wants. I see them as a godsend in project planning. You can group related cases together and their placement will almost directly relate to their placement in code. With an explicit list in front of you, it becomes much easier to see all the features your development team must finish. This become a lot more important... View In Full
7 Comments 8.75 out of 10
[C++] Pointers and their practical uses in programming.
Programming
Intro One of the most handiest features of C++ (and C) are pointers. Many beginner programmers learn about pointers and don't see the practical uses for them. This tutorial will go over pointers and point out multiple practical uses of them in C++. Some experience in C or C++ programming would be helpful, but not mandatory. What's a pointer? A pointer is a variable, like any other, only that a pointer variable holds a memory address. That is an integer will hold a integer, while an integer pointer will hold a memory address. At the memory address, the computer will find a pointer. Let's look at an example #include <iostream> using namespace std; int main() { int *pnt = 0; int x = 2; pnt = &x; cout<<pnt<<": "<<*pnt; cin.get(); return 0; } The code might seem a little confusing at first so I'll clarify. The first line creates a variable that will be a pointer to an integer. You can tell that it is a pointer, because... View In Full
2 Comments 9.67 out of 10
The Differences and Similarities Between C and C++
Programming
Intro There have always been debates about the differences between C and C++. Hopefully this article will clear somethings up. I've seen a lot of content online, where C++ programmers assume that they know everything about C, just because they know C++. This is not the case. Hopefully this article will illuminate these differences. Knowledge of C and C++ is recommended for this article. History C++ was created by Bjarne Stroustrup as a superset to C. He originally called it "C with Classes". After C++ became more and more popular, C++ began a standardization process and the name became C++. C++ contains all the features of C. That is to say that every C program is a C++ program, save a few specific times. All C++ programs are not C programs. The Differences Object Oriented Programming One of the most commonly known differences between the two programming languages is that C++ supports OOP and C does not. Although this is true, it is a very basic definition. C was orig... View In Full
0 Comments 9.50 out of 10
[C++] A tour of OOP
Programming
Intro to OOP Hey guys. Today I will be writing a tutorial on Object Oriented Programming(OOP) in C++. This will hopefully help someone learn the heart of C++ and will help me reinforce my own knowledge. The three major concepts of OOP are: encapsulation, inheritance, and polymorphisms. There's a mouthful! This tutorial will explain all three. Note that this article was originally written for Newgrounds and can be found there as well. Also note that all the dash characters (------) simply denote indentation. Encapsulation Encapsulation in programming refers to the containment of information. In OOP, you want to create objects that contain information about something in them. This information should be visible only to that class. This is the basis of encapsulation. In other words, all information in an object should ONLY be visible to that object, no other object should be able to see them. Here is an example of a program that does not demonstrate encapsulation: #in... View In Full
0 Comments 7.33 out of 10
[C++] Templates
Programming
I've noticed that there is no tutorial on arguably C++'s most useful feature, templates. I thought, what the hell, I might as well write one. Templates are a way of making functions and classes type independent. They allow you to write one general function/class, and lets the compiler determine the specifics, namely the type. Let's take a theoretical example of when templates can be useful. Adding. Say I need to add two numbers. The process is always the same, x + y. But you have to define different functions to do the operation with int and doubles. For instance, say I had a program that needed to add two integers and two doubles at any given time. There are several solutions. One would be to create two different functions like so: double addDoubles(double x, double y){ return x+y; } int addInts(int x, int y) { return x + y; } Alternatively, if we could make things more professional using function overloading: double add(double x, double y){ return x+y; } int add(... View In Full
0 Comments 8.00 out of 10
Page 1 of 1
Oleksi Derkatch (18)
Canada, Ontario
Cinjection has 14 fans
become a fan
� Applications
Articles Articles (8)
Source Codes Source Codes (59)
Code Pin Board Code Pin Board (13)
� About Me
About Me About Me
User Groups User Groups (11)
Portfolio Portfolio (7)
Friends Friends (91)
� Misc
Overview Overview
Send A Friend Invite
Send Message Send A Message
RSS Whole Profile Feed
 
 
Latest News About Coder Profile
Coder Profile Poll
Do you use RSS feeds?

Yes, all the time, first thing i do on the net
Sometimes, when i remember to check them
No, can't be bothered with them
No, what are they?


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
25 Days Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright � 2007 - 2008, Scott Thompson, All Rights Reserved