Archive

Archive for the ‘web developing’ Category

Speak by DHH

July 28th, 2008 No comments

 Just want to share this great presentation from DHH about "the secret of making money online"

Check it out: http://www.omnisio.com/startupschool08/david-heinemeier-hansson-at-startup-school-08

Autoloading objects in PHP

June 11th, 2008 No comments

 When doing OOP in PHP it can be a pain to include all the different class files. The code becomes really ugly with lots of require_once() function calls and you risk to include classes that are never used.

This is were object autoloading comes in handy. In PHP 5 it is now possible to define a functions called __autoload() which takes the name of the class as parameter. The function will be called when trying to use a class or an interface that has not been defined yet. The function could look like this

function __autoload($class_name){
require_once('/classes/'.$class_name.'.php');
}
$obj = new MyClass(); //will load MyClass from /classes/myclass.php
MyClass::getSomething() //will load MyClass from /classes/myclass.php

JAOO 2008

April 3rd, 2008 2 comments

Thursday and Wednesday I attended the JAOO conference in Copenhagen. It was a pure Ruby conference with lots of exiting speakers, such as "Matz", Dave Thomas and Michael Koziarski. Unfortunately DHH wasn’t there. I don’t know why because it would have been very obvious, but there were some other guys from the Rails core team. Some of the most interesting speaks was about:

  • Hobo – an extension for Ruby on Rails which makes prototype web developing extremely easy and quick. I’m looking forward to try this framework, especially their DRYML (Don’t Repeat Yourselves Markup Language) which enables the view to be simple and aesthetic.
  • REST – Stefan Tilkov made a nice presentation about REST and how to make your Rails app RESTful.
  • Metaprogramming – Dave Thomas had a good talk where he explained the "self" concept in Ruby.

 JAOO is really well organized and the speaks are at a high standard. Next conference is in Oslo and it is also a Ruby Fools conference. Check out the future events at www.jaoo.dk

Categories: ruby, web developing Tags: , , ,

GD Library with PHP on Leopard

March 8th, 2008 2 comments

After having spent a few hours trying to get an image uploading script to work in php on my mac, I found out that the GD Library is not pre-installed with PHP. Why is that? I thought that the GD lib was a standard module and I know it is installed in the XAMPP package for windows. I have not installed the lib yet, but I found this page which explains a how-to, but by looking at the comments it seems that it is not as simple as it should be. People are really having dififculties getting it to work. I will try to install it when I have some more time and post my result here.

Upatune.com

March 5th, 2008 No comments

I’m now official member of the upatune crew. Upatune.com is a community site where musicians can license their music and earn money when people download or stream their music. Upatune.com will be launched in the near future. Check out more info and subscribe to the newsletter on upatune.com

 

Categories: upatune, web developing Tags:

Base-tag-href

March 2nd, 2008 2 comments

 I was pretty confused about the <base /> tag in HTML. If your base tag look like this:

<base href="http://somedomain.com" />

and your link looks like this:

<a href="page1.html">page1</a>

your link would point to http://somedomain.com/page1.html

If your base tag looked like:

 <base href="http://somedomain.com/folder" /> *whithout a trailing slash*

your link would still point to http://somedomain.com/page1.html

If you add the slash -> <base href="http://somedomain.com/folder/" />

your link would now point to http://somedomain.com/folder/page1.html

Now, as I can see it. If you add a "/" in front of your link 

<a href="/page1.html">page1</a>

and your base still looks like

<base href="http://somedomain.com/folder/" />

The link would point to http://somedomain.com/page1.html ignoring the /folder/

 This page http://www.drostdesigns.com/base-href-tag/ tells people always to add a "/" in front of all the link, but then you are not able to put subdirectories in your base tag.

This page http://www.cs.tut.fi/~jkorpela/HTML3.2/5.7.html makes an example without the "/" in the link.

It makes more sense to me, not to add the "/" in front of all the links, making it easy to change the base href to whatever you want, but maybe I have missed something.

 

Categories: web developing Tags: ,