Koke’s

My English alter-ego

eBox 0.7.99 available today

Posted by Jorge Bernal November 29, 2006

eBox

It’s been a while since the last release but here we are again: eBox 0.7.99 is out!

This release brings not only some new features and bugfixes, but two shiny new developers to the crew. Welcome!

Now with the features:

In this version the backup actions have been improved and extended to other modules. Now you will be able to backup the shared files for your samba users, the LDAP database, or burn the backup files directly to DVD or CD-ROM. Several bugfixes have been made, it is worth mentioning in this regard that we have added a new version of OpenLDAP which seems to behave much better with power failures, hopefully all issues reported regarding database corruptions will disappear. There is a complete changelog at the end of this email.

You can read about upgrade and installation instructions at eBox 0.7.99 ready to download

AddThis Social Bookmark Button   AddThis Feed Button

Not enough thanks

Posted by Jorge Bernal November 29, 2006

Bugs like #72212 are always nice

Ubuntu is awesome. Dapper is really stable, and Edgy is pushing the boundaries of what my hardware can do. I didn’t pay a penny for Ubuntu, but it’s totally replaced my old Operating System, and taught me to fall in love with free software.

While there is a brilliant community of really great and helpful people, we don’t thank the developers enough… especially the devs that don’t get paid (by devs I’m not just talking about programmers, I’m including – well everyone). The best I can do at the mo is submit bug reports and try to be active on the forums.

Sometimes there is negativity directed toward this project, for all sorts of reasons. And, while there are loads of people saying thanks and who appreciate what you all do. I think we could all say it again -> thanks for a really awesome distro, and thanks for your wider contributions to the Free Software cause!

AddThis Social Bookmark Button   AddThis Feed Button

Better error_messages_for (I)

Posted by Jorge Bernal November 27, 2006

What is error_messages_for?

Rails validation system is definitely a time saver. For those of you who don’t know it, let’s say you define validations in a model like this

class User < ActiveRecord::Base
  validates_presence_of :name, :email, :password, :on => :create
  validates_uniqueness_of :email, :name

# ... rest of model code here ...
end

and if you fail to enter data correctly this is what you get

error_messages_for is the helper used in the views to show the warning box.

The enhancement

I thought it would be nice to have the first field with an error not only shown in red but focused so you can fix the error right away.

To make this happen you can add the following code to config/environment.rb

module ActionView
  module Helpers
    module ActiveRecordHelper
      alias_method :error_messages_for_original, :error_messages_for
      def error_messages_for(*params)
        options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {}
        objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact
        error_text = error_messages_for_original(params)
        if error_text.empty?
          error_text
        else
          # Add JS tag to focus on first error
          first_attr = nil
          objects.first.errors.each {|attr,msg| first_attr ||= attr}
          error_text + javascript_tag("window.onload = function () {$('#{params.first}_#{first_attr}').focus();}")
        end
      end
    end
  end
end

Caveats

This is far from being perfect (that’s why you should expect a second part article on this one). The caveat is using the window.onload attribute. It’s needed because you can’t modify a DOM object before it exists.

The next approach will be modifying directly the form helpers, so the JS code to focus the first field with an error will go just after the INPUT tag.

AddThis Social Bookmark Button   AddThis Feed Button

Weirdest SPAM message

Posted by Jorge Bernal November 24, 2006

This is the most bizarre but fun SPAM I’ve received today this month ever.

Subject: But Fortran programs will continue to live for years in large financial institutions.

view KML files with google maps.
SEM leads to more direct sales, in which the seller is most interested,
but we also learn from brands like Coca-Cola with, perhaps, one of the
most recognizable faces in the world. view KML files with google maps. I
would not have written an authentication system in JavaScript. He then
was telling me about re-engineering my site.

xxxx

[… real cheap stocks spam stuff …]

xxxx

