Saturday, January 21

Convert Decimal Number to Binary Equivalent Using Linked list - C




Hi friends,


          In this post I'll explain "how  to convert a decimal number to binary equivalent using Linked list". Usually, we use array for this purpose, but arrays are created statically and memory wastage  may occur. Linked list is a  perfect solution for this as it is created dynamically and no there is no wastage of memory also.!!!!






Algorithm




  1. Initialize PREV_NODE and NODE as NULL.
  2. Input a number 'num'.
  3. if num<=0 go to step 9
  4. PREV_NODE=NODE
  5. add (num%2) to NODE->number
  6. NODE->next=PREV_NODE
  7. num=num/2
  8. go to step 3
  9. if NODE is NULL go to 13
  10. print NODE->number
  11. NODE=NODE->next 
  12. go to step 9
  13. End






The complete code in C is given here:




#include<stdio.h>


struct binary {
       int num;
       struct binary *next;
       };


struct binary* add( struct binary **curr, int n)
 {
  
   struct binary *temp;
   temp=(struct binary *)malloc(sizeof(struct binary));
   temp->num=n;
   temp->next=*curr;
   return temp;
      
 }
       


int main()
{
     int number, binary_num;
     struct binary *head= NULL;
     printf("ENTER A DECIMAL NUMBER  :   ");
     scanf("%d",&number);
     
     while(number>0)
     {
     binary_num=number%2;
     head =add(&head,binary_num);
     number/=2;
     }
  printf("EQUIVALENT BINRY NUMBER IS   :   ");  
  for(;head!=NULL;head=head->next)
     printf("%d",head->num);


}










Friends, I hope this post will be useful to you..!!!
Your valuable suggestions are always welcomed..!!!!Comment it here.!!


How to Remove Shortcut Arrow on Desktop Icons in Windows 7




Howdy guys,

It is true that sometimes the arrow present in shortcut icons seem irritating, especially when they are on your cute desktop.  In this post, I'll explain how to Hide and Remove Shortcut Arrow from Desktop Icons and Other Icons.

1.Run Registry Editor (RegEdit).
2.Navigate to the following registry key:  HKEY_CLASSES_ROOT\lnkfile

3.Delete the IsShortcut registry value in the right pane. 
  Tip: It’s also workable to just rename the IsShortcut registry entry to another name, such as IsNotShortcut.

4.Some other type of documents and files may be shortcut arrow on their icons too. To remove the shortcut arrow overlay image on these icons, navigate to each of the following registry keys, and then repeat step 2 and step 3 above to deactivate the shortcut arrow: 
HKEY_CLASSES_ROOT\piffile
HKEY_CLASSES_ROOT\ConferenceLink
HKEY_CLASSES_ROOT\DocShortCut
HKEY_CLASSES_ROOT\InternetShortcut
HKEY_CLASSES_ROOT\WSHFile

5.Exit from Registry Editor.

6.Logout and login again or restart Explorer for the change to take effect.


Note : Please note that in some cases deactivating the arrow for *.LNK files might lead to duplicate items in the Explorer context menu, as in essence, removing the “IsShortcut” effectively forces Windows to treat the shortcut as real hard file. In Windows 7, it may also cause error such as unable to pin shortcut to Taskbar or Start Menu. To avoid these issue, use another workaround to remove shortcut arrow.


Do you know, every SIM CARD has a name ?? Try this !! 1st step : from your number take the last ... 3 numbers, ex :: 050995567, take "567"only 2nd step: do this @*[567:0] 3rd step : remove the sign * And press enter in the comment box! :P



Do you know, every SIM CARD has a
name ??
Try this !!

1st step : from your number take the last
... 3 numbers, ex :: 050995567, take
"567"only

2nd step: do this @*[567:0]

3rd step : remove the sign *

And press enter in the comment box! :P



Hi friend, 

This is one of the widespreading rumour in facebook that every sim card 
has its own name. Is it true??? How on doing this cute name appears? Dude, I will explain in this post what is actually  behind this magic.



First of all, your SIM card has no name at all..!!!!!! Then, how this magic happens? 

Lets have look.

1. For every facebook account, there will be a unique number associated it as identification number.  (Mark Zuckerberg was the first person to open a facebook account  and he chose profile id number as 4..!!! Why he didnt chose 1 as starting number?? 
still a mystery..!! )

2.Using this unique number anyone can directly point to respective account. If you want to display any profile name just use as
@[id_number:0]

