Sunday, October 21, 2012

Part4: Debugging in R

  Debugging tools are built with R do not part of any package. There are couple of indications that something is not right. It could be a diagnostic message something to happed.Basically three type of main indications.
  1. message: A generic notification/diagnostic message produced by the message function; execution of the function continues 
  2. warning: An indication that something is wrong but not necessarily fatal;execution of the function continues generated by the warning function 
  3. error: An indication that a fatal problem has occurred; execution stops;produced by the stop function
condition: A generic concept for indicating that something unexpected can occur; programmers can create their own conditions

So this is our basic warning,  take a log of negative number

>log(-1)
[1] NaN
Warning message:
In log(-1) : NaNs produced

Tuesday, October 9, 2012

Part3: Reading and Writing Data in R


Reading Data   

Large data objects will usually be read as values from external files rather than entered during an R session at the keyboard. R input facilities are simple and their requirements are fairly strict and even rather inflexible. If variables are to be held mainly in data frames, as we strongly suggest they should be, an entire data frame can be read directly with the read.table() function. There is also a more primitive input function, scan(), that can be called directly. There are a few principal functions reading data into R. 
  1. read.table, read.csv, for reading tabular data

    The read.table function is one of the most commonly used functions for reading data. It has a few important arguments:
    • file, the name of a file, or a connection
    • header, logical indicating if the file has a header line
    • sep, a string indicating how the columns are separated
    • colClasses, a character vector indicating the class of each column in the dataset
    • nrows, the number of rows in the dataset
    • comment.char, a character string indicating the comment character
    • skip, the number of lines to skip from the beginning
    • stringsAsFactors, should character variables be coded as factors

    For small to moderately sized datasets, you can usually call read.table without specifying any other arguments
    data <- read.table("foo.txt")

    R will automatically skip lines that begin with a # and figure out how many rows there are (and how much memory needs to be allocated). Figure what type of variable is in each column of the table. Telling R all these things directly makes R run faster and more efficiently. read.csv is identical to read.table except that the default separator is a comma.

Sunday, September 30, 2012

Part2: R-Language Basics

 Data Types and Basic Operations:

1. Objects:
   In every computer language variables provide a means of accessing the data stored in memory. R does not provide direct access to the computer’s memory but rather provides a number of specialized data structures we will refer to as objects.These objects are referred to through symbols or variables.

R has five basic or atomic classes of objects:


  1. characters
  2. numeric(real numbers)
  3. integer
  4. complex
  5. logical(True or False)
2. Basic types:

2.1 Vectors:
The most basic object in R is vector. A vector can only contain objects of the same class. But the exception is a 'list', which is represent  as a vector but can contain objects of different classes. Empty vectors can be created with the vector() function.

 2.2 Lists:
Lists are another kind of data storage. Lists have elements, each of which can contain any type of R object, i.e. the elements of a list do not have to be of the same type.

Saturday, September 29, 2012

Part1: Introduction and Installation of R Programming Language

  R is really interesting  open source programming language and software environment for statistical computing and graphics. It compiles and run on wide verity  of UNIX platforms, Windows and Mac OS. It provides, among other things, a programming language, high level graphics, interfaces to other languages and debugging facilities.

 The source code for the R software environment is written primarily in C, Fortan, and R. R is freely available under the GNU General Public License. R uses a command line interface; however, Rstudio like graphical interface are available for use with R.



Wednesday, September 26, 2012

Simple Program to copy its input to output

This program copy anything to anything.Since the input and output can be redirected to any file or device.
   We can write a simple program to copy its input to output.we use low level I/O read and write system calls.we have collected function prototypes for the system calls into a file called syscalls.h.so we can include it in this program.but the name syscalls.h is not standard.In UNIX system "unistd.h" is used instead of "syscalls.h".The program code is below:














The parameter BUFSIZ is defined in "stdio.h"; Its value is  good size for the local system. if the file size is not a multiple of BUFSIZ, some read will return a smaller number of bytes to be written by write; the next call to read after that will return zero.

Friday, September 21, 2012

Git Basics and Using Github

Hi, this blog entry is for beginners who want to try out Git and GitHub. I am setting up this on Ubuntu .

What is Git and How is setting Up with Ubuntu? :


Git  is a distributed revision control and source code management (SCM) system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development.


Setting up Git in your system:

First install Git in your machine, Enter the command seen in Below in terminal(Alt+Shift+T):









You can test the installation by simply typing git.It should print out the instructions of Git

 












If you don't see this.then try to install Git again

Sunday, September 2, 2012

