Search This Blog

Google Analytics

Wednesday, June 26, 2013

Wednesday, June 19, 2013

NEA Singapore Tweets For PSI Updates


Monday, June 10, 2013

MSSQL: Get All Stored Procedures With References to a Table

AFAIK, there is no built-in feature to generate a list of stored procedures that made references to a specific database table. The following help me to do just that.

SELECT DISTINCT so.name
FROM syscomments sc INNER JOIN sysobjects so ON sc.id = so.id AND so.xtype = 'P'
WHERE sc.TEXT LIKE '%TABLE_NAME%'

Monday, May 27, 2013

How to Turn Off Thumbs.db From Appearing?

The auto creation of Thumbs.db files in folders with images can get annoying. Before burning photo albums into DVD-R, I often have to go around searching and deleting such files. This can also get annoying for web developers using version control software e.g. TortoiseGit and TortoiseSVN.

Eh .. Sometimes, deleting these files can get the "file is in use and cannot be deleted" prompt. Very annoying.

So what exactly is Thumbs.db? As quoted from Wikipedia,

On Microsoft Windows operating systems, starting with the IE4 Desktop Update for Win95/98, a thumbnail cache is used to store thumbnail images for Windows Explorer's thumbnail view. This speeds up the display of images as these smaller images do not need to be recalculated every time the user views the folder.

Yes we know the purpose of Thumbs.db but what if we still wish to turn off Thumbs.db from appearing? There is a way to do it by tweaking a setting on the Local Group Policy Editor.

  1. From the Start Menu, click Run option. Or, you can use Win+R keyboard shortcut.

  2. Type gpedit.msc and hit ENTER key. This will launch the Local Group Policy Editor.

  3. Navigate to User Configuration > Administrative Templates > Windows Components > then either Windows Explorer (Windows Vista/7) or File Explorer (Windows 8).

  4. Look for "Turn off the caching of thumbnails in hidden thumbs.db files" key and double click on it.

    Local Group Policy Editor
  5. Select Enabled and click OK.


» How to Switch Off the Thumbs.db Image Cache File in Windows | Sitepoint

Sunday, May 26, 2013

MSSQL: Generate Random String Using SQL

The following will generate a random fixed-length string using SQL. Simply pass in a string of accepted characters and the length of the random string to be generated.

IF ISNULL(object_id('cspRandomString'),0)<>0 DROP PROC cspRandomString
IF ISNULL(object_id('fnGenRandomInteger'),0)<>0 DROP FUNCTION fnGenRandomInteger
GO
CREATE function fnGenRandomInteger(@MinValue int, @MaxValue int, @Seed float)
returns int
as
begin
-- =============================================
-- Author:        Loh Hon Chun
-- =============================================
 return ((@MaxValue + 1) - @MinValue) * @Seed + @MinValue
end
go
CREATE procedure cspRandomString (
 @Result varchar(255) output,
 @AcceptedChars varchar(255),
 @Length int
)
as
begin
-- =============================================
-- Author:        Loh Hon Chun
-- =============================================
 set nocount on

 declare @ret char(255)
 declare @i int, @pos int
 
 set @Result = ''
 set @i = 0

 if LEN(@AcceptedChars) > 0
 begin
  while @i < @Length
  begin
   set @pos = dbo.fnGenRandomInteger(1, LEN(@AcceptedChars), RAND(CONVERT(VARBINARY, NEWID())))
   set @Result = @Result + CAST(SUBSTRING(@AcceptedChars, @pos, 1) AS VARCHAR(1))
   set @i = @i + 1
  end
 end
end
go

declare @result varchar(255)
declare @acceptedChars varchar(255)
declare @length int

set @acceptedChars = '0123456789'
set @length = 7
exec cspRandomString @Result=@result output, @AcceptedChars=@acceptedChars, @Length=@length
print @result
go

11 tips for developing a mobile app that users will love

