1:06 AM

Ntfs-3g

Ntfs-3g is a stable ntfs driver for linux,android mac os and other operating system.The ntfs-3g is an open source cross platform implementation of the Microsoft windows ntfs file system with read or write support.Thus is provides safe handling of the windows ntfs file system.

A base linux system cannot handle ntfs system on its own and requires third party drivers like the ntfs-3g.
The  stable version of the ntfs-3g can be downloaded form the the website http://www.tuxera.com/community/ntfs-3g-download/

Once installed sucessfully the ntfs-3g can be used to mount devices but the command

mount -t ntfs-3g /dev/sda1 /mnt/windows


where windows is a valid device.That is one has to make sure that /mnt/windows do 
exist.


The manual page for the ntfs-3g can be found at


http://www.tuxera.com/community/ntfs-3g-manual/


....................................................................................







3:26 AM

Connecting to wireless network in debian

Connecting to ethernet is as easy as in last post.Connecting to wireless is also as easy but the main problem is that we rarely find resources that help as to do the same.

Inorder to connect to wifi one has to install the firmware for the network driver.The driver can be found using the command nm-tools .
Now for intel cards the driver is iwlagn whose firmware can be downloaded and installed.

first add a non free repositry to /etc/apt/sources.list


deb http://ftp.us.debian.org/debian squeeze main contrib non-free  


Now the firmware can be installed through the following commands


# aptitude update


# aptitude install firmware-iwlwifi wireless-tools


the module can be loaded by the command


#modprobe iwlagn


This solves the problem.


For other drivers,the installation details can be found form
http://wiki.debian.org

...................................................................................................................................................................

4:26 AM

setting up network in debian

Debian is one of the stable Linux distributions available.Most users find it difficult to connect to network.The main prloblem in this is that Debian loads the netwrok drive atleast the ethernet port on by itself.The problem is that we fail to realize this.This is because a basic Linux system lacks many components like network manager applets which notifies that the network has been setup.when we see no notifications we usually misunderstand it as no network connections.
Usually net can be dierectly accessed.
If this fails normal ethernet connecton can be established by editing the file /etc/network/interfaces.
The file sholud look like


# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp




Now rebooting the system will load the eth0 for use.


Now the network manager applet can be loaded by using commandline.


inorder to do so repostries must be added editing the file /etc/apt/source.list
deb http://http.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://http.us.debian.org/debian/ squeeze main contrib non-free 
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
deb http://ftp.debian.org/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib non-free

Now the package can be installed using the following commands.

aptitude update
apt-get install network-manager-gnome

Rebooting the system should solve the problem.

9:12 AM

DEbian......not as easy as it seems

Full day working on Debian to fix the network .Nothing works fine.No  Ethernet...no WiFi so to say nothing in the Debian...no videos no music just the GUI and terminal.Cannot install any packages....
It is the first time having problem with a Linux distro .Have tried different distros but I never have encountered any problem with network it used to work fine Little unhappy about that.

5:21 AM

Water level control system.

Water level control systems, as the name suggest are used to monitor the level of water in  a tank.This is one of the basic problems involving the theory of computation and can be solved using a digital circuit.
Consider a tank with water filled to some level .Two switches S1and S2 are used to monitor the level of water in the tank.

When water is below both S1 and S2 ie S1=0 and S2=0,the motor has to be switched on to fill the water.
When the water level is above the S1,we have S2=1 and S2=1.Now the motor is turned off.
When water is in between the switches that is S2=1 and S1=0 then the motor has to remain in its earlier state that is if motor is on then it remains in on state and in off state otherwise.
The state S1=0 and s2=0 is an invalid case and does not exist
The truth table for the same can be formed as..
                                           
                                      S1              S1            Previous state       Output

                                       0                0                       x                        1
                                       0                1                       0                        0
                                       0                1                       1                        1
                                       1                1                       x                        0
                     
A simple circuit can be designed using a NOR gate XNOR gate and a D flip flop .The flip flop is used to retain the previous state of the motor.The logic used is once the water is below S1 and S2 ,then the motor is turned on until the water is filled to the max that is above both the switches.Now the motor is turned off until the water drains below both S1 and S2..after with the motor is turned on again.
The circuit for the same can be designed as....