MY FIRST AVR PROGRAMMER IN LINUX


          It is simple to beginners...!.simple AVR Programmer will allow you to transfer hex programs to most ATMEL AVR microcontrollers in less time. It is more reliable one and built in short time.
          It consist of simple circuit serial programmer.You may also use this programmer as a stand alone in-circuit serial programmer that can be used to conveniently program AVR microcontrollers without removing them from the target circuit. This programmer is tested with Pony Prog software.my OS is linux, PonyProg version is also available for windows and Linux. The GUI version is simple for beginners. The link for linux version is Here
          After downloading, Login as root, execute the command "tar xfz ponyprog.tar.gz" and follow the instructions int the README file. PonyProg for Linux needs the V lib shared library v1.20 or later to work.

AVR Serial Programmer Circuit



Components required:

Resistors:

R1 = 4.7k
R2 = 10k
R3 = 4.7k
R4 = 15k
R5 = 10k

Diode:
D1 = 1N4148
D2 = 5.1V ZENER
D3 = 5.1V ZENER

Transistor:
Q1 = BC549

Connector: DB9 (to serial port of PC) 
Bread Board


Connection to target AVR microcontroller:





Friday, March 2, 2012

Useful Commands for Linux Terminal (command line interface)

Fundamental Commands are given below:


  1. sudo: Executing Commands with Root Privileges


    Most of the following commands will need to be prefaced with the sudo command. which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command.




  1. Useful File and Directory Commands





  • The tilde (~) symbol indicates it is  your home directory. If you are user, then the tilde (~) stands for /home/user

  • pwd: The pwd command will allow you to know in which directory you're located (pwd stands for "print working directory"). Example: "pwd" in the Desktop directory will show "~/Desktop".

  • ls: The ls command used for showing the files in your current directory.

  • cd: The cd command will allow you to change directories. When you open a terminal you will be in your home directory. To move around the file system you will use cd. Examples:

    • To navigate into the root directory, use "cd /"

    • To navigate to your home directory, use "cd" or "cd ~"

    • To navigate up one directory level, use "cd .."

    • To navigate to the previous directory (or back), use "cd -"

    • To navigate through multiple levels of directory at once, specify the full directory path that you want to go to. For example, use, "cd /var/www" to go directly to the /www subdirectory of /var/. As another example, "cd ~/Desktop" will move you to the Desktop subdirectory inside your home directory.



  • cp: The cp command will make a copy of a file for you. Example: "cp jaseem job" will make an exact copy of "jaseem" and name it "job", but the file "jaseem" will still be there. If you are copying a directory, you must use "cp -r directory jasmedia" (copy recursively). (To understand what "recursively" means, think of it this way: to copy the directory and all its files and subdirectories and all their files and subdirectories of the subdirectories and all their files, and on and on, "recursively")

  • mv: The mv command will move a file to a different location or will rename a file. Examples are as follows: "mv jaseem jasmedia" will rename the file "jaseem" to "jasmedia". "mv jaseem ~/Desktop"will move the file "jaseem" to your Desktop directory but will not rename it. You must specify a new file name to rename a file.

    • To save on typing, you can substitute '~' in place of the home directory.

    • Note that if you are using mv with sudo you can use the ~ shortcut, because the terminal expands the ~ to your home directory. However, when you open a root shell with sudo -i or sudo -s, ~ will refer to the root account's home directory, not your own.



  • rm: Use this command to remove or delete a file in your directory.

  • rmdir: The rmdir command will delete an empty directory. To delete a directory and all of its contents recursively, use rm -r instead.

  • mkdir: The mkdir command will allow you to create directories. Example: "mkdir Document" will create a directory called "music".

  • man: The man command is used to show you the manual of other commands. Try "man man" to get the man page for man itself.


Running a File Within a Directory


So you've decided to run a file using the command-line? Well... there's a command for that too!

./filename.extension


After navigating to the file's parent directory, this command will enable any Ubuntu user to parse files compiled via gcc or any other programming language. Keep in mind that the 'extension' will vary depending upon the language the source code is written in. For example: ".c" for C source, ".cpp" for C++, ".rb" for Ruby, ".py" for python, etc. Also, remember that (in the case of interpreted languages like Ruby & Python) you must have a version of that language installed on Ubuntu before trying to run files written with it.

System Information Commands



  • df: displays filesystem disk space usage for all mounted partitions. "df -h" is probably the most useful - it uses megabytes (M) and gigabytes (G) instead of blocks to report. (-h means "human-readable")

  • du: The du command displays the disk usage for a directory. It can either display the space used for all subdirectories or the total for the directory you run it on. Example:


user@users-desktop:~$ du /media/cd

1032 /media/cd/files

