Test post to see is comments are working with spam detection.
Please add a comment or two with or without spammy content.
A quick computer hardware post to report I have upgraded my Mac mini Hard drive to a Solid State Drive (SSD). With a spinning magnetic drive it would take 148 seconds to boot up and open system preferences.
Opening Photoshop CS5 and creating a 5000×500 image and applying a color gradient would take 115 seconds. I had already upgraded the memory from 4GB to 8GB but I found an adapter to add a second hard drive to a mac mini http://www.ifixit.com/Apple-Parts/Mac-Mini-Dual-Hard-Drive-Kit/IF171-005
A mac Mini (http://www.apple.com/au/macmini/) is the cheapest way to access OSX to do development as your BYO your own monitor/keyboard and mouse. I ended up going for a 256GB Crucial M4 SSD.
Opening the hard drive was a breeze with the iFixit tools and video (http://www.youtube.com/watch?v=2NORZR0BbZs). The only problem was the video stopped giving advice right where I needed it (how to place the cables in between the two drives (instead of wrapping around them). After a few hours I figured it out.
1. Open the Mac Mini
2. Install the SSD Drive
4. Boot OSX from the old HDD
5. Clone the drive with Carbon Copy Cloner
6. Boot off the SSD (hold option during boot up). Set SSD and default boot.
7. Delete the old drive and re-partition.
8. Enable TRIM with this utility http://www.groths.org/?page_id=322
9. Enjoy the benefits of a SSD.
Boot Time Time:
Before: 42.4 sec
After: 24.2 sec
Boot Time + Login + Open System Preferences:
Before: 148.9 sec
After: 39.9 sec
Open Photoshop CS5 + Create 5000x500px image + Apply Colour Gradient
Before: 114.9 sec
After: 17.5 sec
Most of my demos are going to use Visual Basic 2010 Express (a free development studio from Microsoft). This download is about 600MB.
Visual Studio Express 2012 requires Windows XP, Vista or Windows 7 with 2GB minimum of memory with 3GB hard drive space and a 1.6Ghz processor or more.
How to download and Installing Visual Studio Express 2010.
2. Click Install now (save vb_web.exe)
3. Run vb_web.exe
4. Click next
5. Select I have read and accept the licence.
6. Click Install
7. Click Exit when Done
9. Download VS10sp1-KB983509.exe
10. Click Next to install Visual Studio Service Pack 1
11. Click next then click I have read and accept the licence terms then click next (this will download about 500MB).
12. You should now have Visual Studio Express Installed.
13. Check your Windows for software updates.
Future posts will show you how to develop programs in Visual Studio Express (Visual Basic) 2010. If you are a Mac user I will get into Apple’s Objective C with XCode but for now you can install Visual Studio in a Virtual Machine on OSX.
If you are keen read some of these guides.
Programming logic is a quick description of the flow of your program.
A very simple program logic may be
IF ITEM_PRICE < BANK_BALANCE THEN
Before we write the program above we need to identify what is data and what is language associated with the programming language.
Data would be BANK_BALANCE (that is a number) and ITEM_PRICE is a number too.
“IF” and “END IF” are commands available in this program. When dealing with data you can assign the data to a variable name, for example your bank balance (a number) can be saved in the variable MyBankBalance and your credit card balance can be saved in a variable called MyCreditCardBalance.
There are different types of variables used in Visual Studio 2010 – Visual Basic.
Bits: 0 or 1 (True or False)
Byte: -128 to 127
String: any text you can think of.
Short: -32,768 through 32,767.
Long: -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807
Decimal: -79,228,162,514,264,337,593,543,950,335 through 79,228,162,514,264,337,593,543,950,335
There are other types but you can read about them here: http://msdn.microsoft.com/en-us/library/ae55hdtk.aspxIf you have to choose one type of variable choose a string as it can hold almost anything.
With numbers try and use the variable with the smallest maximum to save using too much memory (e.g. If you were creating a variable to hold ones age use a Byte, if you were creating a variable to hold a bank balance use a Decimal over an integer mostly because Decimals allow decimal points where Integers round off anything after a decimal point.
Now what we have our programming logic decided our programming variables how can we optimize my program. Let’s say we want to check our primary bank balance then our secondary bank balance if the primary bank balance does not have enough money. If we duplicated the code that checks the bank balance that would work but the code would get twice as big. What we need to do is move the code that checks the bank balance into a FUNCTION called “CHECK_BANK_BALANCE” and pass in the name of the bank account to check. No we can check 1, 2 or 2000 bank balances without duplicating code.
The new code might look like
IF ITEM_PRICE < CHECK_BANK_BALANCE(BANK_ACCOUNT_NUMBER) THEN
The code above is not perfect, we do not have a breakdown of the check price function but pseudo code allows you to flesh out the structure of your program before you start coding.
Another alternative to using a function may be to use a “Sub” (Subroutine), A subroutine is like a function but it does not return any data. You could use a sub routine to deduct an amount from a bank balance and not return the bank balance when done.
- Pseudo code allows you to flesh out your program. If you have an idea just write our the pseudo code, review and optimise it. When you are happy with the flow, choose a suitable software language and start turning the pseudo code into real code.
- Variables are used to hold data.
- There are variables for text, numbers etc.
- Use FUNCTIONS instead of duplicating code.