Saturday, January 28, 2017

Which competitive programming site is good for beginners?

Today one of my friend asked me this question after doing some research on that topic , from google ,quora , wikipedia  I myself landed with this conclusion listed below : -


  1. Infrastructure and UI
    1. CodeChef: Light weight web pages, don't need a really good internet connection to work. Sometimes sucks during heavy traffic contests. Not so cool leaderboard. No direct way to retrieve submissions from leaderboard. Unlike other platforms, only verdict is shown for submission, not number of files or test case numbers.
    2. Codeforces: Again, light web pages, no scalability issues even in heavy traffic. Very intuitive and slick UI, cool leaderboard. Best rating system among all.
    3. HackerEarth: Code editor is available, nice leaderboard. Haven't seen any scalability issues lately. However, contests page cluttered with lot of hiring challenges.
    4. HackerRank: Heavy web pages; with slow internet connection, you might find it difficult to use. No such things as friends/lists as available in other platforms. Good stuff: Code editor available, problem-wise leaderboard, can directly get solutions from leaderboard.
  2. Quality of problems and about contests
    1. CodeChef: Great problems in long and short challenges. Unique format of long challenges, which is great for beginners I think.
    2. Codeforces: High quality problems from highly rated coders. I most enjoy the problems on CF. Only short contests for two divisions. A great feature: educational rounds. No prizes or tshirts for winners as compared to others.
    3. HackerEarth: Recently, good problems in contests like Clash. Easy contests for beginners are a good learning source. Monthly two contests.
    4. HackerRank: Very good structured content topic wise. A project-Euler style contest called infinitum. I liked HourRank(a one-hour contest). No more weekly contests as before.
  3. Editorials and community supportI think for a beginner these factors are the most important.
    1. CodeChef: Good and detailed editorials by dedicated editorialist for each contest. However, less community participation in discussions.
    2. Codeforces: Best in this regard. Editorials written by problem setters. Sometimes brief, but amazing community support. A lot of top rated users discuss very regularly on CF. You can ask people from around the world your queries/doubts and people visit the website very regularly just to browse the blog posts.
    3. HackerEarth: Dedicated editorialists, good editorials, but again, very little community participation.
    4. HackerRank: Problem setters write the editorials which sometime are not so helpful. Scarce community participation.
Considering all aspects, my vote goes to Codeforces. Some other things I like about Codeforces are:
  • GYM contests. Its an archive of various competitions from all around the world like previous ICPC regionals. Most teams preparing for ICPC do virtual contests, which means a virtual competition where you can gauge your preparation levels.
  • Virtual contests. You can simulate the whole contest environment and do the contests which you missed.
  • Mashup contests and groups. You can create groups with your friends and compete on problems chosen by you.

How to Create New Partition in Windows 10/8/7 without Formatting Hard Drive!

Suffering from having ONLY one partition in your windows PC or you have just installed a new hard drive to your computer and want a few drives? In both the cases we have to make another partition in our PC! Let’s start making a new partition in our Windows 8 PC without formatting.
Note: This same tutorial works for windows 10, 7 and 8 (and hopefully will work for other version too).
We don’t need any external software or something! We can make another partition in windows or a new drive in my computer ðŸ™‚ as with an inbuilt utility which is called as “Disk Management”.

What Is Disk Management?

Disk management is an option available in Windows which is present in “Computer Management” and helps us to carry out many tasks in our daily computing, those are Formatting of Disks and Partitions, Splitting partitions and many more.

Ok Let’s Start Creating Partitions…

Right click on computer icon. Click on manage, so you should get “computer management” window.
Computer Management Windows Appears, Click on disk management which is available in the left side of your Window.
et’s Create Some Free Space for New Partition
Right click on the volume (Disk drive) you want to split/shrink to create another partition of it. Here I want to make another partition of “New Volume D”. Click on “Shrink Volume” to move further.
NOTE: This step is for shrinking a large drive on hard disk to create some raw space but if you had attached a new hard disk (and have raw space) you don’t need to shrink any of the partition.
A dialogue box appears saying “Querying Shrink Space” wait for that to go.
Now a window appears saying “Shrink (with drive Alphabet). Enter the size of hard drive you want to make for example I want to make a new partition of 10 GB (1 GB = 1024 MB).
After entering the amount of space you want to shrink, Click on “Shrink”. Your windows 8 Pc may hang for 5 to 10 seconds during the shrinking process (after clicking on “Shrink”).

Creating Your New Windows Partition

