Search This Blog

Google Analytics

Sunday, March 25, 2012

Instagram for Android: Accepting sign-ups

Most popular photography app, Instagram, is coming to Android. If you are interested, click here to queue for the sign-up.

Saturday, March 24, 2012

Combine UPDATE and SELECT in one statement

After we did an UPDATE on a record and when we want to find out what are updated, we will usually follow up with a SELECT. Example,

update tblTest
set
    Age = Age + 1, LastModifiedDate = GETDATE()
where Name = 'Name 1'

select * from tblTest
where Name = 'Name 1'

How about doing the above all in one single statement and avoiding the select statement from getting outdated record when someone intercepts and attempts to update?

It's possible! Try the following.

--SETUP
if ISNULL(object_id('tblTest'),0)<>0 drop table tblTest
go
create table tblTest (
    ID int identity(1,1) not null primary key,
    Name varchar(255) not null,
    Age tinyint not null,
    LastModifiedDate datetime not null default getdate()
)
go

--INSERT test records
insert into tblTest (Name, Age) values ('Name 1', 21)
insert into tblTest (Name, Age) values ('Name 2', 22)
go

--CREATE the temp table for select
if ISNULL(object_id('tempdb..#tem_tblTest'),0)<>0 drop table #tem_tblTest
create table #tem_tblTest (ID int, Name varchar(255), Age tinyint)

--UPDATE record and select into temp table (All in one statement)
update tblTest
set
    Age = Age + 1, LastModifiedDate = GETDATE()
output inserted.ID, inserted.Name, inserted.Age into #tem_tblTest (ID, Name, Age)
where Name = 'Name 1'

--SELECT what's updated
select * from #tem_tblTest
go

--CLEANUP
if ISNULL(object_id('tempdb..#tem_tblTest'),0)<>0 drop table #tem_tblTest

Google Docs spell checker is contextual and awesome!

Google Docs has launched a revolutionary spell checker - one that not only correct spellings, but also is contextual. This contextual spell checker is able to make suggestions on the correct use of word based on the sentence. What's even better is the suggestions get smarter and smarter based on the words Googlebot sees as it explores the web.

The advantages spelled out are as follows:
  1. Suggestions are contextual. For example, the spell checker is now smart enough to know what you mean if you type “Icland is an icland.”


  2. Contextual suggestions are made even if the misspelled word is in the dictionary. If you write “Let’s meat tomorrow morning for coffee” you’ll see a suggestion to change “meat” to “meet."

  3. Suggestions are constantly evolving. As Google crawls the web, we see new words, and if those new words become popular enough they’ll automatically be included in our spell checker—even pop culture terms, like Skrillex.


» Spell checking powered by the web | Google Docs Blog

Thursday, March 22, 2012

Amazon to buy robotics firm Kiva Systems for $775 million

Amazon is reported to be acquiring robotics firm Kiva Systems for $755 million in cash. Saving a little time can save a lot of money for Amazon, making robots move inventory items, instead of the workers, and fulfilling orders faster.

Mitt Romney's "Etch A Sketch" Comment, but some things you can't shake off

An "Etch A Sketch" Romney campaign gaffe is spreading around the Internet like wildfire. The comment that sparked controversial debate is as quote:

Everything changes. It's like Etch A Sketch. You can shake it up and we start all over again.


Soon after the comment, several political rivals including the Democrats seized the opportunity to attack Romney. Democrats even produced a YouTube clip entitled "Mitt Romney: Some Things You Can't Shake Off".

Woman gets in argument, hits man on plane


More details on the incident here.

Monday, March 19, 2012

Apple to distribute dividends and execute share buyback amounting to $45 billion

In post Steve Jobs era, new Apple CEO Tim Cook has decided the time is ripe to distribute dividends and execute share buyback. Apple is now sitting on a massive $97 billion cash balance.

Quote from Apple's press release:

Subject to declaration by the Board of Directors, the Company plans to initiate a quarterly dividend of $2.65 per share sometime in the fourth quarter of its fiscal 2012, which begins on July 1, 2012.

Additionally, the Company’s Board of Directors has authorized a $10 billion share repurchase program commencing in the Company’s fiscal 2013, which begins on September 30, 2012. The repurchase program is expected to be executed over three years, with the primary objective of neutralizing the impact of dilution from future employee equity grants and employee stock purchase programs.

This would means Apple will be spending approximately $45 billion of its $97 billion cash reserves on dividends and share buyback in the first three years of these new programs. For your information, Apple last distributed dividends in 1995.

How to Manage Facebook Photo Tags?

I believe many have been experiencing similar annoyances on Facebook, been tagged in a photo inappropriately randomly. To avoid that, read on here to learn how to control Facebook photo tags and how to manage your privacy settings so it doesn't happen again.

Saturday, March 17, 2012

Garbage Collection on JavaScript

An interesting post on how to perform garbage collection and optimize JavaScript to avoid execution pauses when browser decides to do clean up.

» How to write low garbage real-time Javascript | About Scirra Blog

Nokia Maps offer audio navigation

Nokia Maps and its voice-guided, turn-by-turn walk navigation is now available for iOS and Android. It is not working very well in Singapore.

» m.maps.nokia.com gets updated with walk navigation | Conversations by Nokia

Barack Obama: The Road We've Traveled

Wednesday, March 07, 2012

Google Play - Consolidate Android Market, Books, Music, Video Apps

Google has rebranded Android Market and renamed it to Google Play. In this exercise, it is combining Android Market, Google Music, Video App and Google Books, all onto Google Play.


Google doesn't sell content in all countries, so here's the rundown on what Google Play will offer depending on where you are:
  • US: Apps, Movies, Books, Music
  • UK & Canada: Apps, Movies, Books
  • Australia: Apps & Books
  • Japan: Apps & Movies
  • Others: Apps

Here it is by content type:
  • Apps: US, UK, Canada, Australia, Japan and many other countries (not all countries can buy apps)
  • Books: US, UK, Canada, Australia
  • Movies: US, UK, Canada, Japan
  • Music: US


» Introducing Google Play: All your entertainment, anywhere you go | Official Google Blog

Popular Posts