Warning: include(/home1/george/public_html/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home1/george/public_html/wp-settings.php on line 84

Warning: include(): Failed opening '/home1/george/public_html/wp-content/advanced-cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home1/george/public_html/wp-settings.php on line 84

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home1/george/public_html/wp-includes/load.php on line 760
programming – Tales from the bits http://talesfromthebits.com This is a blog about technology, computer science, software engineering and personal notes from these fields Fri, 17 Jun 2016 16:53:16 +0000 en-US hourly 1 https://wordpress.org/?v=5.1.16 The 3 faces of Cloud Computing http://talesfromthebits.com/2013/12/the-3-faces-of-cloud-computing.html http://talesfromthebits.com/2013/12/the-3-faces-of-cloud-computing.html#respond Sun, 22 Dec 2013 09:55:54 +0000 http://talesfromthebits.com/?p=456 Cloud computing or simply “Cloud” is a term that is used in almost all “techy” conversations but what it actually means?  First of all it means that the physical servers, solid state drives etc are at a remote location, a data center, and you have access to the application or the files that you want over the Internet.

There are three different acronyms for Cloud Computing, the 3 faces,

  1. SaaS: Software as a service
  2. IaaS: Infrastructure as a service
  3. PaaS: Platform as a service

SaaS applications are run from your browser. Usually you do not have to install something to run  them. Email services like Yahoo or Gmail are SaaS applications. Google search is a SaaS application. Using these services you do not care on what type of servers are run, who makes the OS (operation system) updates, who writes the code, where your data is stored, how the vendor load balances the traffic to the application. You only care on the availability of the service and the security of your data.

IaaS gives companies or individuals the opportunity to move their computers or servers on the cloud. Why you may choose to do that? Because of cost benefits, space benefits, stuff benefits, scale benefits etc.Infrastructure means that the provider of the service (Amazon, Google, Rackspace and many others) provides the tools to create a virtualization platform with storage and networking services. To give you an example, assume that you have two servers running your applications and sharing files / information at you premisses . When you decide to move them to the cloud you have the ability to create two virtual servers on a stronger physical machine. You can do it on your premisses too, but by putting them on the Cloud gives you more advantages like you will stop worrying about hardware issues, bandwidth, network infrastructure and scalability issues.

PaaS is a great way to create distributed applications that can have 99.999% availability. To leverage the benefits of a PaaS you have to architect your solution to take advantages of the platform offerings in queues, blobs, storage and other areas. Why to choose PaaS to develop your application? You have numerous benefits such as scalability, reliability, no OS administration time and costs and many other advantages. I will discuss in another blog post how to architect such solutions.

You have to remember that by just putting your application on a cloud server you do not transform them to a PaaS application or to a SaaS application. In almost all the cases you will need to rewrite parts of your application.

Which of the 3 faces of Cloud computing is suitable for you?

]]>
http://talesfromthebits.com/2013/12/the-3-faces-of-cloud-computing.html/feed 0
Learn to code for iOS 7 in 5 steps http://talesfromthebits.com/2013/12/learn-to-code-for-ios-7-in-5-steps.html http://talesfromthebits.com/2013/12/learn-to-code-for-ios-7-in-5-steps.html#respond Sat, 14 Dec 2013 11:50:32 +0000 http://talesfromthebits.com/?p=651 Are you new to coding or want to learn to code for iOS7?  I am coding for more that 30 years in various platforms. I decided now to start with iOS and Objective-C. To learn iOS7 programming I suggest to perform the following steps:

  1. Get access to a Mac computer. If you have a Mac then it is great, if not you can use Macincloud. They give you access to an actual machine and not a VM. The speed it OK. I am using Macincloud and I am very happy with their service.
  2. Connect to Apple’s developer program . The resources are great and free. You will find all the references which provide a wealth of information.
  3. Watch a Free online course from Stanford University available in iTunes.
  4. Study other programs written for iOS7
  5. Write small programs to understand further the concepts.

Have lots of fun!  Happy coding!

 

]]>
http://talesfromthebits.com/2013/12/learn-to-code-for-ios-7-in-5-steps.html/feed 0
Code reviews or testing? http://talesfromthebits.com/2010/04/code-reviews-or-testing.html http://talesfromthebits.com/2010/04/code-reviews-or-testing.html#comments Sun, 04 Apr 2010 08:18:20 +0000 http://talesfromthebits.com/?p=179 What is it better to do, code reviews or testing?

Code review or software inspections are used to spot software errors, omissions and anomalies. The code review as the name implies is to look at the source code for errors and defects. To successful perform a code review a team of at least four people must be formed. The roles are:

  1. Author – programmer: the one who owns the code and is responsible for fixing the errors.
  2. Inspector: Inspects the code and/or the documentation to find errors – omissions.
  3. Reader: Presents the code – documentation
  4. Scriber: Writes the findings of the code review meeting.
  5. Moderator: Manages the process and facilitates the inspection.

It is very important to keep any questions or comment to the code and not to criticize the developer. When done correctly code review is a positive experience for the team and a learning tool for all levels of developers.

