Saturday, May 31, 2014

Unit Testing and why should I bother to understand what it is about?

When I started my software engineering course my lovely lecturer kept on mentioning “Unit testing” several times.. she gave us the definition, examples and why it is important to use unit testing in the software development process. What I did at that stage is memorizing everything she said and my journey with unit testing stopped !!. I didn't actually know why should I apply unit testing to my code.
Isn't it enough to have a running code without  bugs (No red lines, no exceptions… everything is working.. hooray).
After two years I started my masters in software engineering and of course again I came across the term unit testing.
My reaction was !! again !! what is wrong with these people ….. I am happy with want I know.. can’t you understand that my code is working fine !!
One day later the lecturer decided to divide us into teams of six students and we were asked to produce a software product in four weeks time. We divided the tasks between the team members and each two of us worked on a specific task. Me and my friend finished coding and our program was doing everything we asked for… so we went for lunch and life was amazing.
Next day the lecturer came to check our progress.. we were sure that we rock !!
The code is working.. no bugs … no exception. Insert your input and the output will be exactly what you asked for.
He looked at us and said what happens if I …… ??
He kept asking these type of questions….. I thought he wanted  to drive us crazy ??
What if ??
How could your program deal with this case??
And my reaction was.. wait a minute ?? My program met all the requirements you asked for ….. why should I care about these cases !!!
My program is designed to work with humans !! how could it suddenly start dealing with cases coming from aliens.
At that stage I guess I understood that my code should be strong enough to face life circumstances. It should not die in the first battle !!
But how could I make my program strong ??
Simple answer is …. feed it with all expected test cases. Make it strong enough to face life !!
Testing testing..
I have to think about testing my program against bla bla bla ….
I have to think about testing my program against my cat who could simply decide to use my program. …. Cats also expect to see some output…
But.. wait a minute .. this is testing .. what is Unit testing ???
Imagine that your goal is to build a skyscraper from LEGO pieces. The skyscraper is your software product and LEGO pieces are your code.
You finished building your skyscraper and It  looks amazing.
                                     
Suddenly you discovered a crack in one of your LEGO pieces !!! You will panic because its not an easy task to replace it !! Now your skyscraper will not be strong enough to stand and It may fall at any moment !!
How could I have overcome this ?? What went wrong ??
The answer is : If you simply tested each piece of LEGO before using it .. you would have noticed the crack and fixed it…
Testing testing testing !!
This is exactly the same in coding.. You test each single piece of code .. and your whole program will be strong enough to face life difficulties.

The End !!!

Friday, May 30, 2014

Customer Relationship Management





CRM is an acronym that stands for Customer Relationship Management. It describes the strategy that a company uses to handle customer interactions. One example of a common CRM strategy is the rewards card program offered by many supermarkets. The store gives its customers a free card that gives them access to special deals and discounts when they swipe the card during checkout. But that card also tracks everything the customer buys and allows the store to create an extremely detailed customer profile based on his or her purchasing habits. Armed with that information, the store can then offer its customers targeted coupons and other programs that will motivate its customers to buy more products from that store.

CRM Application


The CRM (customer relationship management) application is an incredibly useful tool in sales. CRM applications will store, sort, and report on your prospect and customer data. Not only does this save time, it also helps you make connections and learn about your customer base in ways that you'd never notice while using a pen-and-paper system. CRM applications come in two basic varieties: software and service. CRM software installs on your office computer or server, and the data resides there as well. The advantage to software is that you only have to pay for it once and that you have complete control over both the program and the data inside it. For example, if the software company issues an updated version and you like the old version better, you can simply not install the update. The disadvantage is that you will have to handle the installation process and any technical issues that arise, and if anything happens to your office computers, you could lose all your data. Also, you'll probably need to install the software on every salesperson's computer. CRM services are hosted online. You will typically pay an ongoing fee to access these services, and can access them from any computer – most services just require you to log in with your secure user name and password. The advantage to services is that they are hosted on the provider's equipment, often with backups and redundant servers so that it's unlikely you'll lose data even during a catastrophe. It is the provider's responsibility to keep the service running, so your tech support activities will be minimal. Disadvantages are that if the provider has a problem – or goes out of business – you could lose your data either temporarily or permanently. CRM prices range from free to thousands of dollars. If you're just starting out, a free CRM service or software package is a good place to begin. Many CRM providers release both a free version and a more robust paid version, so if you outgrow the free software it's relatively easy to upgrade.

