Using Web Inspector in Safari 3

I am really digging Safari 3. One of the cool features in Safari 3 is web inspector. Web inspector is a tool mainly for web developers to use in debugging web pages. It is basically Firebug for Safari.

Web inspector is not new. It has been available for a while in Safari 2. But it has been redesigned for Safari 3. Here is a screenshot of it.

The tricky part is that you need to enable it in order to use it. First, if you are using Tiger, you need to get 10.4.11 in order to make sure you have Safari 3. If you are using Leopard, you already have Safari 3. Once you have it you need to be able to use command line in Terminal. To enable Web inspector, open up Terminal and type the followwing command.

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

Now you have it enabled. To use it, restart Safari and right click on any element on a web page and select Inspect Element. This will open up Web inspector.

I won’t take the time here to give a thorough review of everything it does, but play around with it and test it out. It lets you view the underlying code of your page along with the CSS applied to each element in the correct cascade order of the properties. It also gives you an error view and a network view. The network view shows you how each item on the page downloaded and how long it took. There is also an element inspector that lets you view each element that was downloaded that can be very useful for developers.

I also have to comment on how fast Safari 3 is. I noticed while using it that it is much faster than Firefox. It was enough to get me to switch to Safari from Firefox while using a web application. It’s that much faster.

So there you go. If you aren’t using Safari yet, I just gave you two good reasons to check it out.


Safari 3 for Tiger is Now Out

You may or may not know that Apple released Safari 3 with Leopard. If you are like me, you were wondering when it was coming out for non-Leopard Mac-users, or if they were going to release it at all. Well, today is the day. Safari 3 is now available on Tiger. Read about it here.

To get Safari, you need to get Mac OS 10.4.11 which is out today. You can either get it through automatic upgrades or install it manually. It requires a restart if you were wondering. It appears to be worth it. I haven’t installed it yet, but from what I hear, it is much improved over the previous versions.

What are the improvements? Surfin’ Safari has a list of ten new things in Safari 3. The biggest performance improvements in my opinion are the enhanced rich text editing, faster javascript and DOM and faster page loading. Chris in my office installed Safari 3  already and noticed those 3 things right away. Hopefully, enhanced rich text editing means that I can use Wordpress, which uses TinyMCE for editing, in Safari now. I also think the developer tools will be useful. I can’t wait to try it out!


Installing PHP 5 on Mac OS X

Okay, so I have been running PHP 4 locally on my Mac OS 10.4, but I recently needed to upgrade to PHP 5. In addition, PHP 4 will no longer be supported after the end of this year. The installation instructions are the same as for PHP 4, which is not a big deal. I also installed libcurl, which is not included by default for some reason.

Why am I posting this here then? So I can reference it, whenever I need to recompile PHP again. I am installing new libs all the time, it seems like, so it helps to know what I have done each time so I can do it again the next time. This is the third or fourth time I have done this, so I won’t go into that much detail. If you need more details, look at my other posts.

For step one, download and unzip PHP 5. Then, open the folder and run configure, make and sudo make intall, like this.

./configure --prefix=/usr/local/apache2/php \
--with-curl=/usr/local/src/curl-7.17.1 \
--with-zlib-dir=/usr/local/lib \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--with-gd --with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
make
sudo make install

Remember to change your file paths, if they are different than mine. Restart Apache, and you’re done!


Apache 2.2 Included with Leopard

So here’s one more reason to upgrade to Leopard, especially if you are a developer. Leopard reportedly comes with Apache 2.2 installed. A co-worker of mine got it yesterday and was able to confirm this. This is the first I have heard on what software packages are installed with Leopard other than Ruby.

This is great news for developers. Mac OS 10.4 only comes with Apache 1.3 installed. You can upgrade to Apache 2 like I did by installing it yourself, but this way you have to manually stop and start Apache. As if I already needed a reason to upgrade, now I have an even better one. Good job on this Leopard guys!


Leopard Does What Tiger Took Six Weeks to Do

Apple today announced that they have sold two million copies of Leopard since it went on sale on this past Friday. By comparison, Tiger took six weeks to sell 2 million copies. To me, this shows how much Apple’s marketshare has grown.


Leopard Release Day

You may have heard that Leopard for Mac OS X is due to be released Friday, October 26th at 6 PM. Apple sent out e-mails to their subscribers today announcing retail events across the country. The events are taking place between 6PM and 10PM on Friday.

