Já faz um mês que mudei para o novo domínio. Desde então já fiz alguns posts lá no http://blog.rodrigolira.net.
Fiquem atento, não postarei mais conteúdo nesse blog.


O blog do Rodrigo Lira mudou! Agora todas as postagens serão feitas no blog.rodrigolira.net, um novo blog com uma novo design e mais recursos. Todos os posts já foram migrados e em breve estarei retirando-os daqui.




Old but gold!


I’ve been doing a little bit of research into the best compression method to use in Ubuntu. There’s so many compression types when I right click –> create archive. Keep in mind that I’m simply using the default compression values right from the desktop, there’s no special tweaking involved here. Mainly, I want something quick and easy for every day file management. Many of these formats, I’ve seen before and had heard some were ‘better than others’; some faster, and some compress more. I really wasn’t sure what’s the best option.

I often have large data files (hudreds of megs or larger) that I like to make backup copy of, but would rather store them in a compressed format. I also don’t want to wait around forever to get the job done. I’m working on a fast machine (duo core 2) with a gig of memory.

So what’s gave me…

Ver o post original 317 mais palavras



As you may aware, VirtualBox has 2 types of VDI file; static and dynamic. While static VDI is good to minimize potential VDI file fragmentation, it requires a lot of unnecessary disk space. Assuming you allocate 55GB of disk space for VDI (logical hard disk space in VirtualBox machine), static type will need the whole 55 GB for the VDI although your host OS just consume 4 GB (typical Windows XP installation). Thus, using Dynamic type is more practical and sensible (allocate as much as your guest OS uses, generally).

However, dynamic VDI is not 100% efficient. Due to various factors such as empty space, overhead and block reading method, VDI files seem to use significantly more space. For example, if your guest OS consume 20 GB, there is big chance that your VDI file requires up to 25 GB of actual hard disk space.

To solve this problem…

Ver o post original 302 mais palavras

Recomendo! Ótimo post sobre iterable, generators e o uso de yield em Python.


Ontem o arthursribeiro perguntou no canal da #ufcg como funcionava o yield do python. Me lembrei quando eu estava iniciando que também tive essa dúvida e tenho certeza que é muito comum entre iniciantes então estou aqui explicando.


O primeiro passo para se entender o yield é entender o que são iterables. Um objeto é iterable quando você pode percorrer seus valores usando um “for valor in objeto”.

Outra maneira de criar iterables é usando list comprehension:

Geralmente para ser iterable, o objeto precisa ter implementado o método __iter__. Uma regra a essa exceção é a string, que não tem esse método mágico, mas que pode iterada usando seu __getitem__. Uma boa maneira de saber se um objeto é iterável ou não:

Se o objeto for iterável, ele é retornado. Se não, a exceção TypeError é levantada.

Iterables são úteis porque você pode iterá-los quantas vezes…

Ver o post original 253 mais palavras

Many fellas ask me: “why should I learn Python?” so I solved to list a lot of reasons.

Python is the most excited language I’ve ever worked. I use Python since 2008, actually I started to study python since my first year on the graduation. It was funny because I was studying C and Python shows up so easy. I remember which I had many problems with semicolon. Six years passed and now, Python is stronger. So, let me show you some reasons for u use Python:

  • Python is easy and it is clear. You don’t need to waste time with monkey jobs. You just need to develop what you want.
  • Many companies use Python like NASA, GLOBO (Brazil) , M$, APPLE, DISNEY, DROPBOX, GOOGLE… believe Python is everywhere.
    • “Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we’re looking for more people with skills in this language.” said Peter Norvig, director of search quality at Google, Inc.  See more.
  • Object-Oriented Programming or Functional Programming or Imperative programming. You don’t need to choose it. You can use all it with Python. Lambda, map, filter, zip… I love it.
  • The Python interpreter allow you test code snippets very quickly. Actually, if you are using Python on Linux, you should install bpython.
  • There is no company behind Python (like Java has) but there is a huge community. Actually, community is the most cool thing when is talking about opensource.
  • Python is now the the most popupar introductory  teaching language at top US universities because it is powerfull and easy to learn it.
  • Also, Python won twice the “Programming language of the year” created by the TIOBE and according the IEEE, Python is the 4th language most popular.
  • There are a lot of content on the web to study. See my page.

So, listen to me. You should learn it, man! I will increase that list but for while it is enough.



Blue Eyes

Today, I wont talk about tech. I will talk about a interesting brazilian movie which I watched yesterday. Indeed, it is a movie with americans and brazilian actors. Its name is “Olhos Azuis” (Blue Eyes).  Yesterday was a busy day and I was relaxing in front TV while I was waitin’ fall asleep to rest a little but instead of that, I watched that movie. It is a story about the US immigration officer who travel to Pernambuco to find a little girl, an foreing daughter. I don’t want to say spoilers about the movie but it is pretty cool. Actually, Pernambuco is my state so it was an attractive a more and the brazilian guy, I mean the main actor is from here.


Recently, I implemented the Fish School Search II for a discipline on my master degree.
FSSII is an optimization algorithm proposed by Carmelo et all. Actually, it is a version improved of the Fish School Search. That version was proposed last year in the BRICS conference.

Paper: “An Enhanced Fish School Search Algorithm”,
Authors: C. J. A. Bastos-Filho, D. O. Nascimento.
Conference: BRICS 2013, Porto de Galinhas, Brazil. http://brics-cci.org/

I implemented to solve the Rastrigin’s and Sphere’ problem but is very simple to extend for other one. It is a Python code so it is very easy to understand it. I guess I have the code implemented in C++ but I need to find in my stuff.



Python Conquers The Universe

As a programmer, one of the first things that you need for serious program development is a debugger.

Python has a debugger, which is available as a module called pdb (for “Python DeBugger”, naturally!). Unfortunately, most discussions of pdb are not very useful to a Python newbie — most are very terse and simply rehash the description of pdb in the Python library reference manual. The discussion that I have found most accessible is in the first four pages of Chapter 27 of the Python 2.1 Bible.

So here is my own personal gentle introduction to using pdb. It assumes that you are not using any IDE — that you’re coding Python with a text editor and running your Python programs from the command line.

Some Other Debugger Resources

  • For information on the IDLE interactive debugger, see the IDLE documentation
  • For information on the Wing IDE debugger, see…

Ver o post original 2.053 mais palavras

Ótimo post!

Site do Éder Saraiva Grigório

Autor desconhecido.
Tradução para o idioma português do Brasil (pt_BR): Éder S. G.

Esta é uma coleção de livros digitais (ebooks) sobre o sistema operacional GNU Linux que está repleta de informações úteis para usuários iniciantes, experientes, administradores de sistemas ou desenvolvedores. Segue abaixo uma lista de 20 ebooks gratuitos que irão ajudá-lo a desenvolver suas habilidades no GNU Linux.

1. Introdução ao GNU Linux – Um guia de mão
Este livro ensina desde o processo de login, gerenciamento básico de arquivos, áudio e vídeo, técnicas de backup até conceitos básicos de redes. O guia explica a estrutura de arquivos do GNU Linux e introduz os comandos básicos e também os editores de texto.

2. Guia de introdução ao GNU Linux
Este guia para o GNU Linux explica como escolher uma distribuição e, em seguida, te ensina como fazer uma instalação básica do sistema operacional GNU Linux. Então…

Ver o post original 991 mais palavras