An article on The Next Web lists out 11 tips for developing a mobile app that users will love.

  1. Testing is key
  2. Go Deep With Your Users
  3. Plan for the Offline Experience
  4. Design With Ease of Use
  5. Make It Stupid Simple
  6. Tailor Your Design
  7. Use Grids
  8. Cover as Many Platforms as Possible
  9. Don't Forget the Importance of Convenience
  10. Emulate the Real World
  11. Pick One Thing and Nail It

Stop Windows from Restarting Your Computer After Windows Update

Almost always, Windows will always show the "your computer is going to restart in 15 minutes ..." prompt every time Windows Updates is performed. This can get annoying especially when the update setting is set to auto download and update. So I can we make the annoying prompt not to show?

The following fix should apply to both Windows 8 and 7.

  1. Open your registry editor by typing regedit from your Start Menu → Run box.
  2. Navigate to key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU. Many may see up to \Windows level. In that case, you will need to create new keys for \WindowsUpdate and \WindowsUpdate\AU.
  3. Now, create a new DWORD (32-bit) value NoAutoRebootWithLoggedOnUsers under the AU key. Give it a value of 1.
  4. Reboot your machine and you are done.

NOTE: It is still your responsibility and is definitely recommended to reboot whenever you are ready to so the updates can be applied completely.

» Stop Windows from Restarting Your Computer After Updates | LifeHacker

Thursday, May 09, 2013

What to look out for for responsive adaptable web design?

An article on the Smashing Magazine website - How Much Has The Web Really Changed? discusses what has changed for the past one decade or so in web development. A lengthy but easy-to-read article.

Up until not so long ago, we used to base our designs on some rather general assumptions about screen size and input type. With the rise of devices with various screen sizes and alternative ways to interact, these assumptions have turned out to be unreliable. We need to upgrade the defaults that we use when we start designing our websites.

Sunday, May 05, 2013

Google Doodle for Malaysia On Polling Day 2013

Google doodle for Malaysia as the Malaysians go to the poll today.


GS1 Prefix List - How to Determine Origin of Food From Barcodes?

Do you know that it may be possible to determine the country where a food product is manufactured bought from a supermarket by reading the barcodes on the package itself? However, do note that the barcodes do not provide identification of country of origin for a given product though hopefully the manufacturer can put our mind at ease if certain countries are in our blacklist.