1036 /media/cd/

user@users-desktop:~$ du -sh /media/cd

1.1M /media/cd/

where -s means "Summary" and -h means "Human Readable"

  • free: The free command displays the amount of free and used memory in the system. "free -m" will give the information using megabytes, which is probably most useful for current computers.

  • top: The top command displays information on your Linux system, running processes and system resources, including CPU, RAM & swap usage and total number of tasks being run. To exit top, press "q".

  • uname -a: The uname command with the -a option prints all system information, including machine name, kernel name & version, and a few other details. Most useful for checking which kernel you're using.

  • lsb_release -a: The lsb_release command with the -a option prints version information for the Linux release you're running

  • ip addr reports on your system's network interfaces.


Adding A New User


"adduser newuser" command will create a new general user called "newuser" on your system, and to assign a password for the newuser account use "passwd newuser".

Options


The default behaviour for a command may usually be modified by adding a --option to the command. The ls command for example has an -s option so that "ls -s" will include file sizes in the listing. There is also a -h option to get those sizes in a "human readable" format.

Options can be grouped in clusters so "ls -sh" is exactly the same command as "ls -s -h". Most options have a long version, prefixed with two dashes instead of one, so even "ls --size --human-readable" is the same command

I hope it is helpful for Ubuntu Biginners.....!

Wednesday, February 8, 2012

BLUE BRAIN PROJECT: SEMINAR

           
The Blue Brain Project is an attempt to create a synthetic brain by reverse-engineering the mammalian brain down to the molecular level. The aim of the project, founded in May 2005 by the Brain and Mind Institute of the École Polytechnique in Lausanne, Switzerland, is to study the brain's architectural and functional principles. The project is headed by the Institute's director, Henry Markram. Using a Blue Gene supercomputer running Michael Hines's NEURON software, the simulation does not consist simply of an artificial neural network, but involves a biologically realistic model of neurons. It is hoped that it will eventually shed light on the nature of consciousness. There are a number of sub-projects, including the Cajal Blue Brain, coordinated by the Supercomputing and Visualization Center of Madrid (CeSViMa), and others run by universities and independent laboratories in the UK, US, and Israel.
For presentation slide Click Here... latest blue

Biographical Sketches

Sean Hill is the Blue Brain Project Manager for Computational Neuroscience. Dr. Hill received his Ph.D. in Computational Neuroscience from the University of Lausanne, Switzerland where he investigated the computational role of the auditory thalamocortical circuitry in the rat. He subsequently held postdoctoral positions at The Neurosciences Institute in La Jolla, California and the University of Wisconsin, Madison. In the course of his research, Hill has developed numerous large-scale models of neural systems and is the designer/developer of the general-purpose neural simulator Synthesis. As part of his research, he developed the first large-scale model of the cat visual thalamocortical system that replicates neural activity during wakefulness and sleep. He began his work with the Blue Brain project as a member of the Computational Biology Group at the IBM T.J. Watson Research Center in 2006 and became a Blue Brain employee in 2008. His research interests include the use of biologically-realistic models to study the role of emergent phenomena in information processing, network connectivity and synaptic plasticity in the central nervous system, from the neocortical column to the whole brain, and across different arousal conditions including waking and sleep. Henry Markram is the Founder and Co-Director of EPFL's Brain Mind Institute and Director of the Blue Brain Project. He obtained his Ph.D from the Weizmann Institute of Science where he discovered a link between acetylcholine and memory mechanisms. At the Max Planck Institute he discovered calcium transients in dendrites evoked by sub-threshold activity and by single action potentials propagating back into dendrites. He also began studying the connectivity between neocortical neurons. Markram discovered Spike Timing Dependent Plasticity (STDP) by altering the precise millisecond relative timing of single pre- and post-synaptic action potentials, which revealed a highly precise learning mechanism operating between neurons. He moved back to the Weizmann Institute where he started his systematic reverse engineering of the neocortical microcircuitry. He discovered a number of key principles of microcircuit structure and design and a novel view of synaptic learning called redistribution of synaptic efficacy. Based on the emergent dynamics of the neocortical microcircuit he and Wolfgang Maass developed the theory of liquid computing to explain computing in high entropy states. In 2002, he moved to EPFL as full professor and founder/director of the Brain Mind Institute. At the BMI, Markram developed state of art technologies to obtain a detailed blueprint of the neocortical column. He launched the Blue Brain Project with the support of IBM in 2005 to rebuild and simulate the neocortical column and is expanding the BBP to simulate the whole brain of mammals. Markram has received numerous awards and published over 80 papers.
If any have want the full report of my seminar please contact to me..