Sunday, April 29, 2012

I Begin to Wonder

I Begin to Wonder born as a stubborn idea to integrate a Jean Claude Ades song mixed by Jerome Isma-ae, since past year I was trying to added and finally is here, becoming title for this the very first remix of this year. It's genre goes from Deep House, Tech House, Minimal House to Progressive House.


1. Rodrigo Carreira - Communicate (7:35)
2. Anthony Collins - Pop Off (Ludovic Vendi Dub Mix) (9:30)
3. Leron vs. Yves Eaux vs. Luke Star - You Will Be Mine (9:6)
4. EDX - Embrace (Original Club Mix) (7:13)
5. Boom Jinx And Andrew Bayer - Keyboard Cowboys (Original Mix) (7:37)
6. Matt Lange - Other Stories (7:52)
7. Ida Engberg - Owl's Nest (Original Mix) (7:58)
8. Jean Claude Ades - I Begin To Wonder 2008 (Jerome Isma-ae Remix) (9:0)

I hope you like it.

Friday, April 27, 2012

A glance to Ubuntu 12.04 Precise Pangolin


Today I updated my Ubuntu to the new Ubuntu 12.04 LTS "Precise Pangolin", The most immediately noticeable will be the new log in screen and better colors in all UI environment.  Ubuntu 12.04 has cooler tool tips when Rhythmbox change songs or in the launcher bar, also has HUD the new search-based menu and is really cool, since it can interact with all your installed programs such as Firefox (Exploring Bookmark / History), Skype (Filter online, offline contacts) or sending email with Thunderbird just typing email. You save time avoiding access nested menus in huge option programs like Gimp.

See here for more info


Perhaps the most welcome change, though, is the vastly improved performance and power management. Ubuntu, for all of its finer points, has never been particularly battery friendly.

The bad thing I found about it is the launcher side bar, which is quite intrusive in my perspective, I normally use an extended display monitor and now in this Ubuntu version I have to bear this launcher in my extended monitor as well.

After give a glance in the advantages and disadvantages I had no doubt to install it and start to use it, hope this info was useful to you.

Enjoy it.

Tres buenos libros de historia de México


México bárbaro de John Kenneth Turner

Es un ensayo escrito en 1908, dedicado a dar a conocer en los Estados Unidos los acontecimientos que se daban en México en aquella época, describiendo la esclavitud humana que se practicaba durante el gobierno de Porfirio Díaz en lugares como Yucatán y Valle Nacional.

La primera edición de este reportaje a profundidad, vio la luz en forma de libro en los Estados Unidos de Norteamérica en 1911. Se han hecho varias ediciones de la publicación tanto en México como en EE. UU. y se le considera como una importante contribución a la descripción de las condiciones sociales que existían en el México prerrevolucionario del Porfiriato.




Zapata de Pedro Ángel Palou García

Palou detalla: “Zapata luchó y tomó ciudades, llegó a la ciudad de México y estuvo a punto de tomar el poder, pero fue congruente con su convicción de que la política no es para los hombres del campo. Él le rehuyó al poder, nunca se sentó en la silla presidencial, de ahí que sólo buscaba acabar con las injusticias y hacer que se cumpliera la ley.

“Zapata nunca asumió un sólo puesto en la Convención de Aguascalientes, ni le aceptó ninguno a Francisco I. Madero. Fue un hombre de gran coherencia”.

Zapata tuvo que enfrentar muchos openentes en su lucha por defender sus ideales, entre ellos Porfirio Díaz, Francisco I. Madero, Alvaro Obregón y Venustiano Carranza, finalmente fue asesinado en la Hacienda de Chinameca en una trampa ejecutada por Jesús Guajardo.


Azteca de Gary Jennings