How to read the barcodes?
  1. Turn over the food product and look for the barcode.


  2. The first 3 digits of the barcode will reveal the GS1 Prefix.

  3. Tally with the list below to find out the country where the food product could have been manufactured at.

    GS1 Prefixes do not provide identification of country of origin for a given product. They simply provide number capacity to different countries for assignment from that location to companies who apply. Those companies in turn may manufacture products anywhere in the world.

    ASSIGNED GS1 PREFIXES
    000 - 019GS1 US
    020 - 029Restricted distribution (MO defined)
    030 - 039GS1 US
    040 - 049Restricted distribution (MO defined)
    050 - 059Coupons
    060 - 139GS1 US
    200 - 299Restricted distribution (MO defined)
    300 - 379GS1 France
    380GS1 Bulgaria
    383GS1 Slovenija
    385GS1 Croatia
    387GS1 BIH (Bosnia-Herzegovina)
    389GS1 Montenegro
    400 - 440GS1 Germany
    450 - 459 & 490 - 499GS1 Japan
    460 - 469GS1 Russia
    470GS1 Kyrgyzstan
    471GS1 Taiwan
    474GS1 Estonia
    475GS1 Latvia
    476GS1 Azerbaijan
    477GS1 Lithuania
    478GS1 Uzbekistan
    479GS1 Sri Lanka
    480GS1 Philippines
    481GS1 Belarus
    482GS1 Ukraine
    484GS1 Moldova
    485GS1 Armenia
    486GS1 Georgia
    487GS1 Kazakstan
    488GS1 Tajikistan
    489GS1 Hong Kong
    500 - 509GS1 UK
    520 - 521GS1 Association Greece
    528GS1 Lebanon
    529GS1 Cyprus
    530GS1 Albania
    531GS1 MAC (FYR Macedonia)
    535GS1 Malta
    539GS1 Ireland
    540 - 549GS1 Belgium & Luxembourg
    560GS1 Portugal
    569GS1 Iceland
    570 - 579GS1 Denmark
    590GS1 Poland
    594GS1 Romania
    599GS1 Hungary
    600 - 601GS1 South Africa
    603GS1 Ghana
    604GS1 Senegal
    608GS1 Bahrain
    609GS1 Mauritius
    611GS1 Morocco
    613GS1 Algeria
    615GS1 Nigeria
    616GS1 Kenya
    618GS1 Ivory Coast
    619GS1 Tunisia
    620GS1 Tanzania
    621GS1 Syria
    622GS1 Egypt
    623GS1 Brunei
    624GS1 Libya
    625GS1 Jordan
    626GS1 Iran
    627GS1 Kuwait
    628GS1 Saudi Arabia
    629GS1 Emirates
    640 - 649GS1 Finland
    690 - 699GS1 China
    700 - 709GS1 Norway
    729GS1 Israel
    730 - 739GS1 Sweden
    740GS1 Guatemala
    741GS1 El Salvador
    742GS1 Honduras
    743GS1 Nicaragua
    744GS1 Costa Rica
    745GS1 Panama
    746GS1 Republica Dominicana
    750GS1 Mexico
    754 - 755GS1 Canada
    759GS1 Venezuela
    760 - 769GS1 Schweiz, Suisse, Svizzera
    770 - 771GS1 Colombia
    773GS1 Uruguay
    775GS1 Peru
    777GS1 Bolivia
    778 - 779GS1 Argentina
    780GS1 Chile
    784GS1 Paraguay
    786GS1 Ecuador
    789 - 790GS1 Brasil  
    800 - 839GS1 Italy  
    840 - 849GS1 Spain  
    850GS1 Cuba
    858GS1 Slovakia
    859GS1 Czech
    860 GS1 Serbia
    865GS1 Mongolia
    867GS1 North Korea
    868 - 869GS1 Turkey
    870 - 879GS1 Netherlands
    880GS1 South Korea
    884GS1 Cambodia
    885GS1 Thailand
    888GS1 Singapore
    890GS1 India
    893GS1 Vietnam
    896GS1 Pakistan
    899GS1 Indonesia
    900 - 919GS1 Austria
    930 - 939GS1 Australia
    940 - 949GS1 New Zealand
    950GS1 Global Office
    951GS1 Global Office (EPCglobal)
    955GS1 Malaysia
    958GS1 Macau
    960-969Global Office (GTIN-8s)
    977Serial publications (ISSN)
    978 - 979Bookland (ISBN)
    980Refund receipts
    981 - 983Common Currency Coupons
    990 - 999Coupons

Friday, May 03, 2013

Official Chrome Extension for Google Keep

Google has released an official Chrome Extension for Google Keep - a task keeping minimalistic app. The Chrome extension can only be installed from the link above i.e. you won't find the app from doing a search.

As quoted from the Google Drive blog post,
The Google Keep Chrome app launches in its own window, so you can create notes, cross out your to-do lists, and attach photos to tasks while you work on other things. And if you don’t have an internet connection, don't fret: the Chrome app works offline because we all know that ideas (big and small) can be sparked at any time.

Monday, April 29, 2013

The Re-Imagining of Microsoft

Bing, Skype, and Xbox rebranding plans revealed in Microsoft design presentation.

Saturday, April 27, 2013

Information on setting up two-step authentication for Outlook.com / Microsoft account

Read on for more information - Outlook.com gets two-step verification, sign-in by alias and new international domains.

ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error

Should you encounter _doPostBack is undefined JavaScript error on IE 10, it is because there is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4.

Scott Hanselman published two ways to fix this: one is a machine-wide fix, the other is a way to fix individual sites. The replacement of the "fixed" ie.browser file will supposedly resolve the problem but it somehow didn't quite work for me. If that file didn't work for you, you may wish to use the below instead.

~\App_Browsers\ie.browser