According to the e-mail, Apple Store employees will be doing live demos of Leopard and giving away free t-shirts to the first 500 people to show up. My local store is in Knoxville, TN at the West Town Mall. I’m not sure what all will be going on, but I want a free Apple t-shirt, so I will be there!

Update - 10/26/07: Just got back from the Apple Store Leopard event, and I got my free t-shirt. There was a ton of people waiting in line. I was amazed that many people could all fit in the store. I have to admit I was impressed with Leopard. So much so, that I will probably upgrade. I’m not sure when though. Looks like I will be adding Leopard to my Christmas list!


After trying to install Django on my Mac and failing, I have decided to try and upgrade my local version of Apache 1.3 to version 2.0. If you are developing on the Mac OS, you may know that Mac OS 10.4 comes with Apache installed on it. While this is one of the great things about the Mac OS, what’s not great is that it is out of date. For most cases when you are developing locally on the Mac, Apache 1.3 is fine. But, you may find that with Apache 1.3 installed, you will not be able to run certain software.

The solution to this is to upgrade to Apache 2.0. I admit that I was reluctant to do this myself, but I found a tutorial from Apple that convinced me to try it. Apache 2.0.61 is the current stable version of the 2.0 series, and that is the version I decided to go with. I downloaded the package and extracted it into /usr/local/src using the following commands.

curl -O http://www.eng.lsu.edu/mirrors/apache/httpd/httpd-2.0.61.tar.gz
tar xvfz httpd-2.0.61.tar.gz
cd httpd-2.0.61
export ac_cv_func_poll=no

Make the following changes to srclib/apr/network_io/unix/sendrecv.c in the apr_socket_send function:

Change:

do {
rv = write(sock->socketdes, buf, (*len));
} while (rv == -1 && errno == EINTR);

To:

try_write: do {
rv = write(sock->socketdes, buf, (*len));
} while (rv == -1 && errno == EINTR);

