Facebook security has changed and they’ve said nothing

IMPORTANT NOTE : FB has changed and said nothing. Take a look at your URL (top box on your screen.) If you see “http” or just “www” instead of “https” you DO NOT have a secure session & can be hacked. Go to Account Settings – Account Security – click Change. Check box (secure browsing), click Save. FB has automatically set it on the non-secure setting! Do everyone a huge favour, copy & re-post

 

Are you agile or just plain lazy?

Agile development has become a buzz word intended to remove much of the problems of traditional software development. However its not easy to actually achieve (in practice). And it is with this thought that I recently realised I’d hired a person who talked up agile but in fact used it as a means to be lazy. If you’d like to avoid this mistake, read on.
Continue reading

Rails selection lists

Problem: I’ve got the need to have a list of options presented in a drop down list but I really don’t mind them being hard coded somewhere (if I did I’d stuff them in a database table).

Fix: Easy I can add an array of arrays to my model file and them pull them through to the view. In each sub-array the first element in the name displayed, the second is that submitted with the request.

Example: In the model for my bookings I add booking_status

class Booking < ActiveRecord::Base

  BOOKING_STATUS = [
    ['booked', 'booked'],
    ['request', 'request'],
    ['pending', 'pending'],
    ['approved', 'approved'],
    ['not-approved', 'not_approved'],
    ['other', 'other'] ]

end

In the view I can then include a selection tag which uses each of these items

<%= f.select :status, Booking::BOOKING_STATUS %>

Rails rapid prototyping – partials

Rails script generators enable true prototyping from the command line. The simplicity of being able to generate a complete working application within a few commands is wonderful. However I often find that I’m spending time to ensure some very simple basics are better than the out of the box offering.

Yes I know I prototyping, yes I know I’m going to through it away at the end of the day but still there is no need for not making effective use of partials in forms.

Partials within forms makes sure functionality is rapidly updated in both the new and edit actions.

So typically I like to convert:

<h1>Editing booking</h1>

<% form_for(@booking) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :event_id %><br />
    <%= f.text_field :event_id %>
  </p>
  <p>
    <%= f.label :user_id %><br />
    <%= f.text_field :user_id %>
  </p>
  <p>
    <%= f.label :status %><br />
    <%= f.text_field :status %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

to something which makes much more sense like:

<h1>Editing booking</h1>

<% form_for(@booking) do |f| %>
  <%= render :partial => 'form', :locals => { :f => f } %>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

I’d encourage you to do the same and see how it saves you one more piece of hassle. And of course if your using text mate remember ctrl+shift+H will create the partial for you.

My Setup

I was speaking with a good friend the other day who pointed me to http://usesthis.com/. A simple idea: talk to the big players in the now & future space of the software industry and get some insight on who, how they do what they do.

I good ideas deserves copying … And so here is my background on the hardware, software and future desires:

The Hardware:

I recently upgraded to a 15″ MacBook Pro - it works great and doesn’t overheat unlike the baby mac I previously had. I used to use a Lenovo T61 – ugly beast but its served me well and worked hard. When I’m near my desk I connected to a 500GB segate drive, 24″ IIyama display and a overpriced but good mighty mouse.

Also at home I like to listen to music from my old Project Debut II turntable and Mission 701 speakers. I love my vinyl even if I have to constantly get up to flip it over. And for pictures I’ve a second hand Canon 40D. Its not that fancy but very robust – I’ve broken far too many digital cameras so I appreciate its metal chasis. Speaking of which I had to succumb to a marware condom for my iPhone for the same reason.

The Software:

Most of the day to day grind involves Chrome, TextMate and the terminal. Our office has moved very successfully to Google Apps for domains so this frees me from Outlook. I use Aptana for some development work, Tweetdeck to keep up with the world and then theres XCode, Skype, Picasa, Axure, Excel & iTunes. On the server side I’m a big fan of Ubuntu but also resort to Redhat on production environments. In these places its vi, bash, mysql, apache, rails, php & subversion.

What would be the dream setup?

I actually think I’m pretty lucky already. Not to much to add, a QNAP media server and playstation 3 would ease the burden of course and a SSD hard drive would make things move faster – always a necessity. Oh and a Fonera_2.0 router, currently on a bogo cheap thing that needs to be regularly rebooted.

Ideally I’d have a moogle device which would be some kind of google for the mind – it would index the stuff I can’t and do forget every day, oh and can it do the research and the work too please.

Apache – Name Virtual Host errors

For some time now apache has been bugging me that there is a configuration issue with my virtual hosts, so I decided to find out what the issue was and try to resolve it. As it happens the fix was easy but not well documented.
Issue:
[warn] NameVirtualHost *:80 has no VirtualHosts
Resolution:
You can resolve this by ensuring that you virtual hosts are configured correctly. To do this you should have a NameVirtualHost for each of your ports and then be using ServerName within each virtualhost. By configuring apache this way you allow it to correctly interpret requests for different virtual hosts on the same IP Address.
Example:
In my apache2.conf file I have the following declaration
NameVirtualHost *:80
And then each of the virtual hosts is configured:
<VirtualHost *:80>
RailsEnv beta
ServerName my-app.redjamjar.net
DocumentRoot /home/rails/beta/my-app/current/public
<Directory “/home/rails/beta/my-app/current/public”>
allow from all
AllowOverride All
</Directory>
</VirtualHost>

How to get your email heard – make it a tweet style one liner

Every time I make it third person single question/update one liner I get an almost instant response – it really is awesome.

And for the longer messages… well that little subject line is the place to not ‘name’ the email but to get right into the essence of the email – by the time its been read the recipient wants to read the rest of the email.

Integration – how to plan for the unknown

No one has ever said integration of one system with another is straight forward. But does it always need to be a surprise a minute roller coaster ride? In a recent and slightly challenging (read evolving) integration projects I devised a simple set of rules:

Action Plan:

  1. Identify the unknowns
    How? Start simply with broad questions. Don’t be too quick to get into the detail as this will be the natural tendency. At this stage understand nothing about the detail but fully comprehending the end user environment or capabilities will give you a greater barometer for detecting where the unknowns are essential or not.
  2. Questions everything, assume nothing
    I’ve tripped over this many times, combined with one this is probably the largest probably when scoping, initiating or specify an integration piece of work. I find Excel is my friend in this situation, I can capture questions and responses as the knowledge flows
  3. Seek documentation but don’t rely on it.
    Documentation in what ever form is usually well intentioned, but out of date, inaccurate or just plain wrong. Typically the documentation will look grand ‘Technical Specification for X.Y.Z version 1.2′ however what tends to happen is that was written at the outset before a line of code had been written – ask yourself when you last went back and updated a specification at the end of project, yet you want to make key integration decisions based on it?
  4. Get a setup of the system as close as possible to the real environment for use during development, verification testing and UAT
  5. Commit, integrate and test regularly. Really if your not doing this forget it
  6. Use real data not ‘lorem ipsum’ or ‘test account 1′
    Demand this especially if you have translation or localisation considerations to consider.
  7. Allow your/encourage your client to come and inspect your work – they may see things your developer mind over looked.
    Coming from a developer mind I’m always surprised how easy it is to be lulled by our perspective on systems.
  8. Testing
    Even with all the automated testing, eyeballs and code reviews I’m still amazed by how often I come across developers who see it as acceptable to ship code from their development computer to a production environment without any testing.

Have I overlooked anything you find works best for you? Let me have your comments and I’ll add them in.