<browsers>
    <!-- Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4325) -->
    <browser id="IE6Plus" parentID="IE">
        <identification>
            <capability name="majorversion" match="^[6-9]|\d{2,}$" />
        </identification>

        <capabilities>
            <capability name="ecmascriptversion"    value="3.0" />
            <capability name="jscriptversion"       value="5.6" />
            <capability name="javascript"           value="true" />
            <capability name="javascriptversion"    value="1.5" />
            <capability name="msdomversion"         value="${majorversion}.${minorversion}" />
            <capability name="w3cdomversion"        value="1.0" />
            <capability name="ExchangeOmaSupported" value="true" />
            <capability name="activexcontrols"      value="true" />
            <capability name="backgroundsounds"     value="true" />
            <capability name="cookies"              value="true" />
            <capability name="frames"               value="true" />
            <capability name="javaapplets"          value="true" />
            <capability name="supportsCallback"     value="true" />
            <capability name="supportsFileUpload"   value="true" />
            <capability name="supportsMultilineTextBoxDisplay" value="true" />
            <capability name="supportsMaintainScrollPositionOnPostback" value="true" />
            <capability name="supportsVCard"        value="true" />
            <capability name="supportsXmlHttp"      value="true" />
            <capability name="tables"               value="true" />
            <capability name="supportsAccessKeyAttribute"    value="true" />
            <capability name="tagwriter"            value="System.Web.UI.HtmlTextWriter" />
            <capability name="vbscript"             value="true" />
        </capabilities>
    </browser>

    <!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) -->
    <browser id="IE6to9" parentID="IE6Plus">
      <identification>
        <capability name="majorversion" match="^[6-9]$" />
      </identification>
    </browser>

    <!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) -->
    <browser id="IE7" parentID="IE6to9">
        <identification>
            <capability name="majorversion" match="^7$" />
        </identification>
        <capabilities>
            <capability name="jscriptversion" value="5.7" />
        </capabilities>
    </browser>

    <!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) -->
    <browser id="IE8" parentID="IE6to9">
        <identification>
            <capability name="majorversion" match="^8$" />
        </identification>
        <capabilities>
            <capability name="jscriptversion" value="6.0" />
        </capabilities>
    </browser>

  <!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) -->
  <browser id="IE9" parentID="IE6to9">
    <identification>
      <capability name="majorversion" match="^9$" />
    </identification>
    <capabilities>
      <capability name="jscriptversion" value="6.0" />
    </capabilities>
  </browser>

  <!-- Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) -->
  <browser id="IE10Plus" parentID="IE6Plus">
    <identification>
      <capability name="majorversion" match="\d{2,}" />
    </identification>
    <capabilities>
      <capability name="jscriptversion" value="6.0" />
    </capabilities>
  </browser>

  <gateway id="IEbeta" parentID="IE">
        <identification>
            <capability name="letters" match="^([bB]|ab)" />
        </identification>

        <capture>
        </capture>

        <capabilities>
            <capability name="beta"    value="true" />
        </capabilities>
    </gateway>
</browsers>

Extend Your Microsoft Office Trial for Five More Months

Microsoft offers free 30-day trials of Office 365 and Office 2013. After your free month is over, you won't be able to use some major features of these office suites. There is an article on LifeHacker extending Microsoft Office trial for five more months.

I didn't try it though. Let me know if it works.

Thursday, April 25, 2013

Skype Facing Problems Signing In Using Microsoft Account

It's confirmed that signing into Skype using Microsoft Account is facing problem as indicated on Skype Heartbeat.

Skype Heartbeat Announcement

It seem to be affecting only Skype for Desktop.

Error message after attempting to login using Microsoft account

In case you do need to connect with your MSN friends urgently, you may explore the following options:

  1. Skype on mobile
  2. Third party IM e.g. imo.im or eBuddy.

[UPDATE Apr 25, 2013 18:15 GMT+8] The issue has been resolved - at least for myself.

Xiang Yun (向云) Euology On Huang Wenyong (黄文永)

Quoted from the Wikipedia,