Use of Computer Software


Many CRM software and/or service packages exist to help companies manage the customer relationship process. In fact, salespeople tend to think of these computer programs as the be-all and end-all of CRM. But CRM has existed for much longer than the computer – in fact, it has been around in one form or another for as long as people have been buying and selling. Computers have greatly enhanced the customer relationship management process because the key to a good CRM is uncovering and storing information about customers. The more a company knows about its customers, the better it can manage those relationships – as in the above example of supermarket rewards cards. CRM software can help by storing all this information in an easy-access format. With a typical CRM program, new leads are entered into the program's database and salespeople add notes throughout the sales cycle. It's then easy for a company to compile reports from this data that help it to design a CRM strategy that's tailored to its customers. The CRM software can also automatically send out emails to individual customers as designated by the salesperson. For example, a salesperson might program his CRM to send out a thank-you message whenever a customer reaches his or her one-year anniversary of purchase, or to send an e-card on the customer's birthday.

Training the Sales People


Once a company has collected information about a customer, the next step is training its salespeople and other employees in using that information to keep the customer relationship strong. Because salespeople are often the 'face' of the company, theirs is an important role in any CRM program. Frequently a customer who runs into a technical problem will phone her salesperson instead of calling up the customer service team. She already knows her salesperson and probably has good feelings about him, or she wouldn't have bought the product from him. It's safer and easier to reach out to someone she knows than to try to explain her problems to a stranger. So even after the sale is complete, salespeople often continue to speak with customers on a regular basis. These customer interactions can be a burden for a salesperson, but they can also bring a blessing in the form of future sales. When a salesperson helps his customer overcome a difficult problem, it's much more likely that she'll get in touch with him for future purchases. And there's also a good chance that she'll send her friends and family to him as well. And this is exactly what a customer relationship management system is trying to accomplish. It's critical that the sales team understands and implements its company's CRM strategy. for this reason, the sales manager should make a point of keeping on top of the company's CRM strategy and should pass along any changes to the sales team immediately. She should also counsel her team on how to build and maintain a good customer relationship. Most salespeople are happy to do so once the fruits of this labour start rolling in in the form of additional sales.


Tuesday, May 20, 2014

Managed Web Hosting Solutions




Managing a web hosting is just a part of establishing an Internet presence over the internet, installing that website on a server connected to the Internet a web server is how users will actually see the site you've created. A web hosting provider is just like a ServInt, it is a company that owns, operates and rents these web servers, and offers the high-speed connections that quickly deliver web content to end users. 

The process of maintaining the web servers, adding new hardware and software, monitoring the systems, installing security patches, and providing customers with help and support is called Web Hosting Management.


Web Hosting Solutions

There are some Solutions where the web can be hosted

  •          Shared Hosting
  •          Virtual Private Server (VPS) Hosting
  •          Cloud Hosting
  •          Virtual or Dedicated Hybrid Servers

Shared Hosting


In shared hosting, multiple websites are on the same server sharing the same hardware, connectivity resources and software. For small or very simple websites, this can be an acceptable hosting solution, but from performance and security point of view there are often many issues with such hosting.


Virtual Private Server Hosting


VPS provide customers with more control over their hardware resources, software and access in comparison to shared servers. With a VPS solution, multiple customers are hosted on the same server, but each client has a private area on the server to which critical resources are assigned so the performance of one customer's site doesn't impact the performance of any other site.

