digging myself out of a hole

In recent weeks I have been depressed, suffering major ups and downs, avoiding house work, avoiding pretty much everything; Late nights and problems sleeping have followed – I have slowly started living in filth.
I have been doing some reading, some talking and sought professional help on the matter; by no means am I over it but just now I feel like a few things clicked. If I don’t do something soon I will ruin the rest of my life.
The past 5 years have not been great, I don’t feel like I have grown stronger as a person – just weaker. Well tonight I will do something about it.
There will be no more giving up, I am going to be the best that I can be. It will be a long hard climb but if I can take those first few steps I know I can go the whole way.

In recent weeks I have been depressed, suffering major ups and downs, avoiding house work, avoiding pretty much everything; Late nights and problems sleeping have followed – I have slowly started living in filth.

I have been doing some reading, some talking and sought professional help on the matter; by no means am I over it but just now I feel like a few things clicked. If I don’t do something soon I will ruin the rest of my life.

The past 5 years have not been great, I don’t feel like I have grown stronger as a person – just weaker. Well tonight I will do something about it.

There will be no more giving up, I am going to be the best that I can be. It will be a long hard climb but if I can take those first few steps I know I can go the whole way.

{0 comments - leave a comment!}

Am I A Nerd?

photo

These servers are going to be delivered by my client to my hosting provider at some point as toys, while they are both out I am using them to make my laptop screen sit higher :-)

And yes, that is my Magic Mouse and Wireless Keyboard. They work really nicely – I really like typing on the keyboard actually.

{2 comments}

The Great Didlix Move

In 7 hours team didlix will be leaving to do my house move. Hopefully life can return to normal next week :-)

{0 comments - leave a comment!}

Feel The Magic

apple-magic-mouse_2

Beautiful isn’t it? It’s also really good. Have been using mine all day now and can report the following:
  • It was easy to install
  • Getting mutli-touch working required the latest software updates
  • I had to turn right click on
  • It works really well
  • I’ve already gotten used to using it
  • I love it

Sadly the shop was out of New Wireless Keyboards or I would have got one of them too. Still something left to look forwards to then I guess.

{1 comment}

Validate URI’s, Check files exist on http and ftp with Ruby on Rails

During my Ruby education, I decided I wanted to create a model that would store feed urls. Feeds could be supplied by http or ftp.

I needed a good way to check that the url is valid and the file exists. Here are the results:

  protected
    def url_must_be_a_real_uri
      begin
        uri = URI.parse(url)
        if(uri.class == URI::Generic)
          errors.add(:url, 'should be a valid url')
        end
      rescue URI::InvalidURIError
        errors.add(:url, 'should be a valid url')
      end
    end

    def url_must_open
        file = URI.parse(url).open
    end

The second method, url_must_open needs a bit more work, right now it throws exceptions if the file does not exist. It’s late and I’ve been drinking so I can’t be bothered to add a begin/rescue block :-)

{1 comment}

Some reasons why I am learning to love Ruby On Rails

I have been programming using the Zend Framework for some time, one thing I have always been aware of is that it seems to be trying to be very much like Rails. Both are MVC so there are going to be similarities but with each new version of the Zend Framework we get closer to what Rails has.

At least that’s what I thought and confirmed very quickly when I started learning Rails yesterday evening.

Rails gives you alot more out of the box than Zend does, it had been a while since I used a new version of Zend so I decided to start from scratch on my most recent project. I found myself very quickly following the getting started guide where it got me to do a bunch of stuff (like add the autoloader) that I just felt should already be there.

If you use Zend_Tool to build a Zend Framework project but don’t turn on the autoloader I want to hear from you.

In rails, the first thing I did was run one command on the command line which generated me a database table, built some controllers and models. I got the functionality to view, add, edit and delete records straight away. In less than a minute.

The Zend Framework is just not this quick yet, and people will probably tell me that no mature rails developer actually uses the scaffolding because nothing is ever as simple as the code you get; But in the case of the project i am working on now, I spent the better part of a day in Zend writing the most basic of forms to insert data into a table (no joins, nothing clever).

Another feature I love in Ruby, is validation in the models, which carrys through to anything that manipulates the data (via the model of course).

Have a look at how simple the code is, the Zend Framework could only dream of it being this simple right now:

class Product < ActiveRecord::Base
  protected
    def price_must_be_at_least_a_penny
      errors.add(:price, 'should be at least 0.01') if price.nil? || price < 0.01
    end

  validates_numericality_of :price
  validate :price_must_be_at_least_a_penny
  validates_presence_of :title, :description, :image_url
  validates_uniqueness_of :title
  validates_format_of :image_url,
                      :with	=> %r{\.(gif|jpg|png)$}i,
                      :message => 'must be a URL for GIF, JPG ' + 'or PNG image.'
end
{1 comment}

Zend Framework Code Generator

I released this little script for the Zend Framework today that will auto-magically generate your database models for you. This is useful if you have an existing database.

{0 comments - leave a comment!}

Designing a Games Room

I am moving from a 1 bedroom flat to a 3 bedroom house. The house also includes a reception room that I intend to turn into a games room.

Here are some of the things I could have it.

Yes that is 2 Xbox 360’s and 2 Televisions

{6 comments}

Crash and Burn

Last night I got in with every intention of working, well I managed to eat a takeaway and watch an episode of Stargate Atlantis before my head hit the pillow and I was gone. Awaking briefly before sleeping through until 7am.

I have to admit I like laying here in bed in the early hours with a cup of coffee, some music and a Macbook. It’s a rare treat for a night owl.

{0 comments - leave a comment!}

One partner for all my life

Disclaimer: The following is discussion material in response to a post I read elsewhere. I am not saying it is right, that it works, just sparking a topic of discussion.  More than anything I believe in sticking to /What Works For You/

A lot of people are getting married, some are doing their first, second, third, even fourth wedding. Call me sceptical but if you failed at making the life long commitment the first time why would you try again?

The way I see it is that the future is uncertain, everything will change, climate, fashion, economy, work, immigration, biological clock, tastes, interests, types of people you are attracted to and so on.

If we really can not see into the future how do we know we are with “The One”?

I think it makes more sense to live life in a way where we do not know the future, I don’t think a life long commitment to one person makes sense.

I have been reading up on polyamorous relationships, Wikipedia says:

Polyamory (from Greek πολυ [poly, meaning many or several] and Latin amor [love]) is the practice, desire, or acceptance of having more than one intimate relationship at a time with the consent of everyone involved.

The idea is that a relationship may not just be 2 people, there could be three or four in the main relationship, that said people are not limited to those in the “primary” relationship, people can still see others, sometimes called Betas outside of that.

It’s not just about sex, it is more like having a large family, you still make a commitment to each other and the future but you are not limited by this.

If everyone is comfortable with it, then why not? And does it make you better equipped to cope with change in the future?

{1 comment}