Singleton Pattern

Singleton Pattern


The Singleton Pattern ensures a class has only one instance, and provide a global point of access to it.

1.     Synchronize the getInstance() method


public class Singleton{

   private static Singleton uniqueInstance;
   
   private Singleton() { }              // private constructor

   public static synchronize Singleton getInstance() {

       if(uniqueInstance == null)

            uniqueInstance = new Singleton();

    return uniqueInstance;

}


}


But Synchronizing  a method can decrease performance by a factor of 100.


2. Move to eargerly created Instance rather than lazily created one. If performance is an issue in your use of getInstance() method then this method of implementing the Singleton can drastically reduce the overhead.

Using this approach, we rely on the JVM to create the unique instance of the Singleton when class is loaded.The JVM guarantees that the instance will be created before any thread accesses the static uniqueInstance variable.

      public class Singleton{

            private static Singleton uniqueInstance = new Singleton(); 

             private Singleton() {}

            public static Singleton getInstance() {

                       return uniqueInstance;

                 }

      }
  

3. Use "double - checked locking" to reduce the use of Synchronization in getInstance()

    With double -checked locking, we first check to see if an instance is created and if not THEN we synchronize.This way we only synchronize the first time through,just what we want..

Volatile keyword ensures that multiple threads handle the uniqueInstance variable correctly when it is being initialized to the Singleton instance.


     public class Singleton{

            private volatile static Singleton uniqueInstance ; 

             private Singleton() {}

            public static Singleton getInstance() {
  
                       if(uniqueInstance == null){

                        synchronized (Singleton.class) {

                         if( uniqueInstance == null) { 
                                          uniqueInstance = new Singleton();

                               }
                          }

                    }
                       return  uniqueInstance;

      }

}


 





   



Abstract Factory design Pattern

Abstract Factory 

Intent

  • Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
  • A hierarchy that encapsulates: many possible "platforms", and the construction of a suite of "products".
  • The new operator considered harmful.

Problem

If an application is to be portable, it needs to encapsulate platform dependencies. These "platforms" might include: windowing system, operating system, database, etc. Too often, this encapsulatation is not engineered in advance, and lots of #ifdef case statements with options for all currently supported platforms begin to procreate like rabbits throughout the code.

Discussion

Provide a level of indirection that abstracts the creation of families of related or dependent objects without directly specifying their concrete classes. The "factory" object has the responsibility for providing creation services for the entire platform family. Clients never create platform objects directly, they ask the factory to do that for them.
This mechanism makes exchanging product families easy because the specific classof the factory object appears only once in the application - where it is instantiated. The application can wholesale replace the entire family of products simply by instantiating a different concrete instance of the abstract factory.
Because the service provided by the factory object is so pervasive, it is routinely implemented as a Singleton.

Structure

The Abstract Factory defines a Factory Method per product. Each Factory Method encapsulates the newoperator and the concrete, platform-specific, product classes. Each "platform" is then modeled with a Factory derived class.
Scheme of Abstract Factory

Example

The purpose of the Abstract Factory is to provide an interface for creating families of related objects, without specifying concrete classes. This pattern is found in the sheet metal stamping equipment used in the manufacture of Japanese automobiles. The stamping equipment is an Abstract Factory which creates auto body parts. The same machinery is used to stamp right hand doors, left hand doors, right front fenders, left front fenders, hoods, etc. for different models of cars. Through the use of rollers to change the stamping dies, the concrete classes produced by the machinery can be changed within three minutes.
Example of Abstract Factory

Check list

  1. Decide if "platform independence" and creation services are the current source of pain.
  2. Map out a matrix of "platforms" versus "products".
  3. Define a factory interface that consists of a factory method per product.
  4. Define a factory derived class for each platform that encapsulates all references to the new operator.
  5. The client should retire all references to new, and use the factory methods to create the product objects.

UML

UML
The UML puts some notations to out software model. Usually, a single class is represented with a box that is divided into three parts:
  1. The upper section contains the class name.
  2. The middle section has lists attributes of the class.
  3. The lower section lists methods of the class.
