Tech Guide Blog

Tech Guide Programming Tutorial Tips Tricks

Archive for March, 2009

Linear Single Linked List C++

Posted by Admin On March - 26 - 2009

Hey, back to programming again in data structure. It’s now about Linked List, a linear single linked list it’s about to be explained in this post. We can imagine this like a chain, every data has a link to another data. Single Linked List is different from array. In array, we can only insert a new data to the last index after the last data. We can not insert at any place we want. So, the linked list was made.

linear-single-link-list

The Node

At linked list, we add a header, we called it node. This node is used for data to be linked to another data. It’s like each one person has one another person’s address. So, this is the advantage to use linked list instead of array. If a new data want to be placed between another data, we just have to change the address/ node of the data.

linear-single-link-list-add

Insert data

Feel confused? Let’s get to the code. I will make a simple linear single linked list that can insert a data at any index.

//====START====//

#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <windows.h>

class node
{
private:
 int data;
 node * next;
public:
 node()
 {
  next=NULL;
 }
  int get()
 {
  return data;
 }
 void set(int x)
 {
  data=x;
 }
 node * nget()
 {
  return (next);
 }
 void nset(node * nextnode)
 {
  next=nextnode;
 }
};

class Link
{
private:
 node * head, * tail;
public:
 Link()
 {
  head=NULL;
  tail=NULL;
 }
 void add(int data)
 {
  node * baru;
  baru=new node;
  baru->set(data);
  if(!head)
  {
   head=baru;
   tail=head;
  }
  else
  {
   tail->nset(baru);
   tail=baru;
  }
 }
 void view()
 {
  node * temp;
  temp=head;
  if(temp)
  {
   while(temp)
   {
    printf("%d",temp->get());
    temp=temp->nget();
   }
  }
 }
 void addmid(int index,int data)
 {
  int i=0;
  node *temp,*ndata;
  temp=head;
  ndata=new node;
  ndata->set(data);
  while(i<index)
  {
   temp=temp->nget();
   i++;
  }
  ndata->nset(temp->nget());
  temp->nset(ndata);
 }

};

//====END====//

It’s done. You can start to implement this code in your main cpp.

Popularity: 33% [?]

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

Protect Your Blog Article With CopyScape

Posted by Admin On March - 15 - 2009

cs-gy-3d-120x60Hello again, this time I will give you a tip to protect your blog article and content. I use a CopyScape plagiarism warning banner in my blog, thus this can help to prevent copasser (copy & paste) to grab your content, but this only doesn’t protect your blog from copasser 100%. Place and include copyright notices on each of your pages to own over your content. If you are sure that your content is original and you want to know is your content is being copied or not, you can go to Copyscape search and just type your blog URL and walla, there is it, if the result found nothing, so your content doesn’t being copied, still. Too bad if the result found many site or a site, that means your content is being copied by many other blog or site.

What you have to do if your content is being copied? Don’t be panic first. At first if you found the plagiarist’s site, try to be polite by sending the webmaster a message to remove the content or material that being copied. This step still not working, try to contact the web hosting that provided their site. If this still not working, try this tip provided by Copyscape, by file a notice of Digital Millennium Copyright Act (DMCA) infringement  to have the plagiarist’s site removed from search engine results. If you need a proof , you can use the Internet Archive to show that the content appeared on your site is earlier than on the plagiarist’s site.

Well, if those ways still not working, note their address if any, and bomb their office and home, this will make the problem clear and ‘clean’.

Popularity: 31% [?]

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

Make Windows Menu Show Faster

Posted by Admin On March - 10 - 2009

As you know or not, Windows XP and Vista has a delay when you mouse over a menu. By default, Windows takes 400 miliseconds to show the menu items after you mouse over the menu. Sometimes, we think it’s too slow and of course we have a not so fast computer, make it so slowpoke’s performance. Actually, we can shorten the delay, even make it to zero. But, I recommend not to set it to zero, because it’s “too fast!”.

This is how to do it:

  1. Open the registry editor (click “Run” and type “regedit”)

    regedit

    run regedit

  2. Go to HKEY_CURRENT_USER\Control Panel\Desktop

    menushowdelay

    Menu Show Delay Key

  3. Double-click the MenuSHowDelay or right-click and click modify
  4. Modify the value of the delay lower than 400, or if you want to make it slower because your computer it’s too fast for you just input the value hingher than 400, but I recommend to trade your computer with mine.

    menushowdelay_

    Edit value

  5. Click OK and restart your computer to take effect.

Popularity: 10% [?]

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