soledad penadés
repeat 4[fd 100 rt 90]

Archive for the ‘mac os x’ Category

20060122 Subversion-ing with Mac and Textdrive

I wanted to have a good repository of my code projects just in case something bad happens. Searching info here and there, I found the following pages useful for setting up my own repository in textdrive, and also installing and configuring the appropiate software on my mac.

So first thing was creating the repository, from the webmin administration tool (in textdrive, of course)

Then I found this cool page by Josh Buhler, explaining how to install all the svn tools for Mac Os X. Once all is instaled, I jumped to this textdrive forum thread on using subversion on TXD, which is a bit old but gave me the idea of how to refer to the svn paths. I thought it was something like svn://…. but it was http://… (no wonder why it gave me a timeout each time I tried to access it!).

With it, I could go to the terminal and make the first import and put the first version in my repository! I did it as it is explained in this good article at macdevcenter: Making the Jump to Subversion. Basically the most important step here is making a copy of your source code before importing to the repository, then import it, rename the first folder as Myfolder_beforeSVN, and check it out again in the MyFolder folder - so you get the contents again from the repository, but this time they are all marked like subversionized, and if you look carefully, you'll note their icon exhibits a little check box - to make clear they are under the subversion domain and they are up to date.

Subversion'ized file in mac os X

If you are a bit curious and run ls -la in your code folder, you'll note there's a little new (and hidden) folder called .svn which contains something like this:

drwxr-xr-x    12 sole  sole    408 Jan 22 18:57 .drwxr-xr-x   119 sole  sole   4046 Jan 22 18:57 ..-r--r--r--     1 sole  sole    118 Jan 22 18:57 README.txt-r--r--r--     1 sole  sole     78 Jan 22 18:57 dir-wcprops-r--r--r--     1 sole  sole      0 Jan 22 18:57 empty-file-r--r--r--     1 sole  sole  31254 Jan 22 18:57 entries-r--r--r--     1 sole  sole      2 Jan 22 18:57 formatdrwxr-xr-x   114 sole  sole   3876 Jan 22 18:57 prop-basedrwxr-xr-x   114 sole  sole   3876 Jan 22 18:57 propsdrwxr-xr-x   114 sole  sole   3876 Jan 22 18:57 text-basedrwxr-xr-x     6 sole  sole    204 Jan 22 18:57 tmpdrwxr-xr-x   114 sole  sole   3876 Jan 22 18:57 wcprops

 

I think that it is where subversion holds all the info for the files and so on, like the CVS folders which are created in each folder when you use CVS.

And that's all! Now there's no excuse for not being a bit less messy when it comes to having backups and a clean code. Hope you're lucky with it all…

20051218 Firefox 1.5 optimized for your g4

This is supercool (although a more appropiate word would be superfast): a G4 optimized build of firefox 1.5 for your little g4 computers, like powerbooks or ibooks. I would say it's almost as fast as safari.

Note: when installed it shows itself as DeerPark, as the author says the only versions allowed to be called Firefox are the official ones. So it's not an error.

Go download it now!

20051122 RadRails: a nice IDE for rubyonrails

I started developing code with subethaedit. It's not bad, considering that the personal, non commercial edition is free, but somehow the lack of a tree with all the files and its folders (like visual studio, eclipse, etc) annoys me.