The members of the class in the middle and lower sections can be prefixed with a symbol to indicate the access level or visibility:
  • +: a public member
  • -: a private member
  • #: a protected member
We can tell the relationships between classes by using various styles of connecting lines and arrowheads:
  • Association: A simple dependency between two classes where neither owns the other, indicated as a solid line. Association can be directional, shown with an open arrowhead (">").
  • Aggregation: A has-a, or whole/part, relationship where neither class owns the other, indicated as a solid line with a hollow diamond.
  • Composition: A has-a relationship where the lifetime of the part is managed by the whole. This is shown as a solid line with a filled diamond.
  • Generalization: A subclass relationship between classes, represented as a hollow triangle arrowhead.
Each side of a relationship can also be annotated to define its multiplicity. This lets us specify whether the relationship is one to one, one to many, or many to many:
  • 0..1 = zero or one instance
  • 1 = one instance
  • 0..* = zero or more instances
  • 1..* = one or more instances

Composition vs. Aggregation

Composition vs. Aggregation


Aggregation and composition are both strong forms of association. They describe relationship between a whole and as its parts. So, instead of a has-a relationship as a simple association, we are dealing with a relationship says is part or reading the relationship in the other direction, is made up of.
Examples of these kind of relationship:
      Orchestra: Musician
      Orchestra is made up of Musicians
      or Musician is part of Orchestra
      Brochure: Product 
      Brochure is made up of Products
      or Product is part of Brochure
      Building: Room
      Building is made up of rooms
      or Room is part of Building