6:56 AM

C.

C is  a procedural  language developed by Dennis Ritchie in 1973.It was developed at Bell laboratories for the use in  Unix systems there.C is one of the widely used languages ever.It leads to the development of many OS's,languages etc.The played a major role in shaping the digital world as we see today.

Dennis Ritchie(standing)
http://www.cca.org/blog/images/dennis-ritchie.jpg

C Basics

Data types...In C the data the program is deals with can be any of the data types..character,integer,floating point or  double.The size allocation for each varies as 1,2,4,8 bits...
In c any variable must be declared before its use.A variable is nothing but a user defined name for a memory location which he can use to store data of any of the above data types.The declaration of a variable involves specifying the data type followed by its name.As..
int a;...declares a variable with name a which can hold an integer value.
Every statement in C ends with a semicolon.
Modularity in C . The C language enable the user to divide the entire program into different self independent module called functions.In fact the a c program begins execution from a function called main(). That is the main corresponds to the staring of the program.The program can also have user defined functions.
The C has got an inbuilt function named printf() which can be used to print an output on the standard output.The printf() function is defined in the library stdio.h ,that is the standard input output library.So the stdio.h should be added to your program to make the code execute,which can be written as
#include<stdio.h>
Now the printf is a formatted output function and can have a number of parameters.The simplest use of printf is to print some thing on the screen.This can be done by simply enclosing the text in double quotes .like...
printf("hello world");
The value of a variable can be printed using its control string ie %d for int %c for character etc.

The program code written in C is called the source code.The source code cannot be executed directly.The source code written in high level language has to be converted into binary code.This is done using the help of  another program called the compiler.So the compiler generates the corresponding binary code for the program which can be executed directly. The Linux operating system has a compiler collection which can do
the same it is called the GNU compiler collection or the gcc,The gcc take the source code as its argument and generates the corresponding binary code,which can be written as
gcc file_name
The compiler reports the presence of any syntactical errors if any.
 if not it creates an out put file with a .out extension
one can also specify the name of the output file in that case the above statement looks like
gcc -o output_file_name input_file_name
The gcc can also generate the assembly code of the same file for that  an extra argument -S with the above written as..
gcc -S file_name
it will create a file of the same name but of the extension .s
The so created output file can be executed from the terminal by simply giving in the pat of the file.If the present working directory of the terminal contains the  output   file it can be executed by thewritting
./output_file_name
.....................................................................................................................................................................


5:10 AM

Hard Day .......

It was really a hard day for me and my team mate Arun.Simply because nothing went  i the way they were meant to...The questions were not that tough and we are not unhappy that output was not obtained ,but it was shocking to hear that we we working on stupid thing all these hours.. 
Today I realized the meaning  of an old saying "Little or no knowledge is dangerous".The first question we attempted was for finding square root of a number using Newton Raphson method. The logic part of the program was correct and we were able to obtain output.....only for 1.The problem was that we were unaware of using floating point in 8085 and which was the little knowledge we had... The question was a tricky question and we had to develop routines that calculated square..perform division etc .The code was little lengthy that we need to have good planning so that we could join together the different sub routines we had.The subprograms to calculate the square and division required little thinking...
The second question that we attempted was to solve an equation.Which was much easier compared to the first one and we managed to do it in a very small time.The second part of the question really took much if our time .The number of unknown of the first part was increased to three with only two equations in hand.The question was to find the number of solutions.We tried implementing it on the processor which was a very tricky on.We managed to develop an algorithm to find the number of solution and were able to run it but not sure about the result.Then only we came to know that we where required to find the number of solutions and not to implement the same.
Thus today was an unhappy day as we spend most of our time on simply NOTHING....
...........................................................................................................................................................................

5:07 AM

Microprocessors

In earlier classes we have learned that the CPU is the central part of the computer.What does a CPU consist of?...A CPU en cooperates the function of a microprocessor to perform its basic function of computation.




A microprocessor is a multi purpose programming device that accepts digital data as input,processes the data based on the program stored inside its memory ans generate a digital output.