VPS hosting solutions are often managed services, which is an important point to remember when selecting a VPS provider. Managed services means the web host is responsible for configuring everything installed and delivered with a new account.


Cloud Hosting



There are further three types of cloud hosting

  • Software as a Service
  • Platform as a Service
  • Infrastructure as a Service

  • Software as a Service

When a customer purchases cloud, they are simply purchasing access to an application, running on someone else's hardware, on some unknown servers. Their experience is divorced from anything beneath the software they are accessing. Word-press installations running on wordpress.org are a great example of this. Customers load their content onto Word-press's site and their blog is live. They neither know nor care what type of hardware or operating system Word-press is using on their back end.

  • Platform as a Service

Cloud Platform as a Service products are one level deeper than Software as a Service. In this, the Platform or programming language environment is offered to the customer, not simply a piece of Software. ServInt's Java cloud product, Jelastic, is a good example of a Platform as a Service. Jelastic is an elastic Java environment where developers create programs and operations in this programing language. Each Java "instance" grows and contracts dynamically based on load. And while the customer specifies what level server resources they wish to commit, all customer accounts exist in the ServInt Jelastic cloud, a network of computers that share the entire Jelastic workload.

  • Infrastructure as a Service

The final step in cloud services is Infrastructure as a Service, in which the Infrastructure itself is offered as the service. Cloud Infrastructure as a Service products are virtual servers, unlike the virtualization system, ServInt uses for VPS. This similarity is one of the reasons why some hosting service providers choose to market VPS-based hosting services as cloud. However they are different. For one thing, cloud Infrastructure as a Service virtualization is typically a hypervisor-based technology, which gives each user kernel access, choice of OS, and much more.


Private Cloud


To avoid cost overruns, many businesses with large hosting requirements build their own "private" clouds in which they control all the hardware hosting their cloud instances. Doing so gives them the ability to support all their business hosting and storage needs on multiple instances they have set up and tear it down according to their will, on a secure platform of their own design that they can control. 

Since they manage their own dedicated hardware and pay for the sole use of it, they pay for their server on a simple monthly basis, rather than tracking and managing the hourly use of multiple, app-specific instances.


Virtual or Dedicated Hybrid Servers


A more affordable alternative to a private cloud is a dedicated physical server running a virtualization layer. These products offer the scalability and flexibility of virtualization, with the safety, stability and predictable billing of a stand-alone host machine. Running a virtualization layer over dedicated hardware allows the customer to easily migrate between host machines in order to scale up and down. Some of today's virtualization systems are powerful enough to provide all the scalability benefits of hypervisor-based cloud Infrastructure as a Service systems without sacrificing the platform stability of VPS or dedicated servers.


VPS VS Cloud.




The challenge with cloud hosting is that it is far more complex to code for and configure than VPS or dedicated hosting. While a single VPS server might house a database, run a web server, an email server and a name server, a single cloud instance is often designed to do one thing at a time and scale that single function on demand.

While it's true that a single cloud instance can run more than one application, doing so would cause the user to lose the benefit of easy instance scaling. Cloud customers fall into two main types: those who have many instances running at any given time, each performing one specific function and each being billed individually, and those who run cloud instances like mini VPSes, paying a premium for a complexity they are not using.



Monday, May 19, 2014

CoderDojo





The CoderDojo format is the result of intensive design, development and a lot of real world testing completed by the founders in the original Dojo in Cork, Ireland and refined by volunteers who created their own Dojos in communities and businesses. CoderDojo is an open source learning environment that really delivers. CoderDojo is free, and there is no central organisation that wants to charge you. It is full of fun and freedom for young people. If you need anything for your CoderDojo go out and ask your local community; it’s leaders in business and government.  CoderDojo is a no brainer when it comes to getting support from nearly any high tech business and every Dojo location so far has been donated or locally sponsored. 

 

History

 

