Add Speech Recognition icon to your html textbox

Wouldn’t it be nice if you could offer users where they can just speak instead of typing? Well all you need to do is to add keyword ‘x-webkit-speech’ to the existing textbox.

<input type="text" name="search" />

Try out a live demo – click the microphone icon and speak

To enable language based speech recognition add international language code to lang attribute of text box

<input lang="fr" type="text" name="search" x-webkit-speech/>

You can also set the language code at head section

<meta http-equiv='Content-Language' content='fr'/>

Currently, only Google Chrome supports the HTML speech input API and the microphone icon will be visible. For all other browser, it appears as normal text box.

Smart java script to handle query string using Regex

Handling query strings using java script is quite tough. If we Google it, we find lots of solutions, however most of the solutions are complicated or not generic. Years back I got one solution, but I have no idea who came up with this idea. The piece of code is totally generic and can be reused anywhere.


var uri = window.location.href; // Takes the current page Url
var queryString = {};           // array of querystring
uri.replace(
	new RegExp("([^?=&]+)(=([^&]*))?", "g"),
	function($0, $1, $2, $3) { queryString[$1] = $3; }
);                              //regex logic
// Alerts the firstName value from the query string
alert('First Name: ' + queryString['firstName']);
// Alerts the lastName value from the query string
alert('First Name: ' + queryString['lastName']);
 

Now imagine that the current page URL is
'http://www.geekphilip.com/add.php?firstName=philip&lastName=tiju&email=info@geekphilip.com'
Now by using queryString[ ‘tag Name’ ] you can read the value.
ie. queryString[‘firstName’] returns philip and queryString[‘lastName’] returns tiju.

I really would like to appreciate the guy, who came up with this idea.

Anyway Hats off to you boss.

Clustered Indexes v/s Non-Clustered Indexes

A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and the use of more storage space. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random look ups and efficient access of ordered records.

There are basically two types of indexes: Clustered Indexes and Non-Clustered Indexes. Both uses “B-TREE” for searching data. However, storage of physical data differs.

  •  Clustered Indexes:  In clustered index, the non-leaf level points to the actual data.
Clustered Indexes
Clustered Index Architecture
  • Non-Clustered Indexes: In Non-Clustered index the leaf nodes point to pointers, which then point to actual data.
Non-Clustered Indexes
Non-Clustered Index Architecture

 

 

Visual Explanation of Access Specifiers in OOPs

Access specifiers  (or access modifiers) are keywords in object-oriented languages that set the accessibility of classes, methods, and other members. Access modifiers are a specific part of programming language syntax used to facilitate the encapsulation of components.

There are 5 access modifiers.

  1. Private: Accessible only within the class.
  2. Protected: Accessible within the class and its derived classes.
  3. Internal: Accessible anywhere within the current project or assembly.
  4. Protected internal: Accessible with current project and derived classes.
  5. Public: Accessible everywhere.
Access specifier
Access specifier

 

Programmer and Magician, Philip Tiju Abraham – Kochi Post – Dated 27th May 2013

Philip Tiju Abraham, also known as Magician Philip

Philip Tiju Abraham, also known as Magician Philip

Magician Philip, that’s his stage name, uses magic as a medium to convey his messages to society. He takes his magic very seriously even while being a fulltime programmer. We were curious enough to ask him a few questions.

What got you interested in magic?

When I was 12 years old, I happened to attend the show of the famous magician Samraj. I got so inspired and forced my parents to buy a book of magic tricks that was sold at the counter. Very soon, I performed my first magic show at a school function which turned out to be runaway success and I became a star overnight. My magic performances became quite popular in my small town and I started getting opportunities at schools, clubs and parties.

Where did you learn it? Did it take long?

I started learning with books and self-trials. The turning point of my passion was when I discovered the Magic Academy in Kerala, run by another famous magician Gopinath Muthukad. I regularly attended various courses and camps at the Magic Academy, which sharpened my skills and techniques. Even after 15 years, I still consider myself as a student of magic and learn new things every day.

What do you get out of it? At any point did you think it was silly?

It is not an easy question to answer. To start with, it instilled and improved my self-confidence, public speaking skills, showmanship, concentration and ability to engage with a small or large crowd with ease. Recognition and celebrity status came as a byproduct.

You never have the real passion for magic, if you ever thought it was silly. Magicians with a passion are very serious about their business and so do I. Magic is also an art like many others.

Gateways 09, Christ University

Is being a magician a serious career option?

Unlike in the past, there are lots of schools of magic, institutions and academies now in India. I can say, magic is definitely getting much popularity in our country these days. Several national and regional channels are now showcasing reality shows in magic as well.

I believe, it is up to the people themselves to decide whether they want to make their passion full or part time