Something to think about when recruiting, or seeking new employees is
that the pool is getting smaller, and those in the pool are going to ask
for a lot more than they are getting now. But Perl itself is hardly
obsolete. SEM and SEO will, for the foreseeable future, be essential for
being found, and essential for measuring ROI.
Who can hit the nail on the head? But also, the event has a stage in
Second Life, where fans can view a simultaneous live webcast.
They view the additional wait as merely a nuisance, an unfortunate fact
of life in today’s world. The other half, now more attainable, is the
focus on branding – visibility in previously invisible places – and
awareness of products and services.
Return the soup to the heat and fold in the turkey meat. We need a
youtube for technology, or a MySpace for technology to show that we are
not all just a bunch of folks in a cube farm.
I think I have read that somebody mean that Perl is better on security
related projects.
I have not coded a single line in Perl and do not know the language.
Something to think about when recruiting, or seeking new employees is
that the pool is getting smaller, and those in the pool are going to ask
for a lot more than they are getting now. What you probably have not
seen is what to do with all the leftover turkey.
“I am not so sure it’s a mass-market trend, but certainly one for the
audience that enjoys Second Life. Of course, WSJ knowing nothing about
the subject, turns to recent comScore data for its answer. Branding
online is a directive to search, pulling your brand to the front of it,
rather than the back of it.
htaccess better than most of us and look at the free downloads. The odds
are they just don’t know Perl and are trying to convince you to redo
your site so they can get the job and the big payday. It’s a
match-making style website in a niche industry.
I think I have read that somebody mean that Perl is better on security
related projects. He also knows ASP and the MS IIS web server. do you
need your own web space to upload some files? When it’s hot, add the
bacon and cook until crisp. When it’s hot, add the bacon and cook until
crisp.
Branding online is a directive to search, pulling your brand to the
front of it, rather than the back of it.
htaccess to improve security on your site.
What is to stop someone from simply clicking dozens of links and
entering the phone numbers of friends, enemies or premium numbers? The
loose typing of PHP, its inbuild variables has its advantages.
They view the additional wait as merely a nuisance, an unfortunate fact
of life in today’s world. I would not have written an authentication
system in JavaScript.
htaccess better than most of us and look at the free downloads. What
MySpace began, and perhaps abandoned to an extent once News Corp. Of
course, WSJ knowing nothing about the subject, turns to recent comScore
data for its answer.
Branding online is a directive to search, pulling your brand to the
front of it, rather than the back of it.
do you need your own web space to upload some files?

AddThis Social Bookmark Button   AddThis Feed Button

Tinkering

Posted by Jorge Bernal November 23, 2006

Tinkering is what happens when you try something you don’t quite know how to do, guided by whim, imagination and curiosity. It’s about letting the spark of an idea ignite, no matter how far the idea is. When you tinker, there are no instructions, but there is no failure, no right or wrong ways of doing things.

I love that word.

(Via The Craft of Interactive Prototyping)

AddThis Social Bookmark Button   AddThis Feed Button

Snippet: capturing outbound links with Prototype

Posted by Jorge Bernal November 23, 2006

In fact, this can be don with plain JavaScript, but Prototype helpers are quite helpful

<script type="text/javascript">
//<![CDATA[
  function logclick() {
    new Ajax.Request('/stats/outlink/' + this.href);
    return false;
  }

  window.onload = function () {
    var linktags = document.getElementsByTagName('a');
    var links = $A(linktags);

    links.each(function(node){
      if (node.addEventListener){
        node.addEventListener('click', logclick, false);
      } else if (node.attachEvent){
        node.attachEvent('onclick', logclick);
      }
    });
  }
//]]>
</script>

This simple JS code modifies each link in the page so when it’s clicked the browser sends an AJAX request to /stats/outlink/the_url, sou you can track the exit points of your website.

It’s not perfect yet. It doesn’t work if you right-click -> Open in new tab, and it has only been tested in Firefox, but if it’s of some help to anybody, I’ll be happy :)

AddThis Social Bookmark Button   AddThis Feed Button

Did you mean: mod_speling

Posted by Jorge Bernal November 22, 2006

I didn’t know about this one. Funny thing I mispelled the mispelled name of a spell checker.

The real name is mod_speling and documentation describes itself as

Requests to documents sometimes cannot be served by the core apache server because the request was misspelled or miscapitalized. This module addresses this problem by trying to find a matching document, even after all other modules gave up. It does its work by comparing each document name in the requested directory against the requested document name without regard to case, and allowing up to one misspelling (character insertion / omission / transposition or wrong character). A list is built with all document names which were matched using this strategy.

I’ll have to try this somewhere.

BTW, I found this on Stupid htaccess Tricks in case you want to check that too

AddThis Social Bookmark Button   AddThis Feed Button

The logout dialog problem, not only for Ubuntu

Posted by Jorge Bernal November 22, 2006

Joel points this problem in Windows Vista too, at Choice = Headaches.

I love the ideas provided, so maybe we should try this for Ubuntu. At least, it will be easier than trying to get that from Windows developers.

My vote for the one button logout system.

AddThis Social Bookmark Button   AddThis Feed Button

AJAX WYSIWYG CMS

Posted by Jorge Bernal November 21, 2006

Or how to make a title by using only acronyms.

It’s called Authenteo and I have to say I haven’t really tried it yet, but it looks quite impressive.

Authenteo

Ouch, I tried it and it made this post the “Firefox 2 – Safari 0”. After some block moving, Firefox crashed with all my new stuff to read tabs on it. Thanks to Firefox 2 session restore, nothing happened. It has also recovered the unsaved text of this post!

About Athenteo, not working too well and it’s way complicated and strange to use, but could be a good foundation for something great in the future.

(Seen on Ajaxian)

AddThis Social Bookmark Button   AddThis Feed Button

Politically correctness

Posted by Jorge Bernal November 20, 2006

From Flickr FAQ: Contacts:

Someone is blocking me. What’s up with that?

Blocking is a simple way to make sure that everyone is comfortable. If you’ve been blocked by somebody, it most likely that your interaction with them is outside their comfort zone.

The most polite way I’ve ever seen for “you are a pain in the ass

AddThis Social Bookmark Button   AddThis Feed Button

« Older blog posts