Thursday, September 11, 2014

SQL: character set -> collation relationship


MySQL:  when tables are given a combination of character set and collation, what is this mean ?


character set is a set of symbols and encodings. A collation is a set of rules for comparing characters in a character set. Let's make the distinction clear with an example of an imaginary character set.
Suppose that we have an alphabet with four letters: 'A', 'B', 'a', 'b'. We give each letter a number: 'A' = 0, 'B' = 1, 'a' = 2, 'c' = 3. The letter 'A' is a symbol, the number 0 is the encoding for 'A', and the combination of all four letters and their encodings is a character set.
Now, suppose that we want to compare two string values, 'A' and 'B'. The simplest way to do this is to look at the encodings: 0 for 'A' and 1 for 'B'. Because 0 is less than 1, we say 'A' is less than 'B'. Now, what we've just done is apply a collation to our character set. The collation is a set of rules (only one rule in this case): "compare the encodings." We call this simplest of all possible collations a binary collation.
But what if we want to say that the lowercase and uppercase letters are equivalent? Then we would have at least two rules: (1) treat the lowercase letters 'a' and 'b' as equivalent to 'A' and 'B'; (2) then compare the encodings. We call this a case-insensitive collation. It's a little more complex than a binary collation.
In real life, most character sets have many characters: not just 'A' and 'B' but whole alphabets, sometimes multiple alphabets or eastern writing systems with thousands of characters, along with many special symbols and punctuation marks. Also in real life, most collations have many rules: not just case insensitivity but also accent insensitivity (an "accent" is a mark attached to a character as in German 'ö') and multiple-character mappings (such as the rule that 'ö' = 'OE' in one of the two German collations).

Saturday, September 6, 2014

Quote of day

How would one describe JPA  v.s.  Hibernate ? 

"JPA is the dance, Hibernate is the dancer"

or

"JPA is the Art, Hibernate is the artist"

Thursday, August 21, 2014

beginning of a great thing

Sunday, May 25, 2014

Saying of the day


"The intuitive mind is a sacred gift and the rational mind is a faithful servant. We have created a society that honors the servant and has forgotten the gift."


Albert Einstein

This is probably more so true as you get older and develop that faculty.

Friday, February 14, 2014

I love an attentive audience

Photographer Octavio Aburto

Thursday, February 13, 2014

Nature's beautiful white dump

This years been harsher than most in NYC but beautifully done. 

This guys not going anywhere. 

Finally made it to a subway station. 

Shouldn't phase Google employees in their fortress on 16th street. 



Thursday, January 23, 2014

IaaS v.s. PaaS v.s SaaS




IaaS, PaaS and SaaS are cloud computing service models.

IaaS(Infrastructure as a service), as the name suggests, provides you the computing infrastructure, physical or (quite often) virtual machines and other resources like virtual-machine disk image library, block and file-based storage, firewalls, load balancers, IP addresses, virtual local area networks etc. Examples: Amazon EC2, Windows Azure, Rackspace.

PaaS(Platform as a service), as the name suggests, provides you computing platforms which typically includes operating system, programming language execution environment, database, web server etc. Examples : AWS Elastic Beanstalk, Heroku, Force.com, Google App Engine.

While in Saas(Software as a service) model you are provided with access to application softwares often referred to as on-demand softwares. You don't have to worry about the installation, setup and running of the application. Service provider will do that for you. You just have to pay and use it through some client. Examples : Google Apps, Microsoft Office 365.
Few additional points regarding your question :
1- AWS(Amazon web services) is a complete suite which involves a whole bunch of useful web services. Most popular are EC2 and S3 and they belong to IaaS service model.
2- Although Hadoop is based on previous works by Google(GFS and MapReduce), it is not from Google. It is an Apache project. You can find more here. It is just a distributed computing platform and does not fall into any of these service models, IMHO.
3- Microsoft's Windows Azure is again an example of IaaS.
As far as popularity of these services is concerned, they all are popular. It's just that which one fits into your requirements better. For example, if you want to have a Hadoop cluster on which you would run MapReduce jobs, you will find EC2 a perfect fit, which is IaaS. On the other hand if you have some application, written in some language, and you want to deploy it over the cloud, you would choose something like Heroku, which is an example of PaaS.