User Name
|
Cinjection |
Unique Hits
|
22,849 |
Real Name
|
Oleksi Derkatch |
Location
|
Canada Ontario |
Occupation
|
Student/Software Developer |
Gender
|
Male |
Age
|
22 Years Old |
WebSite
|
oleksiderkatch.blogspot.com/ |
|
|
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 |
|
|
|
Wordsearch generator.
C# (C Sharp)
|
3.84 Years Ago
|
2
|
7.50
|
Yes
|
6,886 Chrs
|
|
Generates a word search. The words a drawn from a text file. It starts with just a few words, so put in more if you want to have a more dynamic game.
|
|
|
Linked List in C#
C# (C Sharp)
|
3.84 Years Ago
|
3
|
6.00
|
- - -
|
3,397 Chrs
|
|
A small implementation of a generic Linked List in C#. Let me know if I'm making any C# faux pas. I'm still learning the language.
This list supports:
adding to the end
indexing
index lookup
re
|
|
|
Julia Set
C# (C Sharp)
|
3.90 Years Ago
|
1
|
- - -
|
Yes
|
2,209 Chrs
|
|
Draws the Julia set. This option lets you customize colors and the specific set. You can even draw the Mandelbrot set. Experiment with the colors to see some really pretty fractals.
|
|
Please login to post comments. |
|
Hi! I am Miss Becca
How are you today and how about your health,hope you are fine and good.Any well after going through your profile in this site i became interested in you.I will like to have you as my good friend whom i will like to share my life experience with.Your sex, age, race nor distance does not matter to me rather what matters most in a relationship is the maturity,truth and honest that exist between friends.So i will like you to contact me back through my private mail address([email protected] )So that i can tell you more about my self and send to you my photo.
Yours Sincerely,reply me here ([email protected])
|
|
Hello, i'm working on tagbtheory.com in my free time at the moment. My hands are 99% better now :-D tagbtheory will be finished within a few weeks since it is a vert small and very focused site... then resuming coderprofile.com (i have been doing bits of it recently tho). I want to release the new version over xmas. The new version tho is basically a new website altogether! It doesn't even look like coderprofile anymore. A new simplistic design as well (with colours lol). Don't worry tho, coderprofile is what i'm planning my retirement on :P
|
|
Hey up Cinjection. No i have not abandoned this place. I'm putting a business model into it. It's really hard when your giving everything away for free! lol. I've done it so that you guys earn money from your profiles. Though it wont be in the next few updates. If we can both earn money, we're both happy and i can reinvest the money back into this place (promotion, hosting, development, etc).
|
|
Just about the same as you. Going to a state university down here (Kansas State University) and majoring in Electric & Computer Engineering (double major). Been pretty busy with that and work. I wish Scott would get v2 up already.. jeez it's been almost 2 years!
|
|
Hey man.. browsing through this "dead" site and you came up. How you been? You still in college (or whatever it is called up there in Canada :P)?
|
|
Hey Oleksi, I just got a weird email from you to one of my personal email address'. You know anything about it? It was sent to a bunch of e-mails from a hotmail account with a URL to some Rx site.
|
|
Haha, that sucks. I think I'm back to work tomorrow too. I don't really know. Haven't heard from the boss and email is down. I'll have to give him a call and find out.
|
|
haha, not much man. How about you?
|
|
: Nick Pyren?
Don't tell me you actually found somebody you know on CP, Oleksi :p
|
|
I hear ya.. I fucking HATE CSS (yes.. the f word is needed)
|
|
 |
Oleksi Derkatch (22) Canada, Ontario |
|
Cinjection has 15 fans
become a fan |
|
 |
|
 |
|