Now go back to Computer Management > Disk Management. You can see a box saying “Free space”. Right click on the box saying “Free space” and click on “New Volume”.
A dialogue box appears “New Simple Volume Wizard”, Click on “Next >”.
Now simply specify volume size. You can only chose a volume size lower then what is the maximum free space in disk. Click next.
Now you should Assign a letter for your new volume Name it. You can only select the alphabet which is available in drop-down menu.
And Click “Next > Again” Now you should select a format like which your Volume should be formatted.
I recommend you to select File system as NTFS as NTFS works great with windows and don’t forget to check “Perform a quick format. Then click next
Now the last step, you can see the setting you have selected I prefer you to check them out once and the click on finish and you are done…!
Just verify that is your volume added successfully by opening “computer” otherwise formatting it helps.
So here is new partition created “new volume F”. Hope this tutorial helped you creating a fresh new portioned disk drive ðŸ™‚

How to Write your first C code...?

i m glad to see you here , Most of you are beginner in Computer science field ,  you have next to no experience with programming languages but trust me you’ll soon love it. I will make you understand each and every aspect of programming esp ,Are you ready to do some learning ?

fine, before Coding some basic ideas of what programming is ?

Programming is the process of taking an algorithm and encoding it into a notation, a programming language, so that it can be executed by a computer. Although many programming languages and many different types of computers exist, the important first step is the need to have the solution. Without an algorithm there can be no program.