Hacia 1530, el emperador Carlos pide al obispo de México que le proporcione información sobre la vida y costumbres de los indios americanos; el obispo, fray Juan de Zumárraga, envía al monarca un relato autobiográfico hecho por un indio de unos sesenta años, Nube Oscura o Mixtli, en el que narra su niñez, la mentalidad y costumbres de su pueblo, su formación y sus amores, siempre tormentosos y trágicos. Por fin, el emisario de Moctezuma entra en contacto con los españoles de Hernán Cortés, es bautizado y recibe el nombre de Juan Damasceno, aunque sigue fiel a los usos de los aztecas. Ésta en su trepediante y desgarrada historia, que simboliza el choque de dos civilizaciones, de dos maneras irreconciliables de entender el mundo.

Thursday, April 19, 2012

Older people are happier

Feelings like stress, worry, anger decrease with age. In the paradox of ageing is mention that when we recognize we won't live forever change our perspective on life in positive ways, we recognize we don't own all the time in the world and we see our priorities most clearly, we take less notice of trivial matters we save or life, we are more appreciative, more open to reconciliation, we invest in more important things, and life gets better.

Laura Carstensen

Saturday, April 14, 2012

An efficient way to backup your information

Unison allows you to synchronize a directory with an external drive or a remote host, it is like mirroring your directory.

I would like to explain only external device option.

First connect your external device

Then run Unison and create a new profile where simply specify the paths to the directories you want to keep in sync.



The synchronization is pretty straightforward, in Unison screen you will see changes are ready to apply, finally select Go from the menu.



In my case, I'm always listening new music from several genres, and when some new track please me, I copied to /media/Shared/Music directory in a corespondent directory-genre name. Since I have a bunch of new tracks in different directories. Unison helps me to copy to my backup only new tracks, in a kind of incremental backup.

Enjoy.

Friday, April 13, 2012

How to convert flac to mp3 usgin ffmpeg in ubuntu


In order to convert flac to mp3 you need to install ffmpeg in your computer.

As a root:
1. apt-get install ffmpeg
2. apt-get install lame
3. apt-get install libavcodec-extra-53

Then run command as follow:

ffmpeg -i audio_souce.flac -ab 256k audio_output.mp3

Where ab is bitrate in kb/s

Enjoy

Thursday, January 26, 2012

How to Create a Wallpaper Slideshow in Ubuntu 11.10

sudo add-apt-repository ppa:crebs/ppa
sudo apt-get update
sudo apt-get install crebs

Select your photos and name your slideshow.


After creating it. Crebs store it as xml file in $HOME/.crebs
Then rename & replace crebs xml file to background-1.xml in the path /usr/share/backgrounds/contest
Right mouse click on Desktop and select: Change Desktop background
Select your slideshow in the appearance window.


If for some reason the crebs repo doesn't work, you can always edit your /usr/share/backgrounds/contest/background-1.xml and change the images path for those which you want to use.

Don't forget to assign proper rights to the xml file. I use to set 666 with chmod command. (chmod 666 background-1.xml)

Enjoy it

Thursday, January 19, 2012

FFmpeg


Have you ever needed to increment audio volume level from any of your videos? ok, it is not too common but anyway, there is a powerful tool to help us whit that task. FFmpeg, so I'm going to set the steps here.

1. Remove sound from a video file.

 ffmpeg -i source_video.ogv -an -vcodec mpeg4 -b 1200k just_video.mp4

2. Extract audio from video.

ffmpeg -i source_video.ogv -ab 128k just_audio.mp3

3. Increment volume from an mp3 audio

ffmpeg -i just_audio.mp3 -vol 2000 -ab 128k overninethousand_audio.mp3

4. Encode to the final video.

ffmpeg -i overninethousand_audio.mp3 -i just_video.mp4 -vcodec mpeg4 -b 1200k final_video.mp4

That's it, you have a new video with over nine thousand level.

FFmpeg site

Thursday, December 29, 2011

Mixes 2011


Thank you whoever listened and downloaded my mixes this year !

Wednesday, November 16, 2011

Compound Prepositions

A preposition relates the noun or pronoun following it to another word in the sentence. Compound prepositions are also known as complex prepositions and are, as the name implies, made up of more than one word. Some of the more common compound prepositions are used frequently in the English Language and they will always (or, most probably) be found together. In this post I wrote a helper list for understanding compound prepositions meaning as follow:

