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
“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)
Sunday, December 22, 2013
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.
Wednesday, July 3, 2013
Learning ColdFusion 10
Temporary hold my current projects: Microsoft C# ASP.NET MVC and Google Android Demo App for a week to try out Adobe® ColdFusion® 10 Developer edition and MySQL 5.6.12. I love the opportunity to learn a new thing.

Install Adobe ColdFusion 10 Developer edition on Microsoft Windows.

Install MySQL 5.6.12

Using GitHub on Windows for version control.
Install Adobe ColdFusion 10 Developer edition on Microsoft Windows.
Install MySQL 5.6.12

Using GitHub on Windows for version control.
Monday, July 1, 2013
Using GitHub for Windows with Bitbucket
GitHub is a popular Git version control hosting but it's not provide free unlimited private repositories like Bitbucket. I end up using both. To push files to Bitbucket.org using GitHub for Windows:
Other git commands
# view current remote
git remote -v
# remove remote
git remote rm origin-bb
# Use these sequence git commands to update Git repository in both local and remote later.
git add .
git commit -a
git push -u
Further reading:
https://confluence.atlassian.com/display/BITBUCKET/Import+code+from+an+existing+project
http://git-scm.com/book/ch2-5.html
- Open Git Shell
- Change to other directory if need (cd "..\Visual Studio 2012\Projects\DisplayRSSFeeds")
- Add .gitignore
- Add readme.txt (optional)
- Initialize empty git repository: git init
- Add the existing files to the repository: git add .
- Commit the files: git commit -m "First commit" or git commit -a
- Log into Bitbucket.
- Create a new repository.
- Add a new remote: git remote add origin-bb https://yourusername@bitbucket.org/yourusername/yourgit.git
(Note: See picture below. You cannot push or remove the remote origin, so just make a new one called origin-bb as I did). - Push up the repo for the first time: git push -u origin-bb --all
Other git commands
# view current remote
git remote -v
# remove remote
git remote rm origin-bb
# Use these sequence git commands to update Git repository in both local and remote later.
git add .
git commit -a
git push -u
Further reading:
https://confluence.atlassian.com/display/BITBUCKET/Import+code+from+an+existing+project
http://git-scm.com/book/ch2-5.html
Sunday, June 2, 2013
Buying a new laptop
If you are going to buy a laptop using Microsoft Windows, make sure it has Windows 7. Windows 8 is not good, hard to use and took a lot of time to learn. Thus Microsoft force to make Windows 8.1 as a new free upgrade.
http://www.extremetech.com/computing/155747-windows-8-1-will-be-a-free-upgrade-will-begin-public-beta-testing-on-june-26.
Also, make sure the CPU support supports Intel® Virtualization Technology (Intel® VT) along with many advanced technologies as I mentioned on my previous post. I preferred Intel® Core™ i3, i5 or i7 processor.
Your laptop should have:
http://www.extremetech.com/computing/155747-windows-8-1-will-be-a-free-upgrade-will-begin-public-beta-testing-on-june-26.
Also, make sure the CPU support supports Intel® Virtualization Technology (Intel® VT) along with many advanced technologies as I mentioned on my previous post. I preferred Intel® Core™ i3, i5 or i7 processor.
Your laptop should have:
- 15.6" monitor screen.
- At least 1.9 GHZ Intel® Core™ i3 processor
- At least 4 GB RAM expandable to 8GB or 16GB
- Built-in high-speed wireless 802.11b/g/n and Gigabit Ethernet LAN.
- Two or more USB ports.
- Built-in front camera.
- At least 3 hours battery.
Friday, May 17, 2013
My experience with Android Studio
I love to learn or try a new thing everyday. Yesterday, I downloaded Android Studio and installed on both Mac OS/X Lion 10.7 and Ubuntu 13.04 laptop. Here is the screenshot of Android Studio my MacBook Pro.
I'm still figuring out how to fix this error: "emulator: ERROR: unknown skin name 'WXGA720'" when attempt to load Android Virtual Device without using Eclipse Juno to launch the AVD first.
For Ubuntu 13.04, I must using Oracle Java Development Kit instead of OpenJDK to run Android Studio. With Eclipse IDE, I can use OpenJDK. Here is the screenshot when I make a new Android project imported from my GitHub account:
I also trying to install Android Studio on Microsoft Windows. To save time, you need to read carefully the note on http://developer.android.com/sdk/installing/studio.html
Since this is a preview release, I don't expect much. I hope Google will make Android Studio tool better.
I'm still figuring out how to fix this error: "emulator: ERROR: unknown skin name 'WXGA720'" when attempt to load Android Virtual Device without using Eclipse Juno to launch the AVD first.
For Ubuntu 13.04, I must using Oracle Java Development Kit instead of OpenJDK to run Android Studio. With Eclipse IDE, I can use OpenJDK. Here is the screenshot when I make a new Android project imported from my GitHub account:
I also trying to install Android Studio on Microsoft Windows. To save time, you need to read carefully the note on http://developer.android.com/sdk/installing/studio.html
Since this is a preview release, I don't expect much. I hope Google will make Android Studio tool better.
Wednesday, May 1, 2013
Error when add the StoreManagerController on MVC Music Store Tutorial Part 5
When I followed the MVC Music Store Tutorial using Microsoft Visual Studio Express 2012 for Web on Windows 8, I got this error:
Thank the author of ITorian.com.
Unable to retrieve metadata for 'MusicStore.Models.Album'. Using the same DbCompiledModel to create context against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used.
No idea. Let google for a solution. Here a solution from ITorian (http://www.itorian.com/2012/10/unable-to-retrieve-metadata-for.html) :
After I delete this line in web.config, it worked:
connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
providerName="System.Data.SqlServerCe.4.0"/>
Thank the author of ITorian.com.
Wednesday, April 3, 2013
What did I do last weekend?
Look at this picture :)
I played with Microsoft ASP.NET MVC 4, Visual Studio 2012 on Windows 8. Actually Windows 8 hosted on my Apple MacBook Pro. On my Dell laptop, I used Google Chrome on Ubuntu. I love to learning a new thing everyday.
I played with Microsoft ASP.NET MVC 4, Visual Studio 2012 on Windows 8. Actually Windows 8 hosted on my Apple MacBook Pro. On my Dell laptop, I used Google Chrome on Ubuntu. I love to learning a new thing everyday.
Tuesday, March 19, 2013
Transact-SQL statement terminator
Although the semicolon is not required for most statements in this version of SQL Server, it will be required in a future version. For more information, see Deprecated Database Engine Features in SQL Server 2008.
Read more at http://msdn.microsoft.com/en-us/library/ms177563(v=sql.100).aspx
Thursday, February 14, 2013
A Safe Job Search
Just got this useful message from Monster.com, I repost here For Your Awareness (FYA):
Should I provide my social security number when I apply job online?
Monster makes protecting job seekers a top priority. We'd like to remind you of what you can do to help keep yourself safe during a job search.
Know What to Avoid
Some employment scams appear as job postings or classifieds while others may target victims through unsolicited email. Below are the most common scams:
Money-Laundering Scams
Money launderers offer "jobs" with commissions or pay as high as $2000 per day to process checks on behalf of foreign nationals. They recruit local citizens to "process payments" or "transfer funds," because as foreign nationals, they can't do it themselves. Learn more about money laundering scams here.»
Reshipping Scams
Reshipping scams typically require job seekers to receive packages of stolen goods-frequently consumer electronics-and then forward the packages, often outside the United States. Those who fall for reshipping scams may be liable for shipping charges and even the cost of goods purchased online with stolen credit cards. Read more about reshipping scams here.»
Pre-pay/Work at Home Scams
Although there are genuine jobs working at home, many "offers" are not valid forms of employment and have the simple goal of getting victims to make an initial "investment." Find out more about avoiding these scams.»
Protect Yourself
What seems like a lucrative job offer could cost you your savings and more. Learn to identify the signals of an employment scam to protect yourself. A few simple steps and a little bit of information can keep your job search safe and effective! Learn more by visiting Monster's Security Center.
If you see a questionable job posting or suspect misuse of the Monster website, please report the suspected fraud to Monster.
If you think you have been a victim of fraud, immediately report the fraud to your local police and contact Monster, so steps can be taken to ensure your safety. We also recommend that you file an online report with The Internet Crime Complaint Center, a partnership between the Federal Bureau of Investigation and the National White Collar Crime Center. More information on how to conduct a safe job search is available through the Federal Trade Commission's website. You can also check out LooksTooGoodToBeTrue.com.Further reading:
Should I provide my social security number when I apply job online?
Saturday, January 12, 2013
Java Vulnerability
After learning about Java vulnerability from the Department of Homeland Security's United States Computer Emergency Readiness Team (US-CERT), I checked all my browsers in all computers: Ubuntu Linux, Apple Mac OS X, and Microsoft Windows to make sure Java is disabled. To test whether Java is working on my computer, go to this URL http://java.com/en/download/testjava.jsp
Here are the screenshots from my Windows computer:
Here are the screenshots from my Windows computer:
Java was disable on Google Chrome 23 on Microsoft Windows. Oops. I need to update Google Chrome to the latest version Google Chrome 24. Always keep your browser up to date.
'No working Java was detected on your system.' Good. Java was disabled on Mozilla Firefox 17. Again. I will update Firefox to version 18. On Ubuntu, it was 'Something is wrong. Java is not working'.
Java was disabled on Microsoft Internet Explorer 9.
Next, I went to Control Panel to update Java to the latest version Java 7 update 10 and unchecked the check box 'Enable Java content in the browser'.
Before clicked the 'Apply' button
After clicked the 'Apply' button
Unchecked the 'Keep temporary files on my computer'
Internet Explorer after unchecked the check box 'Enable Java content in the browser'
Subscribe to:
Posts (Atom)


