(That is, add “try_write:” right before the “do {”.)

Replace the following else clause (that is, delete these five lines):

else {
do {
rv = write(sock->socketdes, buf, (*len));
} while (rv == -1 && errno == EINTR);
}

with these two lines:

else
goto try_write;

Run configure, run make, and then run sudo make install to set up Apache 2.0 for installation:

./configure --enable-mods-shared=most --enable-ssl \
--with-mpm=worker --without-berkeley-db
make
sudo make install

Create a directory for mod_dav.h, and copy the module to it using the following Terminal commands:

cd /usr/local/apache2
mkdir -p modules/dav/main
cp include/mod_dav.h modules/dav/main/

Once you have it installed, run the following command to start Apache.

sudo /usr/local/apache2/bin/apachectl start

You also need to run the following commands to start Apache 2.0 on each reboot.

sudo -s
mkdir /Library/StartupItems # This directory might already exist
ditto /System/Library/StartupItems/Apache /Library/StartupItems/Apache2
mv /Library/StartupItems/Apache2/Apache /Library/StartupItems/Apache2/Apache2
defaults write /Library/StartupItems/Apache2/StartupParameters Provides -array "Apache2"
perl -p -i -e 's/WEBSERVER/APACHE2/g' /Library/StartupItems/Apache2/Apache2
echo "APACHE2=-YES-" >> /etc/hostconfig

I have a problem now in that turning off and on web sharing in the system preferences will not stop and start Apache 2.0. I am at a loss on how to make this work. I am also unsure whether or not Apache 2.0 will start on reboot or whether I have to start it manually.

Subversion is rather easy to install. I used the tutorial found at hivelogic along with the same one I used to install Apache 2.0. Subversion appears to be installed and working but I haven’t really tested it in depth.

Once I had Apache 2.0 installed, I wanted to be able to access it when I go to http://localhost/ and access the files in /Library/Webserver/Documents. You need to stop Apache and then edit the http.conf file found in /usr/local/apache2/conf/httpd.conf. Then you need to change the DocumentRoot and the Directory.

DocumentRoot "/Library/Webserver/Documents"
<Directory "/Library/Webserver/Documents">

Now you can restart Apache and you should be able to access Apache 2.0 on http://localhost/. However, I found that PHP was no longer working because I had not yet installed it for Apache 2.0. Don’t worry though all you have to do is recompile it. Here are the steps I used.

If you already have the php files on your machine, go into that directory.

cd /usr/local/src/php-4.4.7

If not download it and unpack it again and then go into the directory you just created. Now you need to create the directory to install PHP into.

sudo mkdir /apache2/php

Then all you need to do is configure it with the right options. I used the following commands which adds support for the GD graphics library, in addition to mysql.

./configure --prefix=/usr/local/apache2/php \
--with-zlib-dir=/usr/local/lib \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--with-gd --with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs
make
sudo make install

I ran into problems doing this. I kept getting the error from mysql.

dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib

I fixed this by copying the file into that path using the following commands.

cd /usr/local/mysql/lib
mkdir mysql
cp libmysqlclient.15.dylib mysql/libmysqlclient.15.dylib

I ran configure, make, sudo make install again, and it worked. An optional step you may want to take is to create a php.ini file. I created the php.ini file with this command.

sudo cp php.ini-dist /apache2/php/lib/php.ini

Now we need to edit the http.conf again so that PHP will run in Apache. Add the following lines in the appropriate sections.

LoadModule php4_module modules/libphp4.so
DirectoryIndex index.html index.php
AddType application/x-httpd-php .php

Now restart Apache 2.0. Once I did that it worked. I now have Apache 2.0, PHP 4.4.7 and Subversion 1.3 installed locally on my Mac.

Disclaimer: Your mileage may vary. This is the compilation of a lot of work over a period of several days. I have tried to recount the steps I used as closely as possible. Use at your own risk. Here are some tutorials you may want to look at if you get stuck. Good luck.

Building and Installing Apache 2.2.4 and PHP 5.1.4 on Mac OS X 10.4.6
Apache 2.0 on Unix systems


Microsoft Office for Mac 2008

As the end of the year approaches, the release of Mac Office 2008 is getting closer. According to this post on the Office for Mac blog, it is currently projected for a release date of January 15, 2008. Here are some good sites to read up on Office 2008 until then, Microsoft Office for Mac 2008, Mac Mojo - the Office for Mac Team Blog and Art of Office. Microsoft is also running a special right now where if you buy Mac Office 2004 you will be able to get Office 2008 for only $10 when it arrives.


Mac OS X Leopard

It’s official. Mac OS X Leopard will make it’s debut on October 26th at 6PM. The price is $129 for single user and $199 for the five-user family pack. You can pre-order it now from Apple to recieve it when it is released.

Apple is touting over 300 new features in this release. Personally, I think I will wait before I plunk down the cash for an OS upgrade. If there is something in there that I can’t resist, then I will do it. But until then, I am pretty happy with Mac OS 10.4.


Thoughts on Pixelmator 1.0

If you are a Mac user that is into design or editing images on your Mac, you may have heard of Pixelmator. Pixelmator is a layers-based image editor that uses Apple’s Core Image. It is even compatible with Photoshop in that it can open and save PSD files.

Here are my main likes and dislikes about the product so far.

Positives:

  • Frequent updates
  • Blog
  • Mailing list
  • Mac OS X look and feel
  • Low price
  • Free 30 day demo
  • Manual PDF
  • Open Source

Negatives:

  • No history panel
  • Demo leaves watermark
  • Export options weak
  • No view/zoom indicators
  • No info panel for tools
  • No rulers

Likes

One of the things I like about it is their marketing. They have a blog and an e-mail list for communicating with customers. They have already updated the product since I downloaded it, and through the blog, they are promising updates and additional features.

I also like that it integrates so well with the Mac OS X, including the beautiful look and feel. It also open source, being based on the Image Magick image libraries.

Dislikes

I have a lot of dislikes as well, and I am hoping they add these features soon. The main thing I find lacking is the several features that Photoshop has, that I use often, that Pixelmator lacks. There is no history panel, no info panel, no rulers and the export dialog is really weak. There is also no zoom indicator that shows you how far in or out you are when you are viewing a document. It is due to these problems that I am not able to currently use this as a Photoshop replacement.

I need a good image editor on my Mac without paying bucketloads of money. Since the 30 day demo will eventually expire and the demo leaves watermarks, I went ahead and bought the full version of Pixelmator, in spite of it’s short comings compared to Photoshop.

I believe that the creators have good things in store for it and will continue to improve. They are also taking suggestions, so if it lacks a feature, tell them what you want to see. Since I am paying, I am going to do that and hopefully they will add the features I want.


« Previous Entries |

Most Popular Posts

Pages

Twitter Updates

Profiles