So I started with skEdit, which is quite nice (although I really *hate* to have to close all the files when it has to refresh. It's painful), but it's not free and the demo version is limited to 25 days only. A big problem I found is that it can't syntax highlight ruby (.rb) files. So it's as useless as coding with textpad.

Then I finally found RadRails. It's based on Eclipse, but it's well adapted and very easy to "install" (i.e., it has no installation, you just drag and drop it to the applications folder, at least on Mac Os X <3 <3). It has nice syntax highlighting and the files/folder tree feature, and no need to close all files to refresh the tree, so by the moment it's more than enough for my needs. Also, I haven't tested it, but the page states that it works on linux and windows as well. It doesn't eat resources as eclipse does. I think it's worth a try.

I'd like to have a look at TextMate but for some weird reason I wrongly downloaded an expired version from the wrong page and it has decided that my test license has expired and never allows me to have a test with a new version, downloaded from their original web. I promise I never tried to crack it, just downloaded it from a wrong page :-(
Shame on the author for not taking care of the distribution of the program, and not appearing on the first place on google searchs!

Maybe one day I'll write them and ask. If I like it (I liked it after seeing the video [link to a MOV file]) maybe I would buy it. Or not: let's see how I work with radrails…

20051116 Fighting against ruby, rails, gems, php and apache on mac os x (and maybe something else I forget)

Last time I did some tests with rubyonrails, I made it over a pc box. This time I decided to give another try on installing everything on my laptop, as it's easier to start and stop ruby applications from my own console and not by running a VNC viewer and then accessing the windows command line, etc.

I must recognize that my previous attempts on installing rubyonrails, apache2 or php5 on this computer left the web thingie completely unusable here. Even the apache server which came installed with tiger by default was not working anymore. Not to mention my ridiculous achievement: install all of rubyonrails, see it worked and do some simple scaffoldings and then destroy it again by trying to not to use webrick and use apache2 instead (which is what led to not to have even normal apache running).

But maybe today was my day and for some strange stars and planets alignment I tried again and finally got everything working. So, just in case it's useful for someone:

I started here, on How To Install on OS X Tiger. Then on point 3 I switched and followed the instructions at Darwin Ports, untill I got rails installed.

Then I came back to How To Install on OS X Tiger, and then to mysql website to get latest installable version of mysql for mac Os. They have a very nice installation program which will do everything for you.

Once that was done, I created the ruby mysql binding with sudo gem install mysql — –with-mysql-dir=/usr/local/mysql, so ruby can communicate with the mysql database. (Some tutorials say you need to put the whole /usr/local/mysql 5.5.0… directory… but that's not exactly true as the mysql installation procedure creates a symbolic link called /usr/local/mysql)

After that I needed a way of launching the applications and the ports and so on. On Rails On Osx I found there was an application framework called Locomotive which could help me in doing that. In fact, I think it has everything that I neded and if I had find it before I shouldn't have had to do the points above, but hey that's a way of learning.

Installed that one, launched it (Applications -> Locomotive folder -> Locomotive) and then created a simple application just for testing (click the + sign, obvious!) and started it. I went to the browser and typed in http://localhost:3000/ and yeeeeeha! it was working: Congratulations, you've put Ruby on Rails!

But I hadn't had enough… now was time for … apache2 and php5! Luckily I found a very nice article that explained everything very clearly, at phpmac: Building and Installing Apache 2 and PHP 5.0.5 on Mac OS X 10.4 Tiger. The only thing that was a bit tricky was the download locations for the source code files, both for apache and php. as sometimes the mirrors weren't working at all. I presume one can simply download the files manually and uncompress them where needed, without having to use curl for getting them.

In any case it worked like a charm. After several long minutes compiling and making configurations and installs (still don't get how people loves to rebuild and recompile the kernel just for the sake of doing it), seems like I have managed to get both running!

Needless to say, I have no words for this. I'm deeply impressed :D

UPDATE 7 december 2005: this tutorial seems to be interesting too: how to set apache2 to be the default mac os X httpd server.

20050810 Week's simplest program!

I was just wondering… what will be the size of the data types on this computer? (Must recognize I hadn't done any research before wondering, then I would have discovered that mac's follow IEEE754 standard, as windowss -or that they say-).

So there we go with it:

#include  using namespace std;
int main (int argc, char * const argv[]) {
// insert code here...
cout << "Type sizes" << endl;
cout << "BOOL " << sizeof(bool) << endl;
cout << "CHAR " << sizeof(char) << endl;
cout << "INT " << sizeof(int) << endl;
cout << "FLOAT " << sizeof(float) << endl;
cout << "DOUBLE " << sizeof(double) << endl;
cout << "INT* " << sizeof(int*) << endl;
return 0;
}

And what does it return?

Type sizes BOOL 4 CHAR 1 INT 4 FLOAT 4 DOUBLE 8 INT* 4

Bool types use 4 bytes!?! WTF?!