My Guru once said, ‘Magic is enjoyed by kids of age from 7 to 70’. As long as we have these kids, magic will always shine and grow.

Tell us about The Dream of Gandhi-ji magical journey? Why such a journey?

The ‘’Dream of Gandhi-ji – The Magic with a Mission’’ was an unique magical journey covering many parts of South India. The main objective of the journey was to spread Mahatma Gandhi-ji’s principles like peace, religious harmony, equality and nonviolence among the people. The journey covered South Indian States Kerala, Tamil Nadu and Karnataka. The journey started on October 2, 2010 from Bangalore and ended on January 30, 2011. I performed in schools, colleges and orphanages in many cities and villages. I got an immense positive response from the crowd and the media.

I always end my show with a religious harmony message. Couple of years back two kids came backstage after the show. They said they were not aware of the importance of religious harmony and in their class they do have religious discrimination, where kids from different religion would not talk with each other. I was quite shocked by hearing those words from 10 year old kids. Then I decided I have to do something for it and composed a show focusing on importance of religious harmony, peace, non violence and equality.

041220102884

What are your next plans? Leaving your job soon?

Well, we do not know what’s going to be next, as of now I would like to continue performing magic as my passion. During my college days friends used to say I’m married to magic and computer programming, probably that’s the reason I cannot leave one for the other. Being an artist, I understand I got immense social responsibilities and commitments. I have already composed couple of shows which you can expect on stage in couple of months.

Article by Editor, THE KOCHI POST LTD.
http://kochipost.com/2013/05/27/programmer-and-magician-philip-tiju-abraham/

 

Introducing Samsung GALAXY S 4

On 14th March 2013, Samsung finally unveiled its flagship device of the year, the Samsung Galaxy S4. The mobile giant has released an introduction video which describes its features and functionality, This is what they want to say:

Technical Specification

Network2G NetworkGSM 850 / 900 / 1800 / 1900
3G NetworkHSDPA 850 / 900 / 1900 / 2100
4G NetworkLTE (market dependent)
EDGEYes
SpeedHSDPA, 42.2 Mbps; HSUPA, 5.76 Mbps; LTE, Cat3, 50 Mbps UL, 100 Mbps DL
WLANWi-Fi 802.11 a/b/g/n/ac, dual-band, DLNA, Wi-Fi Direct, Wi-Fi hotspot
BluetoothYes, v4.0 with A2DP, EDR, LE
NFCYes
Infrared portYes
USBYes, microUSB v2.0 (MHL), USB On-the-go, USB Host
MEMORYCard SlotmicroSD, up to 64 GB
Internal16/32/64 GB storage
RAM2GB
CAMERAPrimary13 MP, 4128 x 3096 pixels, autofocus, LED flash
FeaturesDual Shot, Simultaneous HD video and image recording, geo-tagging, touch focus, face and smile detection, image stabilization, HDR
VideoYes, 1080p@60fps, 1080p@30fps, dual-video rec.
SecondaryYes, 2 MP, 1080p@30fps, dual video call
FEATURESOperating SystemAndroid 4.2.2 (Jelly Bean)
ChipsetExynos 5 Octa 5410
ProcessorQuad-core 1.6 GHz Cortex-A15 & quad-core 1.2 GHz Cortex-A7
BatteryLi-Ion 2600 mAh battery
SIMMicro-SIM
BODYDimensions136.6 x 69.8 x 7.9 mm (5.38 x 2.75 x 0.31 in)
Weight130 g
DISPLAYType5 inch Full HD Super AMOLED (1920 x 1080) display
MultitouchYes
ProtectionGorilla Glass 3

 

Firefox Mobile OS on your desktop Firefox

Everyone is quite eager to test and use Firefox mobile OS. May be we still have to wait for some more time for the mobiles to be available in market. However using a Firefox add-on you can simulate the Firefox mobile OS. This add-on is not stable and you might find lots of bugs and issues.  First of all download the Firefox mobile OS, you will find three version, based upon your operating system, download the respective version. Once the installation is complete, you will be redirected to a dashboard.


Firefox mobile Add-on Window
Firefox mobile Add-on Window

 

Suppose If you have missed the page somehow, you can get the dashboard by navigating to  Web Developer and click Firefox OS Simulator. For Mac, Linux it appears under Tools.

 

Accessing the Addon - Firefox mobile OS
Accessing the Addon – Firefox mobile OS

 

Click the Stopped button. It changes into the Running button and Firefox OS boots up in its own window. The default size for this window is 320×480. To stop the Simulator, click the Running button in the dashboard, or just close the Simulator window.


phone

 

Note: Because of the size of the add-on, Firefox may freeze for several seconds while installing it, and its unresponsive script dialog may appear, due to bug 814505. If it does, just click the Continue button, and Firefox will continue installing the add-on.

 

