Conky Desktop

Conky - Lightweight System Monitor

I use ubuntu as my daily driver so all the commands are going to be ubuntu/debian based Installation Install conky-all package by sudo apt-get install conky-all Setup conky takes a config file to know what to draw on screen. the default location of config file is ~/.conkyrc Run you can start the conky by just typing conky in terminal, and a and ugly black window should come up. Customization There are thousands of options to pick conky config, and if that’s not enough you can just google for more....

November 27, 2021 · 2 min · Zeeshan Khan

Understanding Linux load average

>>> uptime 09:20:04 up 13:22, 5 users, load average: 0.11, 0.31, 0.42 Load average is those three numbers. It gives an idea about how busy the system is. It shows load for last 1, 5 and 15 mins, A common misconception is that it just shows how business of the CPU. It also considers other IO operations. Read the post below that explains when and how it is the way it is....

November 26, 2021 · 1 min · Zeeshan Khan

Factorial in C using Character array

Hey Guys, wondering why I am here once again with this “factorial” thing? You will get to know it in no time..just keep reading! Let’s calculate some of the factorials: 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 well there is no problem, isn’t it? Continue then… 7! = 5040 8! = 40320 Now let’s look at 21! It is 51090942171709440000...

June 15, 2016 · 5 min · Swati Kesarwani

Factorial in C

Hey! Today i am gonna show you how to calculate factorial of a number. The code below depicts the basic methodology of how to calculate factorial of a number. # include<stdio.h> void factorial(int number){ int i; long long int factorial=1; for ( i = number ; i > 0 ; i-- ) factorial*=i; // Printing the factorial of the number **/ printf("Factorial of %d = %lld",number,factorial); return 0; } int main(){ // Declaring variables **/ int num; // Asking and scanning input **/ printf("Enter a number : "); scanf("%d",&num); // Passing number to the function **/ factorial(num); return 0; } output of above code will be...

June 1, 2016 · 1 min · Swati Kesarwani

Linked List in C

First let’s get familiar with some basic terminologies used in linked list. A linked list is a type of array in which each elements points to the next element. Each element in the list is called a node The very first node of the list is called the root node or head of the list. Linked list is represented only by the root node i.e., we store only the pointer to the root node....

November 23, 2015 · 8 min · Zeeshan Khan

How To Scan Input In Java

The best way to scan input in java includes the use of BufferedReader class, another method uses Scanner class but is slower, so here we will prefer BufferedReader. The following code demonstrate the use of BufferedReader for scanning input of different type. // file ScanInput.java import java.io.*; public class ScanInput{ public static void main(String args[]) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a String: "); String msg=br.readLine(); System.out.print("Enter a Integer: "); int integer=Integer....

February 3, 2015 · 1 min · Zeeshan Khan

Faster Input Scan Method in C

Sometimes we need to scan input really fast like when we are participating in coding competitions like codechef or SPOJ where the time limit is very strict and inputs are large, we can save some time by adopting faster scanning methods. We can achieve our gaol using getchar_unlocked function. code below scans 100000 integers and has two different methods one is scan_normal() this will scan integers using standard scanf() function and the other one is scan_fast() this scan integers using getchar_unlocked function, we will execute the program twice one for each method mark the time taken for execution to evaluate the performance....

January 26, 2015 · 2 min · Zeeshan Khan

How To Run a Java Program

To run a java program you must have one, so lets have a sample code which prints “Hello world!!” to console. Source Code If you have source code ready then ignore else create a new file Hello.java and copy the below code in it and save it. Source code // file Hello.java import java.io.*; class Hello{ public static void main(String args[]){ System.out.println("Hello World!!"); } } now you have your source code ready,...

January 24, 2015 · 1 min · Zeeshan Khan

Client Server in Java

The following program demonstrate how we can implement simple client server architecture in java Start Server.java in a terminal/command prompt then open another command prompt/terminal and start Client.java in it Server can handle new Clients on disconnection of previous one. ...

January 21, 2015 · 2 min · Zeeshan Khan

ArrayList in java

ArrayList is a collection of data items that grows and shrinks depending on the number of data items present in it, you can think it as a dynamic array or a link lists in C, whose size increases when we insert a data and decreases as delete some data from it. To insert a data item we use add() method and to delete we use remove() method as demonstrated below in line 13 and 20 respectively....

January 8, 2015 · 2 min · Zeeshan Khan