Giving hints to the user

Posted by Jorge Bernal August 07, 2007

Backpack hint

I just had to share this screenshot. This is what happens when you create a new page in Backpack. The arrow disappears once you do your first edit.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

The web developer’s mind

Posted by Jorge Bernal August 01, 2007

Found while blaming the whole IE team:

Web developer mind

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Spain is back to the middle ages

Posted by Jorge Bernal July 20, 2007

The last edition of the famous Spanish magazine “El Jueves” has been removed from the streets. All because of this cover (NSFW)

Copy says: If you get pregnant, this will be the nearest thing to work I’ve ever done (these are caricatures of the prince and princess of Spain). The cartoon refers to the amount now offered by the Government for every birth in Spain.

This is one of the times I feel ashamed to be Spanish. No surprises here, we are a monarchy in the 21th century. In fact this might be the only magazine who has the guts to laugh at the Royal Family.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Wanted: Google Groups

Posted by Jorge Bernal July 18, 2007

Bizarre. At this moment, google is missing its groups
Groups missing

The home page is returning random 500 errors and individual groups are accessible but empty

Discussions aren’t available right now. We’re sorry. Try again shortly.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

EULAs from hell: typography

Posted by Jorge Bernal July 11, 2007

a

Do you think proprietary licenses suck? Try reading a typeface’s EULA. From typotheque:

4. You are permitted to make a single back-up copy. The Typotheque Font Software or documentation may not be sublicensed, sold, leased, rented, lent, or given away to another person or entity.

So it seems if you buy a typeface the author wants to have a saying in your backup policy. I’m also wondering why a typeface should be licensed by CPU

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Amazing 13 year old CEO

Posted by Jorge Bernal July 01, 2007

I’ve wrote about young enterpreneurs before (see: the youngest grocer in America), but this kid is amazing. He speaks with more confidence than most of the people I know, and the idea is quite cool.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Understanding exposure

Posted by Jorge Bernal June 25, 2007

For what I’ve seen, it seems some of you also have photography as a hobby. Some days ago I found a review for Understanding exposure at Understanding Exposure by Brian Peterson – a Reader Review

Easy to read and straight-forward, Understanding Exposure offers the basics of aperture, lighting and shutter speed, photography’s basic triumvirate, to beginning and intermediate photographers. The book is divided into these three topics, as well defining exposure, special techniques, and a discussion of film vs. digital. This is not a highly technical book and any technical points are well-written and easy to understand.

My question now is if any of you have this book and recommend it. Should I get it or it has nothing I can’t found reading photography blogs and forums?

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Fixing your trac with greasemonkey

Posted by Jorge Bernal June 15, 2007

One of the basic advantages of using open source software is having the ability to change its behaviour to suit your needs. That’s awesome, but what happens when it’s a web application like trac? Sure you could change it, but if it’s your company trac you might be the only one wanting fo change a specific behaviour.

Trac before

One of the things that most annoys me is having to use the mouse to create a ticket. If I fill the fields using only the keyboard (the day I learned to use the Tab key to switch between fields was a major breakthrough in my digital life) and hit Enter to submit the ticket, trac does a preview instead of creating it. I’m not sure if you can override this behaviour using some special attribute, but the button used with Enter is the first one to appear in the HTML. So I had to turn it into this:

Trac after

I’ve used Greasemonkey for this. Greasemonkey is a Firefox extension which lets you write JavaScript code to modify the pages you visit, so I did a quite simple user script to switch the buttons order in any trac ticket page.

If you find this interesting, download the script:
[switchtracpreview.user.js]

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

LQTM

Posted by Jorge Bernal June 14, 2007

From Urban Dictionary’s word of the day:

Laughing quietly to myself.” A more accurate representation of the human response to funny things seen on the interweb.

When people type lol, rarely are they laughing aloud for the whole world to hear, but merely smiling and laughing quietly to themselves.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Loading a MySQL database in memory (with some Ruby help)

Posted by Jorge Bernal June 14, 2007

Let’s say when you have to run a batch process monthly, you can survive with times like 10 minutes. I can imagine a lot of seasoned DBAs right now ROFL about my insignificant 10 minutes. The point here is I was developing this process and some test cases, so my usual trial/error methodology doesn’t scale very well with 10 minute offsets.

So I borrowed an idea from a colleague: why not moving all the database to memory? It’s not so big and I have 2G of ram. But, could I change all tables (~20) to MEMORY in one line or so?

Since this was a Ruby on Rails project, I used the rails console to be able to mix SQL and Ruby. My first try:

conn.tables.each do |t|
  conn.execute "ALTER TABLE #{t} ENGINE=MEMORY"
end

First error: foreign keys couldn’t be migrated from InnoDB to MEMORY
Maybe there is a more MySQL-esque way of dropping all the foreign keys on a database but this one worked quite well:

>> res = conn.execute "SELECT TABLE_NAME, CONSTRAINT_NAME
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE K
 WHERE table_schema = 'app_development'
 AND REFERENCED_TABLE_NAME IS NOT NULL"
>> res.each_hash do |h|
  conn.execute "ALTER TABLE #{h['TABLE_NAME']}
                       DROP FOREIGN KEY #{h['CONSTRAINT_NAME']}"
end
>> conn.tables.each do |t|
  conn.execute "ALTER TABLE #{t} ENGINE=MEMORY" rescue nil
end

Still I had some problems with a few tables using BLOBs, but they were not used on the process/tests so I ignored them. That’s what the rescue nil is for.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

« Older blog posts • Newer blog posts »