Wednesday, August 17, 2011

Install Mac OSX 10.5.8 on Aspire One A150

Software
You might need to search and download the following software from the internet. Some of them can be downloaded directly from Apple.

  1. Kalyway 10.5.2 Installation disc burned on a DVD.
  2. 1_Kalyway_UpdCombo10.5.3.pkg
  3. 2_kalyway_10.5.3_kernel.pkg
  4. MacOSXUpd10.5.4.dmg
  5. MacOSXUpd10.5.5.dmg
  6. paulswinddriverutilitypack
  7. alc268fix
  8. Trackpad PreferencePane



Hard Drive Preparation
To install the MacOSX into an AspireOne netbook, the hard drive must be pre-formatted as a Mac extended partition. FAT32 or NTFS wont' work for Mac.
  1. Connect the external DVD drive.
  2. Boot up the computer.
  3. Press F12 to the boot sequence menu.
  4. Insert the Kalyway 10.5.2 disc into the drive.
  5. Wait until the disc is stop spinning.
  6. Select the DVD drive as the boot up disk.
  7. Wait until the language selection screen shows up. Then select English.
  8. In the welcome screen, DO NOT click continue.
  9. Click Utilities on the menu bar, then click Disk Utility.
  10. Select the main hard drive in the left pane.
  11. Select partition on the right pane, then select the disk0s1. DO NOT select disk0s0 or you can't restore the Windows XP.
  12. Erase the partition with "Mac OS extended journal"
  13. Enter the drive name. For example, MacintoshHD.
  14. Click Apply to erase the partition. It should take less than one minute.
  15. Click Quit Disk Utility from the Disk Utility menu.
  16. Now you can click continue to go ahead for the installation process.



Kalyway 10.5.2 installation
Setting up a Hacintosh is not quite straight forward. Lots of things has to be done carefully.

  1. Click Agree in the welcome screen
  2. Select the drive you just prepared, then click continue.
  3. In the big X screen. DO NOT click continue at this moment.
  4. Click customize and select the following option:
  • Uncheck language translation
  • Expand Kernel and ONLY seldct the kernel_9.2speedstep
  • Expand graphic drivers and ONLY select the Intel_GMA950.
  • Uncheck Audio Driver
  • Expand Network Drivers, ONLY select RTL1000.
  • If you have Broadcom card installed, also select the IO80211 family.
  • Uncheck Mobo_chipsets
  • Uncheck Thirds_application
  • Uncheck patches
  1. Double check all options.
  2. Click Done and Install.
  3. When the installation process starts, click Skip to bypass the DVD Check process.
  4. The intallation takes about 30 to 40 minutes.
  5. Restart the computer when the installation is complete.
  6. First time boot up with Mac OS, you need to answer all the questions. Just do it.
  7. The first app loaded into the system is call Finder. Look at the top left corner besides the Apple logo to verify it.
  8. Close all opened windows.



Kalyway 10.5.3 installation
Change the kernel to Vanilla kernel in order to make the computer compatible to original Apple Update.

  1. Click Go, Utilities from the top menu.
  2. Double click terminal.
  3. Type "sudo su -"
  4. Type your password
  5. Type "vi /Library/Prefetences/SystemConfiguration/com.apple.Boot.plist"
  6. Move the current in between under the kernel_flags
  7. Type "I" switch to insert mode
  8. Type "cpus=1"
  9. Press Escape and type ":wq" to save the file.
  10. Close the terminal window by click the red button at the top left corner.
  11. Run the "Kalyway Mac OS X 10.5.3 combo update.pkg". After the process, DO NOT restart the computer.
  12. Run the "Kalyway_10.5.3_kernel.pkg". Go through the steps then select the "vanilla_kernel_9.3".
  13. When the installation is finished, close the window and click restart from the previous installation screen.
  14. When the computer is booting up, press spacebar or F8 to interrupt the startup.
  15. Type "update -v" then press enter.
  16. Lots of text will shows up on screen and that's normal even you see something has failed to load.



Kalyway 10.5.4 installation
Going a bit forward to 10.5.4.

  1. When you are in the Mac OS again, open the terminal again.
  2. Type "sudo su -" then press Enter.
  3. Type "while sleep 1 ; do rm -rf /System/Library/Extensions/AppleIntelCPUPowerManagement.kext ; done"
  4. Press Enter. Leave the window open for now.
  5. Mount the MacOSXUpd10.5.4.dmg then run the installation for 10.5.4.
  6. When the installation is finished, switch to terminal windows and press ctrl-c and close the window.
  7. Reboot your computer now.
  8. When the computer is booting up, press spacebar or F8 to interrupt the startup.
  9. Type "update -v" then press enter.
  10. Lots of text will shows up on screen and that's normal even you see something has failed to load.



Kalyway 10.5.5 installation
Going a bit more forward to 10.5.5

  1. When you are in the Mac OS again, open the terminal again.
  2. Type "sudo su -" then press Enter.
  3. Type "while sleep 1 ; do rm -rf /System/Library/Extensions/AppleIntelCPUPowerManagement.kext ; done"
  4. Press Enter. Leave the window open for now.
  5. Mount the MacOSXUpd10.5.5.dmg then run the installation for 10.5.5.
  6. When the installation is finished, switch to terminal windows and press ctrl-c and close the window.
  7. Reboot your computer now.
  8. This time the computer might take 5 minutes to boot or will never boot. If you wait longer than 10 minutes, just press the power button to restart it.
  9. When the computer is booting up, press spacebar or F8 to interrupt the startup.
  10. Type "update -v" then press enter.
  11. Lots of text will shows up on screen and that's normal even you see something has failed to load.



Sound work
Make your computer sing by doing this steps

  1. In the "Paul's wind driver &utility pack", go into the "sound" folder.
  2. Double click "AzaleaAudio.pkg" and step through the installation.
  3. Restart the computer.
  4. When the computer is back to OSX, go to the ALC268Fix folder.
  5. Run the ALC268_Installer1. DO NOT restart the computer when it is finished.
  6. Goto the /System/Library/Extensions. Move the ALCInject.kext to the trash.
  7. And you can restart your computer now.
  8. In the "Paul's wind driver &utility pack", go into the "utilities" folder.
  9. Double click the "kext helper b7".
  10. Use the finder to open the ALC268Fix folder.
  11. Drag and drop the HDAEnabler.kext to the kext helper.
  12. Type in your password and click "Easy install".
  13. When it is finished, DO NOT restart the computer.
  14. Run the "Disk Utility".
  15. Select the MacintishHD partition in the left pane.
  16. Select the first-aid tab in the right pane.
  17. Click "repair permissions". It takes a while.
  18. Restart your computer when the repairing is done.
  19. When you are in the OSX again, goto the "System preference" and click "sound".
  20. Select the internal speaker in the play alert and sound effects tabs.




Resolution fix #1
Utilize the natural LCD resolution, 1024x600.

  1. In the "Paul's wind driver &utility pack", go into the "utilities" folder.
  2. Double click the "kext helper b7".
  3. Use the finder to open the "kext" folder in the Paul's pack.
  4. Drag and drop the following kext to the kext helper.:
  • AppleIntelGMA950.kext
  • AppleIntelIntegratedFrameBuffer.kext
  • AppleSMBIOS.kext
  • ClamshellDisplay.kext
  • Natit.kext
  1. Type in your password and click "Easy install".
  2. When it is finished, DO NOT restart the computer.
  3. Run the "Disk Utility".
  4. Select the MacintishHD partition in the left pane.
  5. Select the first-aid tab in the right pane.
  6. Click "repair permissions". It takes a while.
  7. Restart your computer when the repairing is done.
  8. When you are in the OSX again. The resolution should be in 1024x600 now.



IDeneb 10.5.8 Installation
Finally upgrade the MacOS to the latest Leopard version, 10.5.8. This version will let your computer work with the lastest xCode for Leopard. And also let your computer work with iPhone4 and iOS 4 device.

  1. Open the terminal from utility menu.
  2. Type "sudo su -" then press Enter.
  3. Type "while sleep 1 ; do rm -rf /System/Library/Extensions/AppleIntelCPUPowerManagement.kext ; done".
  4. Press Enter and leave the window open for now.
  5. Double click the iDeneb.MacOSx86ComboUpd10.5.8.pkg
  6. Step through the installation process.
  7. When the installation is finished, switch to terminal windows and press ctrl-c and close the window.
  8. Reboot your computer now. This time the computer might take 5 minutes to boot. Or it be rebooted a couple of time.



Resolution fix #2
I like to use the 1024x600 natural LCD resolution. So I did these steps again. But make sure do not reload the AppleIntelGMA950.kext or your screen will become grey with some black line, that's no good.

  1. After the computer is booted back to OSX. You will notice the resolution is in 800x600 again.
  2. So now you need the kext helper again by drag and drop the following kext to the kext helper.:
  • AppleIntelIntegratedFrameBuffer.kext
  • AppleSMBIOS.kext
  • ClamshellDisplay.kext
  • Natit.kext
  1. You should notice the AppleIntelGMA950.kext hasn't been select. That's correct. DO NOT select this file.
  2. Type in your password and click "Easy install".
  3. When it is finished, DO NOT restart the computer.
  4. Run the "Disk Utility".
  5. Select the MacintishHD partition in the left pane.
  6. Select the first-aid tab in the right pane.
  7. Click "repair permissions". It takes a while.
  8. Restart your computer when the repairing is done.
  9. When you are in the OSX again. The resolution should be in 1024x600 again.



Trackpad fix
When your mouse is not with you, Trackpad is the only thing you have to control the cursor. You will want to have a little bit control on this device.

  1. Go to the /System/Library/PreferencePanes folder
  2. Move the Trackpad.prefPane to the Trash
  3. Copy the new Trackpad.prefPane from the trackpad fix pack to the /System/Library/PreferencePanes.
  4. You should see the Trackpad icon in the System Preference menu.



Software Update
Now you can do the software update from Apple, but I will only select the Safari, iTunes and Quick Time update. Because I had experienced the crash or kernel panic from some update. Or it makes the Airport Card stop working.

Sunday, August 7, 2011

Macro lens photo

Canon 60D. 55mm, f/22, with EF12, focus at 4 inches.

This is my testing macro photo. I used my pretty old lens on the 60D. The actual size of this car is 1:43. The background is a magazine. And the ground is a bible. I put a desktop light on top of the object. Also used an EF12 extension tube to reduce the focal length from 1.1 ft down to 4 inches. The aperture must be opened as wide as possible, or the field of depth will be extremely shallow. Of course, Camera on tripod is a must. I don't have shutter cable or remote yet, so I just simply use 2 seconds self timer to solve the shaking from pressing shutter. It works for me.

Thursday, July 28, 2011

Use Foxpro to work with Excel

** Opening ******************************************
*
_xls.CreateObject ('Excel.Application')
_xls.Workbooks.Add
_xls.Workbooks.Open (sys(5) + curdir() + 'book.xls')
_xls.Visible = .t.


** Sheets *******************************************
*
_xls.sheets(1).Select && Select Sheet
_xls.sheets(2).Delete && Delete Sheet
_xls.sheets(3).Name = 'Hello' && Rename Sheet
_xls.sheets.add && Add new sheet

** Columns / Row ************************************
*
_xls.Rows("1:5").RowHeight = 10
_xls.Rows("1:5").EntireRow.AutoFit
_xls.Rows("1:5").Insert

_xls.Columns("A:Z").ColumnWidth = 10
_xls.Columns("A:Z").EntireColumn.AutoFit
_xls.Columns("A:B").Insert


** Selection ****************************************
*
_xls.Range("A1:A5").Select && Select Range
_xls.Cells(1, 1).Select && Select Cell
_xls.Selection.End(1).Select && Next Left
_xls.Selection.End(2).Select && Next Right
_xls.Selection.End(3).Select && Next Top
_xls.Selection.End(4).Select && Next Bottom
_xls.Columns("A:Z").Select && Select Columns
_xls.Rows("1:5").Select && Select Rows
_xls.Cells.Select && Select Entire Workbook

** Data Extract / Assignment ************************
*
_xls.Selection = 'Text'
_xls.Cells(1, 1).Value = 'Text'
_value = _xls.Cells(1, 1).Value


** Font Style Setting *******************************
*
_xls.Selection.Font.Name = 'Arial'
_xls.Selection.Font.Size = 12
_xls.Selection.Font.Bold = .T.
_xls.Selection.Font.Italic = .T.
_xls.Selection.Font.Underline = .T.
_xls.Selection.Font.ColorIndex = 0
_xls.Selection.ShrinkToFit = .T.
_xls.Selection.Orientation = 45
_xls.Selection.MergeCells = .T.
_xls.Selection.WrapText = .T.
_xls.Selection.NumberFormat = '$#,##0.00'
_xls.Selection.Interior.ColorIndex = 0


** Alignment ****************************************
*
_xls.Selection.HorizontalAlignment = 1 && Auto Justify
_xls.Selection.HorizontalAlignment = 2 && Left Justify
_xls.Selection.HorizontalAlignment = 3 && Center Justify
_xls.Selection.HorizontalAlignment = 4 && Right Justify

_xls.Selection.VerticalAlignment = -4160 && Top Justify
_xls.Selection.VerticalAlignment = 2 && Center Justify
_xls.Selection.VerticalAlignment = 3 && Bottom Justify


** Border Lines *************************************
*
_xls.Selection.Borders(1).LineStyle = 1 && Cell Left
_xls.Selection.Borders(2).LineStyle = 1 && Cell Right
_xls.Selection.Borders(3).LineStyle = 1 && Cell Top
_xls.Selection.Borders(4).LineStyle = 1 && Cell Bottom
_xls.Selection.Borders(5).LineStyle = 1 && \ Diagonal
_xls.Selection.Borders(6).LineStyle = 1 && / Diagonal
_xls.Selection.Borders(7).LineStyle = 1 && Outer Left
_xls.Selection.Borders(8).LineStyle = 1 && Outer Top
_xls.Selection.Borders(9).LineStyle = 1 && Outer Bottom
_xls.Selection.Borders(10).LineStyle = 1 && Outer Right
_xls.Selection.Borders(10).Weight = 1 && See line weight below

** Picture ******************************************
*
_xls.ActiveSheet.Pictures.Insert ( ;
sys(5) + curdir() + 'TEST.JPG').Select
_xls.Selection.ShapeRange.ScaleHeight(0.5, 1, 0) && 0.5=50%
_xls.Selection.ShapeRange.ScaleWidth (0.5, 1, 0)
_xls.Selection.ShapeRange.IncrementLeft (1)      && Minus to move right
_xls.Selection.ShapeRange.IncrementTop (1)       && Minus to move up
_xls.ActiveSheet.Shapes.Addline (X1, Y1, X2, Y2).Select

** Page Break ***************************************
*
_xls.ActiveSheet.Rows(10).PageBreak = 1 && 0 = Remove Break
_xls.ActiveSheet.Columns(10).PageBreak = 1


** Page Setup ***************************************
*
_xls.ActiveSheet.PageSetup.CenterHeader = "Center Header"
_xls.ActiveSheet.PageSetup.LeftHeader = "Left Header"
_xls.ActiveSheet.PageSetup.RightHeader = "Right Header"
_xls.ActiveSheet.PageSetup.CenterFooter = "Center Footer"
_xls.ActiveSheet.PageSetup.LeftFooter = "Left Footer"
_xls.ActiveSheet.PageSetup.RightFooter = "Right Footer"

_xls.ActiveSheet.PageSetup.HeaderMargin = 36 && 1" = 72
_xls.ActiveSheet.PageSetup.FooterMargin = 36
_xls.ActiveSheet.PageSetup.BottomMargin = 36
_xls.ActiveSheet.PageSetup.TopMargin = 36
_xls.ActiveSheet.PageSetup.LeftMargin = 36
_xls.ActiveSheet.PageSetup.RightMargin = 36

_xls.ActiveSheet.PageSetup.PrintArea = "A1:Z30"
_xls.ActiveSheet.PageSetup.PrintGridLines = .T.
_xls.ActiveSheet.PageSetup.PrintHeading = .T.
_xls.ActiveSheet.PageSetup.PrintTitleColumns = "$A:$B"
_xls.ActiveSheet.PageSetup.PrintTitleRows = "$1:$5"
_xls.ActiveSheet.PageSetup.FitToPagesWide = 1
_xls.ActiveSheet.PageSetup.FitToPagesTall = 1
_xls.ActiveSheet.PageSetup.Zoom = .F.
_xls.ActiveSheet.PageSetup.CenterHorizontally = .T.
_xls.ActiveSheet.PageSetup.CenterVertically = .T.
_xls.ActiveSheet.PageSetup.PaperSize = 1 && 1=Letter, 2=Legal
_xls.ActiveSheet.PageSetup.Orientation = 1 && 1=Portrait
&& 2=Landscape

** Closing ******************************************
*
_xls.DisplayAlerts = .F.
_xls.AlertBeforeOverwriting = .F.
_xls.ActiveWorkBook.Save
_xls.ActiveWorkBook.SaveAs (sys(5) + curdir() + 'book.xls')
_xls.Quit

Release _xls


***** Color Index *****
*
* 00=No Fill 01=Black 02=White 03=Red
* 04=Bright Green 05=Blue 06=Yellow 07=Pink
* 08=Turquoise 09=Dark Red 10=Green 11=Dark Blue
* 12=Dark Yellow 13=Violet 14=Teal 15=Gray 25%
* 16=Gray 50% 33 Sky Blue 34=Light Turqupise 35 Light Green
* 36=Light Yellow 37=Pale Blue 38=Rose 39=Lavender
* 40=Tan 41=Light Blue 42=Aqua 43=Lime
* 44=Gold 45=Light Orange 46=Orange 47=Blue-Gray
* 48=Gray 40% 49=Dark Teal 50=Sea Green 51=Dark Green
* 52=Oliver Green 53=Brown 54=Plum 55=Indigo
* 56=Gray 80%
*
***********************

***** Line Style ******
*
* 1=Continuous 4=Dash Dot 5=Dash Dot Dot 13=Slant Dash Dot
* -4115=Dash -4118=Dot -4119=Double
*
***********************

***** Line Weight *****
*
* 0=None 1=Hairline 2=Thin -4138=Medium 4=Thick
*
***********************

Wednesday, July 27, 2011

Split PDF into single page

** This process requires you to have acrobat pro
** The acrobat reader does not compatible with it


** Create an object to hold the Acrobat
Pd = CreateObject('acroexch.pddoc')
Pn = CreateObject('acroexch.pddoc')Pd.open('input.pdf')


** Get the actual page count from pdf
PC = pd.getnumpages


** First page is 0, so the last page is the PC - 1
For cp = 0 to PC - 1


  ** Create a new and empty PDF file
  Pn.create


  ** Insert a page from the original file
  Pn.insertpages(-1, pd, cp, 1, .f.)


  ** Save the new pdf with page number
  Pn.save(1, 'output_' + padl(cp + 1, 3, '0'))


  ** Close the new pdf file
  Pn.close


Next


** Close and release all PDF process
Pd.Close
Release pd
Release Pn
Close all

Tuesday, July 26, 2011

Print to IP printer at DOS Command

In the DOS command prompt, create a batch file and type the following code:




For /R %CD% %%I in (*.PRN) do (
  @echo printing %%I
  LPR -S 192.168.1.100 -P raw %%I
)




The 192.168.1.100 is your network printer's IP address. It should be changed accordingly.


This program reads all *.PRN and print them to the specified IP printer.

Tuesday, July 19, 2011

Ontario Public Holiday Program


