Wednesday, August 9, 2017

Getting started with Windows IoT and Raspberry pi 3

The following tutorial drives through getting started with Windows IoT on a Raspberry pi 3.

Equipment needed:


  1. Raspberry pi 3.
  2. Adapter.
  3. Memory card.
  4. Card reader.
  5. Led,resistor and connecting jumper cables.

In this tutorial we will run Hello, blinky using Windows IoT and Raspberry pi3.

  • First go to https://developer.microsoft.com/en-us/windows/iot  and select getting started . It will redirect you to another page .Here we have to select the device, in our case "Raspberry pi 3". 
  • Select install on to my blank sd card. 
  • Then select the OS as Windows 10 IoT core. Click Next.
  • This will launch you on another page from where we get Windows 10 IoT dashboard. Download  and install the dashboard.
  • Connect the card reader to the computer and open the dashboard. Go to set up my device and select raspberry pi3.
  • Make sure you select the wifi on the right hand side and setup device name and password .
  • After this check I accept and press on download and install. This takes a while and after the installation place the sd card on the board and power it on.
  • The initial boot takes some time and on the dashboard go to my devices, there you will find the board.
  • Download and install visual studio if you dont have one.
  • Go to https://github.com/ms-iot/samples and clone the repository. This contains a bunch of samples we can run .
  • Set up the led and resistor on the breadboard as shown below. 
  • After that based on the picture below use the white jumper cable at pin 1 (3.3W power) and black jumper cable at pin 29 (gpoi 5).
    Place the pin1 jumper cable other end at the resistor and pin 29 jumper cable other end at led .
  • Open hello blinky solution in the visual studio.
    Go to properties of the project and select debug and click on find remote machine. You should see the raspberry pi 3, select it and save it .
  • Then click on remote machine to run the program, it would take a while to deploy and then you can see the led blinking.
  • The output should look like this, a blinking led.



Have you ever wondered why there are two options sleep and hibernate? I will explain here the differences.

There are two options other than shutting down your computer .

1.Sleep
2.Hibernate

Sleep will store all the applications which are running onto RAM. As we are storing on RAM,as it is a volatile memory it will consume power as normal and when we don't have power(in case of laptop battery)we will loose our data.

Hibernate will store all applications related data onto hard disk and shuts down the computer. In this mode power consumption is almost same as when we shutdown the computer. When we turn on the computer all our data is retrieved during booting. If we are having an SSD it is good to use hibernate over Sleep as power consumption is less.

Saturday, August 5, 2017

What is an Operating System

An operating system is a program or programs that act as a intermediary between user of computer and hardware of computer.

Operating systems mainly for making computer hardware to be used in an efficient manner, make the computer system convenient to use and also solve user problems in easier way.


Friday, August 4, 2017

Describe the terms regarding Operating Systems a)Concurrency b)Parallelism

Concurrency:

The term concurrency refers to techniques that makes program more usable. Concurrency can be implemented and is used a lot on single processing units nonetheless it may benefit from multiple processing units with respect to speed.If we can load multiple documents simultaneously in the tabs of our browser and still can open other applications and perform actions,this is concurrency.


Single Core

T1
T2
T3
T4
T1
T2
T3
T4




                              -------------------------------------------->  time


Concurrency on Single Core



Parallelism:

The term parallelism refers to techniques to make programs faster by performing several computations in parallel. Graphic computations on GPU are parallelism is reduce data dependencies in order to be able to perform computations on independent computation units with minimal communication between them.

Parallelism on Multi Core

Core 1  
T1
T3
T1
T3
T1
T3
T1
T3






Core 2
T2
T4
T2
T4
T2
T4
T2
T4





                              --------------------------------> time 


Difference between threads and processes


  • Processes and threads are independent sequences of  execution ,the typical difference is that threads run in a shared memory space while processes run in separate memory spaces.
  • A process has self contained execution environment that means it has a complete, private set of basic run time resources particularly each process has its own memory space. Threads exist within a process and every process has at least one thread.
  • Each process provides the resources needed to execute a program. Each process is started with a single thread known as primary thread. A process can have multiple threads in addition to the primary thread.
  • Threads have direct access to the data segment of its process but processes have their own copy of the data segment of parent process.
  • Changes made to main thread may affect the behavior of the other threads of process while changes to parent process does not affect child process.
  • Processes are heavily dependent on system resources available while threads require minimal amounts of resource so a process is considered heavyweight while thread is considered a light weight process. 

Difference between ReactJS and React-Native

React-Native is a framework, whereas ReactJS is a java script library we can use to develop user interfaces. When we are using ReactJS in a project we need to choose a bundler like webpack, which we want to use in our project. React-Native is like a "go work" kind of thing . Here it comes with everything we need and it is very easy to setup,very fast and can be run in the terminal with just one command.
                 

Call a function in child component from parent component in React

Consider the following parent component class Parent extends React.Component { constructor(props) { super(props);         thi...