Compound preposition
following by description: and an example.

According to
In a manner, correspond to, in proportion: This list is sort according to the Alphabet.

Along with
In addition to someone or something; together with someone or something
Jane went to the mall along with David. I ate some chocolates along with some fruit.

Apart from
With the exception of: Apart from a few scratches, the car was undamaged.

As for
Considering or speaking about: I am still working, and as for my health, it is very good.

As of
On: The project was terminated as of January 1.

Aside from
Excluding; except for: Aside from a mild fever, the patient feels fine.

Because of
By reason of: I didn't go out because of the rain.

By means of.
Owing to: He'll succeed by means of sheer persistence.

By way of
Passing through something (as a place); via something: He came home by way of Toledo.

Except for
Apart from; with the exception of: Except for this mistake, you did very well

In addition to
As well as; besides: In addition to directing the play, she designed most of the scenery.

In back of
Means behind: The trash is kept in back of the store.

In case of
If there should happen to be: A number to call in case of emergency.

In front of
At or near the front part of (something): Not in front of the children!

In place of
Instead of someone or something; as a substitute for someone or something:
I changed my mind. I want a red one in place of the blue one.

In spite of
In opposition to all efforts of: He still loves her in spite of everything.

Instead of
Rather than: He walked to school instead of taking the car.

Next to
Beside; alongside: A adventure playground is located next to the main building.

On account of
Due to and owing to: He was kept in after school on account of his bad behaviour.

On behalf of
Speaking or acting for: On behalf of all those present, may I thank you for a well executed presentation.

On top of
Fully informed about: A senator who is always on top of the issues.

Out for
Definition: To be + out for Searching:  I'm looking out for some new door handles.

Owing to
Because of; on account of: I couldn't attend, owing to illness.

Prior to
Preceding; before: Prior to the changes of ownership and editorship

Regardless of
In spite of: We will persevere regardless of past failures.

With regard to
Concerning; about: I spoke to him with regard to his future

Friday, October 07, 2011

Las Valkirias

Una vez leí en un libro de Paulo Coelho “Todo lo que ocurre una vez, puede no ocurrir jamás. Pero todo lo que ocurre dos veces, terminará sucediendo una tercera”, desde entonces esa idea ha formado parte de mi vida, y es una grata sorpresa volverlo a encontrar en las Valkirias.

No soy muy afecto a la poesía, pero que tal ésta de Oscar Wilde.

Destruimos siempre aquello que más amamos
en el campo abierto, o en una emboscada;
algunos con la ligereza del cariño
otros con la dureza de la palabra;
los cobardes destruyen con un beso,
los valientes destruyen con la espada.

 De la poesía a los ángeles. ¿Existirán?. No me lo creo mucho, pero sería hermoso que si.
¿Has tenido la sensación de que, en determinados momentos en tu vida, alguien te observa? -- preguntó Paulo.
-- ¿Cómo los sabes?
-- Porque lo sé. Son momentos en los que, sin tener conciencia, notamos la presencia de los ángeles.
Los ángeles son mensajeros de Dios. Ellos nos dicen empieza a moverte, y yo empezaré a cuidar de tu camino.

La segunda mente. -- Ésa es la segunda mente  -- dijo --. La que está cantando esa canción. Podría ser una preocupación cualquiera. O si estuvieses enamorado, podrías tener ahí dentro a la persona con la que te gustaría estar, o lo que desearías olvidar. Pero la segunda mente no es fácil: trabaja independientemente de tu voluntad.

¿Tú nunca tuviste amores aprisionados?
-- ¡Son los peores amores, amores terribles! -- Continuó Took, sin poder contener la risa --- Viajas, intentas olvidar, pero la segunda menta te está diciendo todo el tiempo: "¡Ella adoraría esto!", "¡Caray, qué bueno sería si ella estuviera aquí".

