Wednesday, January 29, 2014

Do U Know : Differnce between IT and CS ????


Difference Between IT and CS :
--------------------------------------------- 

CS (computer science) describe what is the science behind computer..

how computer is engineered. include history, present and future of computer. including its application and lot many things.

while IT is some thing different...

it is study of technology..describe following things..

1. How to collect information from various source....
2. How to store information in such a way that it can be back in desire manner.
3. How to re-distribute information in such way that it fulfill the requirement.

and by chance computer is involve in the all activity. so, its look like computer and IT both are same.
but fact is that,
CS is a study of machine..
IT is a study of information gathering, storing and distributing.

now a days computer is main device that is used in such activity so IT very similar to computer science.
if in future any device will invented that will betterly fulfill IT requirement(information gathering, storing and distributing). than i am sure that IT people are going to learn that device.

Tuesday, January 28, 2014

Interesting Code. Program without main in C language....

Interesting Code. Program without main in C language :-------------------------------------------------------------

#include<stdio.h>

#include<conio.h>

#define decode(s,t,u,m,p,e,d) m##s##u##t

#define begin decode(a,n,i,m,a,t,e)

void begin()
{

clrscr();

printf("hello");

getch();

}

Friday, January 24, 2014

DO U KNOW???? HOW TO HIDE THE DISK DRIVE VIA MS - DOS....

TO HIDE THE DISK DRIVE VIA MS - DOS 

START -> RUN -> CMD -> DISKPART

( THEN THE PROMPT CHANGE TO DISKPART> )

TYPE “LIST VOLUME” (WITHOUT QUOTATIONS)

THEN YOUR SYSTEM WILL SHOW LIKE THIS

DISKPART> LIST VOLUME

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- -------
Volume 0 D DVD-ROM 0 B
Volume 1 C NTFS Partition 78 GB Healthy System
Volume 2 D NTFS Partition 78 GB Healthy "
Volume 3 E NTFS Partition 78 GB Healthy "
Volume 4 F NTFS Partition 64 GB Healthy "

DISKPART> SELECT VOLUME 3

Volume 3 is the selected volume.

DISKPART> REMOVE
DiskPart removed the drive letter, but your computer needs to be 

rebooted before the changes take effect.

Wednesday, January 22, 2014

How to execute a java code without using MAIN method?

How to  execute a java code without using MAIN method?

At Compile time ,compiler will not look for any main method but  at runtime, JVM will look for a main method .
At Runtime, JVM performs three main task  :

1> Class loading è where class will be loaded from file location into JVM.

2> Byte code verification where byte code verifier will verify the byte code

3> Runtime or Execution where JVM will look for main method in the java class and it will run that main method .

JVM looks  for main method in  the 3rd phase but what if we can execute the code before that phase…
Question : How we can run any code before the 3rd phase  ?
Ans:
We can run  a code  after the class loaded  using static  initializer or static blocks.
STATIC Initializer (Static block ):
Static block runs after the class is loaded into JVM but before the  main method.

Here is the sample code:

Class Test
{
          Static
{
                  System.out.println(“Hello…program without main function.”);
                  System.exit(0);
}
}
Output :
E:\> javac Test.java
E:\> java Test
Hello…program without main function.
E:\>

As you can see there is no main method in the code , but still its working because static block runs before the main method.  
But yes , at the end JVM will look for main method and throws the error to avoid that use System.exit(0)
Note:
è System.exit(0) :  Terminates the currently running Java Virtual Machine so that the code will not get into the third phase if we skip System.exit(0)  then JVM will look for main method and it will throw "java.lang.NoSuchMethodError: main Exception in thread main "and we don’t want that.


è This will not work in JAVA 7 because Java 7 looks for a main method before loading the class. This is a behavior change from previous java versions and hence static block will not execute. In previous versions, the behavior was that JRE used to look for main method post loading the class and after executing the static blocks.

DO YOU KNOW???? POWER MANAGEMENT FEATURES.......

TECHNOLOGY NAME: Windows OPERATING SYSTEM(Win 8)


We are going to explore Sleep and  Hibernate
(Works only if motherboard is ACPI(Advanced Computer and Power Interface) Compliant and appropriate Motherboard Chipset drivers are installed)

All the programs currently running are stored in the RAM.
We very well know that if power is lost, data from RAM will be lost.
It comes to pass that sometimes we do not use our computer and do want to shutdown either.

SLEEP/STANDBY: A power saving mechanism that theoretically cuts off power from all devices except RAM.
However, if power goes during SLEEP, SLEEP mode becomes void and all data in RAM is lost.
SO Redundant power supply backup should be available.
HOW TO SLEEP/STANDBY:
START-> SHUT DOWN -> Select Sleep/Standby .
You can also setup to sleep automatically after a defined time. RUN-> POWERCFG.CPL-> Change when the computer sleeps


HIBERNATE: A mechanism that takes an image of the RAM and stores it on the Hard Disk as a file.
The computer appears to have shut down after hibernate and loss of power thereafter does not affect HIBERNATION mode.On turning on the machine back, it loads the RAM image from Hard disk to RAM and all programs are back to as they were.
HOW TO HIBERNATE:
FIRST, enable hibernation option by RUN-> POWERCFG.CPL -> Choose what the power button does-> Change settings that are currently unavailable.
 Unavailable-options

Check HIBERNATION
Hibernate

The Hibernation option will appear in the shutdown menu:
Windows key-> Type anything->Settings(right pane)->
Change PC Settings-> Click Power button-> Hibernate.

Monday, January 20, 2014

DO YOU KNOW? Why does a 4 GB pen drive shows only 3.72 GB as total space????????

-----------------------------------------------------------------------------------------------------------


https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhupMBgVugImKej6-hYkM2sRR5mwGtOsL1TltYXqJ3Q1jwJMM0H-cM-_otAVP5G5al6wrdMVOU6rwC2_W4tvYBM3e1lT1YR_PQi-Y5BbE2s50YlTDru0b7YvQpAy2iyfGEIT45u2EeVg/s640/123.bmp

If you have a pen drive, I am sure you must have observed that if it is a 4 GB pendrive, and if you see its properties, it will show you only 3.72 GB of total space. So where does this 0.28 GB i.e. 280 MB go??????

All those who are comfortable with loss of 280 MB...check this out..On a hard disk of 500 GB , you loose 34.24 GB..how about that? 

This question has haunted many for years together. 

THE MYTH : People usually say some important files that hold drive configuration, Partition allocation table, File system and settings are stored in that space.


Before I start explaining why is that, lets consider this....
Lets go to a grocery shop and buy 1 litre of OIL... After buying 1 litre packet of oil from the shop and just to make sure we are not cheated, we measure it on the weighing at the shop and guess what...it reads 922 grams.. Why not 1 kg.......?Yes you got it?
1 litre = 922 grams.

First lets understand whats "GIGA"?( 
1000000000(1000x1000x1000)) (10^9)
Yes that is 3 times kilo(1000)

So when I say 4 
GB, it would be 4000000000....is'nt it?

But when you connect your drive to the PC, our Operating System calculates it in GiB
(note the ‘i’ in GiB)
(Now GiB is 1073741824(1024x1024x1024) (Gibibyte)that is 3 times a kibibyte(1024)(2^30)

So naturally, it goes like this

4000000000/
1073741824 = 3.725 GiB
So 4 GB = 3.725 GiB 
But our OS refers to GiB as GB only.....
On some LINUX flavors, 4 GB pen drive will still show 4 GB.

For vendors, GB is 1000000000
For OS(like windows), GB is 1073741824

So, it is just the conversion problem. MYTH BUSTED...