Huang Wenyong (25 July 1952 – 20 April 2013) was a Malaysia-born Singaporean actor, musician, and former teacher of Chinese descent. He was an actor for MediaCorp from the early 1980s until his death. Appearing in more than 100 television programmes, he was among the first few batches of locally-trained actors to enter the local entertainment industry and considered to be one of the "pioneers in local Chinese drama". Huang died on 20 April 2013 of Lymphoma.

Soon after his death, several fans and fellow colleagues pour in their consolation and regret to have lost an invaluable asset to Singapore local film industry. Long-time working colleague of Huang Wenyong's (黄文永) - Xiang Yun (向云) penned an euology on the passing of her friend.

Xiang Yun (向云) penned an euology on Huang Wenyong (黄文永)

"永别了!我的挚友。你真的很风光!"
第一代阿姐,悼念第一代阿哥,一段情真意切的肺腑之言,感动千万心。
昨天午夜,“阿梅”向云在FB写了一篇长文《悼文永》,令数万名网友感动,不少人更说,读了情不自禁落泪。
今午,永远的“阿水”已经出殡,《联合晚报》谨此与面友分享这篇动人的悼文,向文永大哥致敬。

【悼文永】
文永,30多年的战友,要写他,点点滴滴,能记得多少?

我们从青年,壮年到黄金年代一路走来,面对着不同阶段的人生、事业和健康的挑战。

之财常形容我的“象一头牛那样会吃苦”,那文永就像牛和雄狮的结合。他不只很会吃苦,还很固执的坚守岗位。

许多农历新年的时段,大家忙着拿假回家庆祝,但是只要公司开口要求他留下开工,他从不拒绝。看他忙完这个戏,就接下个任务,马不停蹄,年复一年的苦干。

文永性格老实憨厚、正直,画画唱歌都是他的擅长。对于弱势者会特别的照顾。

在我眼中的他是一个孝子,好丈夫,好父亲。在与他共事这些年里,虽然他不提,但我也知道他在不同阶段曾为母亲离世前的病重担忧,承受失去母亲的悲痛,妻子患病时的忧虑,以及为孩子们成长的操心,我只能默默给他打气。

《雾锁南洋》是我和文永在演艺圈的一个转折点。文永很用心,很卖力的演,许多危险动作都自己来,病了也继续拍,很敬业。而我却是糊里糊涂的跟着演。

那部戏消耗了我们许多体力和连续开早晚班的睡眠时间,但是那时我们还年轻,有本钱。

之后他就一部接一部的拍下去。看到文永工作时一丝不苟,及与导演配合的专业态度,我从中学习了许多,尤其是他原本是教师的背景,对他是又敬又畏,后来一起工作久了熟悉了,从他天天说不完的笑话中感觉轻松多了,慢慢的无所不谈,但还是不敢在他面前放肆,到现在还是一样。所以他与我是亦师亦友。

到拍摄新年歌mtv时,听到同事说文永暴瘦10公斤的消息时,赶紧给他一个电话问候,他说不知原因,还在想要不要带家人去台湾度假?我鼓励他一定要去,一家人出游是最开心的事,别担心工作了。

在“戏剧情牵30年”那天总算看到他了,相信我那一愣认不出消瘦了的他的那个惊讶表情是伤了他,他紧握我的手,小声说:这次不太乐观!我马上阻止他胡思乱想。当晚我彻夜难眠,发了个信息给他,要他一定要去找出病因。

之后因不敢打扰他,久不久才发个短信慰问他,要他加油!他也回复我,要我好好照顾自己。但在新年后的简讯他就没回复了,我心里开始着急,后来得知他在医院的那段日子,我几次想探望他的要求都被拒绝了。

我了解,因为我也是艺人,希望大家都留下美好的印象,而不是被病魔摧残了的病容,我也知道他明白我的心意。

近年来我很健忘,许多记忆都常常需要文永来提我,他走了,记忆忘了就忘了,人生还是要往前走。

看看身边的同伴,不是每个都会与你同行到老,有些会先告别,也许有一天……这就是人生。

文永60年的岁月是精彩的,他照亮自己,也照亮大家,让每个认识他的人都快乐。

永别了!我的挚友。你真的很风光!

Popular Posts