CoderDojo is a non-profit global movement founded by James Whelton and Bill Liao. It was first started in James Whelton’s school in early 2011 when he received some publicity after hacking the iPod Nano which lead to creating interest of coding in  younger students. He setup a computer club in his school (PBC Cork) where he started teaching basic HTML and CSS. Later that year he met Bill Liao, an entrepreneur and philanthropist, who was interested in growing the project into something bigger. In June 2011 the first CoderDojo was launched in the National Software Centre in Cork which became very successful. The Cork Dojo analyzed that people traveled from Dublin frequently to attend their sessions. Owing to the popularity, a Dublin Dojo was launched soon after in Google’s Montevetro building. By making the movement open source, it led to hundreds of dedicated champions setting up more Dojos around Ireland and subsequently around the world

Community



  • Champion


If you are reading this then you probably care enough to be the CoderDojo champion so your first job is go get a space by telling the story of CoderDojo and your vision for it in your community. A champion needs to be someone who will just show up week in week out to open the doors and be a point of contact for that Dojo! Try to be consistent with your sessions, if you change the date of a dojo or cancel a session people will often show up on the wrong day. A champion does not need to be technical, just passionate about the CoderDojo philosophy!

  • Mentors


You need people who will come help out, teach sessions, help tidy up and get the space ready. Have at least 2 people with coding skills to start, you will usually find that more technical people are quickly attracted to the session once they hear about it. 5-8 regular technical people is good for a Dojo that has matured for a few months. You can expect that there will be a drop off in number of mentors after the initial enthusiasm wears off, so it is worth getting more mentors on board than you think you need.

 

  • Good ratio of mentors


