Search This Blog

Google Analytics

Friday, April 17, 2015

Chen Tianwen's un-un-un-un-unbelievable song got a remix

The famous Mediacorp's 'Spouse For House' actor Chen Tianwen music video "Un. un. un. un. unbelievable!!!" now comes with a remix version.


If you are interested to listen to the original version, do check out this link!

Wednesday, April 15, 2015

MsSQL Split Function

The following demonstrates how to do a string Split using a character delimiter.

Edited: [dbo].[Split_PerformanceEnhanced] added - better performance results (31 July 2017).

--SQL function to do split (performance enhanced)
CREATE FUNCTION [dbo].[Split_PerformanceEnhanced]
(
 @List NVARCHAR(MAX),
 @Delimiter VARCHAR(5)
)  
RETURNS @RtnValue TABLE
(
 ID INT IDENTITY(1,1),
 Data VARCHAR(MAX)
) 
AS
BEGIN
 INSERT INTO @RtnValue(Data)
  SELECT [Value] FROM 
    ( 
    SELECT 
     [Value] = LTRIM(RTRIM(SUBSTRING(@List, [Number],
     CHARINDEX(@Delimiter, @List + @Delimiter COLLATE Latin1_General_100_BIN2, [Number]) - [Number])))
    FROM (SELECT Number = ROW_NUMBER() OVER (ORDER BY name)
     FROM sys.all_objects) AS x
     WHERE Number <= LEN(@List)
     AND SUBSTRING(@Delimiter + @List, [Number], LEN(@Delimiter)) = @Delimiter
    ) AS y

 RETURN;
END
GO
--Test out the SQL function
SELECT * FROM dbo.Split_PerformanceEnhanced('one|two|three|four', '|')
GO
Below SQL function still works but prefer the above new performance enhanced version.
--SQL function to do split
CREATE FUNCTION [dbo].[Split]
(
 @RowData NVARCHAR(MAX),
 @SplitOn CHAR(1)
)  
RETURNS @RtnValue TABLE
(
 ID INT IDENTITY(1,1),
 Data VARCHAR(MAX)
) 
AS
BEGIN
 DECLARE @count INT
 SET @count = 1

 WHILE (CHARINDEX(@SplitOn COLLATE Latin1_General_100_BIN2, @RowData) > 0)
 BEGIN
  INSERT INTO @RtnValue (data)
  SELECT Data = LTRIM(RTRIM(SUBSTRING(@RowData, 1, CHARINDEX(@SplitOn COLLATE Latin1_General_100_BIN2, @RowData) - 1)))
  SET @RowData = SUBSTRING(@RowData, CHARINDEX(@SplitOn COLLATE Latin1_General_100_BIN2, @RowData) + 1, LEN(@RowData))
  SET @count = @count + 1
 END

 INSERT INTO @RtnValue (data)
 SELECT Data = LTRIM(RTRIM(@RowData))

 RETURN
END
GO
--Test out the SQL function
SELECT * FROM dbo.Split('one|two|three|four', '|')
GO

So stunned like a vegetable by Chen Tianwen's "Un. un. un. un. unbelievable!!!" music video

Mediacorp's 'Spouse For House' actor Chen Tianwen music video "Un. un. un. un. unbelievable!!!" is so unbelievably funny. What a multi-talented guy.


Spouse For House airs every Wednesday, 10pm on Channel 5.

Tuesday, April 14, 2015

Google Malaysia access disrupted and hacked

As of now, access to Google Malaysia (www.google.com.my) remains not possible and is showing 'Google Malaysia HackeD' message.


The disruption is reported to be due to DNS redirection as confirmed by a tweet from Google Malaysia.


A WHOIS check on www.google.com.my domain confirmed the DNS redirection.

Monday, April 13, 2015

Introduction to Project Management

Greg Balestrero (Strategic Advisor on Corporate Consciousness, Leadership & Sustainability, IIL) provides a quick but thorough introduction to Project Management, how it is being used, and why it should matter to you, especially if you are into Project Management.

Wednesday, April 08, 2015

Charlie Munger in 2010: ‘Don’t ask Charlie Munger. Study the life and work of Lee Kuan Yew, you’re going to be flabbergasted’

In a Q&A at University of Michigan in 2010, Charlie Munger who is Vice-Chairman of Berkshire Hathaway Corporation praised the Singapore system and Lee Kuan Yew. He said, ‘Don’t ask Charlie Munger. Study the life and work of Lee Kuan Yew, you’re going to be flabbergasted’.

Watch the segment in the video below.

Wednesday, April 01, 2015

Amazon newly revamped design - RETRO

As part of April Fool, Amazon has just launched their newly revamped retro design. See below if you like it!

Popular Posts