Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, February 21, 2021

How I started my Coding life without any prior knowledge of Coding?

Abhinandan Mishra
After being failed in JEE-2019 , I got admission in Madan Mohan Malaviya University of Technology, Gorakhpur,Uttar Pradesh.


When I entered college my first priority was to enjoy life and make Friends then do anything.

I remember that was my first day of class (in August 2019), Teacher was asking questions about Coding and Other things. Some of my batchmates were answering that and I wasn’t even understanding the questions.

I decided to learn Programming that day and in class our HOD was teaching us Linux and bash programming and I had so difficulty in that.
I  decided that I will do my best to learn it. One of my batchmates was ready to teach me but he needed more people to start teaching and I brought two more learners but they ruined our class.

Learning Starts

Then in the last of September, I started learning C Language from the Mysirg channel on YouTube and his content is awesome.

But just watching lectures wasn’t enough for that I have to code somewhere so that I can take part in college events. So one day(16 September 2019) I made an account on Hackerrank and I faced a great problem in just printing Hello World (In C it’s not that easy for beginners without any guidance though). I solved that problem but I didn’t open HackerRank till December. (because of fear)

Are you bored??…………………………

You are nothing without practicing.
So I practiced problems of Book( written by Yashwan Kanetkar) just on codeblocks and once I made confidence on doing questions.

        In the last of December 2019, I started Hackerrank again, and Now I didn't stop before 4th star in C language.

After that, I wasn’t proficient in C but I have confidence in C at least I can solve problems .

Solving problems is main motive of Programming and Life also.

Now I have learned too much in Coding and Programming but still learning.

You can go to my Linkedin Profile to see where I am in 10 months of my College. https://www.linkedin.com/in/abhinandan-mishra-174839167

I know If I can do it Everyone can do it .

This answer was written on my medium blog on 20/05/2020.

Thanks for reading!

Jai Hind


Are you stucked with web- development?

Abhinandan Mishra

                     


 

Are you stucked with web- development?

For mastering web development first of all you have to master Front-End and that’s not too easy.

To master Front-End firstly you have to master CSS.
When you write code in css sometimes you got stucked and you don’t get the results as you want. Then,you put random values to get a result near to your expectations but what happens for maintaining one block of code your other five blocks get disturbed.

How to write right codes in css?

  • Practice, practice and practice.
  • First thing to learn basic html and css .It will take maximum 1 hr to make a simple website.
  • Must learn about CSS BOX MODEL that is about margin,padding ,border .
  • Then you have to study about images and background .There are so many ways to attach images such as img tag, changing background colors ,adding background image using other tags.

background-image: url("paper.jpg");

<img src="url link" >

  • Display and position are the most important properties of css which should be payed more attention and it’s somewhat complex .

display: (block,inline,inline-block,table);

position:(static,absolute,relative,fixed,sticky)

Learn deeply about all the values of display and position and one more property which is very important -

float: left | right;

Use it as many time untill you get understand what it does?

  • To know about the tags colours ,fonts,lists ,tables etc.
I don’t know where will you reach by doing all these but I bet you will become very good at front end development.

Resources to learn?

  • w3schools- It is a very interesting and best website for learning by examples. It’s a free resource.
  • freecodecamp- A free website designed for learning by doing . It provides you theory of content and then to solve question to go further .
  • Copying other’s websites just for learning purpose. Choose a random website which you like and inspect it’s code and then try to make a website like it .

You can check your codes from website code and then you will learn which properties and values are for what specific work?

Best of luck for your learning

Thanks for reading.

This is my first article please suggest me to improve myself.

Friday, January 22, 2021

Software Tools

Abhinandan Mishra


 

Program 1: Write command line code in Linux. 

The commands are : 1) pwd 2) ls 3) file 4) cat










Program 2: Write command line code in Linux. The commands are : 1) mkdir 2) cp 3) mv 4) rm

 


Program 3: Write command line code in Linux. The commands are : 1) clear 2) history 3) date 4) cal

 


2)History

3)Date







4)Cal









Program 4: Write a program in C to create and store information in a text file. 

 

Output:

