Looked into the past, I thought I would more success and quickly reached my goals if I slowed down. So, my resolution for this new year is slow down.
I will reading slowly so I can enjoy the writing.
I will drive slowly so I can arrive the destination safely and on time.
“To build may have to be the slow and laborious task of years. To destroy can be the thoughtless act of a single day.”
— Winston Churchill
“For fast-acting relief, try slowing down.”
— Lily Tomlin
“The trees that are slow to grow bear the best fruit.”
— Moliere
“Always remember to slow down in life; live, breathe, and learn; take a
look around you whenever you have time and never forget everything and
every person that has the least place within your heart.”
— Anonymous
“Slow down and enjoy life. It's not only the scenery you miss by going to
fast-you also miss the sense of where you are going and why.”
— Eddie Cantor
“Slow down and everything you are chasing will come around and catch you.”
— John De Paola
“Slow down you're doing fine
You can't be everything you want to be
Before your time.”
— Billy Joel
“I am going the way of all the earth. Be strong and be a man! Keep the mandate of the Lord, your God, walking in his ways and keeping his statutes, commands, ordinances, and decrees as they are written in the law of Moses, that you may succeed in whatever you do, and wherever you turn.” (1 Kings 2:2-3)
Wednesday, January 1, 2014
Sunday, December 22, 2013
Install Eclipse on Mac OS/X
After I upgraded my MacBook Pro from OS/X 10.7 "Lion" to OS/X 10.9 "Mavericks", many my applications did not work correctly so I uninstalled them. Install Eclipse IDE on Mac OS/X is simple, just extract the zip file and you are all set.
How do I put Eclipse icon on launchpad?
Move whole Eclipse folder to your Applications folder
How do I put Eclipse icon on launchpad?
Move whole Eclipse folder to your Applications folder
Sunday, November 17, 2013
Check for existing record before insert
To avoid duplicate record in database, it is better to check for duplicate certain column data before insert. Primary key is a good mechanic to prevent duplicate row but don't count on it. Take a look the following SQL statements.
-- Creating temporary table (Notice the primary key is set to identity)
CREATE TABLE #tblTemp
( ID int identity primary key,
ColA nvarchar(30),
ColB nvarchar(50)
);
GO
-- Inserting new record into the temporary table tblTemp
-- If execute this insert statement twice, you will have two row have same data in ColA and ColB
-- with difference ID
INSERT INTO #tblTemp VALUES ('Test A1', 'Test B1');
-- This is better
IF NOT EXISTS (SELECT 1 FROM #tblTemp WHERE #tblTemp.ColA='Test A1')
INSERT INTO #tblTemp VALUES ('Test A1', 'Test B1')
SELECT * FROM #tblTemp
Another example using sample database AdventureWorks2012.
USE AdventureWorks2012;
GO
SELECT * FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.';
GO
-- We don't want a duplicate record for AddressLine1 '1970 Napa Ct.' and PostalCode 1597
IF NOT EXISTS (SELECT 1 FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.' AND PostalCode=1597)
INSERT INTO AdventureWorks2012.Person.Address (AddressLine1, City, StateProvinceID, PostalCode)
VALUES ('1970 Napa Ct.', 'Lane Cove', 50, 1597);
SELECT * FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.';
GO
-- Creating temporary table (Notice the primary key is set to identity)
CREATE TABLE #tblTemp
( ID int identity primary key,
ColA nvarchar(30),
ColB nvarchar(50)
);
GO
-- Inserting new record into the temporary table tblTemp
-- If execute this insert statement twice, you will have two row have same data in ColA and ColB
-- with difference ID
INSERT INTO #tblTemp VALUES ('Test A1', 'Test B1');
-- This is better
IF NOT EXISTS (SELECT 1 FROM #tblTemp WHERE #tblTemp.ColA='Test A1')
INSERT INTO #tblTemp VALUES ('Test A1', 'Test B1')
SELECT * FROM #tblTemp
Another example using sample database AdventureWorks2012.
USE AdventureWorks2012;
GO
SELECT * FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.';
GO
-- We don't want a duplicate record for AddressLine1 '1970 Napa Ct.' and PostalCode 1597
IF NOT EXISTS (SELECT 1 FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.' AND PostalCode=1597)
INSERT INTO AdventureWorks2012.Person.Address (AddressLine1, City, StateProvinceID, PostalCode)
VALUES ('1970 Napa Ct.', 'Lane Cove', 50, 1597);
SELECT * FROM AdventureWorks2012.Person.Address WHERE AddressLine1='1970 Napa Ct.';
GO
Tuesday, October 8, 2013
Error 5120 When Attached Database
I got error 5120 when attempted to attach sample database AdventureWorks2012 to Microsoft SQL Server 2012 ran on Microsoft Windows 8.1 Preview.
Solution to this problem is simple: Close the current Microsoft SQL Server Management Studio and run it as administrator to attach database. Also, do not use 'sa'. Use Windows Authentication instead.
Now, test it as normal user by update a record in the AdventureWorks2012 database.
Solution to this problem is simple: Close the current Microsoft SQL Server Management Studio and run it as administrator to attach database. Also, do not use 'sa'. Use Windows Authentication instead.
Now, test it as normal user by update a record in the AdventureWorks2012 database.
Tuesday, September 17, 2013
Microsoft SQL vs MySQL
I'm working with both databases and love them. Here are my notes their SQL syntax difference.
Select first 10 records from table:
In Microsoft SQL:
Select first 10 records from table:
In Microsoft SQL:
SELECT TOP 10 SchoolID, SchoolName
FROM schools
ORDER BY SchoolID;
In MySQL:
SELECT SchoolID, SchoolName
Create new table and insert data from existing tables
Microsoft SQL:
SELECT * INTO Schools_Bak20130916 FROM Schools;
MySQL:
CREATE TABLE Schools_Bak20130916 SELECT * FROM Schools;
FROM schools
ORDER BY SchoolID;
In MySQL:
SELECT SchoolID, SchoolName
ORDER BY SchoolID
LIMIT 10
Microsoft SQL:
SELECT * INTO Schools_Bak20130916 FROM Schools;
MySQL:
CREATE TABLE Schools_Bak20130916 SELECT * FROM Schools;
Saturday, August 17, 2013
GPS & CELL PHONE
Got this story by email, don't know it's true or not. But somethings are useful. Here are my suggestions:
- First, alway think twice before click on any link or text back.
- Second, put your password on your cell phone or any mobile devices such as tablet, iPad, iPod Touch.
- Third, make a new email to use on smart phone only. In case your phone lost or stolen, people cannot use that email to reset your account password.
- Last, don't put you home address, birthday on your address book, Facebook, LinkedIn or anything not necessary. When I search for map direction on the web, I used the public location nearby such as school, store or supermarket as my home address.
* * * * *
GPS
A couple of weeks ago a friend told me that someone she knew had their car broken into while they were at a football game. Their car was parked on the green which was adjacent to the football stadium and specially allotted to football fans. Things stolen from the car included a garage door remote control, some money and a GPS which had been prominently mounted on the dashboard.
When the victims got home, they found that their house had been ransacked and just about everything worth anything had been stolen. The thieves had used the GPS to guide them to the house. They then used the garage remote control to open the garage door and gain entry to the house.
The thieves knew the owners were at the football game, they knew what time the game was scheduled to finish and so they knew how much time they had to clean out the house. It would appear that they had brought a truck to empty the house of its contents.
Something to consider if you have a GPS - don't put your home address in it.. Put a nearby address (like a store or gas station) so you can still find your way home if you need to, but no one else would know where you live if your GPS were stolen.
MOBILE PHONES
I never thought of this.......
This lady has now changed her habit of how she lists her names on her mobile phone after her handbag was stolen. Her handbag, which contained her cell phone, credit card, wallet... Etc...was stolen.
20 minutes later when she called her hubby, from a pay phone telling him what had happened, hubby says 'I received your text asking about our Pin number and I've replied a little while ago.' When they rushed down to the bank, the bank staff told them all the money was already withdrawn. The thief had actually used the stolen cell phone to text 'hubby' in the contact list and got hold of the pin number. Within 20 minutes he had withdrawn all the money from their bank account.
Moral of the lesson:
Do not disclose the relationship between you and the people in your contact list.
Avoid using names like Home, Honey, Hubby, Sweetheart, Dad, Mom, etc....
And very importantly, when sensitive info is being asked through texts, CONFIRM by calling back
Also, when you're being texted by friends or family to meet them somewhere, be sure to call back to confirm that the message came from them. If you don't reach them, be very careful about going places to meet 'family and friends' who text you..
Monday, July 15, 2013
Using Visual Studio 2013 Preview and Team Foundation Service
Back to Microsoft Windows stuff. To maintain my program skills, I alway learn a new thing, practice what I learn and review what I did. This time I work with ASP.NET by using Visual Studio 2013 Preview on Microsoft Windows 8.1 Preview with Microsoft Team Foundation Service, a free TFS on the cloud.
Subscribe to:
Posts (Atom)