El espacio mágico. Todos los hombres y animales, creamos una especie de ‘espacio mágico’ a nuestro alrededor. Generalmente es un círculo de cinco metros de radio, y prestamos atención a todo lo que entra en él. No importa si son personas, mesas, teléfonos o vitrinas: intentamos mantener el control de este pequeño mundo que nosotros mismos hemos creado.
”Los magos, sin embargo,  miran siempre a lo lejos. Ellos amplían este ‘espacio mágico’ y tratan de controlar muchas cosas más, a eso le llaman mirar al horizonte”.

¿Qué son las Valquirias?. Ninfas del palacio de votan. La palabra valquiria proviene del nórdico antiguo valkyrja y significa la que elige a los caídos en batalla. Mensajeras de los dioses, conducían a los heroes a la muerte y después al paraíso. Simbolizan al mismo tiempo la embriaguez del coraje y el reposo del guerrero, la aventura del amor en la lucha, el encuentro y la pérdida.

¿Qué es la rutina? Es un ritual cuidadosamente elaborado, que el ser humano procura ejecutar con precisión porque tiene miedo de que todo se venga abajo si no cumple con cualquiera de sus partes.

Como cualquier libro de Coelho no podía faltar la mención del sentimiento más hermoso del mundo. El amor. “La pasión es algo bueno, divertido, y que podía enriquecer mucho la vida. Pero era distinta del amor. Y el amor vale cualquier precio, no merecía ser cambiado por nada”.

Frases de Valkirias:
* El mundo está en las manos de quienes tuvieran el coraje de soñar y de vivir de sus sueños.
* Mantén nuestra mano firme y haz que no desistamos de luchar, aun sintiendo que somos indignos de la batalla.
* Quien es feliz sólo puede mirar el mundo con amor, esa fuerza que  regenera todo lo que existe en el universo.


Paulo Coelho - Las Valkirias (Amazon)

Wednesday, October 05, 2011

Steve Jobs

Ayer feliz porque estaba estrenando mi MacBook Pro, hoy me entero que Steve Jobs se ha adelantado. Un visionario, un hombre que trascendió por el impacto en la vida de muchas personas. El mundo no hubiera sido el mismo sin él.

Wednesday, September 14, 2011

Aleph

1.  Las Oraciones
¿Pero las oraciones no nos acercan a Dios?

-- Voy a responder con otra pregunta. ¿Todas esas oraciones que rezas harán que el sol salga mañana? Claro que no: el sol nace porque obedece a una ley universal. Dios está cerca de nosotros, independientemente de las plegarias que hacemos.

-- ¿Estás diciendo que nuestras oraciones son inútiles? -- insiste Tatiana.

-- De ninguna manera. Si no te despiertas temprano, nunca conseguirás ver al sol naciendo. Si no rezas aun cuando Dios simpre esté cerca, nunca consiguirás notar Su presencia.

 2. El perdón
Seré naturalmente capaz de amar por encima de todo desamor.
De dar aun habiendo sido desposeido de todo.
De trabajar alegremente incluso en medio de todos los obstáculos.
De extender la mano aun cuando esté en la más completa soledad y abandono.
De secar las lágrimas aun en medio del llanto.
De creer aun sin ser creyente.

3. Yo te amo
Yo te amo como un río, que crea las condiciones para que la vegetación y las flores crezcan por donde pasa. Te amo como un río que da de beber a las personas que tienen sed y transporta a las personas donde quieren llegar. Yo te amo como un río, que entiende que necesita correr diferente en una cascada y aprender a reposar en una depresión terreno.

4. Experimentar, aprendizaje.
¿Es posible desviarse del camino trazado por Dios? Sí, pero siempre es un error. ¿Es posible evitar el dolor? Sí, pero entonces no aprenderás nada. ¿Es posible conocer las cosas sin experimentarlas verdaderamente? Sí, pero ellas nunca formarán realmente parte de ti.

Paulo Coelho - Aleph (Amazon)

Sunday, September 11, 2011

Compassion


Love & Compassion are necessities, they are not luxuries without them humanity can not survive. ~ Dalai Lama

