Tech Guide Blog

Tech Guide Programming Tutorial Tips Tricks

Archive for February, 2009

Boost Your Internet Connection Speed

Posted by Admin On February - 25 - 2009

This is very classic and simple method that can boost your internet connection speed. For example, Windows will default take your 20% of your bandwidth to do the automatic update. Whether you turn it off or not, it still take your 20% bandwidth. This can decrease your internet speed of course, but may increase your security. I believe, although your computer do update, but if your brain still dumb, it’s meaningless to do update. So, you can turn it off (You must at least run on XP Professional or Server 2003 to do it). How to do it:

  1. Click Start and click Run
  2. Type gpedit.msc and click OK
  3. Go to Administrative Templates -> Network -> QoS Packet Scheduler
  4. Double-click Limit reservable bandwidth -> Setting tab
  5. Enable it and set bandwidth limit to 0 and click OK.

Another way to boost your internet speed, don’t do too many simultaneously download. For Bit Torrent user, a torrent will eat your bandwidth although it’s download speed is 0 KB/s in downloading status. Just pause it if the download speed is low and wait for another moment where the Seeds and Peers are in frenzy mode.

Use third party download accelerator/ manager. This can help you to get optimal speed of your connection. Internet Download Manager is very good download manager, but it’s not free, it’s shareware. A quite good and free download manager is Free Download Manager.

After you do like the above, you can check your connection speed. A web like speedtest.net can help you to know how much your connection speed is.

If these tips and tricks still don’t increase your connection speed, please check these fundamental things.

  1. Are you using 56K Modem?
  2. What speed your connection is?
  3. Is the speed you get is the same as your provider promised at the promo so you use their product till now?
  4. How much you’ve spent your money for your modem?
  5. Change to another provider.

Popularity: 35% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter

Queue C++ Data Structure Code

Posted by Admin On February - 15 - 2009

Another data structures type is queue. Adding data is the same as stack, it’s called enqueue. The different between stack is queue use “first in first out”. The first data will be kicked out first when you dequeue it (getting data from queue). There are 2 pointers we can use in queue. Head is pointer that point the first data and tail to point the last data. This picture below may help you to understand.

linear_queue

Linear Queue

There are 2 types of queue, linear and circular. A circular queue has a shape like donut, so we can say the queue is connected. The different is at head position, a linear queue has a static head position, and a circular has a dynamic head position every time you do dequeue.

Circular Queue

Circular Queue

This time, I will only tell you how to make a linear queue class in header :D, it looks like stack application at previous post, so it’s unnecessary to write the main code.

//============== start of code ==============//
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#define MAX 255

class lqueue
{
private:
	int data[MAX];
	int tail; // linear queue has a static head, assume head = 0
public:
	lqueue()
	{
		tail = 0;
	}
	void enqueue(int value)
	{
		if (!full())
		{
			data[tail] = value;
			tail++;
		}
	}
	int dequeue()
	{
		if (!empty())
		{
			int temp;
			temp = data[head];
			for (int i = 0; i < tail; i++)
			{
				data[i] = data[i+1];
			}
			tail--;
			return temp;
		}
	}
	bool full()
	{
		if (tail == MAX)
			return 1;
		else
			return 0;
	}
	bool empty()
	{
		if (tail == 0)
			return 1;
		else
			return 0;
	}
	void view()
	{
		for (int i = 0; i < tail; i++)
			printf("%d ",data[i]);
		getch();
	}
};
//=============== end of code ===============//

It’s done. I think it should work fine :))

Popularity: 37% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter

Stack C++ Data Structure Source Code

Posted by Admin On February - 7 - 2009

This time I will show you how to make a stack structure class with Visual C++, I do this with Visual C++ 6.0 Enterprise Edition. Just for info, stack is one of data structure types where data is somewhat placed on top of another data (stack). Adding or removing data can be done only on top of stack itself, last in first out. The adding is called push and getting or removing is called pop.
If you want to put a new data, it should be placed like this.

stack-illustration

stack illustration

then, if you want to get a data, it should return the last data you put on it (top of stack).

stack-illustration

stack illustration

pop-stack

Pop Stack

The third picture is stack after being popped out. Let’s get to the code then, juts make a header file (.h) and start typing. I will make a simple application that can keep integers with stack method.

//============== start of code ==============//
#include <stdio.h>
#include <conio.h>
#include <windows.h>

#define MAX 255

class cstack
{
private:
	int data[MAX]; // this is the place to keep
	int top; // to point the top of the stack
public:
	cstack() // constructor
	{
		top = 0;
	}
	void push(int value)
	{
		if (!full())
		{
			data[top] = value;
			top++;
		}
	}
	int pop()
	{
		if (!empty())
		{
			top--;
			return data[top];
		}
	}
	bool full()
	{
		if (top == MAX)
			return 1;
		else
			return 0;
	}
	bool empty()
	{
		if (top == 0)
			return 1;
		else
			return 0;
	}
	void view() // make a function to view the data
	{
		int i;
		printf("Just another stack data:n");
		for (i = 0; i < top; i++)
			printf("%d ", data[i]);
		getch();
	}
};
//=============== end of code ===============//

After you finished, you can make a C++ source file (.cpp) and can use that stack class that have you made.

//============== start of code ==============//
#include "header.h" // this must be the same place with your header file

void main()
{
	int choice, temp;
	cstack stack;

	do
	{
		system("CLS");
		printf("MENUn1. Pushn2. Popn3. Viewn4. ExitnChoice: ");
		scanf("%d",&choice);
		system("CLS");
		if (choice == 1)
		{
			printf("Value: ");
			scanf("%d",&temp);
			stack.push(temp);
		}
		else if (choice == 2)
			stack.pop();
		else if (choice == 3)
			stack.view();
	}
	while (choice != 4);
}
//=============== end of code ===============//

Save it and compile to try this simple application.

Popularity: 50% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter