Qt Development on OS X Mountain Lion

1. October 2012 21:18 by Cameron in C++, Mac, Mac OS X, Qt  //  Tags: , , , , , ,   //   Comments

OS X Mountain Lion changes a few things on how XCode is installed. Xcode is now contained in an app bundle and the SDKs directory is part of the bundle contents, thus you will need to update your SDK paths in your project file like so:

MAC_SDK  = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
    if( !exists( $$MAC_SDK) ) {
        error("The selected Mac OSX SDK does not exist at $$MAC_SDK!")
    }
    QMAKE_MAC_SDK = $$MAC_SDK

If you want to support Snow Leopard as a target platform with your Qt applications, be sure to use the 10.7 SDK and not the default 10.8 SDK. Your app should work just fine in Snow Leopard provided that you don't make any calls to Lion specific features while using the 10.7 SDK.

Another important thing is to install the command line tools for GCC so that Qt can find the compiler during installation and successfully compile C/C++ applications from Qt Creator. If you do use the 10.8 SDK with any Qt version less than Qt 5.0, it will give warnings that OS X 10.8 is unsupported during compilation. These warnings can be safely ignored. Aside from that, everything else should be the same as before. Happy coding!

MSI GT70 0ND-202US Gaming Laptop/Hackbook

28. August 2012 00:51 by Cameron in   //  Tags: , , , , , , , , ,   //   Comments

I recently bought a gaming laptop from MSI on Newegg with some pretty excellent specifications:

http://www.newegg.com/Product/Product.aspx?Item=N82E16834152347

Laptop: MSI GT70 0ND-202US Z77M, Intel Core i7-3610QM 2.3GHz, 12GB DDR3 RAM, 750GB Hitachi, 250GB WD, NVIDIA GTX 675M / Intel HD 4000 (Optimus), Realtek HD Audio (voodoohda), Wireless-N Atheros 9285 Half mini PCI  Express Card - Windows 8 Professional x64 RTM, OS X Mountain Lion 10.8.2 Retail

Preinstall

To install OS X Mountain Lion, download the Mountain Lion installer from the App Store (MacOS X 10.6.8 or higher) and use Unibeast to create a USB installation disk. Once the disk is created, you can then boot from the flash drive to install Mountain Lion! At the boot prompt, be sure to boot verbose using the '-v' option and also set 'GraphicsEnabler=No' as at the time of writing this guide, the NVIDIA GTX 675M cannot be used as the primary GPU and the Intel HD 4000 will need some tweaks later to get QE/CI. Once in the installer, you will need to choose where to install OS X Mountain Lion. You can install to your existing disk on a separate partition or install to a secondary disk (recommended). You will need to make sure that the hard drive you are installing ML to is using the GUID partitioning map and not MBR. If you need MBR, you'll need to patch the installer.

Postinstall

Multibeast

Wifi

The MSI GT70 0ND-202US comes stock with an Intel Centrino Wireless-N 2330 mini PCI Express card which will need to be subbed out with another compatible card. Swapping cards is fairly simple. All you need to do is pop up the speaker panel and disconnect the existing card and replace with the new one. One thing that you must do is make sure the Wifi LED is lit, otherwise, you won't be able to use the card. Here's a complete guide on how to choose an appropriate replacement card and how to get it working: http://www.tonymacx86.com/network/58146-guide-airport-half-mini-pcie.html

Intel HD 4000 QE/CI

Using the MacBook Pro 9,1 SMBIOS, LegacyAGPM.kext, 1920x1080x32, and DSDT injection for 01660004 you can achieve QE/CI. It should also be noted that I have removed AppleIntelSNBFramebuffer.kext as it is not needed with the Intel HD 4000 (probably could stop the kext from loading with DSDT later). Here's the DSDT patch for injecting the ig-platform-id:

into method label _DSM parent_adr 0x00020000 remove_entry;
into device name_adr 0x00020000 insert
begin
        Method(_DSM,4,NotSerialized)\n
        {\n
                Store(Package(0x02)\n
                 {\n
                                "AAPL,ig-platform-id",\n
                                Buffer(0x04)\n
                                {\n
                                   0x04,0x00,0x66,0x01\n
                                },\n
                        },Local0)\n
                DTGP (Arg0,Arg1,Arg2,Arg3,RefOf(Local0))\n
                Return(Local0)\n
        }\n
end


Using DSDT Editor, you'll have to apply the above patch as well as the DTGP patch from the patches directory.

Sound

VoodooHDA 2.7.2 - note, you'll have to edit the Info.plist in VoodooHDA.kext so that there isn't a hissing sound coming from the VoodooHDA prefpane. 

USB 3.0 fix (temporary)

One thing that I have found is that if you remove AppleUSBXHCI.kext from the plugins in IOUSBFamily.kext, it will treat USB 3.0 ports as just USB 2.0 ports and crashing no longer happens. This is a temporary fix until full USB 3.0 support exists (possibly in a later update). Make a backup of your existing IOUSBFamily.kext and then do the edits and re-install using Kextbeast.

Kexts

 Here's the voodoo kexts that I use for my laptop. Included is a kext for the battery, audio, and trackpad (multitouch).