Composition is even stronger relationship than aggregation. To test if we are dealing withcomposition, use no sharing rule for composition: part can belong to only one whole.
For the #1 and #2, part (Musician/Product) can belong only one (Orchestra/Catalog) whole? Yes! But for #3, room can belong to more than one building. No! No sharing rule applies to this case. So, the relationship #3 is better described by composition than by aggregation.
Besides the no sharing rule, another the rule for composition is: if the whole is destroyed, is the part that makes it up also destroyed?
Only the case #3 follows the additional composition rule. If orchestra breaks it up, will musicians be destroyed? No!
Code Example: A university owns various departments, and each department has a number of professors. If the university closes, the departments will no longer exist, but the professors in those departments will continue to exist. Therefore, a University can be seen as a composition of departments, whereas departments have an aggregation of professors. In addition, a Professor could work in more than one department, but a department could not be part of more than one university.
  • University - Department : composition: ownership: destroyed with the whole: strong has arelationship
    The composite object takes ownership of the component. This means the composite is responsible for the creation and destruction of the component parts. An object may only be part of one composite. If the composite object is destroyed, all the component parts must be destroyed.
    Composition enforces encapsulation as the component parts usually are members of the composite object:
    class University
    {
      ...
      private:
     
        Department faculty[20];
    
  • Department - Professors: aggregation: no ownership: may outlive: component may still have weakhas a relationship
    In aggregation, the object may only contain a reference or pointer to the object. The object may not have lifetime responsibility for the reference or pointer:
    class Department
    {
      ...
      private:
        // Aggregation
        Professor* members[5];
      ...
    };
  • Complete code example:
class Professor;
 
class Department
{
  ...
  private:
    // Aggregation
    Professor* members[5];
  ...
};
 
class University
{
  ...
  private:
 
    Department faculty[20];
  ...
 
  create dept()
  {
   ....
     // Composition
     faculty[0]= Department(....);
     faculty[1]= Department(....);
   ....   
  }
};
Source of the code and diagrams: wiki

Aggregation-Composition_A 
In UML, composition is depicted as a filled diamond and a solid line. It always implies a multiplicity of 1 or 0..1, as no more than one object at a time can have lifetime responsibility for another object. The more general form, aggregation, is depicted as an unfilled diamond and a solid line. The image above shows both composition and aggregation. 

ref :http://www.bogotobogo.com/DesignPatterns/introduction.php

GitHub

Git/GitHub


Git Install 
We can install the Git command line tool using the command below:
$ sudo apt-get install git 

$ git --version
git version 1.9.1
Creating a git repository
$ git init project1
Initialized empty Git repository in /home/k/GitTraining/project1/.git/
Note that we do not have any server, and there is no background daemon. We just used local file system to create the project1 directory and the nested .git directory.
$  cd project1
$ ls
$ ls -al
total 12
drwxrwxr-x 3 k k 4096 Jun  3 09:52 .
drwxrwxr-x 3 k k 4096 Jun  3 09:52 ..
drwxrwxr-x 7 k k 4096 Jun  3 09:52 .git
$ tree .git
tree_git.png 
Unlike other source control system such as CVS, there is only one .git folder at the top level. Only one.git per repository!
Also, note that we do not have any file in the repository yet:
$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
Now we make our first ifle: first.txt.
Let's see how the git think of the file:
$ git status
On branch master

Initial commit

Untracked files:
  (use "git add ..." to include in what will be committed)

 first.txt

nothing added to commit but untracked files present (use "git add" to track)



Adding a file to a git

$ git add first.txt
The git add is merely telling the git our intention of adding for the next transaction. It's not adding the file to a repo yet. It just signals our participation. We do not have a permanent recode of the file yet.
We can see the changes to be committed using git status:
$ git status
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached ..." to unstage)

 new file:   first.txt
Now we can commit to the master:
$ git commit -m "My first commit"
[master (root-commit) b025f57] My first commit
 1 file changed, 50 insertions(+)
 create mode 100644 first.txt
Here, the b025f57 is a global unique identifier. The 644 indicates the user can read and write and others and group just can read the file.
Now we have permanent record of the file and we can see our current directory is clean:
$ git status
On branch master
nothing to commit, working directory clean

Java Programming Tips ...

Popular Java/J2EE Development/Testing Tools

1. IDE => Eclipse/Netbeans/IntelliJ IDEA/JBuilder/JDeveloper/WSAD

2. Application Server => WebSphere/Weblogic/Sun GlassFish/Apache Tomcat/JBoss/JRun/Iplanet/NES(Netscape Enterprise Server)/NAS(Netscape Application Server) /IPLANET(It is latest version of NES and NAS)

3. Database Server => Oracle/Sqlserver/Sybase/MySql/DB2(if Application is Mainframe)

4. Middle Tier => EJB/Hibernate/TopLink/JDO/JMS/Corba(TAO,JavaOrb,OmniOrb ...)

5. Web Application Frameworks => Struts/Spring/JSF/GWT/Apache Wicket/Grails/Adobe Flex/ OpenLaszlo/SAILS/Tapestry

6. XML Parser => Xerces(Apache Parser)/JAXP(Sun Parser)

7. XSLT Parser => Xalan(Apache XSLT)/Saxon

8. JAVA XML Binding => JAXB/Castor/XMLBeans

9. Unit Testing Framework for Java => JUnit/GJTester

10. Unit Testing Framework for Servlets => Cactus/AppPerfect

11. Unit Testing Framework for Servlets/JSP/EJB => HtmlUnit/AppPerfect

12. Unit Testing Framework for Java Database Programming => SQLUnit / DBUnit / DAO

13. Java Memory Leak Tool => HeapRoots / JRockit JVM

14. Java Performance Checking Tool => Apache JMeter / JProfiler / JUnitPerf / The Grinder

15. Java Code Static Analysis Tool => ASSENT(TCS Product)/JTest

16. Java Code Coverage Tools => CheckStyle/PMD

17. Java Build Tool => Ant/Maven/Apache Ivy


18. Java Bug tracking Tool => Jira/Bugzilla/SVN Trac/QC(Quality Center)

19. Java Webservices Tool/Libraries => Jersey(RESTful) / Restllet / Axis(SOAP WebServices)

20. Java Common Utilities API => Apache Commons Library ( Please check this Library before you develop any new Java Utilities Classes)

21. Java Reporting Tools => BI Crystal Reports/Actuate/Jasper Reports/JCharts

22. Open Source UML & Modeling in Java => AgroUML/WebUML/Jude/Violet

23. Logging Tools => Log4J / Commons Logging / AspectJ / Log4plsql(Open-Source Tool for PL/SQL Logging) / jLo

24. Java Security Frameworks => Acegi, JaaS

25. Java Graph/Network Visualization Tools => Tom Sawyer / VizServer / Giny


26. Java Desktop GUI : AWT/SWING/GWT/SWT/JFace

27. Open Source Wiki Engines in Java => JSPWiki / MediaWiki

28. Web Browsers => Chrome/Mozilla FireFox/Safari/IE


29. Miscellaneous:

a. Continuous Integration/Build Tools => Jenkins / Hudson


b. Encryption/Decryption Libraries => JASYPT (Pretty good Java cryptography library to encrypt/decrypt your usernames, passwords, files ...)

c. Image API => Jai (Java Advanced API for Imaging)

d. Configuration Management Tools - Subversion / CVS

e. Java Service Wrapper (To run your java applications as a windows service)

f. Content Management System(CMS) - plone / zoomla / zope / drupal

g. Java Persistence API(JPI)

h. JCR - Content Repository API for Java (JCR) is a specification for a Java platform API for accessing content repositories in a uniform manner

i. MULE - Mule is the world's most widely used open source Enterprise Service Bus (ESB).

j. JSON - JSON (JavaScript Object Notation) is a lightweight data-interchange formatFor data-oriented applications, prefer JSON to XML due to its simplicity and ease of processing on the client side. XML may be great on the server side, but JSON is definitely easier to deal with on the client side. Popular JSON libraries are Jackson, Gson.

k. Rhino - Javascript Engine in Java

l. Apache Lucene/Solr - A high-performance, full-featured text search engine library written entirely in Java

m. JavaScript Web Frameworks - AngularJS, Dojo

n. JavaScript Unit Testing - Jasmine

Core Java Focus:
1. Core Java Fundamentals (Core Packages)

2. Collections, Generics, Reflections
3. Multithreaded Programming
4. AWT/SWING GUI Programming
5. JDBC programming
6. Network Progamming (sockets, ...)
7. HTTP Programming
8. RMI
9. JNDI

Compared to JDK 4.0 ( 1.4.4) , JDK 5.0 ( 1.4.5) has more features like -
1. Generics => which are like C++ STL (Standard Template Library)

2. Variable Args
3. enum
4. Auto Boxing
5. Reading Commandline Arguments
6. printf

J2EE Focus:
Here you will focus on one of the J2EE Web Application Frameworks -

Any Web Application Framework => Presentation Tier, Middle Tier
Examples:

1. Struts => Presentation Tier(Servlets,JSP),Middle Tier(EJB)
2. Spring => Presentation Tier(Servlets, JSP), Middle Tier(Hibernate)
...

So the common and fundamental stuff in J2EE is Servlets, JSP
Servlets => HTML code Snippets embedded with JAVA code
JSP => Java Code Snippets embedded with HTML code

So we can say Servlets & JSP in J2EE as Fundamentals of J2EE programming.
To be a good one in J2EE, You have to be proficient in atleast one Application Server & one Database Server based on the Operating System that you are going to deploy J2EE Products/Applications.

Application Server can be => WebSphere/JBoss
Database Server can be => Oracle/SqlServer ( if OS is Windows then SqlServer )

Thanks To:
Special Thanks to my husband, Krishna Koney for his inspiration, contribution and continuous support to write this Java/J2EE post.

Books:

1. "Thinking in Java , 3rd Edition" by Bruce Eckle - http://www.mindview.net/Books/TIJ/


2. Joshua Bloch effective Java (2nd edition) - http://uet.vnu.edu.vn/~chauttm/e-books/java/Effective.Java.2nd.Edition.May.2008.3000th.Release.pdf

3."'J2EE Web Services: The Ultimate Guide" by Richard Monson-Haefel -http://books.google.com/books?id=NNqmolbaApQC&pg=PA1&dq=j2ee&sig=ACfU3U3-RDn6uGY8QZ6DjYPT_Fb_dSPiKA#PPA885,M1

4. "J2EE Design Patterns" by William Crawford, Jonathan Kaplan -
http://books.google.com/books?id=N_cEwmcSauUC&printsec=frontcover&dq=j2ee&sig=ACfU3U0cgVRY8TUXpZc8TH31xU_4Z_XgRA

5. "Core J2ee Patterns: Best Practices and Design Strategies" by Deepak Alur, John Crupi -
http://books.google.com/books?id=1dx34EMVyi8C&printsec=frontcover&dq=j2ee&sig=ACfU3U34F4XCp2YQSIge-EQHvjjJqQcU9w#PPA11,M1

6. "J2EE and JAX: developing Web applications and Web services" by Michael Yawn -
http://books.google.com/books?id=SK0Im1uI3jsC&printsec=frontcover&dq=j2ee&lr=&sig=ACfU3U3gToC6jT-YLbNQ5WRzKgL7hlmNcQ

7. "Sun Certified Enterprise Architect for J2EE Study Guide (exam 310-051)" by Paul R. Allen, Joseph J. Bambara -
http://books.google.com/books?id=GJRKjnwYJcgC&printsec=frontcover&dq=j2ee&lr=&sig=ACfU3U3qAxMyrwvi8V26J7QYGiwp1vZkDA

8. "Sun Certified Enterprise Architect for J2EE technology study guide" by Mark Cade, Simon Roberts -
http://books.google.com/books?id=qczD49Yc9OoC&pg=PA11&dq=j2ee&sig=ACfU3U3fiZUtuhg0RHFnbFJEz5ZXu8-dlQ#PPP1,M1

9. "Core Web Programming" by Marty Hall and Larry Brown

10. "CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets" by Gregory Brill

Ref:

1. Open Source Software in Java - http://java-source.net/

2. Open Source Testing Tools in Java - http://java-source.net/open-source/testing-tools

3. Java/J2EE IDEs Overview - http://www.devx.com/Java/Article/34009

4. J2EE Interview Questions - http://www.geekinterview.com/Interview-Questions/J2EE

5. J2EE Overview - http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Overview.html

6. J2EE Overview - http://www.comptechdoc.org/docs/kanti/ejb/j2eeoverview.html

7. .NET vs J2EE - http://www.oreillynet.com/pub/a/oreilly/java/news/farley_0800.html

8. Java Desktop GUI - http://www.javaworld.com/javaworld/jw-04-2004/jw-0426-swtjface.html

9. Java Content Repository(JCR) API -http://en.wikipedia.org/wiki/Content_repository_API_for_Java

10. Mule -
http://www.mulesource.com/products/mule.php

http://www.theserverside.com/tt/articles/article.tss?track=NL-461&ad=645256&l=COISWithMuleandJCR&asrc=EM_NLN_3809631&uid=3048354

11. JSON - http://www.subbu.org/weblogs/main/2006/08/json_vs_xml_1.html

12. Ruby Blog - http://ola-bini.blogspot.com/2008/06/fractal-programming.html

13. Java Interview Questions -http://www.indijava.in/community/faq/java_interview_questions

14. Runtime Code Generation with JVM & CLR - http://www.itu.dk/~sestoft/rtcg/rtcg.pdf


15. JVM vs CLR memory allocation - http://benpryor.com/blog/2006/05/04/jvm-vs-clr-memory-allocation/

16. Javascript Engines : WebMonkey(in C) , Rhino(In Java) - http://www.mozillazine.org/

17. Runtime Code Generation with JVM & CLR - http://www.itu.dk/~sestoft/rtcg/rtcg.pdf

18. JVM vs CLR memory allocation - http://benpryor.com/blog/2006/05/04/jvm-vs-clr-memory-allocation/

19. PHP Frameworks - CAKE, ZEND, SYMFONY

20. Java Server Magazine - http://www.javaskyline.com/

C++ Programming Tips ...


C++ VC++ Interview Preparation Spectrum:

General Concepts 1. Pointers

2. Algorithms/Programs for basic String Operations

3. Reverse of a String using Pointers

4. Swap 2 numbers without using temporary variables & Swap 2 numbers using XOR operator

5. Find the duplicate number in an NOT sorted Array of numbers ... Best Search alogorithm

6. Algorithms/Programs regarding Single Linked Lists, Double Linked Lists, Binary Search, Hash Tables, Tree, B-Tree
    a. Reverse a Single Linked List
    b. Finding whether a Loop is present in Single Linked List
    c. Finding whether a Loop is present in Single Linked List & Break the Loop
…

C++ Concepts
1. Difference between Pointers and References, Why References in C++, C++ Function Pointers, extern "C"

2. Constructor, Private Constructor, Singleton, Initializer List, Destructor, Virtual Destructor,Pure Virtual Destructor, new, delete , Private Inheritance

3. Copy Constructor, Assignment Operator , Shallow Binding vs Deep Binding

4. Static Member Functions, Friend Functions

5. Runtime Polymorphism , Virtual Pointers, Virtual Tables, Abstract Classes

6. Templates, STL (Vector, List, Map ...)

7. C++ TypeCasting(dynamic_cast,reinterpret_cast,static_cast,constant_cast), dynamic_cast w.r.t C++ References ,Smart Pointers , auto_ptr
…

OS specific Concepts(Windows, Unix (AIX, Solaris, HPUX, Linux))

Windows
1. Inter Process Communication (Named pipes, WinSock, Memory Mapped Files, Window Messages (SendMessage, PostMessage))

2. MultiThreading

3. Thread Synchronization(Critical Section, Mutex, Events, Semaphore, WaitForSingleObject,WaitForMultipleObject)

4. Windows Hooks , Windows Timers, Windows Services

5. Component Object Model(COM), COM Threading Models, IDL, MIDL, IUnknown, IDispatch, Monikers

6. Microsoft Foundation Classes(MFC), Document View Architecture, Command Message Flow, Customizing MFC Controls, MFC Subclassing, MFC HTTP Programming(WinInet), MFC Wizards, MFC Panes , MVC Design Pattern

7. MFC Subclassing (1. Override the IsSubclassedControl and PreCreateWindow member functions of COleControl 2. Modify the OnDraw member function)
...

Unix1. Inter Process Communication (Pipes, Named pipes, Sockets, Messages Queues & Shared Memory)

2. Multithreading (Pthreads, OS specific threads)

3. Thread Synchronization mechanisms (Semaphore, Mutex, Condition Variable)

4. UNIX Systems Calls, Signals
…

Database Programming (Sqlserver, Oracle on Windows & Sybase, Oracle on UNIX)
1. Accessing Database on Windows using ODBC, OLEDB, ADO

2. Accessing Database on UNIX using Database specific API (example: OCI/OCCI API to access Oracle)

3. Developing Stored Procedures using TSQL on SqlServer & Sybase

4. Developing Stored Procedures using PL/SQL on Oracle

5. Understand SqlInjection and how to prevent it
...

GUI Programming
1. GUI programming using Win32 API

2. MFC Programming in Windows , modal & modeless dialogs, SDI vs MDI, Message Command Flow in MFC , MFC Subclassing, Customizing MFC Controls

3. Developing ActiveX controls using MFC

4. Using Curses Library on Unix

5. Using Motif/QT/… on Unix
…

Advanced Topics
1. Design Patterns ( Read GOF book on Patterns)The link below explains Design Patterns in general & has C++/Java example code for each Design pattern.
Link : http://www.vincehuston.org/dp/

2. SOA Architecture ; Developing WebServices (using either gSoap (or) Microsoft specific )

3. Popular Design Patterns : Singleton, Factory, Observer, Command, Decorator, Facade, Builder

Misc
1. XML (MSXML Parser on Windows, Xerces parser, Expat (Written in "C"))
2. XSLT Parser(Xalan C++ parser)
3. Boost Regular Expression Libray / PCRE
4. HTTP (GET/POST)


ACE(Adaptive Communication Environment) - http://www.cs.wustl.edu/~schmidt/ACE.html



Books:

C++ Books


1. "Thinking in C++" by Bruce Eckle - http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

2. Charles Petzold Website -
http://www.charlespetzold.com/

3. Douglas C. Schmidt -
http://www.ece.uci.edu/~schmidt/

4. Vijay Mukhi's Website (Online Books) -
http://www.vijaymukhi.com/

5. Online Books -
http://www.esnips.com/

6. Online Books -
http://onlinebooks.library.upenn.edu/

7. Online Books -
http://safari.informit.com/

8. Safari Online Books -
http://safari.oreilly.com/

9. "Effective C++" by Scott Meyers (ISBN #0201924889) "More Effective C++" by Scott Meyers (ISBN #020163371X)

10. "The C++ Standard Library" by Nicolai Josuttis (ISBN #0201379260)

11. "Accelerated C++" by Koenig and Moo (ISBN #020170353X)


VC++ Books

1. "Programming Windows With MFC" by Jeff Prosise

2. "Programming Applications for Microsoft Windows" by Jeffrey Richter

3. "Microsoft Windows Internals" by Mark E. Russinovich, David A. Solomon

4. "Programming Windows" by Charles Petzold


C/C++(UNIX) Books

1. "UNIX Network Programming" by W. Richard Stevens

2. "Advanced Programming in the UNIX(R) Environment" by W. Richard Stevens

3. "Design of the UNIX Operating System" by Maurice J. Bach

Arduino Development

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

Arduino is a single-board microcontroller, intended to make building interactive objects or environments more accessible. The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM. Current models feature a USB interface, 6 analog input pins, as well as 14 digital I/O pins that accommodate various extension boards.


Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language and the Arduino development environment. Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP. The boards can be built by hand or purchased preassembled; the software can be downloaded for free. The hardware reference designs (CAD files) are available under an open-source license, you are free to adapt them to your needs.


avr-gcc, avr-g++, avr-objcopy, avrdude are the tools used in compiling 'C' code on arduino.


ref:


wiki - http://en.wikipedia.org/wiki/Arduino


Arduino website - http://www.arduino.cc/


Opensource Hardware Group(All about Arduino) - http://opensourcehardwaregroup.com/


Arduino IDE - http://arduino.cc/en/main/software


Arduino development environment - http://arduino.cc/en/guide/Environment


Arduino Development tools - http://playground.arduino.cc/Main/DevelopmentTools


Arduino library - https://github.com/arduino/Arduino/tree/master/hardware/arduino/cores/arduino


Arduino Makefile - https://github.com/sudar/Arduino-Makefile


Programming Arduino Uno in pure C/C++ - 

Arduino IDE for Microsoft Visual Studio and Atmel Studio - http://www.visualmicro.com/

Introduction to Arduino - http://www.instructables.com/id/Intro-to-Arduino/


Intel Arduino compatible Galileo board - http://www.intel.com/content/www/us/en/do-it-yourself/galileo-maker-quark-board.html


Arduiono IDE and sketch development overview - http://opensourcehardwaregroup.com/tutorial-3-arduino-ide-and-sketch-overview/


Arduino boards summary - http://www.hobbytronics.co.uk/arduino-summary


Advanced Arduino Hacking - https://pragprog.com/magazines/2011-04/advanced-arduino-hacking


Arduino Books -


Arduino Cookbooks -

Arduino Cookbook 2nd edition - 

Arduino Cookbook 1st edition -