Posts

Showing posts from March, 2020

Story Of Google AlphaGo

Image
Today we look about stranger things done by modern computers with artificial intelligence. How did computers with artificial intelligence work in the past? They looked about all possible outcomes and choose the most logical outcome. It is called the brute force method. IBM Watson But after a few years, computers could collect information by reading things written in general languages and watching videos and pictures. IBM Watson computer is an example of that. However, our brains can work more than these simple works. As an example, we can make decisions by using our senses rather than depending only on the logic. Our brain works like that because it can learn new things from our memories and our experiences. Not only that these learned things can recognize similar situations and use them in similar problems. But it is not such easy work to teach a computer to work like this. Because even we don't know how we get decisions like that. So we have many difficulties to make a l

What is Lucid Dreaming?

Image
Many people interested in dreams, they are dreaming and think about dreams. Today we look about dreams and how to control dreams. Scientists did many kinds of research about dreams but they can't give a better explanation to this question yet: Why we are dreaming?. But they introduced some theories about dreaming. We collect many memories in the day time and these memories stored in a short time memory. When we fall into the sleep our subconscious mind converts these memories as long time memory. Our long time memory doesn't store memories like a hard drive. It stores these pieces of information like well organized, categorized manner and makes interconnections among them. Not only that if there is a memory that can't make interconnections and subconscious mind erases that memory from the brain.  Our subconscious mind is a strange thing. Just think we are going to sleep now but this does not stop it's working. It is working always until we die. When we fall in

Pipe System Call in Linux

Image
Write a C program to run on Linux to do the following. 1. Parent process creates a pipe using the pipe() system call. 2. Parent process creates a child process. 3. Parent process sends a message "Hello from Parent" to the child. 4. Child process prints the message to the screen. C Code: #include <stdio.h> #include <unistd.h> #include <stdlib.h> int main(){     int pid,pipe_ends[2];     char received_string[20];     pipe(pipe_ends);     pid=fork();         if(pid>0){     close(pipe_ends[0]);     write(pipe_ends[1], "Hello From Parent", 18);     close(pipe_ends[1]);     exit(0);     }     else{     close(pipe_ends[1]);     read(pipe_ends[0], received_string, 18);     printf("Message - %s\n", received_string);     close(pipe_ends[0]);     exit(0);     } }

Fork System Call in Linux

Image
Write a C program to do the following when executed on a Linux system. 1. The parent process creates two other processes (child processes). 2. The parent prints "PARENT" 3. One child prints "CHILD 1" 4. The other child prints "CHILD 2" C Code: #include <stdio.h> #include <unistd.h> int main() {      if (fork())   {      printf("parent\n");      if(fork()==0)    {      printf("child1\n");    }   }      else   {      printf("child2\n");   }      return 0; }

Completely Fair Scheduler

Image
The Completely Fair Scheduler (CFS) is a process scheduler which was merged into the 2.6.23 (October 2007) release of the Linux kernel and is the default scheduler. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU utilization while also maximizing interactive performance. Con Kolivas's work with scheduling, most significantly his implementation of "fair scheduling" named Rotating Staircase Deadline, inspired Ingo Molnár to develop his CFS, as a replacement for the earlier O(1) scheduler, crediting Kolivas in his announcement. In contrast to the previous O(1) scheduler used in older Linux 2.6 kernels, the CFS scheduler implementation is not based on run queues. Instead, a red–black tree implements a "timeline" of future task execution. Additionally, the scheduler uses nanosecond granularity accounting, the atomic units by which an individual process' share of the CPU was allocated (thus making redundant the previ