sábado, agosto 30, 2008
sábado, agosto 16, 2008
How to start with emacs [2]
Emacs uses a configuration file that is by default placed in your home directory, the file is called .emacs (I don't know if on win32 systems is also called .emacs). This file contents is elisp code, so for full control of emacs it's imperative learn elisp, but I still didn't learn elisp and I'm an emacs user :), so you can learn elisp while you are looking for snippets of code.
Concepts
I will have to explain some concepts that are important to understand why emacs behave in the way that it does.
In emacs there are buffers, there is the minibuffer that is where you type the emacs commands (or elisp interactive functions), and the other buffers could represent an opened file, a pipe, or just a temporary editing space that is not attached to a file, the name of the last type of buffers start and end with *, for example *scratch*
Emacs has something called 'modes', it's something like the way that a determined buffer must behave, for example if you are going to open C source code file the c-mode should be loaded, and it will help you in task of develop with the C language. There are 2 kinds of modes, the major and minor modes, one buffer can only have one major mode and zero or more minor modes.
First tweaks
Emacs is a software with a huge history and tradition, so there are some things that for somebody that is formed in the last 10 years in computing terms there some musts that you must have in you emacs config file, like the transient-mark-mode
The transient mark mode highlights the selected region of text, by defaults this is disabled so I recommend you enable it with pasting the following in your .emacs
(transient-mark-mode 1)
Fill you name and email to let the modes that need that information could use, this is done with the following snippet of code
(setq user-mail-address "homer@simpsons.com")
(setq user-full-name "Homer J. Simpsons")
If you like to use Ctrl+g to jump to a line number then you should add the following code
(global-set-key [(control g)] 'goto-line)
One of the sweetest feature that must have a text editor is syntax highlight, well emacs has this, but disabled by default, with the following code you will have it enabled always
(require 'font-lock)
(global-font-lock-mode t)
I think that this is enough for this entry, the next entries probably will be more fun to write and read, because i will start talking about the major modes, one mode per entry, probably the next one will be the C mode.
Posteado por
Felipe
a la(s)
9:04 p. m.
0
comentarios
Etiquetas: emacs
sábado, agosto 09, 2008
How to start with emacs [1]
First of all, All my tips related to the underlying Operative System are using GNU/Linux Debian, so if you are using another distribution (or even another OS) you will have to look for the appropriate way to do the task, if you send me how to do it with another OS I will add it to the entry.
What is emacs?
Well, emacs doesn't exists, the correct name is GNU Emacs for the series of post, because there is a lot different flavors of emacs, for example XEmacs, Aquamacs, and others.
The GNU Emacs website says:
GNU Emacs is an extensible, customizable text editor—and more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing.
What can I do with emacs?
It's a text editor, so write text :P, but also:
- Develop software in a wide range of compute languages, like C, C++, elisp, C#, ruby, python, java, ...
- Mail client
- Chat with your irc folks
- Surf on the web
- And other things that will be discussed in their respectives posts
Install GNU Emacs
First you must decide witch version of emacs do you want to use?, exists emacs22, which is the current stable release, and also emacs23 (aka emacs-cvs) which is the development version, but currently is in the state of features freeze, so It's pretty stable to me, if you use emacs22 you will not have anti-alias, something that is very nice to the eyes when you spend the day developing, almost all the tips discussed in the series will be neutral, except the related with anti-alias and multi-tty.
Debian
To use emacs22 you can just use the debian official archive and execute
apt-get install emacs22
But if you want to use the emacs cvs there is a repository maintained by Romain Francoise of the package emacs-snapshot which is a binary package of the cvs code (this is the one that I use). To use this repo you must the following to you source.list (to obtain more details visit the webpage of the repo)
deb http://emacs.orebokech.com sid main
deb-src http://emacs.orebokech.com sid main
Then just install the emacs-snapshot package.
On the next entry, I will talk about how is emacs by default and how to change the configuration.
Posteado por
Felipe
a la(s)
1:04 p. m.
0
comentarios
Etiquetas: emacs
How to start with emacs [0]
Before I could really be productive with emacs, I failed a couple of times, because I knew that emacs were powerful, but the default configuration shows you a simple text editor that look awful, without syntax highlight, without anti-alias, a color schema that really sucks.
In GNU/Linux (to not piss off rms xD)I was never found a really nice (text) editor, because all the available suck at some point (even emacs sucks sometime, but suck less than the rest :P), so when I met zeus lead me in the first steps giving me some elisp tips, I could start swimming by myself and improving my emacs configuration file, and even teaching some tips to the mentor :P.
So I will start a series of articles of how to start with emacs, especially giving the recipes (elisp code) of how to obtain the desired behavior.
Posteado por
Felipe
a la(s)
12:48 p. m.
0
comentarios
Etiquetas: emacs
martes, julio 29, 2008
Installing services
Today I had a dejavu, I had to use the following command 3 times on different tasks and even on different machines, but for different purposes
$ ln -s . foo
soft links are really helpful to work-around a strange behavior.
Posteado por
Felipe
a la(s)
11:01 p. m.
0
comentarios
lunes, julio 21, 2008
Openmoko
Is Openmoko for the mass market?, well the answer is simple NO, believe me I want to have an opemoko smartphone, but it cost US$500 against the US$200 of the iphone, it has a faaaar from be a great software stack and the lack of eye candy for the mass market and for be an iphone-killer that's a must.

openmoko has a lot of potential, especially for a linux developer, _we_ need to develop good software with eye-candy.
Posteado por
Felipe
a la(s)
10:54 p. m.
1 comentarios
domingo, julio 20, 2008
RIP brother in arms.
It's always hard loose a friend, but it's even harder when he is still a young boy, rest in peace raúl (aka darth debian), every body will be there with you sooner or later, wait for us with a shell to hack in the heaven, we always remember you.
Posteado por
Felipe
a la(s)
12:46 p. m.
0
comentarios
jueves, julio 10, 2008
El coyote atrapa al correcaminos
Gracias youtube, me haz permitido ver el mítico mommento en que el coyote atrapa al correcaminos :D
Posteado por
Felipe
a la(s)
5:42 p. m.
0
comentarios
lunes, julio 07, 2008
Just use Pencil
if you want to create UI prototypes (web or desktop app) then use the Pencil, but not an analogical one, use the software called Pencil it's awesome. ... and can run over firefox or like a standalone program (yes, it uses xulrunner)
Posteado por
Felipe
a la(s)
4:53 p. m.
1 comentarios
jueves, julio 03, 2008
Fayerwayer
Para todos los que hemos leido de vez en cuando algún artículo de fayerwayer se ha dado cuenta que los chicos de fayerwayer tienen mucha llegada con las empresas (no tengo idea a que se dedican para ganarse la vida), han ido a expos de nokia, tienen un contrato con paris.cl, les regalan cosas para que sorteen con sus lectores, etc..., por lo tanto cuando sacan críticas a una empresa, ya sean para bien o para mal, me es muy dificil no mirar con desconfianza sus palabras, ya que seamos sinceros, si las empresas te regalonean no vas a querer enrostrarles en su cara que son wnas y que deben hacer X o Y, por lo tanto las palabras de Alexander Schek (Mr.Chips) las veo con cuidado, en especial porque Mr chips está metido en el rubro de las tiendas virtuales.
El otro punto a destacar es que dell se ha mandado el mismo cagazo antes y aun no aprende, y estoy seguro que volverá a pasar, por lo que no es un error aislado, sino que es una constante, deben asumir el riesgo de su negocio y mejorar su equipo de QA, además cuando vas a comprar a una tienda y compras un pantalón en 20 lukas y la siguiente semana la tienda tira el gran remate gran de el mismo pantalón 2x1 a 10 lukas, uno no va llorando donde la tienda pk se lo cagaron, asume hidalgamente y putea, pero nada más, por lo tanto deberia ser la actitud de Dell, asumir hidalgamente su error, mejorar sus procesos internos y entregar los laptop.
Update: un punto no menor que rescata José Roa (extracto sacado de Invertia.com) es el siguiente:
las empresas están obligadas a respectar las ofertas que le realizaron a los consumidores en los términos que la realizaron (...) Así como nadie pretende que sea un error el que una empresa cobre muchas veces el precio por el mismo producto en otro local, así tampoco debe llamar a ese juicio el hecho que una empresa cobre un precio menor. Ese es un trato asimétrico
PD: no quiero que se interprete mal, pensando que digo que los de fayerwayer son unos vendidos, sino que simplemente es necesario mirar con detención las criticas (de todo el mundo, no solo de fayerwayer, ... sí, incluso esta), porque todos *tenemos* tejado de vidrio.
Posteado por
Felipe
a la(s)
7:52 p. m.
3
comentarios
get the thumbnail of a file with python
with this function you can obtain the the path where is stored (returns None if the thumbnail doesn't exists) the thumbnail of the given uri.
import md5
import os.path
def thumbnail_path_from_uri(uri, size='normal'):
"""Construct the path for the thumbnail of the given uri
Arguments:
- `uri`: the uri that points to the file that is looking for the thumbnail.
- `size`: the size of the thumbnail (normal or large)
"""
assert isinstance(uri, basestring), \
TypeError("The uri must be a str")
assert isinstance(size, basestring) and (size == 'large' or size=='normal'), \
TypeError("The size for thumbnail can be normal or large")
hash = md5.new()
hash.update(uri)
path = os.path.join(os.path.expanduser('~'), ".thumbnails", size, str("%s.png" % hash.hexdigest()))
if os.path.exists(path):
return path
else:
return None
Posteado por
Felipe
a la(s)
4:24 p. m.
0
comentarios
miércoles, julio 02, 2008
a photo manager
damn it!, f-spot is pretty nice, but it doesn't work for me, because my video driver sucks, it hang up when you use some functionality that has some code with glx.
I tried to made a quick photo viewer (usgin the photos.db of f-spot) with python and GtkIconView, but I want to implenet the list store (backend) in a OOP-way, and avoi the data duplication, something that is trying to figure it out in the pygtk mailing list, my other option is make a fork of f-spot, but not to make a better software, instead to eliminate all the glx code, and have a simpler f-spot, but I dont know how many animations could be around.
so, anyone has some photo manger like f-spot?.
PS: picasa is not usefull to me, I'm a fucking freetard (If you are a reader of linux hater's blog, the you what I'm talking about).
Posteado por
Felipe
a la(s)
5:06 p. m.
2
comentarios
sábado, junio 28, 2008
jueves, junio 26, 2008
firefox stop pissing me off
a common use case of my daily routine before firefox 3 appeared on sid:
- open liferea
- open evolution
- open iceweasel (aka firefox)
- open emacs
- put music with emms
- while unread_items > 0, read the interesting items of the feeds loaded in liferea, and click in the interesting links
- read the mail, and if somebody sent me a link, then follow it
- check all the links opened in iceweasel
a common use case of my daily routing after firefox 3
- open liferea
- open evolution
- open iceweasel
- open emacs
- put music with emms
- while unread_items > 0, read the interesting items of the feeds loaded in liferea, click in the interesting links, minimize firefox to return the focus to liferea
- read the mail, and if somebody sent me a link, then follow it, minimize the firefox to return the focus to evolution
- check all the links opened in iceweasel
Posteado por
Felipe
a la(s)
1:05 p. m.
4
comentarios
miércoles, junio 25, 2008
recicla!
un tip que me envió la naty
mouji dice:
En Facebook la cosa está que arde…se han creado muchos grupos interesantes y uno de ellos es “Yo Reciclo” que ya lleva más de 2000 miembros, ahora han publicado ésta lista con las diferentes organizaciones que reciben reciclaje en Chile:
1.- VIDRIOS:
– Codeff: 777-2534 (www.codeff.cl)
– Coaniquem: 570-2500 (www.coaniquem.cl)
2.- CARTRIDGES IMPRESORAS
– Nocedal: 381-3641 www.nocedal.cl
– Crearte: 236-0341 www.crearte.cl
– Coar: 732-2821 www.coar.cl
3.- CACHUREOS ELECTRÓNICOS (computadores, impresoras, pantallas… . etc)
– Emaus: 643-3643 643-2035 (www.traperosemaus.cl)
– Municipalidad de Providencia 410-5215 (www.providencia.cl)
– Fundación Todo Chilenter 516-0807 516-0403
4.- PILAS
– Chilectra: 696-0000 www.chilectra.cl
– Casa de La Paz: www.casadelapaz.cl
5.- PLÁSTICO
– Recipet: 854-5967 www.recipet.cl
– Cenfa: 800-410066 www.cenfa.cl
6.- TETRAPAK (envases de leche y jugos de larga vida)
7.- ALUMINIO (latas de bebida y cervezas)
– Copasur (retira a domicilio sobre 40kg) 548-7755 www.copasur.cl
– Cenfa 800-410066 www.cenfa.cl
8.- PAPEL
– Fundación San José 399-9614 www.fundaciónsanjose cl
– Sorepa 473-70000 www.sorepa.cl
– Recupac 624-6539 www.recupac.cl
– Reciclados industriales 641-3128
Posteado por
Felipe
a la(s)
11:43 a. m.
0
comentarios
domingo, junio 15, 2008
code swarm
This visualization, called code_swarm, shows the history of commits in a software project. A commit happens when a developer makes changes to the code or documents and transfers them into the central project repository.
code_swarm - Python from Michael Ogawa on Vimeo.
Posteado por
Felipe
a la(s)
2:38 p. m.
1 comentarios
jueves, junio 12, 2008
Linux hater's blog
yea that's right, it's a must-read blog, I recommend How to write a Gnome Application
Linux hater's blog
Posteado por
Felipe
a la(s)
5:43 p. m.
0
comentarios
martes, junio 10, 2008
interesante nota
http://www.usachaldia.cl/index.php?id=3054
Posteado por
Felipe
a la(s)
2:31 p. m.
1 comentarios
viernes, junio 06, 2008
git screencasts
If you have heard that the kernel.org guys use git to develop it, but you just know that it's a CVS/SVN replacement, but in a distributed way, and you don't know how it works, then the right place for you is gitcasts.
The site has a lot of videos, they pick a functionality of git and show it in a video of about 8 minutes, pretty educative :D
Posteado por
Felipe
a la(s)
10:54 a. m.
0
comentarios
jueves, junio 05, 2008
via
What's worng with you via?, the announcement about give us free open source drivers for the graphics cards was made about more than a month and we are still waiting, why you are just dropping binary drivers on your site?, damn it I want a fully functional video card, but believe me that my next laptop will be powered by Intel technologies, they are doing the things right.
Posteado por
Felipe
a la(s)
8:34 p. m.
0
comentarios