http://www.7chip.com/2010/08/intel-8085-microprocessor-family.html
Little History...


The first microprocessor introduced was Intel 4004  in 1971.The research for 4004 began in 1969 when a Japanese company Busicom approached the Intel to  develop a chip for programmable calculator.The original design consist of a seven chip architecture and a shift register memory.Ted Hoff an Intel engineer come up with a more simplified model.Hoff came up with a four–chip architectural proposal: a ROM chip for storing the programs, a dynamic RAM chip for storing data, a simple I/O device and a 4-bit central processing unit (CPU).
Intel latter come up with more models like 8008,8085,8086 etc of which 80x86 is being used today which are based on the 8086.


More into 8085 design....


The 8085 platform remains as the base of latest  x86 architecture.The instruction set of x86 platforms are derived from the 8085 and hence understanding  the basic architecture is necessary for further understanding of newest designs.
http://www.8085projects.info




The 8085 architecture consist of a Arithmetic and logic unit(ALU) which performs the operations such as addition subtraction or other logic functions .
Other basic components are 
Registers:  The registers are fast memory location found inside the microprocessors .they are of very small size and is expensive and uses static RAM cells.
Bus Bus represents linkage between different components of the architecture say between ALU registers etc...The buses are of three types address bus which transfers address,data bus  meant to transfer data and control bus which transfers control signal like read or write etc...
Interrupt  signal The interrupt signal ensures that the microprocessor halts its working on its occurrences.
Program counter is a special type register which points to the next instruction to be executed that is it contains the address of the next instruction to be executed.The program execution starts when the PC points to the first location.
Instruction register is a register which the contains the present instruction  which is being executed.The contents of the IR are given to the decoder circuit which decodes the value corresponding to the operation to be performed.This value is passed to the timing and control unit.The unique op code of the operation is identified in this unit and the oscillatory circuit within generates the corresponding clock this signal.This clock signal is applied to the the alu which activates the circuitry corresponding to the operation.  


Basic instruction set for addition of two numbers.


Assuming that the data is available at location 5000 and 5001.The corresponding program can be written as....
LD A 5000
MOV B A
LD A 5001
ADD B
ST A 5000
HALT


The instruction set fed to the microprocessor is ..
4100  3A 
4101  00
4102  50
4103  47
4104  3A 
4105  01
4106  50
4107  80
4108  32
4109  00
410A  50
410B  76


The above program can be improved by the concept of jumping between steps to enble addition of  n numbers.


Writing the instruction set for an instruction is a low level programming.The disadvantages of this is that the programmer should have a clear knowledge on the hardware of the system and their functioning .Also the codes are lengthy.....

...................................................................................................................................................................

8:20 AM

A motor that can rotate in both dierections

An electrical motor converts electrical energy into mechanical energy.Electrical motors find extensive use in electronics especially robotics.Small rating DC motors are used to enable movement of different parts like arms legs,wheels etc ....

DC motor
As a modification to the above statement a Dc motor is an electrical device that converts DC input energy into mechanical energy,which is obtained as the rotation of the rotor.The rotor rotates in one direction input is provide and it changes the direction when the when the input current is reversed.This can be done using an L293D IC

L293D


L293D is a motor driving IC.The IC rotates the motor in different directions based on the on the input signal provided.The L293D IC acts as a current amplifier as a small signal input can drive a high rated motor as the output.
L293D contains twp inbuilt H bridge driver circuits.In its common mode of operation,two DC motors can be driven simultaneously both in forward or reverse direction.The  motor operation of two motors can be controlled by input logic at pins 2&7 and 10&15. An input 01 will rotate the motor  in clock wise direction while 10 rotates the motor in anti clock wise direction..

The pin out diagram for L293D is


The connections can be given as


The motor behaves as
A -> 0 B ->1 clockwise

A -> 1 B ->0 anti  clockwise


..................................................................................................................................................................

4:51 AM

Electronics......

