Cocoa Geek


Linux From Scratch

Posted in Uncategorized by andrew on the June 15th, 2008

There are loads of different Linux distributions around these days, and this number seems to get bigger every week. Loads of them are great and some are really great but how can you actually use one to learn Linux, and what techniques do you use?

One of the problems with learning about a Linux system and its structure is that its just so massive. Particularly for someone not familiar with Unix or another similar system, and although there these days it is easy to get up and running – especially with the advent of really good package managers and lots on online tutorials. But what about the real nuts and bolts of Linux hacking? Where do you start?

This is where Linux From Scratch comes in this is a really interesting book that details hot to build your own Linux distribution. The writers have written this because they find the current distribution not customizable enough and as much as I agree that there could be things done I think for most uses a standard distribution is absolutely great. The real benefit from trying this is that you get a really good insight into the inner working of Linux as well as several major problems with installing like this (How do you compile a compiler without a compiler?). On the whole its very interesting however definitely not something I would put on a production machine, it takes a lot of work to build this and set it up – setting it up for a production environment would be even more difficult!

I shall be playing with this over the next couple of weeks, so I will keep you all informed.

Bazaar-GTK

Posted in General Development by andrew on the June 8th, 2008

Further to my last post about GUIS’s for Bazaar, there is a python-gtk GUI called bzr-gtk available which can be installed through macPorts with:

sudo port install bzr-gtk

This command will install all the dependencies into your /opt directory if you haven’t installed much python stuff it will take a while (it did for me!). It is important to note that for my install of macPorts for some reason my terminals $PATH variable wasn’t updated. This is the variable that controls where bash looks when you typse a command into the terminal. If typing sudo port install bzr-gtk gives you an error you can change this yourself by using a text editor to change the .profile text file in your home directory.

Since this is a system file you will probably have to change it via a text editor in the terminal. The line you are interested in is the export path=$PATH line, just change this to export PATH=$PATH:/opt/local/bin/ and you should be good to go.

If this is the first thing you are installing with macPorts this could take some time, for me there was a huge number of dependencies that were installed – remember this isn’t bzr-gtk isn’t a native mac app!

Once its installed correctly you can just go to the directory with your project in and from the terminal type:

olive-gtk

This loads up the interface using the X11 implementation included with OS X, from which you can drop back through revisions, view revision logs, push, pull, update, merge code and commit revisions.  Its even possible to initialize a new Bazaar project on the whole it seems like quite a nice interface to work with for bazaar although and aqua interface would be a whole lot nicer.  I did have some problems with pushing my project to my server and the error message that was returned was suitably useless, however it did make reviewing changes for commits much nicer to view.

I think it would be much nicer if someone did an aqua version of this GUI but it is worth the install if you really need a GUI!

Version Control Systems

Posted in General Development by andrew on the June 7th, 2008

There seems to be alot of talk in the dev community of Version Control Systems (VCS) at the moment. Since this seems to be quite a fashionable thing to talk about at the moment i figured i would give it a go.

Why do we need VCS’s?

A VCS is a piece of software that allows the management and revisions of data and files. This can be any kind of information by typically text files are the easiest to manage and the differences between versions can be more easily tracked.

In the case of developers these are great tools that we can use to control revisions of projects. Small teams and solo developers can benefit from being able to more cohesively control current source in a centralized location and being able to test experimental code with our worrying about ruining already functioning code.

Trunks of code can typically be produced, in other words when version 1.0 is released a new trunk for 1.1 can be started still allowing you to patch the old code for as long as you need. Most importantly this can also provide a great way to back-up each point in the code as you go along, typically just from a simple command in the terminal.

VCS’s for the mac?

Subversion

The most commonly seen VNC, and the one that comes as a default install with the Developer Tools is Subversion. Subversion has been around for a long time and was initially built to supersede CVS. It has a huge feature set and is run from in the terminal with the ’svn’ command. There are loads of great resources out there for learning Subversion (http://svnbook.red-bean.com) but basically there is one master copy of the source called the repository.

With regards to controlling and accessing this repository there is support with svn itself through the terminal - however if you prefer a graphical approach there is some support in xCode itself. Personally i don’t think xCode is very good at controlling your source management options. Luckily there are some third party apps out there to do this for you.

SvnX is a great tool for accessing and updating your repository it also allows multiple “check outs” and keeps a log of all your working copies. Its very easy to use and also quite well documented. Earlier this week the open beta for Versions came out. This looks a stunning piece of software for use with subversion making the whole process of working locally with the source code easy - although it looks like it will only be in open beta until july!.

Bazaar

If you have checked out any of my source code you will notice that i’m not using subversion on this site. i’m using Bazaar. Bazaar is a VCS built entirely in python. This is a relative upstart in the world of VCS’s however was developed in association with the Ubuntu project in order to allow easy update of packages.

Although not installed by default on OS X the install process is relatively straight forward. Bazaar doesn’t use a repository type system, instead this is what is know as a distributed system where there are multipe branches of a your source code which Bazaar will later merge if required. As far as i know at the moment there are no GUI’s for it either - so although its easier to set up and manage initially for someone who wants a GUI Subversion may be the better option. Whatever you decide to use VCS’s are important - even to the solo developer having the ability to drop back to the code or database you were using last week is priceless. Try them out and let me know what you think!

WWDC ‘08 Rumor Mill

Posted in OS X, Uncategorized by andrew on the June 4th, 2008

Another WWDC, another shed load of blog posts about what’s going to be announced. Is it just me that thinks a developer conference shouldn’t be used as a tool to announce new products? As much as i agree its exciting and interesting to see what apple have been working on recently i still think its not the place to be launching the next iPhone.

I have seen loads of blog posts today about the next major release of OS X being announced next week, as well as the next iPhone, other media devices, new hardware and everything else. Basically no one knows, all i am saying is lets at least wait until next tuesday before we get excited about things that haven’t been announced yet, lets also hope that next year the keynote can be for the developers who have traveled there as opposed to the media in the hall.

Web Development For The Developer

Posted in Web Development by andrew on the June 4th, 2008

Web development has always had similar goals as development across other platforms. Essentially what we are trying to do in both is deliver information to a user. Both require a large amount of creativity however this is different is each area of development, this is particularly interesting with regards to web development.

For web development this creative process is essentially split into two: The graphic design process, and the back-end process. For me at least this graphic design process has always been a problem and something that simple logic and programing won’t solve the choice of colours and position of an image on a page or how the end-users browser displays the final result.

In the design of this website this has been a problem, for any developer without these graphic design skills is it possible to entirely produce your own website. With the influx of tools such as Joomla! or Rapid Weaver how do we as developers, particularly the hobbyist, develop unique site to sell ourselves and give ourselves a unique presence on the web? Especially when all we want to use is Text Mate.

Developing the back-end is not the problem there are enough web frameworks and web enabled languages available for all of us to work with and create great information that we can show to the world, the problem is displaying all of this great stuff to everybody. How do we keep up aesthetically with everyone else? Do we have the time to write that great looking site on our own?

I am sure that you will all have figured out my own answers to these questions by noticing that i am using Word Press at the moment. As much as i want my whole site to be mine from scratch that dream is going to have to wait and be a work in progress. I think ultimately the answers to these questions are all if you can dedicate the time to testing and development then you can come up with these great looking sites, but don’t we all have some coding to do?