Friday, November 1, 2013

Deleted stored procedure from MS SQL!

Do not panic, as there are 2 ways to retrieve your precious stored procedure:


1) Recover them from the dblog table

SELECT
[cp].[refcounts],
[cp].[usecounts],
[cp].[objtype],
[st].[dbid],
[st].[objectid],
[st].[text],
[qp].[query_plan]
FROM
sys.dm_exec_cached_plans cp
CROSS
APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st
CROSS
APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp 
where [st].[text] like '%__AUDIT%'

Select Convert(varchar(Max),Substring([RowLog Contents 0]
,33
,LEN([RowLog Contents 0]))) as [Script]
from fn_dblog(NULL,NULL)
Where [Operation]='LOP_DELETE_ROWS' And [Context]='LCX_MARK_AS_GHOST'
And [AllocUnitName]='sys.sysobjvalues.clst'

2) Recover them from cached database plan

SELECT
[cp].[refcounts],
[cp].[usecounts],
[cp].[objtype],
[st].[dbid],
[st].[objectid],
[st].[text],
[qp].[query_plan]
FROM
sys.dm_exec_cached_plans cp
CROSS
APPLY sys.dm_exec_sql_text ( cp.plan_handle ) st
CROSS
APPLY sys.dm_exec_query_plan ( cp.plan_handle ) qp ;


Tuesday, June 18, 2013

Unofficial pulse app finally arrives on Windows Phone

After many sleepless nights, i've finally completed the app and got approved by Microsoft. It was a pain to be rejected twice, first due to my negligence (i forgot to assign the app icon), second time was due to copyright issues (i've used the windows logo in the icon).

But nonetheless, it's approved and finally live in the app store now. You can download it here



Several roadblocks hit me, due to some Windows Phone Toolkit updates, LongListSelector are now officially part of Phone.Controls, microsoft had finally made it part of the official controls.

I was using the old toolkit and had several problems in maintaining the memory foot print low. My device was a Lumia 620 and was capped with a 180mb memory limit. After days of OutOfMemory exceptions, i've customised HubTiles so much that it no longer look and behaves like the original. I had to reduce the number of controls within HubTiles, take out different animations such as flip and rotate.

I was able to support both wp7 and wp8, until the new control came out with so much feature that i didn't have to code manually is luring me to ditch wp7. And so i did, i decided to support wp8 only and have the new LayoutMode="Grid" and virtualizing capabilities built-in. Now the app is able to load hundreds of hubtiles in a panoraitem without any hiccups.

The old version can only load like 50 tiles at max, before crashing due to the memory pressure. I've incoporated a feedback channel within the app and hope that with user's feedback, i can improve the app further and let the Windows Phone community have what they deserve (A rich appstore)

Monday, May 20, 2013

My first windows phone 8 app - SG News Cloud services Part 2

I've managed to garner good feedbacks and input from many helpful people and i'm preparing for a version 2.1 release, i'm still tinkering with the nitty gritty, but you can have a preview over here

A lot of brain cracking went into making all these happen. My first challenge was to work with the XAML mark up.


  1. Somehow my sampledatamodel couldn't display everything during design-time, so i had to debug, tweak, debug, tweak over and over again. 
  2. Fonts installation was quirky as well, but luckily i've managed to get the custom fonts working by using Expression Blend. 
  3. But i've used a converter, but visual studio kept prompting an error: Invalid XAML, after lots of frustration, i found someone saying that it's due to the space that i've put in my project name. No big deal for now, since visual studio designer wasn't helping me much, luckily it works on the devices & emulators
Comment below if you would like to know more about my app

My first windows phone 8 app - SG News Cloud services Part 2

I've

Tuesday, May 14, 2013

Yahoo Weather on iOS is beautiful

So i decided to try and make 1 using HTML & JS, take a look here: http://murugaratham.appspot.com/

Not much time for details, but if you are interested in getting involved, do drop me a comment/mail.

Thursday, May 9, 2013

My first windows phone 8 app - SG News Cloud services

I had a small window of time while waiting for my new job and managed to squeeze an application for windows phone 8. I would like to share my experience and decisions along the way.

Why are you creating applications for windows phone 8 when the smartphone OS is low?
 Well, i am not an expert in iOS/android development, although i have led a full team in delivering mobile solutions, but i didn't had opportunity to write full native applications. With less than 1 week of time, i've decided to leverage on my .NET experience to write an application

What advice do you have for me to be an indie developer hoping to get some passive income?
First of all, if you are an indie developer, plan out your budget & time. Even if you have the best application idea, but if it would requires $500,000 of upfront investment (which you find out in the midst of developing), then you are just wasting your own time. Software licenses, equipment, etc were all consider before i started.

When i decided to make a windows phone app, i've read up on what are the software prerequisites. So for windows phone 8, obviously you would need the Windows Phone 8 SDK, and here are the requirements as well as the link. I would also need a cheap windows phone 8 device (i bought a Lumia 620 for SG$350), as well as the developer account (SG$135).

Can you just tell me how much you spent in total before getting everything up?
SG$135 + SG$350 = SG$485

But that's not all, put into consideration the Windows 8 OS that you need in order to use the SDK. Luckily i gotten my windows 8 key from MSDN subscription.

So you mean i have to subscribe for MSDN in order to get everything running? You know how much it costs?

Frankly, i don't know how much it costs, but i managed to get an MSDN account from BizSpark, a short overview, it's a Microsoft initiative to help 'start-ups'. They provide free Azure & MSDN accounts to kick start your 'business'.

Enough of Q&A, if you have more, do comment on this post. Let me give a short breakdown of the architecture.

Even though i was given a free azure account, after some evaluation, i went ahead with Google App Engine (GAE). Reasons?

  1. Azure was too much fluff and complicated for me to get a simple thing done. Here's a quick wiki look up of what they are offering.
  2. .NET framework is powerful, but too bloated in my case, which might incur high utility costs.

So after deciding on GAE, i was at crossroads once again, Python, Java or Go? I've avoid Azure due to bloat, so no Java. Go is young for my liking, so i went with Python. 

Was it a challenge? 

To my surprise, No. I have zero knowledge on Python but it only took 2 days for everything to start working. Google did a great job in providing python toolkit which offers very useful features, e.g. authentication, authorization, api to Memcached, NoSQL, and many more.

So i hacked up a REST webservice and simple Content Management System (CMS) using GAE, webapp2 and JINJA templates. Tested everything a few rounds and didn't had to bother much about the cloud server anymore. Oh and not to mention GAE gives 1gb of bandwidth daily as opposed to Azure's complicated free tier

I will update with the windows phone 8 application development in my next post :) in the meantime, if you have a windows phone, do take a look SG News