Program 5: Write a program in C to read the file and store the lines into an array.

Output:

Program 6: Write a program in C to count a number of words and characters in a file.

Output:

Program 7: Program that uses fork to create a child process and then child uses exec to overwrites itself with a code that checks whether input received from parent is an evil number or not. A evil number is one which has even number of 1s in its binary form.

 Main program for calling fork and executing exec():

Secondary file opened in Child process using exec():

Program 8: Write a program show how a parent can avoid creation of orphan/zombie and can keep track of the terminated child in normal or abnormal condition.

Some Theory - 

Zombie state : When a process is created in UNIX using fork() system call, the address space of the Parent process is replicated. If the parent process calls wait() system call, then the execution of parent is suspended until the child is terminated. At the termination of the child, a ‘SIGCHLD’ signal is generated which is delivered to the parent by the kernel. Parent, on receipt of ‘SIGCHLD’ reaps the status of the child from the process table. Even though, the child is terminated, there is an entry in the process table corresponding to the child where the status is stored. When parent collects the status, this entry is deleted. Thus, all the traces of the child process are removed from the system. If the parent decides not to wait for the child’s termination and it executes its subsequent task, then at the termination of the child, the exit status is not read. Hence, there remains an entry in the process table even after the termination of the child. This state of the child process is known as the Zombie state.

A parent can keep track of Child process by using wait().

#include<stdio.h>

#include<unistd.h>

#include<sys/wait.h>

#include<sys/types.h>

  

int main()

{

    int i;

    int pid = fork();

    if (pid==0)

    {

        for (i=0; i<20; i++)

            printf("I am Child\n");

    }

    else

    {

        wait(NULL);

        printf("I am Parent\n");

        while(1);

    }

}


Program 9: Show the use of pipe () system call where a child displays a message that it receives from its parent through pipe.

Theory -

Conceptually, a pipe is a connection between two processes, such that the standard output from one process becomes the standard input of the other process. In UNIX Operating System, Pipes are useful for communication between related processes.

Syntax in C language:
int pipe(int fds[2]);

Parameters :

fd[0] will be the fd(file descriptor) for the 

read end of pipe.

fd[1] will be the fd for the write end of pipe.

Returns : 0 on Success.

-1 on error.


Pipes behave FIFO(First in First out), Pipe behave like a queue data structure. Size of read and write don’t have to match here. We can write 512 bytes at a time but we can read only 1 byte at a time in a pipe.

Code :- 


#include <stdio.h> 

#include <unistd.h> 

#define MSGSIZE 16 

char* msg1 = "hello, world #1"; 

char* msg2 = "hello, world #2"; 

char* msg3 = "hello, world #3"; 


int main() 

char inbuf[MSGSIZE]; 

int p[2], i; 


if (pipe(p) < 0) 

exit(1); 


/* continued */

/* write pipe */


write(p[1], msg1, MSGSIZE); 

write(p[1], msg2, MSGSIZE); 

write(p[1], msg3, MSGSIZE); 


for (i = 0; i < 3; i++) { 

/* read pipe */

read(p[0], inbuf, MSGSIZE); 

printf("% s\n", inbuf); 

return 0; 


Created by - Abhinandan Mishra

Best of Luck!


Friday, September 25, 2020

What do you understand by Programming?

Abhinandan Mishra

 When anybody hear the word Programming they starts thinking about computers and those bulky and complex codes that a programmer writes.

Programming is not something related to computers only . Yes anything you do  is a programming. Like when you were in your nursery class and you didn't have knowledge of anything but you were able to speak,listen,feel and express.

Then your teacher started you teaching alphabets of different of Hindi ,English or both and Numbers . Slowly slowly you learned how to write words , names and how to do operations on numbers.

This process is also a type of programming , programming human being.

You might have seen some people have their pets and some people use to earn money by showing dances of their pets like monkeys, snakes . 

They train these animals some techniques and after doing same thing those animals get programmed . 

The term programming is like training and it can be anything - Human Being , Animals or Computers.


This is my first blog on Blogger and I will be sharing much more things with you .

Thanks for reading.