Simple and stylish Drop down using CSS

We have found a simple and decent way to achieve stylish select dropdown using CSS. It works across all browsers, simple to implement and moreover stylish.

1. Create a normal select dropdown as follows:

<select id="ddlCountry">
   <option value=""> --- Choose ---</option>
   <option value="India">India</option>
   <option value="China">China</option>
   <option value="Pakistan">Pakistan</option>
   <option value="Sri Lanka">Sri Lanka</option>
</select>

2. Now wrap the select with a div tag

<div class="ddlWrap">
   <select id="ddlCountry">
      <option value=""> --- Choose ---</option>
      <option value="India">India</option>
      <option value="China">China</option>
      <option value="Pakistan">Pakistan</option>
      <option value="Sri Lanka">Sri Lanka</option>
   </select>
</div>

3. Basically we are going to make the opacity 0 and add a background image for that

.ddlWrap select {
   opacity: 0;
   width: 215px;
   line-height: 1;
   border: 0;
   border-radius: 0;
   background: url("arrow_select.png") no-repeat 100% 0 #2D2D2D; //for IE
   -webkit-appearance: none; //for Google Chrome
   color: #fff;
   height: 32px;
}
.ddlWrap {
   width: 215px;
   overflow: hidden;
   background: url("arrow_select.png") no-repeat 100% 0 #2D2D2D;
   border: solid 1px #333333;
   border-radius: 5px;
   position: relative;
}

4. Now you will find a drop down with an arrow and no text to display, thats because the opacity is 0. Here we need to do a small tweak. We add addional span tag above the select and display the selected content.

<div class="ddlWrap">
   <span> --- Choose ---</span>
   <select id="ddlCountry">
      <option value=""> --- Choose ---</option>
      <option value="India">India</option>
      <option value="China">China</option>
      <option value="Pakistan">Pakistan</option>
      <option value="Sri Lanka">Sri Lanka</option>
   </select>
</div>

5. And update the style for span

.ddlWrap span {
   position: absolute;
   left: 10px;
   top: 5px;
}

6. Now with the help of jQuery we update the span with the selected dropdown text

$('select').click(function () {
   $(this).prev('span').text($(this).find('option:selected').text());
});

That’s it, we have done it. You can trigger a  ready event and update the selected content, if you do not wish to hard code ‘— Choose —‘.

Select drop down using CSS
Select drop down using CSS

 

Click here to download the full source code.

 

Courtesy: Biswanath Dey (BD)

Steam for Linux Now in Open Beta

The Steam for Linux beta is now open to the public, meaning anyone and everyone can join. All that’s required is that you download/upgrade the latest Steam Linux client and you’re good to go. Currently around 39 games added to Linux list, expecting more games to be added in the coming weeks.

linuxsteam

Valve announced in July 2012 that they were developing a Steam client for Linux and modifying the Source engine to work on native Linux, based on the Ubuntu distribution. The team developing the Linux client had been working for a year prior to the announcement to validate that such a port would be possible. Initial internal beta testing of the Linux client started in October 2012, with an external beta testing occurring in early November. Not only will Valve’s Linux group focus on improving the Steam client but will assure that their selected first Source game, Left 4 Dead 2, will run at acceptable frame rates and connectivity with the Windows and Mac OS X versions.

Check out the following useful links

 

Courtesy: Steam,  Wikipedia

 

Well explained Animated Ad for ‘Ubuntu for Android’

Ubuntu for Android is an upcoming free and open source variant of Ubuntu designed to run on Android phones. Recent animated ad on Ubuntu for Android explains its features, functionality and benefits.

Features

  • Both Ubuntu and Android run at the same time on the device, without emulation and without the need to reboot. This is possible because both Ubuntu and Android share the same kernel (Linux).
  • When the device is connected to a desktop monitor, it features a standard Ubuntu Desktop interface.
  • When the device is connected to a TV, the interface featured is the Ubuntu TV experience.
  • Ability to run standard Ubuntu Desktop applications, like Firefox, Thunderbird, VLC, etc.
  • Ability to run Android applications on the Ubuntu Desktop.
  • Make and receive calls and SMSs directly from the Desktop.

System requirements

  • According to Canonical a phone needs the following requirements:
  • Dual-core 1 GHz CPU
  • Video acceleration: shared kernel driver with associated X driver; OpenGL, ES/EGL
  • Storage: 2 GB for OS disk image
  • HDMI: video-out with secondary framebuffer device
  • USB host mode
  • 512 MB RAM

Courtesy: http://en.wikipedia.org/wiki/Ubuntu_for_Android
                   http://www.ubuntu.com/devices/android