To kids is about 1:10 at most, at least when starting off. As your dojo gets going, and depending on how the dojo is going (project based, topic based, free-form you may be able to run just fine with fewer mentors. E.g. in Cork there is often a successful ratio of 1:25 as it is a free form Dojo. 

  • Good rule of thumb:


Is to stay under 13-15 for the core group of volunteers, this allows For a chain email between everyone, healthy discussion, and not too many voices pulling in different directions. If you have more than this, select the technical specialists and then put everyone else on a mailing list to contact with group announcements.

 

  • Volunteers:


Who do not have coding skills are still very useful: answering email, managing ticketing, setting up/tearing down the venue, manning the registration desk accept all offers of help

 

  • Parents:


Parents are the very best place to start looking for both of the above, Mentors and Champions. They are frequently the most committed mentors in a Dojo. 

 

Legalities and Child/Mentor Protection


The foremost principle to remember with all bureaucracy and red tape is common sense. The information provided on this page and elsewhere on the CoderDojo is a guide on how a CoderDojo can be created, however each dojo is operated independently, and they are not directly connected or affiliated in any way. We do not endorse any Dojo or Individual taking on risk. Laws may vary between jurisdictions, and it may be appropriate to seek legal counsel.


CoderDojo in Ireland : A CoderDojo is known under Irish Law as an ‘unincorporated association’ of Individuals. That is a group that does not have a separate legal personality of its own. This is the usual setup for a community or social group. Any possible liability can be dealt with by having adequate insurance cover. For example, a CoderDojo might meet on a weekly basis in a local hotel. The hotel’s public liability insurance will cover accidents happening on its premises. The disadvantages are that the members of the association may find themselves personally liable for the actions or debts of the association.

 

  • General Guideline on Liability


Every individual has a ‘duty of care’. If any person is aware of a negative situation and does ‘not take reasonable steps’ to mitigate it, then they may be held responsible. In most cases of personal injury the closest connection to the situation will be implicated, i.e. the building and therefore its insurance policy.

 

  • General guideline on conduct of class


In most cases Dojo's are fluid which actually lowers the individual risk for any one person, because Tort law would not clearly define who is responsible. It would then depend on the situation and the duty of care of each person involved.

 

  • General Legal Guideline



All collection of personal details should take into account fair processing under section 2nd of the 1988 Data Protection act, and in all cases where there is a minor involved it is advisable to get the consent of a parent or legal guardian.  

Tuesday, May 13, 2014

The 3D Projection



The 3-D Projection is a projection technology used to turn  objects, into a 3D display on a surface for video projection. These objects may be complex industrial landscapes, such as buildings. With the use of modern technology three-dimensional object is spatially mapped onto the virtual program which mimics the real environment it is to be projected on. The software can interact with a projector to fit any desired image onto the surface of that object, this technique is used by artists and advertisers alike who can add the following to enhance their products: 
  • Add extra dimensions, 
  • Optical illusions, 
  • Notions of movement onto static objects. 
The video is commonly combined with, or triggered by, audio to create an audio-visual narrative

History


Although the term projection mapping is relatively new, the technique dates back to the late 1960s, where it was referred to as video mapping, special augmented reality, or shader lamps  One of the first public displays of projections onto 3D objects was debuted in 1969, when Disneyland opened their Haunted Mansion ride. The ride used fake disembodied heads as objects which had 16mm film projected onto them to make them appear animated. 

The next record of projection mapping is from 1980, when installation artist Michael Naimark filmed people interacting with objects in a living room and then projected it in the room, creating illusions as if the people interacting with the objects were really there. 

The first time the concept of projection mapping was investigated academically was at the University of North Carolina at Chapel Hill in the late 1990s, where scholars worked on a project called Office of the Future to connect offices from different locations by projecting people into the office space as if they were really there. By 2001, more artists began using projection mapping in artwork, and groups such as Microsoft began experimenting with it as a means of technological advancement

 

Orthographic Projection


When the human eye looks at a scene, objects that are at a distance appear smaller than objects placed near by. Orthographic projection ignores this effect to allow the creation of to-scale drawings for construction and engineering. These projections are a small set of transforms often used to show profile, detail or precise measurements of a three dimensional object. Common names for orthographic projections include plane, cross-section, bird's-eye, and elevation.

If the object is placed at a viewing plane which is parallel to one of the primary axes which are the x, y, and z axis, these axes are mathematical transformed to project the 3D point onto the 2D point. While orthographically projected images represent the three dimensional nature of the object projected, they do not represent the object as it would be recorded photographically or perceived by a viewer observing it directly. In particular, parallel lengths at all points in an orthographically projected image are of the same scale regardless of whether they are far away or near to the virtual viewer. As a result, lengths near to the viewer are not foreshortened as they would be in a perspective projection.

 

Weak Perspective Projection


A weak perspective projection uses the same principles of an orthographic projection, but requires the scaling factor to be specified, thus ensuring that closer objects appear bigger in the projection, and vice-versa. It can be seen as a hybrid between an orthographic and a perspective projection, and described either as a perspective projection with individual point depths replaced by an average constant depth . or simply as an orthographic projection plus a scaling.

The weak-perspective model thus approximates perspective projection while using a simpler model, similar to the pure (unsealed) orthographic perspective. It is a reasonable approximation when the depth of the object along the line of sight is small compared to the distance from the camera, and the field of view is small. With these conditions, it can be assumed that all points on a 3D object are at the same distance from the camera without significant errors in the projection

Perspective Projection


As mentioned earlier that when the human eye views a scene, objects placed at a distance appear smaller than those that are placed close by, this is known as perspective. While orthographic projection ignores this effect to allow accurate measurements, perspective definition shows distant objects as smaller to provide additional realism.

The perspective projection requires a more involved definition as compared to orthographic projections. A conceptual aid to understanding the mechanics of this projection is to imagine the 2D projection as though the object(s) are being viewed through a camera viewfinder. The camera's position, orientation, and field of view control the behavior of the projection transformation. The following variables are defined to describe this transformation:


Use of 3D Projection


Artists may use it as an avant-garde form of expression as it is a new technology that can turn their creative ideas into 3D projections, connecting them with their audiences in a new way. Video projections have appeared in urban centers such as New York City and London, where artists have used guerilla projections in public without any necessary approval. This way, artists can show their work in any location as, anything and anywhere can be a canvas. Often people also use it as a means of activism; the group Occupy Wall Street has used it to project onto the Verizon Wireless building in New York City as a means to visually spread the word that Occupy Wall Street is still alive.


Tuesday, May 6, 2014

Ruby on Rails vs Object Oriented Programming Language

 

What is Ruby on Rails? 


Ruby on Rails, is an open source web application framework which runs on top of the Ruby programming language. Rails allows a programmer to write web applications that talk to a back-end database to retrieve data and render the data in templates on the client side. The implicit philosophy of Ruby on Rails also impacts how Ruby on Rails was designed; it provides lots of implicit default conventions that the programmer can rely on out of the box. Ruby on Rails assume there’s only one best way of doing certain things, therefore making it very hard for a programmer to modify the logic and behavior of Rails code.

 

Convention over Configuration


The most important philosophy of Ruby on Rails is convention over configuration (CoC), which means that Ruby on Rails projects have a predefined layout and sensible defaults. All components such as models, controllers, and static CSS and JavaScript files are located in standard sub-directories and you can simply drop your own implementation files into those directories and Rails will automatically pick them up

CoC is a big win for the developer since it saves alot of time typing the same configuration code over and over again. However, if you want to customize your project's configuration, you have to learn quite a bit about Ruby on Rails in order to change the configuration without breaking the whole project.

 

Implemented MVC framework


Ruby on Rails is a Model-View-Controller (MVC) full stack web framework, which means that the controller calls functions from the model and returns the data back to the view. Although many web frameworks are also based on MVC, Rails is unique because it supports a full REST protocol out-of-the-box. All model objects are accessed and handled in an uniform manner using the standard HTTP verbs like GET, PUT, DELETE and POST.

 

Object-Oriented Programming




The Object-Oriented Programming refers to a programming methodology based on objects, instead of functions and procedures. These objects are organized into classes, which allow individual objects to be group together.


An "object" in an Object-Oriented Programming language refers to a specific type, or "instance," of a class. Each object has a structure similar to other objects in the class, but can be assigned individual characteristics. An object can also call methods, specific to that object

Object-oriented programming makes it easier for programmers to structure and organize software programs. Because individual objects can be modified without affecting other aspects of the program, it is also easier to update and change programs written in object-oriented languages. As software programs have grown larger over the years, OOP has made developing these large programs more manageable.

 

Model View Controller (MVC)


MVC is a pattern for implementing UI. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented or accepted from the user. The central component, the model, consists of application data, business rules, logic and functions. A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants. The third part, the controller, accepts input and converts it to commands for the model or view.

In addition to dividing the application into three kinds of components, the model–view–controller design defines the interactions between them. 
  • Model


Notifies its associated views and controllers when there has been  a change in its state. This notification allows the views to produce updated output, and the controllers to change the available set of commands. In some cases an MVC implementation might instead be "passive," so that other components must poll the model for updates rather than being notified.

  • View


Requests information from the model that it needs for generating an output representation to the user.

  •  Controller


Can send commands to the model to update the model's state (e.g., editing a document). It can also send commands to its associated view to change the view's presentation of the model (e.g., by scrolling through a document).

Why Ruby on Rails


Ruby on Rails uses models to describe database tables, and controllers to retrieve data from models and return the data to views who eventually renders the data into an HTTP response. To map controller to an incoming request, programmers specify routes in a configuration file.

Since its initial release in 2005, Rails has become more and more popular among web programmers. It’s easy to use and understand tech stack and implicit CoC philosophy seem to allow agile web programmers to implement applications faster than other frameworks

 

Summary


Both Ruby on Rails and Object Oriented Programming Language are effective. The Object Oriented Programming Language uses the re-usability concepts, however the Model View Control is a framework for reducing the complexity of application by separating the database, business logic and the interface, it also provides better security as the users cannot directly access the database, that’s why Ruby on Rails is preferred for web application development and it is considered in the top  5 languages for used for web development.