Sign in to Publish article.

Sign in

avatar

Abhishek_thewarrior published an article

8 hours, 14 minutes ago

Fork() Function in C

//program to demonstrate the use of fork Function

Int main()

{

Printf("Hello");

Fork();

Fork();

}

This function will print 4 times Hello ,

Thats because fork Function clones the parent process and returns value either 0 or 1.

When it returns" 0" implies the "child"

And for parent  its "1".

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

1 week ago

Convert a number to a string in C - best way

We can use sprintf() function to conver any number to string in C. Number can be any integer or float.

Here is an implementation of it.

#include<stdio.h> 
int main() 
{ 
	char final[100]; 

	float number = 98.12;
 
	sprintf(final, "%f", number);

	printf("\nString of given number is %s", final); 

	return 0;
} 

 

 

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

1 week, 4 days ago

Building news aggregator web app with Django using python web scraping

We can build a news aggerator web app by scrapping the news websites and serving those scrapped news via Django on web or in any app.

In this article, i will explain step by step guide on how to implement everything. Let's start by understand what a news aggregator is and why should we build it.

 

What is news aggregator ?

A news aggregator is …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks ago

Find Length of a Linked List

We can find the length of a linked list by initializing a counter to zero and incrementing it for every node of linked list. We will traverse the linked list from start and go until we reach the end of it. 

linked list

In the above linked list, we can see there are 4 nodes and hence, the legth of this …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks, 1 day ago

Print a matrix in spiral form

To print a matrix in spiral form we can use four loops.

Let's break down the problem, there 4 moves that are possible during spiral traversal.

  • From left to right
  • From top to bottom
  • Right to left
  • and From bottom to up

We'll need to have loop for each move. We'll loop around the entire matrix, with these moves and …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks ago

Sort string of characters C++

We can sort the characters of a string using sort function that comes with C++. We need to pass the start and end position the string like sort(str.begin(), str.end()). This will sort the string the O(n log n) time complexity.

 

Let's take a look at how it works.

Input

hackersfriend

Output

acdeefhiknrrs

 

Implemenation

// C …
Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks, 2 days ago

Print reverse of a string using recursion

To reverse a string using recursion we can create a function that will call iteself with substring of string after removing first element and break when the size of string passed is equals to zero.

Let's code this approach.

#include<bits/stdc++.h>
using namespace std;

void stringReverse(string s)
{
  if(s.size() == 0)
    return;
  stringReverse(s.substr(1));

  cout<<s[0 …
Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks, 5 days ago

Program to find the mid-point of a line

Finding the mid point of line is easy with mid-point algorithm.

In this article, we will implement mid point algorithm to find the mid point of a line segment.

Let's suppose we are given the x and y co-ordinates of start and end point a line. Call them, x1,y1 and x2 and y2.

According to mid-point algorithm, mid-point of …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

3 weeks, 5 days ago

Mouse and keyboard automation using Python

Handling mouse and keyboard of your system using python is easy with pyautogui package.

In this article, i'll show how to use this package to handle mouse and keyboard with python using pyautogui.

Let's understand axis on Monitor first.

Monitor

Monitor is treated as a graph of x axis and y axis and every position on monitor has co-ordinate in x and y …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote


Rajan Kumar

rajan published an article

2 weeks, 5 days ago

Generate QR Code using python with pyqrcode module

We can easily generate QR codes with python using pyqrcode module. It takes a string as input and generate QR code is expected format, having the string we gave as input. pyqrcode module follows standards of QR code.

Here is an implemetation of it.

Let's start by installing the pyqrcode module.

pip install pyqrcode

Here is sample code to generate QR code …

Read full article

arrow_upward Upvote

comment Comment

arrow_downward downvote



View more

HackersFriend Updates





View more


Events


Nov. 28, 2018, 5:30 p.m.

Python from zero to hero

place Delhi

View details


Aug. 13, 2018, 5:30 p.m.

Python from zero to hero

place Bangalore ( HackersFriend office BTM Layout)

View details