Compassion is comprised from that capacity to see clearly in to the nature of suffering, is the ability to really stand strong and to recognize also that I'm not separate from this suffering.

Compassion has enemies and those enemies are things like pity, moral outrage & fear.

“When your fear touches someone’s pain, it becomes pity, when your love touches someone’s pain, it become compassion.” ~ Stephen Levine

Monday, December 20, 2010

You Lost Me


I am done, smoking gun
We've lost it all, the love is gone
She has won, now it's no fun
We've lost it all, the love is gone

And we had magic
And this is tragic
You couldn't keep your hands to yourself

I feel like our world's been infected
And somehow you left me neglected
We've found our lives been changed
Babe, you lost me

And we tried, oh how we cried
We lost ourselves, the love has died
And though we tried you can't deny
We're left as shells, we lost the fight

And we had magic
And this is tragic
You couldn't keep your hands to yourself

I feel like our world's been infected
And somehow you left me neglected
We've found our lives been changed
Babe, you lost me

Now I know you're sorry and we were sweet
But you chose lust when you deceived me
And you'll regret it, but it's too late
How can I ever trust you again?

I feel like our world's been infected
And somehow you left me neglected
We've found our lives been changed
Babe, you lost me

Thursday, November 25, 2010

Matando nuestros sueños

El primer síntoma de el proceso de matar nuestros sueños es la falta de tiempo. La gente más ocupada piensa yo tengo que saber que en mi vida siempre hay tiempo suficiente para hacer todo. Aquellos que hacen nada estan siempre cansados y no ponen atención al pequeño esfuerzo que se requiere hacer. La queja constante que el día es muy corto. La verdad es, ellos estan temerosos de pelear una buena pelea.

El segundo síntoma de la muerte de nuestros sueños se encuentra en nuestras certezas. Porque nosotros no queremos ver la vida como una gran aventura, empezamos a pensar en nosotros mismo como sabios, justos y correctos y procurando preguntar tan poco de la vida. Miramos más allá de las paredes del día a día de nuestra existencia, y oimos el sonido de las lanzas rompiendose, olemos el polvo y el sudor, y creemos que ni la victoria o derrota son importantes; pero lo que es importante es solo que ellos están si están peleando una buena pelea.

Y finalmente, el tercer síntoma el dejar pasar nuestros sueños en paz. La vida se vuelve un Domingo en la tarde; y pedimos nada importante, y desistimos de pedir nada mas de lo que nosotros podemos dar. En ese estado, nosotros pensamos en nosotros como maduros; ponemos de lado las fantasías de nuestra juventud, y buscamos logros personales y profesionales. Nosotros estamos sorprendidos cuando la gente de nuestra edad dice que ellos aún quieren hacer esto o aquellos en la vida. Pero realmente, en el fondo de nuestro corazón, nosotros sabemoos que lo que está pasando es que hemos renunciado a la batalla de nuestros sueños. Nosotros hemos decidido no pelear una buena pelea.


Traducción de blog de Paulo Coelho.

Wednesday, November 24, 2010

Miedo

* Preocupación: Es el mecanismo psicológico que nos pide hacer algo. Lo que nos provoca hacer algo es la energía del miedo. Usualmente miedo a las consecuencias. Por la preocupación, la persona tiende a evitar pensar en ello. Por lo tanto cae en un circulo vicioso . El miedo causa no acción, y la no acción causa preocupación.

* Ansiedad: Es miedo cuya causa no es especifico o vago. Mientras la preocupación es algo especifico e identificado. Ansiedad es el resultado de repetidos miedos no procesados que se han acomulado en el subconsciente. Se ha convertido en un vago sentimiento a cerca de inminente desfortuna pero la cual no puede ser tratada porque no es específica. Para resolverlo, debe primero convertirse en una preocupación específica, y entonces se pueden aplicar los lineamientos de como manejar la preocupación.

