Internet Explorer is Stupid
Posted on
This is retarded. I’m going to complain for a minute here. To be valid XHTML1.1, you need to make your content type application/xhtml+xml. By default the content type is text/html which isn’t valid XHTML1.1. In Internet Explorer, it doesn't know what to do with the application/xhtml+xml content type and asks the user to download it. WHY!? That is so dumb. Why does Microsoft refuse to listen to web standards? I do not understand. There is an easy work around for this, but that is dumb that this has to be done.
While we’re complaining, why doesn’t IE6 not display PNGs when it can? You can hack it to display them (with this clever script). It's so annoying. This is why samsoffes.com will not be supporting IE6. I give up.
Update: I can’t get it to validate now. I need to do some work on that little piece of code.
Sidebar Widgets
Posted on
Today I've been messing with my sidebar a little more. I really like the new Digg Widgets, but I was having trouble styling them the way I wanted.
Solution: write my own. I figured why not. I've been messing with PHP5's xml classes and thought it would be fun. (Notice http://samsoffes.com/rss written entirely in PHP5's SimpleXML class.) After struggling to open an external file with file_get_contents(), I resorted to using cURL...
It works well. I had some problems grabbing the digg count and had to use xpath(). The xpath() method of the SimpleXML class always returns an array. This is very annoying when you would expect it not to return an array if you only get one result.
The OO Page
Posted on
I love objects. Programming in Cocoa has really made me understand the power of OO (object oriented) programming. I‘ll take a minute to explain objects and MVC for a minute. (If you are familiar with objects, move to the next paragraph.) An object is a variable that has multiple variables and functions (called methods when inside an object) inside it and is an instance of a class. A class is some code that tell the object what it can do. One very popular approach to using objects (or just programming in general) is the MVC method (model, view, controller). Each of the elements of a MVC are usually objects too.
In my simple web site, I use CodeIgniter, which is an open-source PHP framework that makes OO PHP easier and quicker, to run things. I have created several libraries (or classes) to take more work from me and moving it to my libraries. The ones I use the most are Page, Sidebar, and Widget. For the first time in PHP, I have used multiple instances of the same class on the same page. In CodeIgniter, this isn't done that often because you rarely have to, but I decided it would be fun, so I am.
My Page object is my page. It creates my <head> tag, page template, and assembles the rest of my views. One of it‘s views is the sidebar of course. The sidebar is also an object that contains an array (think of it as a list if you don‘ know what it is) of widgets which are also objects. After adding all of my widgets to my sidebar, the page objects asks for the final HTML version of it when it‘s ready to display the page. Inside each sidebar widget, there are several methods for manipulating how it looks and acts too.
Coming Soon
Posted on
samsoffes.com is gone right now. It will be back later. I‘m really excited about what this will be. I plan for pics from my everyday use of computers and little things that I run into that make me laugh or are entertaining. Most of my musing have been in the form of emails to my friend in the last year or two. Putting this site back saves them lots of email, give me something to do, and will give you something pretty to look at.
I also plan for a portfolio of all my work. From Cocoa, PHP, MySQL, XHTML, CSS, Javascript, AJAX, Quartz Composer, music, Linux experiments, and other random stuff, I got a lot to put there. I‘m real excited to get all of this up and looking really pretty.
The reason for the delay in a real site is that I am real busy! Between work, having a social life, all my random projects, my two LLCs, and freelance web stuff, when do I have time to make myself a site? It‘s coming in all of it‘s XHTML, CSS and AJAX goodness. I promise.
I got an iPhone
Posted on
It is so amazing. I love getting email on my phone. CoverFlow in the iPod is quite possibly the most amazing thing I have ever seen. The keyboard is also really nice. It's really easy to type on. Everything you've seen in the videos is as easy as they say it is. I really love this phone. It is so much more than just a phone. I am actually typing this note on my iPhone. I am using the real facebook too, I don't have too use that mobile version or anything. Buy an iPhone, you won't regret it.