for Algorithm i have different blog(i"ll uploaded soon)

Now , 

first program i.e the my world program , any where in world if an student learn first program in any  programming language , his/her first program is always be "hello world"(?);

So, first download the IDE(stand for integrated Development Environment) which basically the text editor with compiler in it.


first go to the code block this free IDE and also very reliable DONOT USE DevC or TUrbo C++. 


go to the above link or http://www.codeblocks.org/

then download the Code block IDE

After that see the follows the Screenshot :-


 open new project then type

#include <stdio.h>

int main()
{
  printf("hello world ");

  return 0;
}

then save it in your desired location :-


then click build and run option in left upper portion

                       


then new screen  will genrate like that
   

and voila you success...!!! Stay tuned for next instresting blog!!

~happy Coding

How to find hidden files in Windows using DOS command?

Hidden files are the files on computer that have hidden attribute with them. Files that exist but your computer don’t show them to you. Remember: Any file or folder can be made hidden. Right click on a file, select properties, and check the hidden attribute option under general tab and press OK button. Mind you all readers, this is not the general way to view and find hidden files. If you’re looking for the basic steps then this is not for you. In this article we are going to find hidden files in your Windows system using DOS command.

DOS Command to Find Any Hidden File:

Open DOS (Disk Operating System), go to search option and search for “CMD“or type “CMD” in RUN (Window Key+R). Now copy or type in Dos
Dir C:\*.mp4  /a:h/s
And wait for 2-3 minutes.
NOTE : The above command will only find hidden videos having .mp4 extension in C drive. If you wish to find in D drive replace C with D or with respective drive letter. Replace C drive with %systemdrive% to include searching operation in all the drives of your computer.
Dir %systemdrive%\*.mp4  /a-h/s 
ANY ERROR ? Please mind the necessary space in the command :
Dir <space> C:\*.mp4 <space> /a-h <optional space> /s
Dir  means directory(folder) and *.mp4 means mp4 files with any name
a stands for ‘attribute’. 
h
 for ‘hidden’.
means ‘sub directory  included’.
Update: Change the :h to -h or vice-versa if any command is not working for you.

Find Hidden Videos:

Video files on windows have following extensions (.mp4, .avi, .mov etc.) as mentioned below and to find these hidden files in your windows system you have to use customized the above mentioned DOS command
MP4 files : Dir  %systemdrive%\*.mp4    /a-h /s
MP4, AVI, MKV and WMV : Dir  %systemdrive%\*.mp4 %systemdrive%\*.avi %systemdrive%\*.mkv %systemdrive%\*.wmv   /a-h /s
Some other Famous Video Formats are .flv and .mov that can be used in the above command.

Find Hidden Images or Pictures :

To find Hidden Images files, use following DOS command and sometimes you may have to replace :h with -h.
JPG files : Dir  %systemdrive%\*.jpg    /a:h /s
JPG, PNG and GIF : Dir  %systemdrive%\*.jpg %systemdrive%\*.png %systemdrive%\*.gif    /a:h /s
or
JPG files : Dir  %systemdrive%\*.jpg    /a-h /s
JPG, PNG and GIF : Dir  %systemdrive%\*.jpg %systemdrive%\*.png %systemdrive%\*.gif    /a-h /s

Find Hidden Music Files:

Following DOS command will find out hidden files that are music types on windows system.
For MP3 : Dir  %systemdrive%\*.mp3    /a:h /s 
or
For MP3 : Dir  %systemdrive%\*.mp3    /a-h /s 
Other Common audio file extensions that may be made hidden are .WAV, .AIF and .MID.

Find hidden Ebooks or pdf:

Use following DOS command to find out all .PDF, .EPUB and .TXT files on your windows computer.
PDF files : Dir  %systemdrive%\*.pdf   /a:h /s
PDF, EPUB and TXT : Dir  %systemdrive%\*.pdf  %systemdrive%\*.epub  %systemdrive%\*.txt /a:h /s
or
PDF files : Dir  %systemdrive%\*.pdf   /a-h /s
PDF, EPUB and TXT : Dir  %systemdrive%\*.pdf  %systemdrive%\*.epub  %systemdrive%\*.txt /a-h /s

I hope all the above DOS commands are working for you. If you are facing any problem in finding out hidden files using this DOS command then leave a comment below.

Basic Concept of OOps

Hello friends presenting here basic concept of OOPs for beginers hope you enjoy reading
Basic Concept of OOps

Introduction to Object Oriented Programming (OOP) concepts in C#: Abstraction, Encapsulation, Inheritance and Polymorphism.
OOP Features 
Object Oriented Programming (OOP) is a programming model where programs are organized around objects and data rather than action and logic. 

OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects.
  1. The software is divided into a number of small units called objects. The data and functions are built around these objects.
  2. The data of the objects can be accessed only by the functions associated with that object.
  3. The functions of one object can access the functions of another object.
OOP has the following important features.

 Class
A class is the core of any modern Object Oriented Programming language such as C#.
In OOP languages it is mandatory to create a class for representing data. 
A class is a blueprint of an object that contains variables for storing data and functions to perform operations on the data. 
A class will not occupy any memory space and hence it is only a logical representation of data.
To create a class, you simply use the keyword "class" followed by the class name:


class Employee
{
 
}
 
Object
Objects are the basic run-time entities of an object oriented system. They may represent a person, a place or any item that the program must handle. 

"An object is a software bundle of related variable and methods."
 

"An object is an instance of a class"
A class will not occupy any memory space. Hence to work with the data represented by the class you must create a variable for the class, that is called an object. 
When an object is created using the new operator, memory is allocated for the class in the heap, the object is called an instance and its starting address will be stored in the object in stack memory.
When an object is created without the new operator, memory will not be allocated in the heap, in other words an instance will not be created and the object in the stack contains the value null.
When an object contains null, then it is not possible to access the members of the class using that object.
 
class Employee
{
 
}
Syntax to create an object of class Employee:
 
Employee objEmp = new Employee();
 
All the programming languages supporting Object Oriented Programming will be supporting these three main concepts:
  1. Encapsulation
  2. Inheritance
  3. Polymorphism
Abstraction
Abstraction is "To represent the essential feature without representing the background details."
 
Abstraction lets you focus on what the object does instead of how it does it.
 
Abstraction provides you a generalized view of your classes or objects by providing relevant information.
 
Abstraction is the process of hiding the working style of an object, and showing the information of an object in an understandable manner.
 
Real-world Example of Abstraction
Suppose you have an object Mobile Phone.
 
Suppose you have 3 mobile phones as in the following: 
 
Nokia 1400 (Features: Calling, SMS)
Nokia 2700 (Features: Calling, SMS, FM Radio, MP3, Camera)
Black Berry (Features:Calling, SMS, FM Radio, MP3, Camera, Video Recording, Reading E-mails)
 
Abstract information (necessary and common information) for the object "Mobile Phone" is that it makes a call to any number and can send SMS.
 
So that, for a mobile phone object you will have the abstract class as in the following:
   abstract class MobilePhone
    {
        public void Calling();
        public void SendSMS();
    }

    public class Nokia1400 : MobilePhone
    {
    }

    public class Nokia2700 : MobilePhone
    {
        public void FMRadio();
        public void MP3();
        public void Camera();
    }

    public class BlackBerry : MobilePhone
    {
        public void FMRadio();
        public void MP3();
        public void Camera();
        public void Recording();
        public void ReadAndSendEmails();
    }
 
Abstraction means putting all the variables and methods in a class that are necessary.
For example: Abstract class and abstract method.
Abstraction is a common thing.
Example
If somebody in your collage tells you to fill in an application form, you will provide your details, like name, address, date of birth, which semester, percentage you have etcetera.
If some doctor gives you an application to fill in the details, you will provide the details, like name, address, date of birth, blood group, height and weight.
See in the preceding example what is in common?
Age, name and address, so you can create a class that consists of the common data. That is called an abstract class. 
That class is not complete and it can be inherited by other classes.
 
Encapsulation
Wrapping up a data member and a method together into a single unit (in other words class) is called Encapsulation.
 
Encapsulation is like enclosing in a capsule. That is enclosing the related operations and data related to an object into that object.
 
Encapsulation is like your bag in which you can keep your pen, book etcetera. It means this is the property of encapsulating members and functions.
 
    class Bag
    {
        book;
        pen;
        ReadBook();
    }
 
Encapsulation means hiding the internal details of an object, in other words how an object does something.
 
Encapsulation prevents clients from seeing its inside view, where the behaviour of the abstraction is implemented.
 
Encapsulation is a technique used to protect the information in an object from another object.
 
Hide the data for security such as making the variables private, and expose the property to access the private data that will be public.
So, when you access the property you can validate the data and set it.
 
Example 1
    class Demo
    {
        private int _mark;

        public int Mark
        {
            get { return _mark; }
            set { if (_mark > 0) _mark = valueelse _mark = 0; }
        }
    }
 
Real-world Example of Encapsulation
Let's use as an example Mobile Phones and Mobile Phone Manufacturers.
Suppose you are a Mobile Phone Manufacturer and you have designed and developed a Mobile Phone design (a class). Now by using machinery you are manufacturing Mobile Phones (objects) for selling, when you sell your Mobile Phone the user only learns how to use the Mobile Phone but not how the Mobile Phone works.
 
This means that you are creating the class with functions and by with objects (capsules) of which you are making available the functionality of your class by that object and without the interference in the original class.
 
Example 2
TV operation 
It is encapsulated with a cover and we can operate it with a remote and there is no need to open the TV to change the channel. 
Here everything is private except the remote, so that anyone can access the remote to operate and change the things in the TV.
 
Inheritance
When a class includes a property of another class it is known as inheritance.
Inheritance is a process of object reusability.
For example, a child includes  the properties of its parents.
    public class ParentClass
    {
        public ParentClass()
        {
            Console.WriteLine("Parent Constructor.");
        }

        public void print()
        {
            Console.WriteLine("I'm a Parent Class.");
        }
    }

    public class ChildClass : ParentClass
    {
        public ChildClass()
        {
            Console.WriteLine("Child Constructor.");
        }

        public static void Main()
        {
            ChildClass child = new ChildClass();

            child.print();
        }
    }
 
Output
    Parent Constructor.
    Child Constructor.
    I'm a Parent Class.
 
Polymorphism
Polymorphism means one name, many forms.
One function behaves in different forms.
In other words, "Many forms of a single object is called Polymorphism."
 
Real-world Example of Polymorphism
Example 1
A teacher behaves students.
A teacher behaves his/her seniors.
Here teacher is an object but the attitude is different in different situations.
Example 2
A person behaves the son in a house at the same time that the person behaves an employee in an office.
Example 3
Your mobile phone, one name but many forms:
  • As phone
  • As camera
  • As mp3 player
  • As radio
To read about Polmorphism in detail click the following link:

Polymorphism in .Net 
 
The Differences between Abstraction and Encapsulation
AbstractionEncapsulation
1.  Abstraction solves the problem at the design level.1. Encapsulation solves the problem in the implementation level.
2. Abstraction hides unwanted data and provides relevant data.2. Encapsulation means hiding the code and data into a single unit to protect the data from the outside world.
3. Abstraction lets you focus on what the object does instead of how it does it3. Encapsulation means hiding the internal details or mechanics of how an object does something.
4. Abstraction: Outer layout, used in terms of design.
For example:
An external of a Mobile Phone, like it has a display screen and keypad buttons to dial a number.
 
4. Encapsulation- Inner layout, used in terms of implementation.
For example: the internal details of a Mobile Phone, how the keypad button and display screen are connected with each other using circuits.
 The easier way to understand abstraction and encapsulation is as follows.
Real-world Example
Use an example of a Mobile Phone
You have a Mobile Phone, you can dial a number using keypad buttons. You don't even know how these are working internally. This is called Abstraction. You only have the information that is necessary to dial a number. But not internal working of the mobile.
 
But how does the Mobile Phone work internally? How are the keypad buttons connected with internal circuit? That is called Encapsulation.
Summary
"Encapsulation is accomplished using classes. Keeping data and methods that access that data into a single unit." 
"Abstraction is accomplished using an Interface. Just giving the abstract information about what it can do without specifying the details."
"Information/Data hiding is accomplished using modifiers by keeping the instance variables private or protected."

Reference

http://www.cpp-home.com/archives/206.html