* Panico: Es un miedo abrumador que hace que la persona se confunda y no esté clara de que hacer. Este es el resultado acumulado de muchos miedos, preocupaciones y ansiedad que no han sido resueltos y no han sido manejados bien. Algunas veces se produce un ataque de panico, los cuales provocan inexplicables reacciones que pueden no se tener una causa inmediata pero que se manifiestan en la persona.

* Fobias: Son reacciones al miedo las cual se catalogan en (a) Exagerar el daño que se corre, como saltar y chillar a la vista de una rata o cucaracha o (b) Irracional, como temblar cuando se ve la foto de una araña.

* Trauma: Es una "herida" psicológica que aun causa angustia en la persona. Estrictamente hablando, miedos adquiridos con traumas en diferentes grados de intensidad. Pero un trauma se convierte en patológico cuando causa periodica angustia como pesadillas, reacciones intesas a algo que nos recuerda, o perturbaciones en la vida diaria y trabajo.

* Envidia: Es una emoción compleja, puesto que es una mezcla de un número de cosas: Baja autoestima, resentimiento y miedo. Nosotros no envidiamos el éxito o logros de personas de la cuales nos identificamos con ellas, por ejemplo las que amamos o nos importan. Pues sus logros los sentimos como nuestros. Por otro lado, los logros de aquellos de los cuales no podemos identificarmos, particularmente de aquellos de los cuales estamos resentidos, se convierten en amenaza a nuestra auto estima.

* Pena: Involucra cambios en expresión física que denotan perplejidad o confusión al mismo tiempo. La pena puede no tener causa alguna, como cuando alguién cae en desgracia. Por lo tanto no es causa de enojo hacia alguien (excepto tal vez hacias si mismo). La consecuencia es esconderla y no querer enfrentar la situación. Por el miedo a lo que las personas pueden pensar o decir.


Traducción de blog de Paulo Coelho.

Wednesday, October 27, 2010

Extreme Programming Explained

XP is a style of software development focusing on excellent application of programming techniques, clear communication, and teamwork which allow us to accomplish things we previously could not even imagine. XP Includes:

* A philosophy of software development based on the values of communication, feedback, simplicity, courage, and respect.
* A body of practices proven useful in improving software development, The practices complement each other, amplifying their effects. The are chosen as expressions of the values.
* It's short development cycles, resulting in early, concrete, and continuing feedback.
* XP is a lightweight methodology for small-to-medium-sized teams developing software in the face of vague or rapidly changing requirements.
* XP Creates and maintains a comprehensive suite of automated tests, which are run and rerun after every change to ensure a quality baseline. XP always keeps the system in deployable condition. Problems are not allowed to accumulate.
* XP insists that only the highest priority task are addressed.
* XP asks programmers to accept responsibility for estimating and completing their own work, gives them feedback about the actual time taken so their estimates can improve, and respects those estimates.
 * XP  is like driving because: "Driving is not about getting the car going in the right direction. Driving is about constantly paying attention, making a little correction this way, a little correction that way." This is the paradigm for XP, Stay aware. Adapt. Change.
* XP embraces five values to guide development: communication, simplicity, feedback, courage, and respect.

   - Communication: When you encounter a problem, ask yourselves if the problem was caused by a lack of communication.
   - Simplicity: Is the most intensely intellectual of the XP values. 
   - Feedback: XP teams strive to generate as much feedback as they can handle as quickly as possible. They try to shorten the feedback cycle to minutes or hours instead of weeks or months. The sooner you know, the sooner you can adapt.
   - Courage: Is effective action in the face of fear. Sometimes courage manifest as a bias to action. If you know what the problem is,  do something about it. Sometimes courage manifest as patience. If you there is a problem but you don't know what it is, it takes courage to wait for the real problem to emerge distinctly.
   - Respect: If members of a team don't care about each other and what they are doing, XP won't work. If members of a team don't care about a project, nothing can save it. For software development to simultaneously improve in humanity and productivity, the contributions of each person on the team need to be respected. I am important and so are you. 

Principles:

