domingo, 30 de novembro de 2008

WMA to mp4

I don't know why I am so dumb that I spent so much time scouring the Web to look for a utility to convert between different audio file formats. In fact my favourite video player, VLC can do it right under its hood.

Why would I want to do this conversion business? Because I have a bunch of WMA files which I can't import into my iTunes (but it works on M$ Windows though).

The weird thing is that I didn't manage to coerce VLC to convert it to MP3 for me so in the end I just did MP4 anyway since iTunes support it.

Here are the steps that you need to take:

  1. Start up VLC
  2. Click File and select "Streaming/Exporting Wizard..."
  3. Select "Transcode/Save to file", click "Next"
  4. Select a file and click "Next"
  5. Check the "Transcode audio", and select "MPEG 4 Audio", select the bitrate that you want and click "Next"
  6. Select "MPEG 4/ MP4" and click "Next"
  7. Choose a filename and path to store the new file and click "Next"
  8. Click "Finish"
  9. Wait for it to be done

You can also choose other audio file formats and its pretty easy. Although I wish there is a better interface for this.

sexta-feira, 28 de novembro de 2008

Função nova do Rails 2.1 - Parte 1

Função nova do Rails 2.1:

change_table

Funciona quase igual ao método create_table, o qual aceita um bloco e dentro nós definimos novas colunas. Mas esse método novo permite fazer outras operações como rename, remove, etc.

A lista completa é:

  • t.column – a maneira antiga, migration não-“sexy”
  • t.remove – remove uma coluna
  • t.index
  • t.remove_index
  • t.timestamps – adiciona created_at e updated_at
  • t.remove_timestamps – remove created_at e updated_at
  • t.change – muda o tipo da coluna
  • t.change_default – muda o valor default de uma coluna
  • t.rename – renomeia uma coluna
  • t.references – adiciona uma coluna que serve de chave estrangeira com a convenção [nome_da_tabela]_id
  • t.remove_references – remove a chave estrangeira
  • t.belongs_to – atalho para :references
  • t.remove_belongs_to – atalho para :remove_references
  • t.string
  • t.text
  • t.integer
  • t.float
  • t.decimal
  • t.datetime
  • t.timestamp
  • t.time
  • t.date
  • t.binary
  • t.boolean