In order to initiate a code review you must:

  • Have a complete and precise documentation of the code under inspection.
  • The team must know the coding standards that the organization uses.
  • The code must be updated and must compile, prior to the inspection. It is a waste of time to inspect code that does not compile.

During one hour of inspection about 120 lines of code are reviewed. It is not recommended for the code inspection to last more than one and a half hours.
It is very important during the inspection to read and translate the code in plain English, based on the specifications. This way everyone can examine the logic and validity of the code.

Why should somebody prefer code reviews from testing?

  • During the testing, there is a possibility that an error can mask other errors.
  • Testing does not guarantee the code quality and code efficiency.
  • In applications that use threading errors cannot be caught with testing but only with a thorough code review.

An advice to software project managers:
I would recommend planning time for code reviews in every project. Code reviews is a great way to mitigate code related risks during the early stages of development.

References and useful links

  1. Rober Bogue (2006) Effective Code Reviews Without the pain http://www.developer.com/tech/article.php/3579756/Effective-Code-Reviews-Without-the-Pain
  2. Josh Poley(2007) Best Practices: Code Reviews http://msdn.microsoft.com/en-us/library/bb871031.aspx
  3. Sommerville I (2006) Software Engineering. Addison Wesley; 8th edition
  4. Wikipedia (2010) List of tools for static code analysis http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#.NET_.28C.23.2C_VB.NET_and_all_.NET_compatible_languages.29
]]>
http://talesfromthebits.com/2010/04/code-reviews-or-testing.html/feed 6
Microsoft BizSpark http://talesfromthebits.com/2010/01/microsoft-bizspark.html http://talesfromthebits.com/2010/01/microsoft-bizspark.html#comments Thu, 14 Jan 2010 09:58:05 +0000 http://talesfromthebits.com/?p=159 Microsoft BizSparkis a global program designed to help accelerate the success of entrepreneurs and early stage startups. The requirements to join the program are:

  • The core business of the company is software development
  • Be privately held
  • In business for less than 3 years
  • Generate less than 1 million USD annually

The benefits are:

  • Software: You get all the latest tools and software from Microsoft to help you and your team create software. You can run your software-as-a-service business on the following server platforms: Windows Server, SQL Server, Office SharePoint Server, Systems Center, and BizTalk Server
  • Support:2 Technical support incidents per startup. MSDN premium access.
  • Visibility:Great opportunity to create a profile and attract investors and clients  in the online Startup directory, BizSparkDB, on the Microsoft Startup Zone Website.

As a conclusion, I believe that this Microsoft move is a great help for the startups. They have the tools and the opportunity to create new and innovative software solutions without the initial cost of an MSDN subscription. If you qualify get that opportunity.

]]>
http://talesfromthebits.com/2010/01/microsoft-bizspark.html/feed 1
High performance distributed data storage systems http://talesfromthebits.com/2009/09/high-performance-distributed-data-storage-systems.html http://talesfromthebits.com/2009/09/high-performance-distributed-data-storage-systems.html#respond Sat, 19 Sep 2009 14:33:00 +0000 http://talesfromthebits.com/2009/09/high-performance-distributed-data-storage-systems.html In the online edition of ACM Communications Sept. 2009 Issue I read a very interesting article from Michael Stonebraker’s blog about the end of RDMSs. I did a little research and I found that the distributed key-value stores are gaining ground especially in Web based applications. Many sites such as Amazon, LinkedIn, Yahoo, Facebook use distributed key – value stored to cope with petabyte data.

From the braindump blog I saw that there is a fast growing noSQL community that talks about how distributed non relational databases work.

A very interesting paper is the presentation of Amazon’s Dynamo highly available key-value storage system. From Amazon’s experience we learn that the reliability and scalability of a system is dependent on how its application state is managed.

For some quick links:

Hypertable is designed to manage the storage and processing of information on a large cluster of commodity servers, providing resilience to machine and component failures.

Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store.

Voldemort is a distributed key-value storage system. In the “Build and Break” blog there is a nice post about the Voldemort project.

CouchDB is a document database server, accessible via a RESTful JSON API.

Mongo (from “humongous”) is a high-performance, open source, schema-free document-oriented database.

]]>
http://talesfromthebits.com/2009/09/high-performance-distributed-data-storage-systems.html/feed 0
Brain waves and Software Engineering http://talesfromthebits.com/2009/04/brain-waves-and-software-engineering.html http://talesfromthebits.com/2009/04/brain-waves-and-software-engineering.html#respond Thu, 02 Apr 2009 20:34:00 +0000 http://talesfromthebits.com/2009/04/brain-waves-and-software-engineering.html Brain is one of the last frontiers standing. Only recently scientists have the technology to begin recording and documenting brain activity accurately. Brain Computer Interface (BCI) is a field that has great to offer in mankind if treated with caution. In my opinion there are many implications involving the ability to “read” and interpret brainwaves. We humans have many thoughts but not all of them will become actions. We must respect and protect our final private place, our brain.