Lparameters pDate
Private xY, xC, xN, xK, xI
Private xJ, xM, xD, xHoliday


xHoliday = ''
Do Case
  Case Month(pDate) =  1 And ;
       Day(pDate)   =  1
    xHoliday = "New year's day"

  Case Month(pDate) =  1 And ;
       Day(pDate)   =  2 And ;
       Dow(pDate)   =  2
    xHoliday = "Monday after new year"

  Case Month(pDate) =  2 And ;
       Dow(pDate)   =  2 And ;
       Day(pDate)   > 14 And ;
       Day(pDate)   < 22
    xHoliday = "Family Day"

  Case Month(pDate) =  5 And ;
       DOW(pDate)   =  2 And ;
       DAY(pDate)   > 21 And ;
       DAY(pDate)   < 29
    xHoliday = 'Victoria Day'

  Case Month(pDate) =  7 And ;
       Day(pDate)   =  1
    xHoliday = 'Canada Day'

  Case Month(pDate) =  7 And ;
       Day(pDate)   =  2 And ;
       Dow(pDate)   =  2
    xHoliday = 'Monday after Canada Day'

  Case Month(pDate) =  8 And ;
       Dow(pDate)   =  2 And ;
       Day(pDate)   <  8
    xHoliday = 'Civil Holiday'

  Case Month(pDate) =  9 And ;
       Dow(pDate)   =  2 And ;
       Day(pDate)   <  8
    xHoliday = 'Labour Day'

  Case Month(pDate) = 10 And ;
       Dow(pDate)   =  2 And ;
       Day(pDate)   >  7 And ;
       Day(pDate)   < 15
    xHoliday = 'Thanksgiving'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 25
    xHoliday = 'Christmas Day'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 26
    xHoliday = 'Boxing Day'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 27 And ;
       Dow(pDate)   = 2
    xHoliday = 'Monday after Christmas'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 28 And ;
       Dow(pDate)   = 2
    xHoliday = 'Monday after Christmas'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 27 And ;
       Dow(pDate)   = 3
    xHoliday = 'Tuesday after Christmas'

  Case Month(pDate) = 12 And ;
       Day(pDate)   = 28 And ;
       Dow(pDate)   = 3
    xHoliday = 'Tuesday after Christmas'

  Otherwise
    xY = Year(pDate)
    xC = Int(xY / 100)
    xN = xY - 19 * Int(xY / 19)
    xK = Int((xC - 17) / 25)
    xI = xC - Int(xC / 4) - ;
         Int((xC - xK) / 3) + 19 * xN + 15
    xI = xI - 30 * Int(xI / 30)
    xI = xI - Int(xI / 28) * (1 - Int(xI / 28) * ;
         Int(28 / (xI + 1)) * Int((21 - xN) / 11))
    xJ = xY + Int(xY / 4) + xI + 2 - xC + Int(xC / 4)
    xJ = xJ - 7 * Int(xJ / 7)
    xL = xI - xJ
    xM = 3 + Int((xL + 40) / 44)
    xD = xL + 28 - 31 * Int(xM / 4)
 
    Do Case
      Case pDate = Date(xY, xM, xD) - 2
        xHoliday = 'Good Friday'

      Case pDate = Date(xY, xM, xD) + 1
        xHoliday = 'Easter Monday'

      Case Dow(pDate) = 1
        xHoliday = 'Sunday'

      Case Dow(pDate) = 7
        xHoliday = 'Saturday'

    Endcase
Endcase
Return xHoliday


Monday, July 18, 2011

Change default printer

Declare Long GetLastError In WIN32API
Declare Long SetDefaultPrinter In WINSPOOL.DRV String pPrinterName


xPrinterName = "New Printer"
xDefaultPrinter = Set("printer", 2)
If SerDefaultPrinter(xPrinterName) = 0
  MessageBox("Unable to set the " + ;
             xPrinterName         + ;
             " as the default printer", 0 + 16)
Else


  && insert your code here...


EndIf


SerDefaultPrinter(xDefaultPeinter)