Humanity. People develop software, that's the way because we need to pay attention to: Basic Safety, Accomplishment (Opportunity to contribute to their society), Belonging (The ability to identify with a group from which they receive validation and accountability and contribute to its shared goals), Growth (Opportunity to expand their skills and perspective). Intimacy (The ability to understand and be understood deeply by others).

Economics:  Solving the highest priority business need first maximizes the value of the project.

Mutual Benefit: I write automated tests that help me design and implement better today, I leave these tests for future programmers to use as well. This practice benefits me now and maintainers down the road. 
I carefully refactor to remove accidental complexity, giving me both satisfaction and fewer defects and making the code easier to understand for those who encounter later.
Mutual benefit is the most important XP principle.

Diversity: In order to think of multiple ways to solve problems, and to implement solutions. Development teams need diversity. Two ideas about design present an opportunity, not a problem. The principle of diversity suggest that the programmers should work together on the problem and both opinions should be valuated.

Opportunity: Choosing to transform each problem into an opportunity for personal growth, deepening relationships, and improved software. 

Failure: If you're having trouble succeeding, fail. Don't know which of the three ways to implement a story? Try it all three ways. Even if they all fail, you'll certainly learn something valuable.

Quality: Projects don't go faster by accepting lower quality. The don't go slower by demanding higher quality. Pushing quality higher often results in faster delivery; while lowering  quality standards often results in later, less predictable delivery. 

Responsibility: cannot be assigned; it can only be accepted, if someone tries to give you responsibility, only you can decide if you are responsible or if you aren't.

Primary Practices.

Whole Team: People need a sense of "team":
* We belong.
* We are in this together.
* We support each other's work, growth, and learning.

Stories: When your team are doing estimation be sure that your story has all constraints in that case the team can split in task and do it in a informed decision way.

Pair Programming: 
* Keep each other on task.
* Brainstorm refinements to the system.
* Clarify ideas.
* Take initiative when their partner is stuck, thus lowering frustration.
* Hold each other accountable to the team's practices.
In addition: Rotate pairs frequently, personal hygiene and health are important issues when pairing.

Enjoy it: Amazon

Monday, October 04, 2010

Clean Code

Bad Code.

Programmers create problems for themselves when they write code solely to satisfy a compiler or interpreter.

Have you ever been significantly impeded by bad code? If you're a programmer if any experience then you've felt this impediment many times. Indeed, we have a name for it "wading".


Attitude.

Most managers want good code, even when they are obsessing about the schedule. They may defend the schedule and requirements with passion; but that's their job. It's our job to defend the code with equal passion.

To drive this point home, what if you were a doctor and had a patient who demanded that you stop all the silly hand-washing in preparation for surgery because it was taking too much time? Clearly the patient is the boss; and yet the doctor should absolutely refuse to comply. Why? Because the doctor knows more than the patient about the risks of disease and infection. It would be unprofressional (never mind criminal) for the doctor to comply with the patient.

So too is unprofessional for programmers to bend to the will of managers who don't understand the risks of making messes.

LeBlanc's Law

Why we wrote bad code?, Were you trying to go fast? Were you in a rush? Probably so. Perhaps you felt that you didn't have time to do a good job; that you boss would be angry with you if you took the time to clean up your code. We've all felt the relief of seeing our messy program work and deciding that a working mess is better than nothing. We've all said we'd go back and clean it up later. Of course, in those days we didn't know LeBlanc's law: Later equals never.

Kent Beck Rules
* Run ALL the tests
* Contains no duplication
* Express ALL the design ideas that are in the system
* Minimizes the number of entities (classes, methods, functions)

Functions
* Too many arguments
The ideal number of arguments in a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification and then shouldn't be used anyway.
* Flag arguments
Flag arguments are ugly. Passing a boolean into a function is a truly terrible practice. It immediately complicates the signature of the method, loudly proclaiming that this function does more than one thing.
* Dead functions
Methods that are never called should be discarded. Keeping dead code around is wasteful. Don't be afraid to delete the function, your source code control system still remembers it.
 
Commented-Out Code
Few practices are as odious as commenting-out code. Don't do this!.