voodoo_kexts.zip (212.01 kb)

 Here's my patched DSDT. As I make edits to my DSDT, I'll upload this attachment. I hope this helps for anyone with my laptop or similar.

dsdt.aml (47.02 kb)

 

 

Beginning Desktop Client for IGA

2. January 2012 18:45 by Cameron in PSN, Xbox Live  //  Tags: , , , , , , , , , , ,   //   Comments

After some time to think about the most secure method for processing achievements and trophies for an individual user using the user's account credentials, I've decided that using a desktop client rather than server side technology for collecting achievements and trophies is the best approach. Not only is it more secure, but it also reduces the load on my server by turning each user's computer into a node on the IGA network for processing small parts of achievements and trophy data as a whole. The combined data from each user will be uploaded to the IGA dedicated server for importing into the central database. Then data can be viewed from the web interface or smart phone applications.

The web interface and smart phone applications will merely serve as a way to interact with the data from the database rather than pulling data down from the various sources and taking up bandwidth. This is good for smart phone users as data charges can apply for checking for updates frequently.

I'm using a Qt, a cross platform GUI library, for designing the user interface so that the client may run on Windows, Mac OS X, and Linux out of the box. I will post some screen shots as they become available.

Gitting started with Git

15. August 2011 00:25 by Cameron in Git  //  Tags: , , , , , , , , ,   //   Comments

Git, created by Linus Torvalds, is a very high quality version control system. It was created with the task to manage the source tree of the Linux kernel. Torvalds didn't believe that pre-existing version control systems could give justice to the Linux kernel's source code given its massive size and collaborators so Torvalds created Git. If you are using other version control systems for your projects, consider reading this: http://whygitisbetterthanx.com/

This website explains the advantages in full of why Git is better than other version control systems available. 

Git is free and open source and is available for all platforms: Linux, Mac, Windows, Solaris, you name it

First, be sure to install git for your platform and then you can start playing around with different commands. Once you've installed git, here are a few references to get you started:  

http://book.git-scm.com/  

http://www.kernel.org/pub/software/scm/git/docs/  

Setting Up Git

In order to setup your environment for using a remote git repository, be sure to run these commands:

$ ssh-keygen -t rsa -C "youremail@site.com"

This command creates a public/private key pair for SSH. SSH is used by git to encrypt the connection to remote servers. When asked to where to save your public key, press enter. Then, when asked for a passphrase, leave it empty. Your screen should look like this:

Generating public/private rsa key pair.

Enter file in which to save the key (/home/cameron/.ssh/id_rsa): 

Created directory '/home/cameron/.ssh'.

Enter passphrase (empty for no passphrase): 

Enter same passphrase again: 

Your identification has been saved in /home/cameron/.ssh/id_rsa.

Your public key has been saved in /home/cameron/.ssh/id_rsa.pub.

After your public/private key have been setup, add your global user information:

$ git config --global user.name "Firstname Lastname"

$ git config --global user.email "your_email@youremail.com"

Now you are ready to clone a repository. If you run:

$ git clone git@git.tinksoft.net:test.git

A new directory will be created for the git repository, test, and all of the remote files in the repository will be downloaded into that directory.

Git Command Basics

A few common commands to git are cloning repositories, committing to repositories, pushing to repositories, and pulling from repositories. If you've worked with subversion before, "git clone" is like subversion checkout. It literally clones the remote repository in its current state to your local repository. However, "git commit" is not like subversion commit. When you commit to a git repository, you are only committing to your local repository until you push to the remote repository. Using "git push" is like subversion commit and will push your changes to the remote repository. On the first push, you need to run the command "git push origin <branch name>". This tells git to push the origin to the branch that you specify. After that first push, you can run "git push" thereafter. If you choose to switch branches later on, you simply need to run the original command and specify your origin branch. Similarly, "git pull" behaves like subversion update and pulls down changes from your remote repository into your locally cloned repository. The same  applies to the first "git pull" as does the first "git push". Git needs to know which branch to pull from.  

One thing about pushing and pulling is that if you are working in a team and multiple people are pushing and pulling to the remote repository, you may be required to pull before you push out your changes. Don't worry though. If you have a conflict with your changes, your code will not be overwritten. Git has a conflict resolution tool where you can choose which changes to accept. Another thing that is good practice is to always run "git status" before committing and pushing to your repository. This will allow you to confirm that you are indeed committing files that should be committed to your repository. Also, whatever shows up in a commit log will be pushed to your remote repository when you push our your changes. Be sure to only push out working code and not break the build for your team.

A few advanced commands include "git branch <branch name>" (branches the repository at its current state), "git merge -s ours <branch>" (merges a branch with current branch), and "git checkout <branch name>" (changes current working branch). Please be sure to read up on these commands so that you know how to use them correctly. In a project repository, you don't want to create unnecessary branches, merge branches incorrectly, or lose changes when switching branches. Another advanced topic is to create a .gitignore file for your repository and put all files that git should ignore into this file. Each file should be on a separate line. This can be helpful if you don't want files such as database configurations to be pushed to your remote repository. 

For more information about git, be sure to read the references I listed above and also check out some books on git for a more in depth discussion.

Month List

Tag cloud