Electronics deals with electrical circuits using active components like transistors,diodes etc.Playing with electronic components is real fun....trying out different components...connecting them in different circuits...analyzing the results etc.Experimenting on electronics is interesting when  compared to the boring theory classes.But in order to design  circuits for specific functions on must have a clear idea on electronics base....how the components work etc.

Transistor as a switch

The second most common use of transistor after amplifier is its switching action.
The circuit for the same consist of a transistor.


en.wikipedia.org
The collector terminal of the transistor is biased using a voltage source.When the input voltage at base terminal is zero the transistor is in cutoff state and the transistor is in off state.When a voltage above 0.7 is applied the transistor is switched on.
This basic switching circuit can be used to control components like LED's motor relays etc.These components are connected to the the collector junction.In order to ensure proper working of the components  the input is provided through a resistor.Now these components can be controlled using the input signal like the component will work only when the input is high enough.

The above circuit cannot be used to control a normal bulb as the 230V required for the bulb will burn away the transistor used.So relays are used .Relays is basically an electrical switch which works on the principle of electromagnetic induction. Relays are used where it is necessary to control a circuit by a low-power signal as in the above case.A relay has got an electromagnet.When the electromagnet is no induced the relay remain in normal position.When the electromagnet is activated the magnet pulls its arm to a new position thus giving a new connection. A transistor switch is used to control this relay which will control the high power device.
wanderlodgeownersgroup.com
This switching circuit can be further improved using a which controls the input  to the transistor.That is a system to control the device
.................................................................................................................................

6:52 AM

Image manipulation using Octave.

An image is a collection of pixels.Thus a pixel is a smallest addressable point on an image.The dimensions of an image is represented in terms of the number of pixels.
That is 1024X768 image has a width of 1024 pixels and height of 768 pixels.Any colour in the image can be seen as a combination of three basic colours red green and the blue.Hence the image can  be represented using a three dimensional matrix,where  first layer corresponds to red,next to green and the next to blue.
thus a 1024x768 image consist of three layers each of size 1024x768.that is an image in matrix format can be considered as a combination of three matrices making it a three dimensional matrix of order 1024x768x3.Each element in each of the three matrices has a value representing the colour .For example if it is a 8 bit representation the values range from 0 to 255.

The octave enable images to be loaded into and represented as matrices.the function imread() enables reading images.
im=imread("image name")
now im will be a three dimensional matrix.And normal matrix operations can be performed on im for various manipulations.The various individual bits can be altered to once needs.The matrix can be displayed as an image using the function imshow().that is imshow(matrix).Various other functions on the images can be performed like rotating the image,slicing,resizing etc...The brightest points on the image can be found by determining the one with maximum value of rgb.this has extensive application in detecting purposes like infrared detecting  and the exact point where the user pointed etc...
..................................................................................................................................

6:03 AM

Solving square root using Octave.

The GNU octave is a high level language for performing numerical computations.
It provides command line interface for solving linear and non linear problems represented using matrices.The language has all set of operations that can be performed on matrices.

The octave makes data manipulation much easier with matrices.In octave variables need not be declared and can be used directly by simply assigning the values.A matrix can be initialized as
a=[elements]
where the elements in each column are separated using a semicolon.
a=[1,2;3,4]
The size of a matrix can be found using the in built function size(matrix).
Traversing of the matrix is easy by using indexes as a(i,j).The octave enables slicing of the matrices in any way the programmer needs.
a(:,1) displays all the elements in the first row and so on.....



Square root of a number


Square root of a number can found using any of the following methods.

The simplest method is guess a number , square it and check whether it equals the provided number until you find one .A simple octave code for this is

guess=0;
while x-guess^2<0
     guess=guess+1
endwhile

the final value of the guess will be the required root.
This algorithm can be used only for perfect squares.It can be further improved by updating the guess for a small value say .001 and checking the difference as the same.


Bisection method
The number of steps involved in the above method can reduced using a bisection method.In bisection method  repeatedly bisects an interval and then selects a subinterval in which a root must lie for further processing.The octave code for performing bisection is

low=0;
high=x;
mid=(low+high)/2;
while abs(x-mid^2)>.001
        if mid^2<x
             low=mid;
        endif
        if mid^2>x
             high=mid;
        endif
        mid=(low+high)/2;