// InputStream resultsStream = formatter.getResultStream();
// StreamReader reader = new StreamReader(resultsStream);
// response.setContent(reader.read(formatter.getByteCount()));

Others who see that commented-out code won't have the courage to delete it. They'll think it is there for a reason and is too important to delete. So commented-out code gathers like dregs at the bottom of a bad bottle of wine.

Quotes
* With functions we measured size by counting physical lines. With classes we use different measure. We count responsibilities.
* Wrapping particular implementations in more abstract methods, is also part to avoid duplication.
* When you're coding, you're an author and you have readers,   indeed the ratio of time spent reading vs writing is well over 10:1
* The fewer methods a class has, the better. The fewer variables a function knows about, the better. The fewer variables a class has, the better.
* Well-defined modules have very small interfaces that allow you to do a lot with a little. Concentrate on keeping interfaces very tight and very small. Help keep coupling low by limiting information.
* Before you consider yourself to be done with a function, make sure you understand how it works. Often the best way to gain this knowledge and understanding is to refactor the function into something that is so clean and expressive that it is obvious how it works.
* Boolean logic is hard enough to understand without having to see it in the context of an if or while statement. Extract functions that explain the intent of the conditional.

Tips
* Don't return null
* Don't pass null as parameter
* Take care about quality on Junit test code
* Follow SRP (Single Responsibility Principle)
* Maintain cohesion, when classes lose cohesion split them.
* If you do something a certain way, do all similar things in the same way.
* Consider polymorphism before using a switch or if/else statements.
* Avoid negative conditionals (Negatives are just a bit harder to understand that positives) So, when possible, conditionals should be expressed as positives. For example:

   if(buffer.shouldCompact())

is preferable to

  if(!buffer.shouldNotCompact())

Amazon Enjoy it.

Sunday, September 19, 2010

El secreto de sus ojos

Ésta se ha convertido en una de mis películas favoritas, el tema... los ojos, el espejo del alma. El único poder del ser humano, el de la toma de sus decisiones, los diferentes caminos que puede tomar una historia. De investigación y asesinatos.

Dialogos:

1.
-Es por el tema de las miradas, vos ves a ese tipillo mirando a ésa mujer adorándola. Los ojos hablan.
Usted no sabe lo que es al amor de ése tipo, conmueve.. es como si la muerte de la mujer, lo hubiera dejado para siempre allí eterno, ¿me entiende?.
Usted se imagina lo que debe ser un amor así sin el desgaste de lo cotidiano, de lo olbigatorio.
- Lo dirá por usted, porque a mi no me pasa.

2.
El tipo puede hacer cualquier cosa para parecer distinto, pero hay una cosa que no puede cambiar, ni él ni vos ni yo.
Mirame a mi, soy un tipo joven una mujer que me quiere, pero me sigo cansando la vida viniendo a lugares como éste, mas de una vez me dijiste ¿porqué estás aqui? Pablo, ¿Qué haces ahí? y sabes ¿Porqué estoy Benjamín?. Porque me apasiona, me gusta venir acá. Y vos lo mismo, no hay como sácarte a Irene.
Y ella tiene mas ganas de casarse que Susanita, ha de tener 37 revistas de traje de novia arriba del escritorio, se comprometió con fiesta y todo, pero vos seguís esperando el milagro Benjamín. ¿Sabés porque? ...

3.
-¿Cómo hizo usted para aprender a vivir sin ella?
-Pasaron 25 años Expósito
-El tipo suelto por allí, ¿Cómo hizo para empezar todo de nuevo?
-Pasaron 25 años. Olvidesé. ¿A usted que le importa?, es mi vida no la suya.
-Sí es mi vida también. Su amor por ésa mujer no volví a ver otra vez en nadie. Nunca.

Cuando vean la película pongan atención a:

La analogía de la máquina de escribir.
Cuando hablan de la novela en primera persona.
El secreto de sus ojos.
Como le ha pagado Morales a Expósito la que le debía.    

Enjoy it. IMDB.