This may sound like science fiction but the tools already exist to monitor and interpret brain activity. As stated by Alois Schlogl and Clemens Brunner in their article at October 2008 issue of Computer magazine, BCI’s purpose is to identify the user’s intention by analyzing only brain activity. In the article is presented the BIOSIG library which is a free and open source library of biomedical processing tools.

Recent research has revealed that Brain wave patterns can predict blunders. Neuroscientist Ole Jensen, Ali Mazaheri and colleagues Institute at the University of California, Davis, in collaboration with the Donders Institute in the Netherlands, has found a distinct electric signature in the brain which predicts that an error is about to be made.
By analyzing the recorded magnetoencephalography (MEG) data, the research team found that about a second an error were committed, brain waves in two regions were stronger than when the subjects correctly refrained from hitting the button. In the back of the head (the occipital region), alpha wave activity was about 25 percent stronger, and in the middle region, the sensorimotor cortex, there was a corresponding increase in the brain’s mu wave activity.

“The alpha and mu rhythms are what happen when the brain runs on idle,” Mazaheri explained. “Say you’re sitting in a room and you close your eyes. That causes a huge alpha rhythm to rev up in the back of your head. But the second you open your eyes, it drops dramatically, because now you’re looking at things and your neurons have visual input to process.”

Wireless EKG can help identify errors before they happen. If the technology is limited on these areas then it is used for something serving the common good. If the technology is used to monitor brain activity and spot “deviant” activity then we are not far from a thought police as described by George Orwell’s novel Nineteen Eighty-Four. In my opinion is in our hands to produce a manifest that will clearly state that Computer professionals and Software engineers should not consent into the use of this technology in general population but only on specific beneficial situations. (Air traffic control)

]]>
http://talesfromthebits.com/2009/04/brain-waves-and-software-engineering.html/feed 0
Shuffling algorithm http://talesfromthebits.com/2008/07/shuffling-algorithm.html http://talesfromthebits.com/2008/07/shuffling-algorithm.html#respond Wed, 09 Jul 2008 15:10:00 +0000 http://talesfromthebits.com/2008/07/shuffling-algorithm.html The problem to solve is how to write a shuffling algorithm to shuffle a deck of cards.
First we will have to create a class to represent the deck of cards (52 cards in total).
Then we have to create the deck and finally to shuffle the card. Shuffling is done by a one pass algorithm O(n). We generate a random number from 0 to 51 and we swap the positions. The random number generator must be really good. The method is similar to the Knuth or Fisher-Yates shuffle.
Another alternative would be to generate a GUID and then sort the GUID thus shuffling the deck of card. A Globally Unique Identifier or GUID is a special type of identifier used in software applications in order to provide a reference number which is unique in any context.(Wikipedia) The sorting time is O(n log n). By this we avoid using a random number generator.
Some interesting discussions are made in coding horror by Jeff Atwood about the predictability of the random number generator.

We can perform an initial cut on the deck of cards before applying GUID or the shuffling algorithm. The cut is done by swapping the first 26 cards with the last 26 cards.

The card class
public class Card {
//This card represents a single deck Card
//It will be used to construct a complete deck of cards (52 cards in total)
private string face; // face of card 13 ranks (A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K)
private string suit; // suit of card (“Hearts”, “Diamonds”, “Clubs, “Spades”)

// constructor
public Card(string cardFace, string cardSuit) {
face = cardFace;
suit = cardSuit;
}
// return string representation of Card
public override string ToString() {
return face + ” of ” + suit;
}
} // end class Card

And this is the shuffling implementation
// shuffle deck of Cards
//This is a one pass algorithm for shuffling N elements O(n)
public void Shuffle() {
currentCard = 0;

for (int first = 0; first < deck.Length; first++) {
// select a random number between 0 and 51
int second = randomNumbers.Next(NUMBER_OF_CARDS);

// swap current Card with randomly selected Card
Card temp = deck[first];
deck[first] = deck[second];
deck[second] = temp;
}
}

Several variable definitions are missing but are very easy to declare them.

]]>
http://talesfromthebits.com/2008/07/shuffling-algorithm.html/feed 0
Tales from the Bits(5) http://talesfromthebits.com/2008/07/tales-from-the-bits5.html http://talesfromthebits.com/2008/07/tales-from-the-bits5.html#respond Tue, 08 Jul 2008 05:39:00 +0000 http://talesfromthebits.com/2008/07/tales-from-the-bits5.html Fellow computer programmers and software engineers Heads up!
I found out, the hard way, that I was depending a lot on the visual studio integrated environment to write my programs. I am programming for the .NET framework. I added a new weekly exercise. I write some code using either the editor edit.com or notepad.exe and manually compile it to an executable. After a few bugs I got my code running. I feel better that I do not depend to automatic tools to fill up my code. The approach is not recommended for big projects but for small ones to keep exercising your brain. Keep returning to the core of computer science such as sorting, data structures and algorithms. It has therapeutic results affecting your brain reasoning and status!
Happy coding!

]]>
http://talesfromthebits.com/2008/07/tales-from-the-bits5.html/feed 0