endwhile

the final value of mid will be the root.


Newton Raphson method
The number of steps involved can be further reduced by the using the Newton Raphson method.In this method one stars with an initial guess close to the root,then the function is approximated to the tangent line and the x intercept of the tangent line is computed which is a better guess for the root and can be approximated as the root.This process is iterate to find the root.The eqaution for the next guess is given by

x_{1} = x_0 - \frac{f(x_0)}{f'(x_0)} \,.











The octave code for the same can be written as.
guess=x;
diff=guess^2-x
while abs(diff)>.001
     guess=guess-(diff/2*x);
     diff=guess^2-x;

the final value of guess corresponds to the root
..................................................................................................................











6:17 AM

Machine Design

In graph theory,a Hamiltonian cycle is a path which covers all the vertexes exactly  once and return to the same vertex.A graph is called a Hamiltonian graph if it contains at least one   Hamiltonian cycle. An algorithm to check whether the graph is Hamiltonian or not is an np algorithm that is non deterministic polynomial algorithm . Hence there exists no general procedure too check whether a graph is Hamiltonian and involves a brute force method where we will be trying all possible combinations of paths that can occurs in the graph.such non deterministic algorithms are difficult to implement.For example breaching a 1024 bit encryption does not have any general algorithm and requires one to try out all possible combinations of numbers that can come.The first attempt of such kind was done by Alan Turing breaking German systems..which helped English win the war.

The simplest of the machine design is deterministic finite state automate or deterministic finite state machine.The machine involves a set of states through which the machine goes.When sequential inputs from a language set are givento the machine it state transitions occur and finally rests at the acceptor and not so the case in all other inputs.

The deterministic model involves simple cases and we are not much worried about the number of alphabets and only on the pattern in which they occur. This case is a more complex one and requires a different machine known as push down automate or push down machine.In tis machine a separate stack is used to determine whether the two alphabets are sane in number and is more complex compared to DFM.

The push down machine has a drawback that only two alphabets can be used.This is overcome using a Turing machine developed by Alan Turing.
It has read or write head which moves on top of a tape which contains the sequential data on it . The Turing machine can handle multiple symbols and works on a strike-replace procedure to ensure that the number of alphabets is taken into consideration.........

6:57 AM

Recursion.......

Go to google
search for recursion

You have what a RECURSION is.........   :)

recursion is repeating items in similar manner.......

Recursion has many many applications in mathematics and computer science........
it simplify problems.........and reduce complicity


recursion find extensive use in daily life say from counting to multiplication every thing involves
recursion......

multiplication is a recursive process of summation........

day,night ,year are all recursive   .........
our life  is centered around a whole recursive loop......:)



















6:19 AM

Google Street View

Just had a walk through .......
Street view of big ben
Time square....then to the tower bridge at london ......and the Big Ben.....
then took a long walk through Amphitheatre Parkway.........home of The Google inc......

the Google street view is awesome.....


The google street view was launched in 2007....and offers panoramic images of streets from US initially....

today the google  have a large database of town spanning across the globe....London, Paris .....and many other....

The latest news on google street view came day before yesterday ......
google made available the panoramic views of the tsunami affected areas of northern Japan ....

after driving through more than 44,000kilometers through the affected region.......

http://maps.google.com/?ie=UTF8&t=h&vpsrc=0&layer=c&cbll=38.442917,141.446121&panoid=iWXV0ROJHBfLkiQ7y5qbyg&cbp=13,131.82,,0,-0.76&ll=38.441718,141.44685&spn=0.002639,0.00603&z=17&source=embed

5:01 AM

!st Day At chpc

Hi.....
Attended the first day at hpc with many things streaming through mind.......


And Mahesh sir did not let our expectations down.......


Just had introductory classes....what all to be covered.....like discrete mathematics...digital electronics .....etc.....


Spend the sleepy afternoon session was spend watching the film  the October Sky.....
base on the true life story of Homer Hickman.......
it was such an inspiring story..... :)


.........

hope to see more excitements the following days.......

3:10 AM

.......

Under Consrtuction