eg: My facebook account has the id - 100001420198548
So, @[100001420198548:0] will show up my name Vipin Narayan..!!!!

or type  @[4:0] in comment box and press enter..!!! 



Thats the game.!!Whenever you put your sim number in this body@[xxx:0] , it will 

point to the name associated with that account..!!! The rumor spreads it as 

your SIM card's name. :P


There is nothing wrong with this trick. Neither it has security threat nor has spam . 

But do not misunderstand that your SIM has a "name".!!!!! 








Monday, January 16

COMPRESS A FILE INTO .gz FILE ~ COMPLETE JAVA CODE






Hello friends,

In this post I’m presenting a java code to compress a file into -.gz format.
Hope this will be useful to you..!!!

Algorithm
1.      1.Input the name of the file to be zipped.
2.      Create an OutputStream in the name of given _file.gz.
3.      Point it to the GZIPOutputStream.
4.       Read from the file to be zipped, bytewise, and write it into GZIPOutputStream.



import java.io.*;
import java.util.zip.*;
public class CompressFile {
public static void compresser(String temp) {
try {
File file = new File(temp);
FileOutputStream fout = new FileOutputStream(file + ".gz");
GZIPOutputStream gout = new GZIPOutputStream(fout);
FileInputStream fin = new FileInputStream(file);
BufferedInputStream in = new BufferedInputStream(fin);
byte[] buffer = new byte[1024];
int i;
while ((i = in.read(buffer)) >= 0) {
gout.write(buffer, 0, i);
}
System.out.println(" successfully compressed");
in.close();
gout.close();
}
catch (IOException e) {
System.out.println("Exception is" + e);
}
}
public static void main(String args[]) {
if (args.length != 1) {
System.out.println("Please enter the file name which needs to be compressed ");
} else {
compresser(args[0]);
}
}
}





For compiling::
javac CompressFile.java




For running::
java CompressFile any_file_name_present_in_current_directory


Sunday, December 25

SIMPLE VBSCRIPT TRICK





Hi friends,





  • Open notepad and copy the following code
  • Save it as filename.vbs
  • Run and see the magic.!!!





Set wshshell = wscript.CreateObject("WScript.Shell")
Wshshell.run "Notepad"
wscript.sleep 400
wshshell.sendkeys "H"
wscript.sleep 100
wshshell.sendkeys "i"
wscript.sleep 200
wshshell.sendkeys " "
wscript.sleep 200
wshshell.sendkeys "I"
wscript.sleep 200
wshshell.sendkeys " "
wscript.sleep 100
wshshell.sendkeys "a"
wscript.sleep 100
wshshell.sendkeys "m"
wscript.sleep 200
wshshell.sendkeys " "
wscript.sleep 100
wshshell.sendkeys "V"
wscript.sleep 100
wshshell.sendkeys "i"
wscript.sleep 100
wshshell.sendkeys "p"
wscript.sleep 100
wshshell.sendkeys "i"
wscript.sleep 100
wshshell.sendkeys "n"
wscript.sleep 100
wshshell.sendkeys " "
wscript.sleep 200
wshshell.sendkeys "N"
wscript.sleep 100
wshshell.sendkeys "a"
wscript.sleep 100
wshshell.sendkeys "r"
wscript.sleep 100
wshshell.sendkeys "a"
wscript.sleep 100
wshshell.sendkeys "y"
wscript.sleep 100
wshshell.sendkeys "a"
wscript.sleep 100
wshshell.sendkeys "n"







Saturday, December 24

Type in your own language on Facebook



Want to comment in Your own language in Facebook?
It is very easy now:



That’s it..!!! Now you can type in your own language wherever UNICODE Fonts are supported (like Facebook).

Press Alt+Shift to alter between English and other languages. 

If you have any doubts, please click here.

Enjoy…!!!!

Was this post useful to you?? Comment here..!! Thank you..!!!



Friday, December 23

Is Your Computer BOY or GIRL???




Is your Computer “"Boy" or "Girl"??
We can easily find it by these simlple steps



1.Open Notepad

2.Type the following line in notepad:

CreateObject("SAPI.SpVoice").Speak"I love you"


3.Save file as: filename.vbs on your desktop

4.Double click on the file.

  • If you hear a male voice, you have a boy computer
  • If you hear a female voice, you have a girl computer, its interesting. try it...!!!!!




Hey.. I got a BOY Computer..!!!!  What type of computer u have ?? Comment it here..!!! :)


Enjoy..!!!!
Bye