tag:blogger.com,1999:blog-91803132024-03-07T10:16:02.153+01:00NoPlogEl weblog de NoPsromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.comBlogger81125tag:blogger.com,1999:blog-9180313.post-52120876087623673772013-05-06T09:25:00.004+02:002013-05-06T09:25:54.179+02:00Filtering messages in rsyslog<br />
Each time I open a new chromium-browser tab, I get messages like this in /var/log/syslog:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">May 6 09:15:37 compiler kernel: [4742643.809674] type=1701 audit(1367824537.257:40179): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=433 comm="chromium-browse" reason="seccomp" sig=0 syscall=2 compat=0 ip=0x7f3de13f86c0 code=0x50002</span><br />
<br />
<br />
This kind of continuous log writing is annoying and useless in my "desktop" system, even worse with an SSD disk, so I started looking how to filter rsyslog messages based in text strings.<br />
<br />
Thanks to Javier Vela, I finally added the following to my /etc/rsyslog.d/50-default.conf:<br />
<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">#### Begin - Remove chromium-browser messages:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">if ($syslogfacility-text == 'kern') and \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ( \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ($msg contains 'chromium-browse') or \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ($msg contains 'Chrome_') or \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ($msg contains 'callbacks suppressed') \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ) \</span><br />
<span style="font-family: Courier New, Courier, monospace;"> then ~</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">#### End </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">auth,authpriv.* /var/log/auth.log</span><br />
<span style="font-family: Courier New, Courier, monospace;">-/var/log/syslog</span><br />
<span style="font-family: Courier New, Courier, monospace;">*.*;auth,authpriv.none -/var/log/syslog</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">kern.* -/var/log/kern.log</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">mail.* -/var/log/mail.log</span><br />
<br />
<br />
<br />
After an <span style="font-family: Courier New, Courier, monospace;">service rsyslog restart</span> or <span style="font-family: Courier New, Courier, monospace;">/etc/init.d/rsyslog restart</span> , the message will not appear again.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com1tag:blogger.com,1999:blog-9180313.post-12432638064846870522013-04-05T19:12:00.001+02:002013-04-05T19:19:27.448+02:00Autoreload external code changes in Eclipse<br />
Interesante, para poder usar "git" manualmente en Eclipse sin el plugin de Egit:<br />
<br />
<br />
<i>----------------------------------------------------------------</i><br />
<i><a href="http://veerasundar.com/blog/2012/04/how-to-auto-reload-external-code-changes-in-eclipse-project/">http://veerasundar.com/blog/2012/04/how-to-auto-reload-external-code-changes-in-eclipse-project/</a></i><br />
<i><br /></i>
<br />
<i>I have started using Sublime text as my preferred code editor (for JS, CSS, Coffee). But, I still rely on Eclipse for writing Java code because it auto-imports Java packages and auto suggests variables and method names from my custom class files.</i><br />
<i><br /></i>
<i>Working on multiple editors throws in another problem: whenever I make a change in some file outside of Eclipse, the IDE does not silently reload. It shows a blank page saying 'The resource is out of sync. Press F5 to reload'. The message started annoying me soon as I had to switch back and forth often.</i><br />
<i><br /></i>
<i>It is not just for the multiple editors. Even when I do a<b> git pull</b>, the resources go out of sync.</i><br />
<i><br /></i>
<i>Then, I found a workaround for this.<b> Eclipse provides a built-in option that auto reloads a resource if its out f sync</b>. Here's how you can enable it.</i><br />
<i><br /></i>
<i>Go to <b>Window -> Preferences -> General -> Workspace</b> and check the option <b>'Refresh using native hooks or polling'.</b></i><br />
<i><br /></i>
<i>So, the next time when you try to open a out of sync file, the IDE will sync it for you (thus saving you a keystroke, one at a time ).</i><br />
<i>----------------------------------------------------------------</i><br />
<i><br /></i>
El autor del mensaje original no lo comenta, pero también es necesario activar la opción <b>Refresh on Access.</b><br />
<b><br /></b>sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-80455351581101360272013-03-15T14:49:00.000+01:002013-03-15T16:51:59.509+01:00Volver a ROM Samsung Galaxy S2 oficial 4.1.2-root desde CyanogenMod<br />
<br />
Voy a describir los pasos necesarios para volver desde una CyanogenMod (9.1 en mi caso, pero también sirve para las 10.x) a la ROM oficial de SAMSUNG <b>XWLSD_FOPLS4</b> (Febrero 2013). Ojo, sólo he probado lo siguiente en esa versión de ROM, así que no recomiendo realizar los mismos pasos y usar los mismos programas para otras (no puedo certificar nada para versiones diferentes).<br />
<br />
En mi caso vuelvo a la ROM oficial porque estoy cansado de trastear con el teléfono. Creo que la versión 4.1.2 ya es suficientemente completa para mi uso diario y no quiero perder más tiempo con el teléfono más allá de usarlo y disfrutarlo. Poner la ROM oficial te limita mucho así que un término medio entre Custom ROM y ROM oficial es poner la ROM oficial y un kernel custom que te "regala" root+CWM+BLN.<br />
<br />
Básicamente, el procedimiento consiste en:<br />
<br />
<ol>
<li>Descargar todos los ficheros necesarios (ROM, kernel, ODIN, apks para liberar el móvil, etc)</li>
<li>Hacer backup del contenido del móvil (carpeta /efs, nandroid, aplicaciones, etc)</li>
<li>Instalar ROM oficial con ODIN.</li>
<li>Rootear el teléfono con un kernel custom y ODIN.</li>
<li>Liberar de nuevo la SIM del teléfono.</li>
<li>Quitar el triángulo amarillo de aviso de que el móvil ha sido modificado.</li>
<li>Recuperar nuestras aplicaciones y personalizar de nuevo las configuraciones.</li>
</ol>
<br />
Comencemos:<br />
<br />
<br />
<b><u>COSAS A DESCARGAR:</u></b><br />
<br />
Buscamos en google (normalmente es fácil de encontrar y están enlazadas en htcmania o xda-developers):<br />
<br />
<ul>
<li><b>Samsung Kies</b> (si no lo tienes ya instalado, hay que instalarlo para que Windows reconozca el teléfono).</li>
<li><b>Odin 3 v1.85</b> (para instalar la ROM)</li>
<li><b>Odin 3 v3.07</b> (para instalar el kernel Siyah con root)</li>
<li><b>Siyah-s2-v6.0b5.tar</b> (kernel con root y soporte BLN)</li>
<li><b>GalaxSimUnlock.apk</b> (para re-liberar el móvil)</li>
<li><b>TriangleAway237.apk</b> (para quitar el triángulo amarillo que avisa en el arranque de que el móvil ha sido modificado)</li>
<li><b>ROM I9100XWLSD_I9100FOPLS4_FOP.zip</b> (descargada de sammobile, ahora explico cómo).</li>
</ul>
<br />
<br />
<br />
<b><u>DESCARGAR LA ROM:</u></b><br />
<br />
<ul>
<li>Ir a <a href="http://www.sammobile.com/firmwares/">http://www.sammobile.com/firmwares/</a></li>
</ul>
<ul>
<li>Necesitaremos crear una cuenta para poder descargar ficheros. Creamos una cuenta nueva.</li>
<li>Una vez en /firmwares/, pulsamos arriba en <b>FIRMWARES</b> donde pone "<i>HOME - CHECK YOUR FIRMWARE - FIRMWARES</i>"</li>
</ul>
<ul>
<li>En el cajetín de búsqueda ponemos "<b>SmartPhone</b>" - "<b>Android</b>" - "<b>GT-I9100 - Galaxy SII</b>" - "<b>Spain - FOP</b>". La versión <b>FOP</b> es la versión libre. Podemos instalar también (están en ese desplegable) las de las operadoras Movistar, Vodafone, Orange y Yoigo (yo prefiero la libre).</li>
</ul>
<ul>
<li>Abajo nos aparecerán los posibles firmwares a descargar. Por ejemplo:</li>
</ul>
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>Country Date Version PDA CSC Kies</b></span><br />
<span style="font-family: Courier New, Courier, monospace;">Spain<span class="Apple-tab-span" style="white-space: pre;"> </span> 2013 February<span class="Apple-tab-span" style="white-space: pre;"> </span> 4.1.2<span class="Apple-tab-span" style="white-space: pre;"> </span> I9100XWLSD<span class="Apple-tab-span" style="white-space: pre;"> </span> I9100FOPLS4</span><br />
<span style="font-family: Courier New, Courier, monospace;">Spain<span class="Apple-tab-span" style="white-space: pre;"> </span> 2013 January<span class="Apple-tab-span" style="white-space: pre;"> </span> 4.1.2<span class="Apple-tab-span" style="white-space: pre;"> </span> I9100XWLS8<span class="Apple-tab-span" style="white-space: pre;"> </span> I9100FOPLS3<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<br />
<br />
<ul>
<li>Pulsamos sobre I9100XWLSD, que es la última versión. Es la misma que la XWLS8 con un parche de 21MB que salió a las 2 semanas vía OTA. Esto nos llevará a un enlace directo en hotfile, de donde bajamos la ROM (552.7MB).</li>
</ul>
<ul>
<li>Desempaquetamos el ZIP y obtendremos un fichero .tar.md5 que es el que usaremos en ODIN.</li>
</ul>
<br />
<br />
<br />
<b><u>HACER COPIAS:</u></b><br />
<br />
<ul>
<li>Si somos root en el dispositivo (lo normal si usamos Cyanogenmod), es muy recomendable <b>hacer una copia del directorio /efs</b>. Este directorio es importante porque contiene el IMEI de nuestro teléfono, y si lo perdemos podemos tener bastantes problemas después para hacer llamadas. De hecho, este backup deberíais hacerlo desde el primer día y guardarlo, estéis cambiando de rom o no. EFS cuelga de /, no de /mnt/sdcard que es la raíz que vemos en la mayoría de gestores de ficheros. Yo hice la copia con el FX File Explorer explorando / en modo root, pulsación larga sobre EFS, Comprimir, en /emmc/backup/efs.tar.gz . Es necesario un tar.gz para que se preserven propietarios y permisos de los ficheros porque la SD suele ser formato FAT. También hay aplicaciones específicas para hacer copias de la carpeta EFS. En teoría no se debería sobreescribir este directorio porque es una partición diferente de data, system y /, pero por si acaso (y por si algún día se os corrompe) haced este backup.</li>
</ul>
<ul>
<li>Instalar MyBackup o Titanium Backup hacer copia de las apps instaladas (sólo APKs, no APKs+DATOS). Los datos no nos servirán porque no son compatibles entre versiones, sólo los APKs.</li>
</ul>
<ul>
<li>Hacer una copia de la /sdcard/DCIM (las fotos y vídeos) a la microSD, para tenerlas por si acaso.</li>
</ul>
<ul>
<li>Entramos en Ajustes - Desarrollo y activamos Depuración USB.</li>
</ul>
<ul>
<li>Si tenemos Clockworkmod, entrar en modo recovery (encender el teléfono pulsando <b>POWER + HOME + VOLUP</b>) y hacer nandroid en formato tar del sistema, en la microSD.</li>
</ul>
<ul>
<li>Apagar el teléfono, poner la microSD en el PC y hacer una copia de sus contenidos (de los backups y los datos a conservar, vamos).</li>
</ul>
<ul>
<li>Aprovechar para crear una carpeta "OLD" en la microSD y MOVER alli todas las carpetas de "android" (android, data, databases, whatsapp, etc) que hay en la microSD, propias de Android o de aplicaciones, para que las cree limpias en el mismo sistema. Dejar solo las carpetas nuestras personales (Download, musica, etc).</li>
</ul>
<ul>
<li>Entrar en modo recovery de nuevo y hacer "<b>Wipe Cache</b>", "<b>Wipe Battery Stats</b>", "<b>Wipe Dalvik Cache</b>" y "<b>Wipe Data / Factory Reset</b>". Acabamos de resetear totalmente el teléfono.</li>
</ul>
<br />
<br />
<br />
<b><u>INSTALAR LA ROM 4.1.2 OFICIAL:</u></b><br />
<br />
<ul>
<li>Cargar batería del móvil al 100% por seguridad. Si el procedimiento lo hacemos desde un portátil conectado a la luz y con la batería cargada, mejor.</li>
</ul>
<ul>
<li>Instalar Samsung Kyes (si no lo tenemos ya).</li>
</ul>
<ul>
<li>Reiniciar Windows.</li>
</ul>
<ul>
<li>Insertar el teléfono para que instale los drivers. Esperar hasta que esté reconocido el teléfono (avisará de una serie de drivers instalados).</li>
</ul>
<ul>
<li>Desconectar el teléfono.</li>
</ul>
<ul>
<li>Matar Kyes con (Inicio -> ejecutar -> taskmgr -> procesos -> eliminar Kyes.exe).</li>
</ul>
<ul>
<li>Abrir Odin 3 v1.85</li>
</ul>
<ul>
<li>Quitar cable del teléfono y del PC.</li>
</ul>
<ul>
<li>Arrancar el teléfono en modo download (apagar, encender con <b>VOLDOWN+POWER+HOME</b> y soltarlo cuando salga una pregunta a la que contestaremos con la <b>VOLUP</b> para continue).</li>
</ul>
<ul>
<li>Conectar el cable al teléfono y al PC, y esperar a que lo detecte Windows y ODIN.</li>
</ul>
<ul>
<li>En PDA seleccionar el tar.md5 de la rom a flashear. Asegurarse de que sólo están marcadas las opciones "AutoReboot" y "F. Reset Time". <b>NO MARCAR NINGUNA OTRA OPCION</b>.</li>
</ul>
<ul>
<li>Darle a START. Esperar unos minutos, <b>NO DESCONECTAR EL CABLE NI TOCAR NI EL PC NI EL TELEFONO</b>.</li>
</ul>
<ul>
<li>El teléfono se reiniciará (desconectar entonces los cables ya sin problemas).</li>
</ul>
<ul>
<li>Arrancará 4.1.2 JB. Configuradlo pero no pongáis cuenta de google aún.</li>
</ul>
<ul>
<li>No marcar todavía las opciones de "Hacer copia de este dispositivo" y "Restaurar el dispositivo".</li>
</ul>
<ul>
<li>Meter el PIN de red. Luego (al menos en mi caso) nos pedirá un código para desbloquear la SIM porque si el teléfono era liberado, probablemente ya no lo estará. En este segundo punto cancelamos/descartamos para seguir usando el teléfono sin SIM.</li>
</ul>
<br />
<br />
Este procedimiento lo podéis ver más o menos en este vídeo:<br />
<br />
<a href="http://www.youtube.com/watch?v=XCYU0XNNQh8&feature=player_embedded">http://www.youtube.com/watch?v=XCYU0XNNQh8&feature=player_embedded</a><br />
<br />
<br />
<b><u>ROOTEAR EL TELEFONO E INSTALAR KERNEL CON SOPORTE BLN:</u></b><br />
<br />
Como véis, la ROM original no tiene root por lo que estamos limitados para ciertas cosas y además si era un teléfono liberado, es posible que necesitemos root para liberarlo de nuevo. Instalando un kernel personalizado podemos tener root y además cosas adicionales, como soporte BLN.<br />
<br />
El soporte BLN es IMPRESCINDIBLE. Nuestro móvil no tiene LED de avisos, como sí tienen otros móviles, así que si alguien te escribe por Whatsapp o te llama y no estás delante del teléfono, cuando lo tienes de nuevo delante no te enteras a menos que enciendas la pantalla y veas las notificaciones. Con el soporte BLN y la aplicación del market BLN Control, se encenderán las luces de la parte de abajo de la pantalla (menú y volver) como si fueran leds de notificación, de forma que sólo mirando el teléfono puedes saber si tienes algún mensaje nuevo. No gastan tanta batería como podáis pensar. Lo único que tuve que hacer yo para que no estuvieran siempre encendidas (por culpa del correo) fue quitar las notificaciones de gmail y poner un widget de gmail que tiene un numerito con los correos sin leer.<br />
<br />
Aunque no queráis soporte BLN, tenéis que instalar este kernel para tener root, luego no tenéis por qué activar el BLN (ni descargar siquiera BLN Control) si no queréis.<br />
<br />
<ul>
<li>Abrir Odin 3 v3.07</li>
</ul>
<ul>
<li>Quitar cables del teléfono y del PC.</li>
</ul>
<ul>
<li>Arrancar el teléfono en modo download (apagar, encender con <b>VOLDOWN+POWER+HOME</b> y soltarlo cuando salga una pregunta a la que contestaremos con la <b>VOLUP</b> para continue).</li>
</ul>
<ul>
<li>Conectar el cable al teléfono y al PC, y esperar a que lo detecte Windows y ODIN.</li>
</ul>
<ul>
<li>En PDA seleccionar el tar.md5 de Siyah-s2-v6.0b5.tar. Asegurarse de que sólo están marcadas las opciones "AutoReboot" y "F. Reset Time".</li>
</ul>
<ul>
<li>Darle a START. Acabará muy rápido y reiniciará el teléfono (podemos quitar los cables).</li>
</ul>
<ul>
<li>Meter el PIN de red. Luego nos pedirá un código para desbloquear la SIM porque si el teléfono era liberado, probablemente ya no lo estará. En este segundo punto cancelamos/descartamos para seguir usando el teléfono sin SIM.</li>
</ul>
<ul>
<li>Ir a "Cajón de aplicaciones" -> "Ajustes" -> "Seguridad" -> "Fuentes desconocidas" y activarlo.</li>
</ul>
<ul>
<li>Ir a las aplicaciones, Archivos e instalar GalaxSimUnlock.apk. Ejecutarlo y desbloquear la SIM.</li>
</ul>
<ul>
<li>Reiniciar, esta vez sí nos aceptará el PIN.</li>
</ul>
<br />
<br />
<br />
<b><u>QUITAR EL TRIANGULO DE AVISO DE TELEFONO MODIFICADO</u></b><br />
<br />
Al modificar el teléfono (hacerse root) siempre sale un triángulo amarillo de aviso al arrancar. Podemos quitarlo así:<br />
<br />
<br />
<ul>
<li>Instalar TriangleAway237.apk y ejecutarlo. </li>
</ul>
<ul>
<li>Reiniciar para comprobar que ya no aparece.</li>
</ul>
<br />
<br />
<br />
<b><u>RECUPERAR TODAS LAS APLICACIONES:</u></b><br />
<br />
Ahora viene lo peor, dejar el teléfono como estaba antes de meternos en faena (con todas sus aplicaciones y configuraciones):<br />
<br />
<ul>
<li>Activar copia de seguridad y restauración ("Ajustes" -> "Copia de seguridad").</li>
</ul>
<ul>
<li>Configuramos nuestra cuenta de Google en "Ajustes" -> "Cuentas" -> "Google".</li>
</ul>
<div>
<br /></div>
<div>
Y ahora, recuperamos las aplicaciones:</div>
<ul>
<li><b>Opción A:</b> Entrar en google play, sección aplicaciones, todas, y descargar manualmente las aplicaciones que queramos descargar.</li>
</ul>
<ul>
<li><b>Opción B: </b>Instalar MyBackup o Titanium Backup y restaurar las apps instaladas. Ojo, tendréis que desmarcar algunas de las aplicaciones para que no las restaure (cosas de Cyanogen como su cámara, sus salvapantallas, el ROM manager, etc). Si restauramos desde backup, deberá ser SOLO los APKs, no los datos. Tendremos que configurar las aplicaciones otra vez (al restaurar sólo los APKs no están configuradas).</li>
</ul>
<ul>
<li>Hay que tener paciencia en este paso, y restaurar sólo lo que vayamos a usar y no meter "basura" que venía de Cyanogen.</li>
</ul>
<ul>
<li>Si tenemos titaniumBackup, "congelar" (o desinstalar) aplicaciones que puedan consumir recursos o que sean de Samsung.</li>
</ul>
<ul>
<li>Configuramos el launcher, ponemos los iconos en su sitio, agregamos los widgets deseados, etc etc etc...</li>
</ul>
<br />
Algunas aplicaciones que se pueden congelar con seguridad (visto en htcmania y xda-developers):<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Actualizacion de software</span><br />
<span style="font-family: Courier New, Courier, monospace;">Allshare service</span><br />
<span style="font-family: Courier New, Courier, monospace;">Almacenamiento de contenido protegido por DRM</span><br />
<span style="font-family: Courier New, Courier, monospace;">Dias</span><br />
<span style="font-family: Courier New, Courier, monospace;">Dispositivos cercanos</span><br />
<span style="font-family: Courier New, Courier, monospace;">DSMForwarding</span><br />
<span style="font-family: Courier New, Courier, monospace;">DSMLawmo</span><br />
<span style="font-family: Courier New, Courier, monospace;">Enterprise SysScope Service</span><br />
<span style="font-family: Courier New, Courier, monospace;">Kies mediante wifi</span><br />
<span style="font-family: Courier New, Courier, monospace;">MAPServiceSamsung</span><br />
<span style="font-family: Courier New, Courier, monospace;">Rastreador móvil</span><br />
<span style="font-family: Courier New, Courier, monospace;">Samsung browser syncadapter</span><br />
<span style="font-family: Courier New, Courier, monospace;">Samsung calendar syncadapter</span><br />
<span style="font-family: Courier New, Courier, monospace;">Samsung contact syncadapter</span><br />
<span style="font-family: Courier New, Courier, monospace;">Samsung syncadapter</span><br />
<span style="font-family: Courier New, Courier, monospace;">SamsungAppsUNA2</span><br />
<span style="font-family: Courier New, Courier, monospace;">SASlideShow</span><br />
<span style="font-family: Courier New, Courier, monospace;">SysScope</span><br />
<span style="font-family: Courier New, Courier, monospace;">Weather widget</span><br />
<span style="font-family: Courier New, Courier, monospace;">wssyncmlnps</span><br />
<span style="font-family: Courier New, Courier, monospace;">ChatOn</span><br />
<span style="font-family: Courier New, Courier, monospace;">Video Hub</span><br />
<span style="font-family: Courier New, Courier, monospace;">Readers Hub</span><br />
<span style="font-family: Courier New, Courier, monospace;">Music Hub</span><br />
<br />
En XDA hay un hilo con más aplicaciones que se pueden congelar (o deinstalar) para reducir el consumo de batería:<br />
<br />
<a href="http://forum.xda-developers.com/showthread.php?t=2016419">http://forum.xda-developers.com/showthread.php?t=2016419</a><br />
<br />
Espero que os haya sido de utilidad :-) . Por si acaso, yo no me responsabilizo del resultado de la ejecución de los anteriores pasos, sólo diré que lo he hecho en mi teléfono con éxito y que la semana que viene lo haré en otro S2 para dejarlo también en la versión oficial.<br />
<div>
<br /></div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com4tag:blogger.com,1999:blog-9180313.post-77762903233401921982013-03-13T13:26:00.004+01:002013-03-13T14:08:54.141+01:00Control de volumen usando el teclado en XFCE <br />
<br />
Si queremos manejar rápidamente el volumen desde el teclado en XFCE y no tenemos ningún teclado con teclas de función especiales (o no las detecta), podéis usar los símbolos +, -, * y / del teclado numérico junto a la tecla CONTROL de la siguiente forma:<br />
<br />
<i>Menú → Configuración → Teclado → Atajos de aplicación</i><br />
<br />
<br />
Añadir los siguientes atajos:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Comando: amixer set Master 5%+</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_+</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Comando: amixer set Master 5%-</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_-</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Comando: amixer set Master 100%-</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_*</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Comando: amixer set Master 100%-</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_/</span><br />
<br />
<br />
Otra posible opción a añadir es la de alternar el canal de audio con:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">amixer set Master toggle</span><br />
<br />
Pero presenta el problema de que es posible que al hacer un toggle a mute, necesitemos deshacer el mute del PCM (y de los HeadPhone, si se tercia) para recuperar el audio:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">amixer set PCM 100% unmute</span><br />
<br />
(Esto implicaría tener que usar un script para el toggle, y no un simple comando como en los casos anteriores, de ahí que prefiera el paso de volumen a cero con CTRL+KEYPAD_/)<br />
<br />
<br />
<b><span style="font-size: large;">EDIT: </span></b><br />
<br />
No me he podido resistir a añadir también lo siguiente para controlar banshee:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Comando: banshee --toggle-playing</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_5</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Comando: banshee --previous</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_4</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Comando: banshee --next</span><br />
<span style="font-family: Courier New, Courier, monospace;">Atajo: Ctrl+KEYPAD_6</span><br />
<br />
<br />
Espero que os resulte útil.<br />
<br />
<br />
<div style="margin-bottom: 0.5em; padding: 0px;">
<div style="font-size: 12.727272033691406px;">
</div>
</div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-42739478315601490282013-03-07T13:04:00.000+01:002013-03-07T16:31:24.842+01:00Astyle - reformateando código desde CLI o vim<br />
En la <a href="http://noplog.blogspot.com.es/2013/03/autoformateo-de-codigo-en-eclipse-curly.html">anterior entrega</a> comenté los diferentes estilos de formato de código y cómo reconfigurar el formateador de código de Eclipse para formatear con el <a href="http://en.wikipedia.org/wiki/Indent_style#Allman_style">Estilo Allman</a> .<br />
<br />
Pero ... ¿y los programadores de C, C++ o Java que no utilizan Eclipse? ¿Alguna buena opción para reformatear el código a un estándar si todos los ficheros del proyecto no lo cumplen?<br />
<br />
La solución es <a href="http://astyle.sourceforge.net/">AStyle</a>.<br />
<br />
Según la documentación, una vez instalado (bien descargado manualmente o bien con "<i>yum install</i>" o "<i>apt-get install</i>" astyle, podemos hacer cosas como:<br />
<br />
<br />
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;">astyle --style=allman ~/project/foo.cpp</pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;"></pre>
<div>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;">astyle --style=allman --recursive ~/project/*.cpp ~/project/*.h</pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;"></pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;"></pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;"></pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;"></pre>
<pre style="color: navy; font-weight: bold; margin-left: 0.3in;">astyle [options] < OriginalSourceFile > BeautifiedSourceFile</pre>
<br />
<br />
Si no especificamos ninguna opción adicional, se usarán 4 espacios para los tabuladores.<br />
<br />
Si no queremos tener que especificar manualmente ni el estilo ni las opciones largas, podemos crear un fichero <b>$HOME/.astylerc</b> en Linux o <b>%USERPROFILE%\astylerc</b> en Windows, conteniendo las opciones por defecto que queremos, así como opciones que por defecto no podríamos solicitar por la línea de comandos:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">#The best formatting style:</span><br />
<span style="font-family: Courier New, Courier, monospace;">--style=allman</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"># Options:</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-classes</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-switches</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-cases</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-namespaces</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-labels</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-preprocessor</span><br />
<span style="font-family: Courier New, Courier, monospace;">--indent-col1-comments</span><br />
<span style="font-family: Courier New, Courier, monospace;">--break-blocks</span><br />
<span style="font-family: Courier New, Courier, monospace;">--convert-tabs</span><br />
<span style="font-family: Courier New, Courier, monospace;">#--add-brackets <-- add="" after="" codelines="" else...="" font="" if="" single="" to=""><!------><!------></--></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"># Short options:</span><br />
<span style="font-family: Courier New, Courier, monospace;">-s4 -p</span><br />
<br />
<br />
Además de llamarlo desde línea de comandos, podemos formatear el buffer actual entero en Vim en modo comando con:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>:%!astyle</b></span><br />
<br />
<br />
Con esto se filtrará el buffer entero a través de astyle, sustituyendo al actual texto. Se utilizarán los parámetros del .astylerc.<br />
<br />
De hecho, si lo usamos normalmente, lo habitual será mapearse una tecla para ello:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>map <F8> <f8>:%!astyle<cr></cr></f8></b></span><br />
<div>
<br /></div>
<br />
<br />
Ojo, esto reformateará el archivo entero, ya que tal y como lo estamos haciendo, si le pasamos a Astyle texto seleccionado (<b>:!astyle</b> en una selección) no verá el contexto lo formateará, pero dejándolo en indentado 0 (algo que podríamos solucionar después con >>)...<br />
<br />
<div>
<br /></div>
<br />
<pre style="margin-left: 0.3in;"></pre>
</div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-58821008253695446602013-03-05T10:20:00.000+01:002013-03-07T12:44:40.820+01:00Autoformateo de código en Eclipse: Curly Brackets y Max Line Length<br />
La convención de formato para código Java parece indicar que las llaves (<i>curly brackets</i> o <i>braces</i>) que abren clases, métodos y sentencias de control van a la derecha de la definición/sentencia, en la misma línea:<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">class MiClase {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">if( condicion ) {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<br />
No obstante, yo, desde hace 15 años (en C) estoy acostumbrado a poner la llave en la siguiente línea, indentada al mismo nivel que la línea de cierre:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">class MiClase </span><br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">if( condicion ) </span><br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<div>
<br /></div>
Sinceramente, a mí me parece más legible e intuitivo para encontrar los diferentes niveles de indentado de código, por lo que no termino de acostumbrarme a poner la llave de apertura a la derecha en la misma línea.<br />
<br />
Entiendo que esto se realiza para poder diferenciar estas llaves de las llaves que se pueden usar para definir ámbitos locales para variables:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> int i;</span><br />
<span style="font-family: Courier New, Courier, monospace;"> for i in (blah; ... )</span><br />
<span style="font-family: Courier New, Courier, monospace;"> {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> }</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> } // i desaparece con este cierre de ámbito</span><br />
<span style="font-family: Courier New, Courier, monospace;">}</span><br />
<br />
Pero, insisto, yo me he acostumbrado a ponerlas en una nueva línea y mucho más desde que programo en Python, donde tengo la costumbre de indentar perfectamente y con 4 espacios, y que ahora me hace casi imposible escribir código Java de la forma "habitual" para los demás desarrolladores.<br />
<br />
El problema que tengo es que cuando pulso CTRL+ALT+F (formatting) en Eclipse, me formatea todo el código con la convención "habitual".<br />
<br />
Por suerte, he visto que se puede cambiar, tanto eso como el tamaño máximo de línea:<br />
<br />
<a href="http://stackoverflow.com/questions/4470232/how-do-i-change-the-code-convention-in-eclipse" target="_blank">[stackoverflow]/how-do-i-change-the-code-convention-in-eclipse</a><br />
<br />
<div>
+</div>
<div>
<a href="http://stackoverflow.com/questions/2891782/how-to-change-eclipse-indentation-style-for-automatically-generated-code" target="_blank">[stackoverflow]/how-to-change-eclipse-indentation-style-for-automatically-generated-code</a></div>
<br />
<br />
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.600000381469727px;"><i>Window -> Preferences -> Java -> Code style -> Formatter view</i></span><br />
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.600000381469727px;"><i><br /></i></span>
<span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.600000381469727px;"><i>Create a new profile based on the eclipse built in, then go to braces tab and change "same line" to next line everywhere. Then set the new profile to default.</i></span><br />
<br />
<br />
<a href="http://stackoverflow.com/questions/3697287/eclipse-set-maximum-line-length-for-auto-formatting" target="_blank">[stackoverflow]/eclipse-set-maximum-line-length-for-auto-formatting</a><br />
<br />
<br />
<i>In preferences Java -> Code Style -> Formatter, edit your profile. Under the Line Wrapping tab is the option for line width (Maximum line width:).</i><br />
<i><br /></i>
<i>Comments have their own line length setting at the bottom of the setting page Java -> Code style -> Formatter -> Edit... -> Comments</i><br />
<i><br /></i>
<br />
<br />
<b><span style="font-size: large;">EL DEBATE: CONVENCIÓN VS ESTILO PERSONAL</span></b><br />
<br />
<br />
Tengo sentimientos encontrados al respecto de este cambio.<br />
<br />
Por un lado, pienso que es un error ir contra las convenciones generales, porque es importante mantener un estilo similar en todo el código. Y si trabajas en equipo, esto es un problema. Tal vez lo ideal sería acostumbrarse a la convención habitual.<br />
<br />
Por otro, para mí es MUCHO más legible el código en este formato. Veo mucho más claro el ámbito de cada clase, método, función o bloque de código en una sentencia de control. Es una reminiscencia de Python, entiendo, pero me ocurre. Y claro, <b>al no ser un programador profesional</b> (como amablemente me recuerda constantemente Fede), el código que voy a crear y mantener probablemente será siempre sólo y exclusivamente mío... Ahora bien, esto es lo que me dice el corazón. La cabeza me dice que cuanto antes me acostumbre a la convención original más fácil me resultaré después leer el código de otros, utilizar código de otros o que otros trabajen conmigo, incluso en otros lenguajes.<br />
<br />
La postura oficial de convención para código de Sun y de Oracle es clara al respecto:<br />
<br />
<a href="http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html" target="_blank">[oracle.com]/Code Conventions for the Java TM Programming Language</a><br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<h3 style="background-color: white; font-family: arial, helvetica, sans-serif; font-size: 14px !important; list-style: none; margin: 0px; padding-bottom: 0px; padding-left: 0px !important; padding-right: 0px; padding-top: 0px;">
<span style="font-weight: normal;">
6.4 Class and Interface Declarations</span></h3>
<div style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; list-style: none; margin-bottom: 10px; padding: 0px;">
<a href="http://www.blogger.com/blogger.g?blogID=9180313" id="207" name="207" style="color: #1f4f82; list-style: none; margin: 0px; padding: 0px;"></a>When coding Java classes and interfaces, the following formatting rules should be followed:</div>
<ul style="background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><a href="http://www.blogger.com/blogger.g?blogID=9180313" id="390" name="390" style="color: #1f4f82; list-style: none; margin: 0px; padding: 0px;"></a></li>
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;">No space between a method name and the parenthesis "(" starting its parameter list<a href="http://www.blogger.com/blogger.g?blogID=9180313" id="391" name="391" style="color: #1f4f82; list-style: none; margin: 0px; padding: 0px;"></a></li>
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><span style="color: red;">Open brace "{" appears at the end of the same line as the declaration statement<a href="http://www.blogger.com/blogger.g?blogID=9180313" id="394" name="394" style="list-style: none; margin: 0px; padding: 0px;"></a></span></li>
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;">Closing brace "}" starts a line by itself indented to match its corresponding opening statement, except when it is a null statement the "}" should appear immediately after the "{"</li>
</ul>
<blockquote style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 5px 0px;">
<pre style="list-style: none; padding: 0px;">class Sample extends Object {
int ivar1;
int ivar2;
Sample(int i, int j) {
ivar1 = i;
ivar2 = j;
}
int emptyMethod() {}
...
}
</pre>
</blockquote>
<ul style="background-color: white; font-family: arial, helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px 0px 12px; padding: 0px;">
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;"><a href="http://www.blogger.com/blogger.g?blogID=9180313" id="1733" name="1733" style="color: #1f4f82; list-style: none; margin: 0px; padding: 0px;"></a></li>
<li style="background-image: url(http://www.oracle.com/assets/css/list-icons.png); background-position: -266px -129px; background-repeat: no-repeat no-repeat; list-style: none none; margin: 4px 0px 10px; padding: 0px 0px 0px 26px;">Methods are separated by a blank line</li>
<li></li>
</ul>
</div>
<div>
<br /></div>
<br />
Es decir, la llave en la misma línea :-(.<br />
<br />
Me gusta un poco más lo que se propone aquí para PHP:<br />
<br />
<a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md">[github.com]/PSR-2 Coding Style Guide</a><br />
<br />
<br />
<h3 style="-webkit-font-smoothing: antialiased; border: 0px; color: #333333; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 18px; margin: 20px 0px 10px; padding: 0px; position: relative;">
1.1. Example</h3>
<div style="border: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 22px; margin-bottom: 15px; padding: 0px;">
This example encompasses some of the rules below as a quick overview:</div>
<div class="highlight" style="background-color: white; border: none; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 22px; margin: 0px; padding: 0px;">
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;"><span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;"><span class="nx" style="border: 0px; margin: 0px; padding: 0px;">php</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">namespace</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">Vendor\Package</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">;</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">use</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">FooInterface</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">;</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">use</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">BarClass</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">as</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">Bar</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">;</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">use</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">OtherVendor\OtherPackage\BazClass</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">;</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">class</span> <span class="nc" style="border: 0px; color: #445588; font-weight: bold; margin: 0px; padding: 0px;">Foo</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">extends</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">Bar</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">implements</span> <span class="nx" style="border: 0px; margin: 0px; padding: 0px;">FooInterface</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">public</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">function</span> <span class="nf" style="border: 0px; color: #990000; font-weight: bold; margin: 0px; padding: 0px;">sampleFunction</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">(</span><span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$a</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">,</span> <span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$b</span> <span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">=</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">null</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">)</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">if</span> <span class="p" style="border: 0px; margin: 0px; padding: 0px;">(</span><span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$a</span> <span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">===</span> <span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$b</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">)</span> <span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="nx" style="border: 0px; margin: 0px; padding: 0px;">bar</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">();</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">elseif</span> <span class="p" style="border: 0px; margin: 0px; padding: 0px;">(</span><span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$a</span> <span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">></span> <span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$b</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">)</span> <span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$foo</span><span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">-></span><span class="na" style="border: 0px; color: teal; margin: 0px; padding: 0px;">bar</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">(</span><span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$arg1</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">);</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">else</span> <span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="nx" style="border: 0px; margin: 0px; padding: 0px;">BazClass</span><span class="o" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">::</span><span class="na" style="border: 0px; color: teal; margin: 0px; padding: 0px;">bar</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">(</span><span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$arg2</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">,</span> <span class="nv" style="border: 0px; color: teal; margin: 0px; padding: 0px;">$arg3</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">);</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span>
<span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">final</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">public</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">static</span> <span class="k" style="border: 0px; font-weight: bold; margin: 0px; padding: 0px;">function</span> <span class="nf" style="border: 0px; color: #990000; font-weight: bold; margin: 0px; padding: 0px;">bar</span><span class="p" style="border: 0px; margin: 0px; padding: 0px;">()</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">{</span>
<span class="c1" style="border: 0px; color: #999988; font-style: italic; margin: 0px; padding: 0px;">// method body</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span>
<span class="p" style="border: 0px; margin: 0px; padding: 0px;">}</span></span></pre>
</div>
<br />
<br />
Un mix: clases, métodos y funciones con las llaves en la siguiente línea, ifs, whiles, etc con las llaves en la misma. Eso sí, el elseif y el else junto a las llaves de cierre me provocan dolor de ojos...<br />
<br />
¿Opiniones?<br />
<br />
<br />
<b><u><span style="font-size: large;">EDIT:</span></u></b><br />
<br />
Veo que lo mío con las llaves tiene nombre: "Allman Style", y no soy el único que defiende este formato de código (el creador de C++ también lo utiliza). Es una variante del Estilo K&R:<br />
<br />
<a href="http://en.wikipedia.org/wiki/Indent_style">http://en.wikipedia.org/wiki/Indent_style</a><br />
<br />
<br />
<br />
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; font-size: 16.799999237060547px; line-height: 19.200000762939453px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="K.26R_style">K&R style</span></h3>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
The <a class="mw-redirect" href="http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="The C Programming Language (book)">K&R</a> style, so named because it was used in <a href="http://en.wikipedia.org/wiki/Brian_Kernighan" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Brian Kernighan">Kernighan</a> and <a href="http://en.wikipedia.org/wiki/Dennis_Ritchie" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Dennis Ritchie">Ritchie's</a> book <i><a class="mw-redirect" href="http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="The C Programming Language (book)">The C Programming Language</a></i>, is commonly used in C. It is also used for <a href="http://en.wikipedia.org/wiki/C%2B%2B" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="C++">C++</a>, <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="C Sharp (programming language)">C#</a>, and others.<sup class="Template-Fact" style="line-height: 1em; white-space: nowrap;">[<i><a href="http://en.wikipedia.org/wiki/Wikipedia:Citation_needed" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Wikipedia:Citation needed"><span title="This claim needs references to reliable sources from February 2007">citation needed</span></a></i>]</sup></div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
When adhering to K&R, each function has its opening brace at the next line on the same indentation level as its header, the statements within the braces are indented, and the closing brace at the end is on the same indentation level as the header of the function at a line of its own. The blocks inside a function, however, have their opening braces at the same line as their respective control statements; closing braces remain in a line of their own, unless followed by an <b>else</b> or <b>while</b> keyword.<sup class="Template-Fact" style="line-height: 1em; white-space: nowrap;">[<i><a href="http://en.wikipedia.org/wiki/Wikipedia:Citation_needed" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Wikipedia:Citation needed"><span title="This claim needs references to reliable sources from August 2012">citation needed</span></a></i>]</sup></div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
In this style a control statement with only a single statement in its scope may omit the braces. <i>The C Programming Language</i> refers to this as fertile soil for bugs (programming logical errors) and discourages it.</div>
<div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 12.800000190734863px; line-height: 1.1em; padding: 1em;">
<div class="c source-c" style="font-family: monospace; line-height: normal;">
<pre class="de1" style="background-image: none; border: 0px none white; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;"><span class="kw4" style="color: #993333;">int</span> main<span class="br0" style="color: #009900;">(</span><span class="kw4" style="color: #993333;">int</span> argc<span class="sy0" style="color: #339933;">,</span> <span class="kw4" style="color: #993333;">char</span> <span class="sy0" style="color: #339933;">*</span>argv<span class="br0" style="color: #009900;">[</span><span class="br0" style="color: #009900;">]</span><span class="br0" style="color: #009900;">)</span>
<span class="br0" style="color: #009900;">{</span>
...
<span class="kw1" style="color: #b1b100;">while</span> <span class="br0" style="color: #009900;">(</span>x <span class="sy0" style="color: #339933;">==</span> y<span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
something<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
somethingelse<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="kw1" style="color: #b1b100;">if</span> <span class="br0" style="color: #009900;">(</span>some_error<span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
<span class="coMULTI" style="color: grey; font-style: italic;">/* the curly braces around this code block could be omitted */</span>
do_correct<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span> <span class="kw1" style="color: #b1b100;">else</span>
continue_as_usual<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
finalthing<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
...
<span class="br0" style="color: #009900;">}</span>
</pre>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
<br /></div>
<br />
<br />
<br />
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; font-size: 16.799999237060547px; line-height: 19.200000762939453px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="Allman_style">Allman style</span></h3>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
The Allman style is named after <a href="http://en.wikipedia.org/wiki/Eric_Allman" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Eric Allman">Eric Allman</a>. It has been incorrectly referred to as "ANSI style"<sup class="reference" id="cite_ref-7" style="line-height: 1em;"><a href="http://en.wikipedia.org/wiki/Indent_style#cite_note-7" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial; white-space: nowrap;">[7]</a></sup> supposedly for its use in the documents describing the <a class="mw-redirect" href="http://en.wikipedia.org/wiki/ANSI" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="ANSI">ANSI</a> <a href="http://en.wikipedia.org/wiki/ANSI_C" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="ANSI C">C</a> standard (later adopted as the <a class="mw-redirect" href="http://en.wikipedia.org/wiki/ISO_C" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="ISO C">ISO C</a> international standard), though in fact those documents use K&R style.<sup class="reference" id="cite_ref-8" style="line-height: 1em;"><a href="http://en.wikipedia.org/wiki/Indent_style#cite_note-8" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial; white-space: nowrap;">[8]</a></sup> It is also sometimes known as "BSD style" since Allman wrote many of the utilities for <a href="http://en.wikipedia.org/wiki/Berkeley_Software_Distribution" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Berkeley Software Distribution">BSD Unix</a>(although this should not be confused with the different "BSD KNF style"; see below). This style has also been adopted by <a href="http://en.wikipedia.org/wiki/Bjarne_Stroustrup" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Bjarne Stroustrup">Bjarne Stroustrup</a> in his books, <i><a href="http://en.wikipedia.org/wiki/The_C%2B%2B_Programming_Language" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="The C++ Programming Language">The C++ Programming Language</a></i>.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
This style puts the brace associated with a control statement on the next line, indented to the same level as the control statement. Statements within the braces are indented to the next level.</div>
<div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 12.800000190734863px; line-height: 1.1em; padding: 1em;">
<div class="c source-c" style="font-family: monospace; line-height: normal;">
<pre class="de1" style="background-image: none; border: 0px none white; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;"><span class="kw1" style="color: #b1b100;">while</span> <span class="br0" style="color: #009900;">(</span>x <span class="sy0" style="color: #339933;">==</span> y<span class="br0" style="color: #009900;">)</span>
<span class="br0" style="color: #009900;">{</span>
something<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
somethingelse<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
finalthing<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
</pre>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
This style is similar to the standard indentation used by the <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Pascal_programming_language" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Pascal programming language">Pascal programming language</a> and <a href="http://en.wikipedia.org/wiki/Transact-SQL" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="Transact-SQL">Transact-SQL</a>, where the braces are equivalent to the <code style="background-color: #f9f9f9; font-family: monospace, Courier;">begin</code> and <code style="background-color: #f9f9f9; font-family: monospace, Courier;">end</code> keywords.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
Advantages of this style are that the indented code is clearly set apart from the containing statement by lines that are almost completely <a href="http://en.wikipedia.org/wiki/White_space_(visual_arts)" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: initial;" title="White space (visual arts)">whitespace</a>, improving readability, and the closing brace lines up in the same column as the opening brace, making it easy to find matching braces. Additionally, the blocking style delineates the actual block of code from the associated control statement itself. Commenting out the control statement, removing the control statement entirely, refactoring, or removing of the block of code is less likely to introduce syntax errors because of dangling or missing brackets.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
For example, the following is still syntactically correct:</div>
<div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 12.800000190734863px; line-height: 1.1em; padding: 1em;">
<div class="c source-c" style="font-family: monospace; line-height: normal;">
<pre class="de1" style="background-image: none; border: 0px none white; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;"><span class="co1" style="color: #666666; font-style: italic;">//while (x == y)</span>
<span class="br0" style="color: #009900;">{</span>
something<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
somethingelse<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
</pre>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
As is this:</div>
<div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 12.800000190734863px; line-height: 1.1em; padding: 1em;">
<div class="c source-c" style="font-family: monospace; line-height: normal;">
<pre class="de1" style="background-image: none; border: 0px none white; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;"><span class="co1" style="color: #666666; font-style: italic;">//for (int i=0; i < x; i++)</span>
<span class="co1" style="color: #666666; font-style: italic;">//while (x == y)</span>
<span class="kw1" style="color: #b1b100;">if</span> <span class="br0" style="color: #009900;">(</span>x <span class="sy0" style="color: #339933;">==</span> y<span class="br0" style="color: #009900;">)</span>
<span class="br0" style="color: #009900;">{</span>
something<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
somethingelse<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
</pre>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
Even like this, with conditional compilation:</div>
<div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="background-color: #f9f9f9; border: 1px dashed rgb(47, 111, 171); direction: ltr; font-family: monospace, Courier; font-size: 12.800000190734863px; line-height: 1.1em; padding: 1em;">
<div class="c source-c" style="font-family: monospace; line-height: normal;">
<pre class="de1" style="background-image: none; border: 0px none white; font-size: 1em; line-height: 1.2em; padding: 0px; vertical-align: top;"><span class="kw4" style="color: #993333;">char</span> c<span class="sy0" style="color: #339933;">;</span>
<span class="co2" style="color: #339933;">#ifdef HAS_GETCH</span>
<span class="kw1" style="color: #b1b100;">while</span> <span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">(</span>c <span class="sy0" style="color: #339933;">=</span> <span class="kw3" style="color: #000066;">getch</span><span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="br0" style="color: #009900;">)</span> <span class="sy0" style="color: #339933;">!=</span> EOF<span class="br0" style="color: #009900;">)</span>
<span class="co2" style="color: #339933;">#else</span>
<span class="kw1" style="color: #b1b100;">while</span> <span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">(</span>c <span class="sy0" style="color: #339933;">=</span> <span class="kw3" style="color: #000066;">getchar</span><span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="br0" style="color: #009900;">)</span> <span class="sy0" style="color: #339933;">!=</span> EOF<span class="br0" style="color: #009900;">)</span>
<span class="co2" style="color: #339933;">#endif</span>
<span class="br0" style="color: #009900;">{</span>
do_something<span class="br0" style="color: #009900;">(</span>c<span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
</pre>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
Each of the enclosing braces occupies an entire line by itself without adding any actual code. Whether this makes the code easier or harder to read is debated.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
<br />
<br /></div>
<div style="background-color: white; font-family: sans-serif; font-size: 12.800000190734863px; line-height: 19.200000762939453px; margin-bottom: 0.5em; margin-top: 0.4em;">
<span style="font-family: Ubuntu; font-size: small; line-height: normal;">Por lo que veo en Stackexchange o StackOverflow, no soy el único que ha iniciado debates similares:</span><br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;"><br /></span>
<a href="http://programmers.stackexchange.com/questions/2715/should-curly-braces-appear-on-their-own-line" target="_blank">[programmers.stackexchange.com]/should-curly-braces-appear-on-their-own-line</a><br />
<br />
<br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;">En la siguiente encuesta gana por goleada el Allman Style (sólo seguido, con el 50% de los votos que el Allman, por el K&R):</span><br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;"><br /></span>
<a href="http://www.terminally-incoherent.com/blog/2009/04/10/the-only-correct-indent-style/">[terminally-incoherent.com]/the-only-correct-indent-style</a><br />
<br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;">Sin embargo, sí que puede tener consecuencias negativas en Javascript, con "return":</span><br />
<br />
<a href="http://stackoverflow.com/questions/11247328/dangerous-implications-of-allman-style-in-javascript">[stackoverflow]/dangerous-implications-of-allman-style-in-javascript</a><br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;"><br /></span>
<span style="font-family: Ubuntu; font-size: small; line-height: normal;">El debate sigue abierto ... en otros foros donde lo he lanzado, la mayoría de la gente opina que me ciña a la convención general del lenguaje, pero cuanto más código miro con la convención general de Java, más claro y simple me parece el estillo Allman...</span><br />
<span style="font-family: Ubuntu; font-size: small; line-height: normal;"><br /></span></div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-11790015620265281112013-03-02T09:20:00.003+01:002013-03-02T09:20:43.326+01:00Parsear el XML del backup de Blogger.<br />
<br />
Hoy he visto que Blogger permite realizar un backup en XML de tu blog en:<br />
<br />
<br />
<ul>
<li>Configuración -> Otros -> Herramientas del blog -> Exportar blog</li>
</ul>
<br />
<br />
El fichero XML resultante contiene de todo: Usuarios, Configuración, Posts, Comentarios ... por lo que si quieres extraer sólo los posts realizados hay que realizar algo de trabajo con el XML.<br />
<br />
En la siguiente URL ( <a href="http://www.benjaminhorn.se/post/blogspot-backup-xml-parser/">http://www.benjaminhorn.se/post/blogspot-backup-xml-parser/</a> ) se habla de una clase PHP para parsear el XML exportado por blogger. La clase está disponible en:<br />
<br />
<a href="https://github.com/beije/Blogspotparser">https://github.com/beije/Blogspotparser</a><br />
<br />
Y su uso es tan "sencillo" como:<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">/**</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * Blogspotparser </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * Blogspotparser is a class that takes the backup xml file from blogspot and parses it</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * into a basic array, returning the posts as is, with html markup or as clean text.</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @author : Benjamin Horn</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @project : Fiinixdesign.eu</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @file : class.blogspot.parser.php</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @version : 1.0.0</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @created : 2012-09-22</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @updated : 2012-09-22</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> *</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * @usage :</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> *</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * $p = new Blogspotparser( $XMLDATASTRING ); // Initiate class</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * $p->fetch_entries_clean(); // Output posts as clean data</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * $p->fetch_entries(); // Output posts with original markup</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> * $p->fetch_amount_of_entries(); // Fetch amount of posts in backup</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> *</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> */</span><br />
<br />
Habrá que probarlo :)<br />
<div>
<br /></div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-39331344724078582312013-03-02T08:31:00.000+01:002013-03-02T08:31:42.003+01:00Utilizar subversion y git en Eclipse<span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Yo, que programo principalmente en python habitualmente usando vim y control de versiones con subversion o git, me veo un poco descolocado al verme "obligado" a usar Eclipse para los proyectos Java.</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Ayer me planteé la duda de si puedo "versionar" el código en subversion o git y al mismo tiempo ser compatible con programar en Eclipse.</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Lo normal en mi procedimiento diario con python es crear un proyecto con un "main.py", versionarlo, borrar el directorio original y bajar el código versionado, y entonces ya subo los cambios, y añado los nuevos ficheros al subversion/git conforme los voy creando. </span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Me gusta (no, más bien, *necesito*) tener el código versionado para tener control de versiones, poder revertir cambios, poder tener un histórico de los cambios realizados, taggear versiones, hacer una rama alternativa para probar cosas, poder mantener el mismo código desde diferentes ordenadores, etc etc etc...</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">No tenía claro si esto se podía realizar en eclipse, es decir, crear un proyecto, subirlo al repositorio, BORRAR la carpeta del proyecto y descargarlo desde el repositorio... ¿cómo le sentará a Eclipse la aparición de los ficheros de versionado en la carpeta del proyecto?</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Tendría supongo que estar también pendiente de todos los ficheros que va creando Eclipse internamente y de los que no te informa, y supongo que para hacer un update del código desde el repositorio tendrá que estar Eclipse cerrado, porque igual no vé los cambios si vienen desde fuera...</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Total, que esa era mi duda, que ha sido fácilmente despejada con los siguientes recursos:</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Por lo visto no se puede (debe) hacer manualmente sino a través de un plugin:</span><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;">Subversion:</b><br />
<b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;"><br style="margin: 0px; padding: 0px;" /></b><a href="http://www.ibm.com/developerworks/library/os-ecl-subversion/" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://www.ibm.com/developerworks/library/os-ecl-subversion/</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><a href="http://tratandodeentenderlo.blogspot.com.es/2009/09/manejo-de-subversion-desde-eclipse.html" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://tratandodeentenderlo.blogspot.com.es/2009/09/manejo-de-subversion-desde-eclipse.html</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br /><br /><b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;">Git:</b><br />
<b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;"><br style="margin: 0px; padding: 0px;" /></b><a href="http://www.vogella.com/articles/EGit/article.html" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://www.vogella.com/articles/EGit/article.html</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><a href="http://blog.art4software.com/2013/02/usando-git-desde-eclipse/" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://blog.art4software.com/2013/02/usando-git-desde-eclipse/</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><a href="http://blog.farmerdev.com/?p=26" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://blog.farmerdev.com/?p=26</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;">GitHub:</b><br />
<b style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;"><br style="margin: 0px; padding: 0px;" /></b><a href="http://eclipse.github.com/" style="background-color: white; color: #00b5cc; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px; text-decoration: initial;">http://eclipse.github.com/</a><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><br style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" /><span style="background-color: white; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px;">Así que, bueno, ya no hay excusa para no versionar </span><img alt="emoticon" src="http://miriadax.net/ubersity-theme/images/emoticons/tongue.gif" style="background-color: white; border: 0px; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; padding: 0px;" />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-45305552799952019122013-03-01T11:07:00.000+01:002013-03-01T11:07:17.824+01:00"Extended" history in bash<br />
I've found a nice article on <a href="http://jeetworks.org/node/80">http://jeetworks.org/node/80</a> that I'm going to reproduce here, to have a copy in case the original page ever disappears (I hope he doesn't mind while I include authorship, original link, etc):<br />
<br />
<br />
<br />
<h1 class="article-title" datatype="" property="dc:title" style="background-color: white; border-bottom-style: none; color: #2e2e2e; font-family: Arial, Helvetica, sans-serif; font-size: 2.167em; line-height: 1; margin: 0px; padding: 0px;">
<a href="http://jeetworks.org/node/80" rel="bookmark" style="color: #2e2e2e; margin: 0px; padding: 0px; text-decoration: initial;">Supplementary Command History Logging in Bash: Tracking Working Directory, Date/Times, etc.</a></h1>
<div>
<br /></div>
<br />
<br />
<br />
<header style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 16px;"><div class="submitted" style="color: dimgrey; line-height: 1; margin-bottom: 1.5em; margin-top: 3px; padding: 0px;">
<span content="2011-11-23T15:43:24-05:00" datatype="xsd:dateTime" property="dc:date dc:created" rel="sioc:has_creator">Submitted by <span about="/user/1" class="username" property="foaf:name" typeof="sioc:UserAccount" xml:lang="">Jeet Sukumaran</span> on <time datetime="2011-11-23T15:43:24Z" pubdate="pubdate">Wed, 11/23/2011 - 15:43</time></span></div>
</header><br />
<br />
<div style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
Here is a way to create a secondary shell history log (i.e., one that supplements the primary "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">~/.bash_history</code>") that tracks a range of other information, such as the working directory, hostname, time and date etc. Using the "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">HISTTIMEFORMAT</code>" variable, it is in fact possible to store the time and date with the primary history, but the storing of the other information is not as readibly do-able. Here, I present an approach based on this <a href="http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">excellent post</a> on <a href="http://stackoverflow.com/" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">StackOverflow</a>.</div>
<div style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
The main differences between this approach and the <a href="http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">original</a> is:</div>
<ul style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin: 0px 0px 1.5em 40px; padding: 0px;">
<li style="margin: 0px; padding: 0px;">I remove the option to log the extra information to the primary history file: I prefer to keep this history clean.</li>
<li style="margin: 0px; padding: 0px;">I add history number, host name, time/date stamp etc. to the supplementary history log by default.</li>
<li style="margin: 0px; padding: 0px;">I add field separators, making it easy to apply '<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">awk</code>' commands.</li>
</ul>
<div style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
The (Supplementary) History Logger Function</div>
<div style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
First, add or source the following to your "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">~/.bashrc</code>":</div>
<div style="background-color: white; color: #2e2e2e; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
</div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
</div>
<div class="line" id="file-loghistory-sh-LC1">
<span style="color: #2e2e2e; font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="white-space: pre;"><br /></span></span>
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #2e2e2e;"><span style="white-space: pre;">_loghistory() {
# From: </span></span>https://gist.github.com/jeetsukumaran/2202879/raw/16e92b805cbcf69ca18e5033c0f26bfebb165efe/loghistory.sh</span><br />
<span style="color: #2e2e2e; font-family: Courier New, Courier, monospace;"><span style="white-space: pre;"># Detailed history log of shell activities, including time stamps, working directory etc.
#
# Based on 'hcmnt' by Dennis Williamson - 2009-06-05 - updated 2009-06-19
# (http://stackoverflow.com/questions/945288/saving-current-directory-to-bash-history)
#
# Add this function to your '~/.bashrc':
#
# Set the bash variable PROMPT_COMMAND to the name of this function and include
# these options:
#
# e - add the output of an extra command contained in the histentrycmdextra variable
# h - add the hostname
# y - add the terminal device (tty)
# n - don't add the directory
# t - add the from and to directories for cd commands
# l - path to the log file (default = $HOME/.bash_log)
# ext or a variable
#
# See bottom of this function for examples.
#
# make sure this is not changed elsewhere in '.bashrc';
# if it is, you have to update the reg-ex's below
export HISTTIMEFORMAT="[%F %T] ~~~ "
local script=$FUNCNAME
local histentrycmd=
local cwd=
local extra=
local text=
local logfile="$HOME/.bash_log"
local hostname=
local histentry=
local histleader=
local datetimestamp=
local histlinenum=
local options=":hyntel:"
local option=
OPTIND=1
local usage="Usage: $script [-h] [-y] [-n|-t] [-e] [text] [-l logfile]"
local ExtraOpt=
local NoneOpt=
local ToOpt=
local tty=
local ip=
# *** process options to set flags ***
while getopts $options option
do
case $option in
h ) hostname=$HOSTNAME;;
y ) tty=$(tty);;
n ) if [[ $ToOpt ]]
then
echo "$script: can't include both -n and -t."
echo $usage
return 1
else
NoneOpt=1 # don't include path
fi;;
t ) if [[ $NoneOpt ]]
then
echo "$script: can't include both -n and -t."
echo $usage
return 1
else
ToOpt=1 # cd shows "from -> to"
fi;;
e ) ExtraOpt=1;; # include histentrycmdextra
l ) logfile=$OPTARG;;
: ) echo "$script: missing filename: -$OPTARG."
echo $usage
return 1;;
* ) echo "$script: invalid option: -$OPTARG."
echo $usage
return 1;;
esac
done
text=($@) # arguments after the options are saved to add to the comment
text="${text[*]:$OPTIND - 1:${#text[*]}}"
# add the previous command(s) to the history file immediately
# so that the history file is in sync across multiple shell sessions
history -a
# grab the most recent command from the command history
histentry=$(history 1)
# parse it out
histleader=`expr "$histentry" : ' *\([0-9]* \[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`
histlinenum=`expr "$histleader" : ' *\([0-9]* \)'`
datetimestamp=`expr "$histleader" : '.*\(\[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`
histentrycmd=${histentry#*~~~ }
# protect against relogging previous command
# if all that was actually entered by the user
# was a (no-op) blank line
if [[ -z $__PREV_HISTLINE || -z $__PREV_HISTCMD ]]
then
# new shell; initialize variables for next command
export __PREV_HISTLINE=$histlinenum
export __PREV_HISTCMD=$histentrycmd
return
elif [[ $histlinenum == $__PREV_HISTLINE && $histentrycmd == $__PREV_HISTCMD ]]
then
# no new command was actually entered
return
else
# new command entered; store for next comparison
export __PREV_HISTLINE=$histlinenum
export __PREV_HISTCMD=$histentrycmd
fi
if [[ -z $NoneOpt ]] # are we adding the directory?
then
if [[ ${histentrycmd%% *} == "cd" || ${histentrycmd%% *} == "jd" ]] # if it's a cd command, we want the old directory
then # so the comment matches other commands "where *were* you when this was done?"
if [[ -z $OLDPWD ]]
then
OLDPWD="$HOME"
fi
if [[ $ToOpt ]]
then
cwd="$OLDPWD -> $PWD" # show "from -> to" for cd
else
cwd=$OLDPWD # just show "from"
fi
else
cwd=$PWD # it's not a cd, so just show where we are
fi
fi
if [[ $ExtraOpt && $histentrycmdextra ]] # do we want a little something extra?
then
extra=$(eval "$histentrycmdextra")
fi
# strip off the old ### comment if there was one so they don't accumulate
# then build the string (if text or extra aren't empty, add them with some decoration)
histentrycmd="${datetimestamp} ${text:+[$text] }${tty:+[$tty] }${ip:+[$ip] }${extra:+[$extra] }~~~ ${hostname:+$hostname:}$cwd ~~~ ${histentrycmd# * ~~~ }"
# save the entry in a logfile
echo "$histentrycmd" >> $logfile || echo "$script: file error." ; return 1
} # END FUNCTION _loghistory</span></span></div>
<br />
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<br /></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<b>Activating the Logger</b></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
Then you need to set this function to execute on every command by adding it to your "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">$PROMPT_COMMAND</code>" variable, so you need the following entry in your "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">~/.bashrc</code>":</div>
<div style="font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">export PROMPT_COMMAND='_loghistory'</span></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
There are a number of options that the logging function takes, including the adding terminal information, the adding of arbitrary text or the execution of a function or function(s) that generate appropriate text. See the function documentation for more info.</div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<br /></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<b>Add Some Useful Aliases</b></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
Add the following to your "<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">~/.bashrc</code>":</div>
<div style="font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;"># dump regular history log<br />alias h='history'<br /># dump enhanced history log<br />alias hh="cat $HOME/.bash_log"<br /># dump history of directories visited<br />alias histdirs="cat $HOME/.bash_log | awk -F ' ~~~ ' '{print $2}' | uniq"</span></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
Checkout the Results! The '<code style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em;">histdirs</code>' command is very useful to quickly list, select (via copy and pasting) and jumping back to a directory.</div>
<div style="font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">$ h<br />14095 [2011-11-23 15:36:20] ~~~ jd nuim<br />14096 [2011-11-23 15:36:21] ~~~ ll<br />14097 [2011-11-23 15:36:23] ~~~ git status<br />14098 [2011-11-23 15:36:33] ~~~ jd pytb<br />14099 [2011-11-23 15:36:36] ~~~ git status<br />14100 [2011-11-23 15:36:53] ~~~ git rm --cached config/*<br />14101 [2011-11-23 15:37:00] ~~~ git pull<br />14102 [2011-11-23 15:37:11] ~~~ e .gitignore<br />14103 [2011-11-23 15:37:28] ~~~ git status<br />14104 [2011-11-23 15:37:35] ~~~ e .gitignore<br />14105 [2011-11-23 15:37:44] ~~~ git status<br />14106 [2011-11-23 15:38:10] ~~~ git commit -a -m "stuff"<br />14107 [2011-11-23 15:38:12] ~~~ git pushall<br />14108 [2011-11-23 15:50:38] ~~~ ll build_c/<br />14109 [2011-11-23 15:53:16] ~~~ cd<br />14110 [2011-11-23 15:53:18] ~~~ ls -l<br />14111 [2011-11-23 16:00:12] ~~~ cd Documents/Projects/Phyloinformatics/DendroPy/dendropy<br />14112 [2011-11-23 16:00:15] ~~~ ls -l<br />14113 [2011-11-23 16:00:22] ~~~ cd dendropy/<br />14114 [2011-11-23 16:00:24] ~~~ vim *.py</span></div>
<div style="font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">$ hh<br />[2011-11-23 15:36:20] ~~~ /Users/jeet ~~~ jd nuim<br />[2011-11-23 15:36:21] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/nuim ~~~ ll<br />[2011-11-23 15:36:23] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/nuim ~~~ git status<br />[2011-11-23 15:36:33] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/nuim ~~~ jd pytb<br />[2011-11-23 15:36:36] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git status<br />[2011-11-23 15:36:53] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git rm --cached config/*<br />[2011-11-23 15:37:00] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git pull<br />[2011-11-23 15:37:11] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ e .gitignore<br />[2011-11-23 15:37:28] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git status<br />[2011-11-23 15:37:35] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ e .gitignore<br />[2011-11-23 15:37:44] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git status<br />[2011-11-23 15:38:10] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git commit -a -m "stuff"<br />[2011-11-23 15:38:12] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ git pushall<br />[2011-11-23 15:50:38] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ ll build_c/<br />[2011-11-23 15:53:16] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon ~~~ cd<br />[2011-11-23 15:53:18] ~~~ /Users/jeet ~~~ ls -l<br />[2011-11-23 16:00:12] ~~~ /Users/jeet ~~~ cd Documents/Projects/Phyloinformatics/DendroPy/dendropy<br />[2011-11-23 16:00:15] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/DendroPy/dendropy ~~~ ls -l<br />[2011-11-23 16:00:22] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/DendroPy/dendropy ~~~ cd dendropy/<br />[2011-11-23 16:00:24] ~~~ /Users/jeet/Documents/Projects/Phyloinformatics/DendroPy/dendropy/dendropy ~~~ vim *.py</span></div>
<div style="font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">$ histdirs<br />/Users/jeet<br />/Users/jeet/Documents/Projects/Phyloinformatics/nuim<br />/Users/jeet/Documents/Projects/Phyloinformatics/pytbeaglehon<br />/Users/jeet<br />/Users/jeet/Documents/Projects/Phyloinformatics/DendroPy/dendropy<br />/Users/jeet/Documents/Projects/Phyloinformatics/DendroPy/dendropy/dendropy</span></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin-bottom: 1.5em; padding: 0px;">
Further Reading</div>
<ul style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px; margin: 0px 0px 1.5em 40px; padding: 0px;">
<li style="margin: 0px; padding: 0px;"><a href="http://www.gnu.org/software/bash/manual/bashref.html#Using-History-Interactively" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">http://www.gnu.org/software/bash/manual/bashref.html#Using-History-Interactively</a></li>
</ul>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><br /></span></span></div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><b><u>User comments:</u></b></span></span></div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><br /></span></span></div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><br /></span></span></div>
<div>
<br />
<header style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px;"><h3 class="comment-title" datatype="" property="dc:title" style="border: none; font-family: Arial, Helvetica, sans-serif; font-size: 1.231em; line-height: 1; margin: 0px 0px 5px; padding: 0px;">
<a href="http://jeetworks.org/comment/562#comment-562" rel="bookmark" style="border-bottom-style: none; color: #2e2e2e; margin: 0px; padding: 0px; text-decoration: initial;">I tried added what you</a></h3>
<div class="comment-submitted" style="color: dimgrey; font-size: 0.917em; line-height: 1; margin-top: 3px; padding: 0px;">
<span content="2011-03-21T10:55:20-04:00" datatype="xsd:dateTime" property="dc:date dc:created" rel="sioc:has_creator">Submitted by <span class="username" property="foaf:name" typeof="sioc:UserAccount" xml:lang="">Anonymous (not verified)</span> on <time datetime="2011-03-21T10:55:20Z" pubdate="pubdate"><span class="date-time permalink"><a href="http://jeetworks.org/comment/562#comment-562" rel="bookmark" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">Mon, 03/21/2011 - 10:55</a></span></time></span></div>
<div style="margin-bottom: 1.5em; padding: 0px;">
</div>
</header><br />
<div class="comment-content" style="background-color: white; color: #2e2e2e; font-size: 12.727272033691406px; line-height: 17.27272605895996px;">
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif;"><span class="rdf-meta" rel="sioc:reply_of" resource="/node/80"></span></span><br />
<div class="field field-name-comment-body field-type-text-long field-label-hidden view-mode-full">
<div class="field-items">
<div class="field-item even" property="content:encoded">
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; margin-bottom: 1.5em; padding: 0px;">
I tried added what you suggested above and it does not seem to log to the default log file. Doesn't seem like anything is even logging. Even tried adding the location of the logfile and still nothing.</div>
<div style="margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">export PROMPT_COMMAND='_loghistory -e -h -y -t'</span></div>
</div>
</div>
</div>
</div>
</div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><br /></span></span></div>
<div>
<br />
<header style="background-color: white; color: #2e2e2e; font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; font-size: 12.727272033691406px; line-height: 17.27272605895996px;"><h3 class="comment-title" datatype="" property="dc:title" style="border: none; font-family: Arial, Helvetica, sans-serif; font-size: 1.231em; line-height: 1; margin: 0px 0px 5px; padding: 0px;">
<a href="http://jeetworks.org/comment/704#comment-704" rel="bookmark" style="border-bottom-style: none; color: #2e2e2e; margin: 0px; padding: 0px; text-decoration: initial;">minor modification required</a></h3>
<div class="comment-submitted" style="color: dimgrey; font-size: 0.917em; line-height: 1; margin-top: 3px; padding: 0px;">
<span content="2011-06-10T13:03:09-04:00" datatype="xsd:dateTime" property="dc:date dc:created" rel="sioc:has_creator">Submitted by <a class="username" href="http://www.documentroot.com/" property="foaf:name" rel="nofollow foaf:page" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;" typeof="sioc:UserAccount" xml:lang="">erik aronesty (not verified)</a> on <time datetime="2011-06-10T13:03:09Z" pubdate="pubdate"><span class="date-time permalink"><a href="http://jeetworks.org/comment/704#comment-704" rel="bookmark" style="color: #086782; margin: 0px; padding: 0px; text-decoration: initial;">Fri, 06/10/2011 - 13:03</a></span></time></span></div>
<div style="margin-bottom: 1.5em; padding: 0px;">
</div>
</header><br />
<div class="comment-content" style="background-color: white; color: #2e2e2e; font-size: 12.727272033691406px; line-height: 17.27272605895996px;">
<span style="font-family: Courier New, Courier, monospace;"><span class="rdf-meta" rel="sioc:reply_of" resource="/node/80"></span></span><br />
<div class="field field-name-comment-body field-type-text-long field-label-hidden view-mode-full">
<div class="field-items">
<div class="field-item even" property="content:encoded">
<div style="margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">#need to allow spaces before the nubmers in bash history</span></div>
<div style="margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">histleader=`expr "$histentry" : ' *\([0-9]* \[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`</span></div>
<div style="margin-bottom: 1.5em; padding: 0px;">
<span style="font-family: Courier New, Courier, monospace;">histentrycmd=${histentry# *[0-9]* \[[0-9\-\: ]*\] }</span></div>
<div style="font-family: 'Lucida Sans Unicode', 'Lucida Sans', 'Lucida Grande', Verdana, Geneva, sans-serif; margin-bottom: 1.5em; padding: 0px;">
<br /></div>
</div>
</div>
</div>
</div>
</div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;">Thanks for this nice article!</span></span></div>
<div>
<span style="font-family: Lucida Sans Unicode, Lucida Sans, Lucida Grande, Verdana, Geneva, sans-serif; font-size: x-small;"><span style="line-height: 17.265625px;"><br /></span></span></div>
<br />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-5067484634738901112013-02-28T19:38:00.002+01:002013-03-01T00:59:05.616+01:00bash tip: get first and last arguments of last executed command<br />
Let's say you execute the following command on bash:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b># cp /long/source/path/file /long/destination/path/directory/</b></span><br />
<br />
<br />
If in the next command you need to edit the file or change to the destination directory, then you can use:<br />
<br />
<br />
a.- "<span style="font-family: Courier New, Courier, monospace;"><b>ctrl+alt+y</b></span>" (<i>simultaneously press ctrl and alt and y</i>) which recovers the first argument of the previously executed command.<br />
<br />
b.- "<b><span style="font-family: Courier New, Courier, monospace;">ESC+.</span></b>" (<i>simultaneously press ESC and dot</i>), which recovers the last argument of the previously executed command.<br />
<br />
<br />
So, you can do either:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b># vim <ctrl+alt+y><ctrl alt="" y=""></ctrl></b></span><br />
<br />
(becomes automatically "<span style="font-family: Courier New, Courier, monospace;">vim /long/source/path/file</span>")<br />
<br />
or:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b># cd </b></span><b style="font-family: 'Courier New', Courier, monospace;"><</b><b style="font-family: 'Courier New', Courier, monospace;">ESC+.</b><b style="font-family: 'Courier New', Courier, monospace;">></b><br />
<br />
<br />
(becomes automatically "<span style="font-family: Courier New, Courier, monospace;">cd /long/destination/path/directory/</span>")<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
Remember this and save lots of keystrokes!<br />
<br />
<br />
EDIT: David Muriel shares with as the way of doing it without key combinations, just using the following direct arguments:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;">First argument of the previous command --> <b>!!^</b></span><br style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;" /><span style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;">Last argument of the previous command --> </span><span style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;"> <b>!!$</b></span><br style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;" /><span style="background-color: #f8f8f8; color: #555555; font-size: 13px; line-height: 18px;">Nth argument of the previous command ----> <b>!!:n</b></span></span></div>
<div>
<br /></div>
<div>
So you can directly write:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b># vim !!$</b></span><br />
<br />
It's quite easy to remember, !! for "the argument" followed by a identifier similar to regular expressions (^ = start, $ = end) or :n = Nth ...<br />
<br />
Thanks, David!</div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-52506003685398170232013-02-28T19:25:00.000+01:002013-03-01T00:50:09.334+01:00Reducir el tamaño de letra del UI en Eclipse bajo Linux<br />
Si ejecutas Eclipse bajo Linux y lo haces (como yo) en un portátil con pantalla de 15", probablemente te encontrarás con el que tamaño de letra usado en el GUI es demasiado grande y se pierde espacio de todas las ventanas de trabajo (código, layout, propiedades, árbol de proyecto...).<br />
<br />
No existe opción específica en Eclipse para cambiar de golpe el tipo o tamaño de letra utilizado, pero buscando información sobre ello he encontrado lo siguiente.<br />
<br />
1.- Crea el fichero .gtkrc-eclipse en el directorio home de tu usuario, con este contenido:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">style "eclipse" {</span><br />
<span style="font-family: Courier New, Courier, monospace;"> font_name = "Sans Condensed 8"</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">}</span><br />
<span style="font-family: Courier New, Courier, monospace;">class "GtkWidget" style "eclipse"</span><br />
<div>
<br /></div>
<div>
<br /></div>
<br />
2.- Lanza eclipse con el siguiente comando:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/usuario/.gtkrc-eclipse /opt/android/adt-bundle-linux/eclipse/eclipse</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
Si lo estás lanzando desde un "launcher" de gestor de ventanas, añade "env" delante:</div>
<div>
<br /></div>
<br />
<span style="font-family: Courier New, Courier, monospace;">env GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/usuario/.gtkrc-eclipse /opt/android/adt-bundle-linux/eclipse/eclipse</span><br />
<br />
<br />
De esta forma, se aplicará todo el estilo Clearlooks y tras él se aplicará el pequeño cambio de estilo definido en el fichero .gtkrc-eclipse.<br />
<br />
<br />
Fuente: <a href="http://techtavern.wordpress.com/2008/09/24/smaller-font-sizes-for-eclipse-on-linux/">http://techtavern.wordpress.com/2008/09/24/smaller-font-sizes-for-eclipse-on-linux/</a><br />
<br />
<br />
EDIT: He llegado a probar el tamaño <span style="font-family: 'Courier New', Courier, monospace;">"Sans Condensed 7" </span>con éxito; todavía es legible y se gana algo más de espacio ... así que todavía podéis apurar un poco más si os lo permite la vista :-)<br />
<br />
<br />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-59826671415294167062013-02-27T12:29:00.004+01:002013-02-27T12:29:57.325+01:00bash tip: sleep until a given date/time and then execute a command<br />
<br />
Imagine that you want to launch a "console" command or script in a terminal at 03:00AM, and being able to check the output at any time. But you don't want to use cron or at, because you need to control both stdin and stdout in any moment.<br />
<br />
Yes, it seems a strange situation but it happens :P<br />
<br />
Instead of waiting to 03:00AM to launch the command, you can use "<span style="font-family: Courier New, Courier, monospace;">sleep N && your-command"</span>, like this:<br />
<br />
<br />
Add the following to your .bashrc file:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">function sleep_until {</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> NSECONDS=$(( $(date -d "$1" +%s) - $(date +%s) ))</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if [ $NSECONDS -lt 0 ];</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> then</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> NSECONDS=$(( $(date -d "tomorrow $1" +%s) - $(date +%s) ))</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> fi</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> echo "Sleeping for $NSECONDS seconds..."</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> sleep $NSECONDS</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">}</span><br />
<br />
<br />
Reload it (<span style="font-family: Courier New, Courier, monospace;">source .bashrc</span>) and then you can write:<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><b>sromero@compiler ~ $ sleep_until 12:16 && echo "TEST"</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Sleeping for 16 seconds...</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">TEST</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><b>sromero@compiler ~ $ sleep_until "tomorrow 12:16" && echo "TEST"</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Sleeping for 86369 seconds...</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">(...)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><b>sromero@compiler ~ $ sleep_until "tomorrow 03:00" && ./your_script.py</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Sleeping for 52777 seconds...</span><br />
<br />
<br />
If you don't specify a date (only hour) and given(hour:minute) < current(hour:minute), the script will use the date for the next day:<br />
<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><b>sromero@compiler ~ $ date</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">mié feb 27 12:28:11 CET 2013</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><b>sromero@compiler ~ $ sleep_until 12:25</b></span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Sleeping for 86207 seconds...</span><br />
<div>
<br /></div>
<br />
<br />
Now you can leave the computer on and go to sleep.<br />
<br />
Wake up at 04:00AM, check that everything's went fine and that you don't need to relaunch the command, and go again to sleep :-).<br />
<br />
For remote systems, don't forget to run this under screen or tmux :)<br />
<br />
<br />
PD: Adapted from <a href="http://superuser.com/questions/222301/unix-sleep-until-the-specified-time">http://superuser.com/questions/222301/unix-sleep-until-the-specified-time</a> .<br />
<div>
<br /></div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-11734046945070558982013-02-15T14:48:00.000+01:002013-02-15T14:50:29.050+01:00Code Simplicity (Summary / Resumen)<br />
<div>
<div>
Después de leer el libro "<b>Code Simplicity - The Science of Software Development</b>" (<i>Ed. O'Reilly - Max Kanat-Alexander</i>), me decidí a crear en formato PDF un pequeño resumen del libro directamente de las propias palabras del autor (<b>copia literal de párrafos o frases entre párrafos</b>).</div>
<div>
<br /></div>
<div>
Subrayé una "copia" del libro con un rotulador fluorescente amarillo e hice una suerte de resumen rápido que reproduzco a continuación. El 95% de las palabras, insisto, son literales tal y como aparecen en el libro. He eliminado texto, ejemplos y explicaciones que deberían ser obvias para muchos de los interesados en este tema. No obstante, os recomiendo leer el libro completo si os resulta un tema de interés.</div>
</div>
<div>
<br /></div>
<div>
<a href="http://www.sromero.org/wiki/_media/programacion/tutoriales/code_simplicity_summary.pdf">Code Simplicity (Summary / Resumen)</a></div>
<div>
<br /></div>
<div>
No es un libro técnico en sí mismo, es más alrededor de la filosofía de la simplicidad en la programación. Espero que el resumen os resulte de interés.</div>
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-9682515507290771582013-02-04T13:13:00.004+01:002013-02-04T20:08:00.609+01:00Problemas de batería en Android y solución con BetterBatteryStats <br />
Tengo un estupendo tablet de Motorola Xoom de 10" con Android 4.1.2 cuya batería me duraba sin dificultades hasta una semana con un uso ocasional diario.<br />
<br />
Como cualquier otro dispositivo que se precie de gestionar bien la batería, cuando lo dejabas con la pantalla apagada, entraba en modo "<b>Deep Sleep</b>" y apenas consumía entre un 3 y un 5% diario, ya que realiza conexiones esporádicas para actualizar datos o programas, y para las notificaciones.<br />
<br />
Hace cosa de un mes, el tablet comenzó a perder un 30% de batería cada noche, por lo que por primera vez en mi uso de Android tuve que bucear en la información sobre la batería y comprar una app de unos 2 EUR que me permitió encontrar dónde estaba el problema.<br />
<br />
Veamos primero unas capturas que muestran la naturaleza del problema. La primera es el consumo de batería, tal cual aparece en "Settings" -> "Battery":<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWKZfcSvKl6SdIyFqDm9B5SvEtz7uLbLErWCrhOifAfGIiJ1A-vCm41o4AnGsqFsPbjr44dEHXQQl70ZkV5WfX-rL5Vk7soYRJzpdAuQVh5rAtpdrd6IucdtMAfcGSE5iuYvvk3w/s1600/Screenshot_2013-02-02-21-47-04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWKZfcSvKl6SdIyFqDm9B5SvEtz7uLbLErWCrhOifAfGIiJ1A-vCm41o4AnGsqFsPbjr44dEHXQQl70ZkV5WfX-rL5Vk7soYRJzpdAuQVh5rAtpdrd6IucdtMAfcGSE5iuYvvk3w/s640/Screenshot_2013-02-02-21-47-04.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Si os fijáis, el "proceso" Android OS está consumiendo un anormal 59% de la batería.<br />
<br />
Si pulsamos encima de la gráfica de batería (arriba, donde pone la duración restante, aparece esto):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthgwIGuqPikjToQ-z5bcaplNX6fjYZCreyGFmyk-mC59FngK5W66vaBX6D4M6BFQMjcCMytzZ9_VHIuLftZNyyDJbTKJ3okVA3QOx6uk_qizKckW5JtxND9VQHWnJo3uB8jy_mQ/s1600/Screenshot_2013-02-02-21-47-09.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthgwIGuqPikjToQ-z5bcaplNX6fjYZCreyGFmyk-mC59FngK5W66vaBX6D4M6BFQMjcCMytzZ9_VHIuLftZNyyDJbTKJ3okVA3QOx6uk_qizKckW5JtxND9VQHWnJo3uB8jy_mQ/s640/Screenshot_2013-02-02-21-47-09.png" width="400" /></a></div>
<br />
<br />
En esta imagen hay que fijarse en la parte inferior de la pantalla, esas pequeñas "barritas azules" que muestran la actividad de ciertos estados. Si os fijáis, la barra del "W<i>i-Fi activo</i>" ocupa toda la pantalla porque el Wifi ha estado activo desde que lo encendí, sin haberlo apagado en ningún momento.<br />
<br />
El estado "<i>Pantalla encendida</i>" apenas tiene una rayita (a la derecha del todo) que es el instante actual en que estoy tomando estas capturas, ya que he encendido la pantalla para interactuar con el tablet.<br />
<br />
Pero el interesante es el estado "<i>Activa</i>", que indica cuándo el tablet está activo. Como podéis ver, prácticamente cada pocos segundos o minutos el tablet está haciendo algo, motivo por el cual nunca entra en modo Deep Sleep y la batería "vuela".<br />
<br />
La aplicación <b><a href="https://play.google.com/store/apps/details?id=com.asksven.betterbatterystats&hl=es">Better Battery Stats</a></b> de Google Play (de pago, unos 2 EUR aprox.) te permite encontrar cuál es la aplicación que está causando este mal funcionamiento. En mi caso, después de comprarla, hice una carga completa, abrí la aplicación y en las opciones configuré las alarmas de proceso y de red (requieren root), en Settings -> Advanced.<br />
<br />
Después, indiqué que comenzara a tomar datos "<i>Since Unplugged</i>" (desde que se desconecte el cargador). Apagué la pantalla, desconecté el cargador, y dejé la tablet durante toda la noche en funcionamiento, apagada.<br />
<br />
Y esto es lo que me indicó el Better Battery Stats al día siguiente:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBhi8bwhIHPhZvYNQPTh9Y2BV14wg_dug9RbpgGvX9lrWhfHfrgVi7pMhPLzZA68bCncE9VJeeOWKK9dukC_a-yi2MtRShiJ02zwZkw09DSIuH9QfIw5dAzgE5DZC0eht_FEumAg/s1600/Screenshot_2013-02-02-21-47-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBhi8bwhIHPhZvYNQPTh9Y2BV14wg_dug9RbpgGvX9lrWhfHfrgVi7pMhPLzZA68bCncE9VJeeOWKK9dukC_a-yi2MtRShiJ02zwZkw09DSIuH9QfIw5dAzgE5DZC0eht_FEumAg/s640/Screenshot_2013-02-02-21-47-21.png" width="400" /></a></div>
<br />
<br />
Como podéis ver, el dispositivo está "Awake" (despierto) casi 11 horas, es decir, no entra en modo Deep Sleep, con lo cual (salvo por la pantalla apagada) es como estar usándolo.<br />
<br />
¿Y la CPU? ¿Cuánto tiempo está activa y cuánto en Deep Sleep?<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfTEkEpyjLGZsQPNlCBRnce1WkSjq24K29UjoKU-wh00b0Sl74koVIu6zy0u4mbBlmWtENzLXaEFQP7kCSiv4Y6r0ALv0v9Z4-5WVoXpOvu3RgiukFYaOAOs3v3wHST07X0k1VHA/s1600/Screenshot_2013-02-02-21-48-23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfTEkEpyjLGZsQPNlCBRnce1WkSjq24K29UjoKU-wh00b0Sl74koVIu6zy0u4mbBlmWtENzLXaEFQP7kCSiv4Y6r0ALv0v9Z4-5WVoXpOvu3RgiukFYaOAOs3v3wHST07X0k1VHA/s640/Screenshot_2013-02-02-21-48-23.png" width="400" /></a></div>
<br />
<br />
Deep Sleep (la última de las barras) = 0.0%.<br />
<br />
¿Y qué aplicación puede estar provocando esto? Pues en la sección de <b>Partial Wakelocks</b> tenemos la clave (en otros casos el problema podría detectarse en otras secciones):<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkLVuT7MRusme624YvhhftwMiEHq14GFVdU6vjjnLvMfq3GRRan-xA8q1rWDyab9-i7cKv_M1NGDzek60oWOYFNwiD3RVET7DaQcLZHVmwb-hOlMNf4P0fUAxYu0ZlAztwS1HefA/s1600/Screenshot_2013-02-02-21-47-50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkLVuT7MRusme624YvhhftwMiEHq14GFVdU6vjjnLvMfq3GRRan-xA8q1rWDyab9-i7cKv_M1NGDzek60oWOYFNwiD3RVET7DaQcLZHVmwb-hOlMNf4P0fUAxYu0ZlAztwS1HefA/s640/Screenshot_2013-02-02-21-47-50.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<b>AppLock</b>, una pequeña aplicación que instalé hace un mes para proteger con "password" el acceso a algunas aplicaciones (Settings, Google Play, etc) de forma que mis hijas no pudieran estropear nada de la configuración del tablet, resulta que se come la batería brutalmente. Encima de la barra podemos ver que la aplicación ha consumido el 23% de batería (100% to 77%), ella sóla, y con el tablet en reposo...<br />
<br />
Para verificar mi hipótesis, desinstalo la aplicación, cargo la batería y vuelvo a lanzar el Better Battery Stats para dejarlo "inactivo" toda la noche. Y al día siguiente...<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjha5o1u993_44xiBypmHgokAA0YPInmCkEw4ntbWY2_tr-_Oq6cdxpwXhmDT4z6pqR2_XC7OyJu1QjtCiFCmxmhYDveor76TRtxkXwNF1nvkeiv6s_xZOkjsW6-Mznjbl53sVjpQ/s1600/Screenshot_2013-02-03-08-08-33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjha5o1u993_44xiBypmHgokAA0YPInmCkEw4ntbWY2_tr-_Oq6cdxpwXhmDT4z6pqR2_XC7OyJu1QjtCiFCmxmhYDveor76TRtxkXwNF1nvkeiv6s_xZOkjsW6-Mznjbl53sVjpQ/s640/Screenshot_2013-02-03-08-08-33.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
¡Zas! La batería pasa a durar de nuevo lo que antes y en la anterior captura podéis ver cómo "<i>Tablet inactivo</i>" ha reemplazado a "<i>Android OS</i>". Si vemos el detalle (pulsando en la gráfica):<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPr5-9kVsYmlaGUDIi1Hhyhrt7Tb87Vwz0WWMEYkji1St-Jct2NXiCsnUjrWe65kNfdMFhFFvVvevI0FFywNqJGcdDrOMR5c0kgAJA7j_7nGVNTpV7JUPgU_lHcQjPr2beW-IDQw/s1600/Screenshot_2013-02-03-08-08-41.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPr5-9kVsYmlaGUDIi1Hhyhrt7Tb87Vwz0WWMEYkji1St-Jct2NXiCsnUjrWe65kNfdMFhFFvVvevI0FFywNqJGcdDrOMR5c0kgAJA7j_7nGVNTpV7JUPgU_lHcQjPr2beW-IDQw/s640/Screenshot_2013-02-03-08-08-41.png" width="400" /></a></div>
<br />
<br />
Ahora la actividad es más normal, hay conexiones pero esporádicas, y sólo he perdido un 2% de batería durante toda la noche (como podéis ver en la gráfica, le desenchufé el cable al 95% de carga, por eso la gráfica no parte desde el 100%).<br />
<br />
Veamos qué dice ahora el Better Battery Stats:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvI1gH_KR81RTAt6kiz9o8tKxfDqaYVusf5cPYXfoWGTMGVfvOecY0lj5wY4aOyLrYidTRccThpFMbrjQNZFjBnEFftvtvCJTJRcpacdVNgSNQb3_yqOQXCuvL5Vl15_VKkWjr5A/s1600/Screenshot_2013-02-03-08-09-01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvI1gH_KR81RTAt6kiz9o8tKxfDqaYVusf5cPYXfoWGTMGVfvOecY0lj5wY4aOyLrYidTRccThpFMbrjQNZFjBnEFftvtvCJTJRcpacdVNgSNQb3_yqOQXCuvL5Vl15_VKkWjr5A/s640/Screenshot_2013-02-03-08-09-01.png" width="400" /></a></div>
<br />
<br />
Deep Sleep = 8 horas. Lo correcto.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajRKChlYEHUtPlvF0RwBlpcNqjECpfRkgbMUaqoQ0QR-Xew-_vDuTu86GH2ID9MAYnIENssqc-FH6AA8hPcs-7VJ5YVXysZWKJcCLvTINrANVQoxfr9idVfHwq1Z5aj4dg9NyOg/s1600/Screenshot_2013-02-03-08-09-51.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiajRKChlYEHUtPlvF0RwBlpcNqjECpfRkgbMUaqoQ0QR-Xew-_vDuTu86GH2ID9MAYnIENssqc-FH6AA8hPcs-7VJ5YVXysZWKJcCLvTINrANVQoxfr9idVfHwq1Z5aj4dg9NyOg/s640/Screenshot_2013-02-03-08-09-51.png" width="400" /></a></div>
<br />
<br />
Nuestros dispositivos Android son verdaderos sistemas multitarea (no como en el caso de iOS) por lo que hay que tener mucho cuidado con las aplicaciones mal programadas (o no diseñadas para la versión de Android que usamos), las cuales pueden consumir toda nuestra batería y que achaquemos el problema a nuestro telefóno, a nuestra versión de Android, o al hardware de la batería en sí.<br />
<br />
Ahora mismo tenemos sistemas dual o quad core con más RAM y potencia que muchos equipos de escritorio de hace un par de años, alimentados por escuálidas baterías de 1450 ó 1850 mA/h (como mucho, de 3000 mA/h, y eso aumentando el tamaño del teléfono) por lo que tenemos que tener mucho cuidado con qué instalamos y revisar regularmente si nuestro teléfono se comporta como debiera.<br />
<br />
En mi caso, creo que <b><a href="https://play.google.com/store/apps/details?id=com.asksven.betterbatterystats&hl=es">Better Battery Stats</a> </b>ha cumplido con creces lo que esperaba de él, aunque me duele tener que pagar 2 EUR para encontrar que una aplicación mal programada o incompatible con mi versión de Android ha sido la causante del problema.<br />
<br />
En cualquier caso, sin tener que comprar ninguna aplicación, la sección de "Batería" de la configuración de Android, y más concretamente las gráficas de actividad, nos pueden permitir detectar si algo está funcionando de forma incorrecta en nuestro teléfono.<br />
<br />
Espero que este pequeño análisis os resulte de utilidad para mejorar el rendimiento de vuestras baterías.<br />
<br />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com7tag:blogger.com,1999:blog-9180313.post-63319223603303485302012-12-06T12:32:00.002+01:002012-12-06T12:32:41.105+01:00A Little Motivation (obviam.net)<br />
Si recordáis mi entrada sobre "La Edad de Oro del Software Español", ésta acababa con <a href="http://noplog.blogspot.com.es/2012/11/ocho-quilates-la-edad-de-oro-de-los.html#reflexion">una pequeña reflexión personal</a> de cómo había perdido mi oportunidad (al ser demasiado joven entonces además de por falta de conocimientos globales) de crear juegos profesionales tanto para Spectrum como para los primeros PCs. Ahora que estoy muy cerca de tener los conocimientos necesarios (los tengo en algunas áreas, y tengo la base necesaria para otras), lo que no tengo es tiempo (obligaciones, casa, trabajo, hijos)...<br />
<br />
Pues bien, buscando información sobre programación en Android / JAVA, me encuentro con un blog interesantísimo (<a href="http://obviam.net/">Obviam.net</a>) con geniales artículos sobre desarrollo de videojuegos para Android. Entre ellos, hay un artículo que intenta justificar el porqué del nacimiento del blog.<br />
<br />
<a href="http://obviam.net/index.php/a-little-motivation/">http://obviam.net/index.php/a-little-motivation/</a><br />
<br />
Este artículo me ha encantado, porque veo a esta persona con un pasado muy parecido a mi situación personal, y muestra que no soy el único que pasado por perder el tren pasado de hacer ciertas cosas en las que le hubiera gustado continuar.
El autor del artículo no renuncia a su sueño de crear juegos y además lo hace como escape a la vida "corporativa" de trabajo para multinacional desarrollando en Java y el mantenimiento de las obligaciones derivadas de esta vida "estándar" (casa, pareja, hijos). Y precisamente eso es lo que cuenta, que utiliza ese blog para automotivarse:
<br />
<br />
<blockquote>
<i>I’m talking about the 80s.</i> </blockquote>
<blockquote>
<i>
Many took the classes, went through all that necessary crap that comes with getting a degree one would not care about in the future and here they are. Some graduated and have decent paying “software engineer” positions working for a multinational corporation doing who knows what. But a percentage of these so called engineers dream of games. They own the latest gadgets but they do not have the one thing that would enable them to make games: Time.</i> <i>Working 9-5 sucks and many have families or other obligations but they still think of doing projects on the side. Unfortunately many never even get started.</i> </blockquote>
<blockquote>
<i>
How many thought: man…I’ll be building the greatest game of all, I’ll be rich and famous. Then they meet someone, have to get a job to pay for “settling” down and pay the bills for a place where they go in the evenings to crash just to start it over the next day. All this by doing boring web stuff or working on a small part of a monstrous multi-threaded distributed enterprise application architected by an inexperienced halfwit architect wannabe who got the job by sticking with the company since he was an intern.</i> </blockquote>
<blockquote>
<i>
Where is the game you dreamed of doing 10 years ago?</i> </blockquote>
<blockquote>
<i>
To be precise I am in a similar situation and while I had a short gig with a game company I am well in the rat race leading nowhere. I have decided to try one more time and I will give it a go. Why? Just for the hell of it, to demonstrate that games are simple to build and you can sit at your computer and have some fun too. Actually this is why I ended up a coder, to make games not to configure some frameworks (yes, that is not programming, it is mostly configuration).</i> </blockquote>
<blockquote>
<i>
There are several reasons I set myself up for this journey and I will document it.</i></blockquote>
<br />
Tampoco quiero olvidarme de artículo "<a href="http://www.androidpolice.com/2012/07/30/going-indie-the-story-of-independent-android-game-development-from-concept-to-completion/">Going Indie: The Story Of Independent Android Game Development From Concept To Completion</a>", donde se puede leer este comentario:
<br />
<blockquote>
<br />
<i>And most importantly, don't let anything stop you. Finishing what you start no matter what obstacles you face or how exhausted you feel is the most important thing. It's not worth anything unless you finish.</i> </blockquote>
<blockquote>
<i>(Naomi Kokubo, LavaMind)</i><br />
<br /></blockquote>
Un saludo.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-22258274768599137942012-12-03T18:56:00.004+01:002012-12-04T18:35:55.999+01:00Remakeando escenas de videojuegos con Paint<br />
Hubo hace unos años un hilo en el foro de Meristation que trataba de crear "<i>escenas de videojuegos</i>" con el Paint.<br />
<br />
La idea era dibujar una imagen con primitivas gráficas (pincel, rellenado, texto...) y colores puros, en apenas 1 ó 2 minutos de trabajo, pero que captara la esencia del juego. Y qué mejor programa para reivindicar la "cutrez" que el Paint de Microsoft Windows ...<br />
<br />
Ayer encontré haciendo limpieza de mi disco duro algunas de las imágenes que publiqué en ese hilo, así que he pensado que antes de que se pierdan, me gustaría compartirlas en el blog.<br />
<br />
<br />
<br />
<center>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpBJ3j-i4uh9BAc4WeONvfMRiedL5lG0To7UgKG-UL9bCTNSFqw20HAFNl_JQuBJflwHCQ_-0TH_N_lqRZP6a1sLxBHlDecmkipAD1f0QmGZVHCLE25BbxMt7YjOzh-DOegeJi3w/s1600/paint_avorig.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpBJ3j-i4uh9BAc4WeONvfMRiedL5lG0To7UgKG-UL9bCTNSFqw20HAFNl_JQuBJflwHCQ_-0TH_N_lqRZP6a1sLxBHlDecmkipAD1f0QmGZVHCLE25BbxMt7YjOzh-DOegeJi3w/s320/paint_avorig.png" width="320" /></a>
</center>
<center>
La Aventura Original (parte 2)</center>
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS6aZnQPZKzwc4K1HOBytvk92JMtCTUs9GJumbUHsCaonHCZc27ZfL9o6W3vI7GFXQvyv4tbMJnGyc-uvh5c-ZXYufUXWfnUMtOqdKUBvyBSLZnThdA1adxEIOIAa6pkt0iG5HPw/s1600/paint_alonedark.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS6aZnQPZKzwc4K1HOBytvk92JMtCTUs9GJumbUHsCaonHCZc27ZfL9o6W3vI7GFXQvyv4tbMJnGyc-uvh5c-ZXYufUXWfnUMtOqdKUBvyBSLZnThdA1adxEIOIAa6pkt0iG5HPw/s320/paint_alonedark.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Alone In The Dark</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgygQ1PgOe2aB1P_4e13WhaU7N7VBqiqvkxmpm_bQERV9o0nvB-I7dL3uMycxEcPqp9DHhtq_LfBx7x_v3qUP37UXfsKgPLS00HiprbIFpws8nUTNbrlcdi38GY0-8IdTQzUiUVEQ/s1600/paint_aworld.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgygQ1PgOe2aB1P_4e13WhaU7N7VBqiqvkxmpm_bQERV9o0nvB-I7dL3uMycxEcPqp9DHhtq_LfBx7x_v3qUP37UXfsKgPLS00HiprbIFpws8nUTNbrlcdi38GY0-8IdTQzUiUVEQ/s320/paint_aworld.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Another World</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNYASbH-5aya8oY8I9Q6CLapwXkWIb732ag3ZcNh2WFEdqiEbpeRkjcMA6f3_dAC5XVZZyHyeBYX9wqGuOnzQB0KCbDGBjZOo7-PRWWSFSyt7IzGjqEEDN4NebkJw4-HE6RNC7dA/s1600/paint_mi.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNYASbH-5aya8oY8I9Q6CLapwXkWIb732ag3ZcNh2WFEdqiEbpeRkjcMA6f3_dAC5XVZZyHyeBYX9wqGuOnzQB0KCbDGBjZOo7-PRWWSFSyt7IzGjqEEDN4NebkJw4-HE6RNC7dA/s320/paint_mi.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
The Secret of Monkey Island</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSFlgdST7KSHALSH14DkxNsea2lMxRqHWd0PS1or3lCga8njLg0cFubvckx6UT07_th2y6Jo0Z-rQYyD-WqxmLEXkNA9zKdIYa6oYNNtIToQybKaV1E5qzRB3LRZptqbuUBjAGcg/s1600/paint_rtype.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSFlgdST7KSHALSH14DkxNsea2lMxRqHWd0PS1or3lCga8njLg0cFubvckx6UT07_th2y6Jo0Z-rQYyD-WqxmLEXkNA9zKdIYa6oYNNtIToQybKaV1E5qzRB3LRZptqbuUBjAGcg/s320/paint_rtype.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
R-Type</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both;">
<br class="Apple-interchange-newline" /></div>
<div style="text-align: -webkit-auto;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDcXg107JF2yWDAq0AIZ73RxvWoK6z-rouCYsbVR_sqqT19W4LRUCfO7_LB4o2UmuzKQUyKGvP1j59GZHiYZ42SHXFGt9hHLUug7ag0LrCLFf97M5ga40euIIu0dRM50fVUJvydA/s1600/paint_dott.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDcXg107JF2yWDAq0AIZ73RxvWoK6z-rouCYsbVR_sqqT19W4LRUCfO7_LB4o2UmuzKQUyKGvP1j59GZHiYZ42SHXFGt9hHLUug7ag0LrCLFf97M5ga40euIIu0dRM50fVUJvydA/s320/paint_dott.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
Day Of The Tentacle</div>
<div style="text-align: center;">
<br /></div>
<br />
<br />
<br />
No están hechas exáctamente con el Paint (ya sabéis a estas alturas que soy Linuxero) sino con el "krita" o el "xpaint" (no recuerdo exáctamente cuál usé), pero la cosa resulta bastante entretenida :P. Además no tienen ni 2 minutos de trabajo en cada imagen, por lo que cualquiera puede intentar aportar las suyas propias sin dedicar demasiado tiempo :)<br />
<br />
¿Os animáis con alguna? Sólo hay que abrir un lienzo en blanco de 640x480, rellenarlo con un color de fondo plano y soltar 4 primitivas gráficas rellenas y algún texto.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com1tag:blogger.com,1999:blog-9180313.post-73645816419228816932012-11-21T14:51:00.001+01:002012-11-22T09:08:16.655+01:00Demoscene: The Art of the Algorithms<div class="separator" style="clear: both; text-align: center;">
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Hoy quiero compartir con vosotros un videodocumental sobre la demoscene: “</span><span style="font-family: Arial; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">Demoscene: The Art of the Algorithms</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">” (2012).</span></b></div>
<br />
<div style="text-align: left;">
<br /></div>
<b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"></b><br />
<div style="text-align: left;">
<b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"><b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Para quien no sepa lo que son las demos e intros (no confundir las demostraciones de juegos comerciales con menos niveles que el juego completo), como veréis en el vídeo se trata de programas similares a videoclips (con efectos gráficos espectaculares, música, y algunos de ellos con cierto mensaje detrás) pero que no están “montados” sino programados. Ese modelo 3D rotando, ese fuego, ese agua tan realista, ese efecto de rotación, están programados realizando operaciones matemáticas sobre los puntos y las texturas, en tiempo real. </span></b></b></div>
<b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;">
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Antes de ver el documental, creo que debéis poneros en disposición de ver una maravilla como </span><span style="font-family: Arial; font-size: 15px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">Second Reality</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">, de Future Crew. Pensad por favor que el vídeo que podéis ver a continuación se corresponde con una demo que se ejecuta en 1993 en PCs 386 y 486 a 25 y 33Mhz y que todo está renderizado en tiempo real: </span></b><br />
<div>
<center>
</center>
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<center>
<b style="font-weight: normal;"><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='480' height='399' src='https://www.youtube.com/embed/XtCW-axRJV8?feature=player_embedded' frameborder='0'></iframe></b>
</center>
<div>
<b style="font-weight: normal;"><br /></b></div>
<div style="text-align: center;">
<b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><i>Second Reality, de Future Crew (1993)</i></span></b></b></div>
<div>
<b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></b></b></div>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Impresionante, tanto la música (no digitalizada, sino compuesta en un tracker musical), como el montaje, como el impresionante nivel de programación que había detrás de esos efectos para que se ejecutaran fluídos en tiempo real en un simple 486 a 33 Mhz. Y PROGRAMADA EN ENSAMBLADOR.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Os dejo el documental:</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<br class="Apple-interchange-newline" /></div>
<center>
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='480' height='399' src='https://www.youtube.com/embed/iRkZcTg1JWU?feature=player_embedded' frameborder='0'></iframe>
</center>
<br />
<div>
<br /></div>
<b style="font-weight: normal;"><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Este videodocumental se centra en lo que es la demoscene húngara, y “entrevista” a programadores, músicos y grafistas de intros (de 4KB y 64KB) y demos. El documental es bastante curioso porque se vé una cultura de gente brillante a muchos niveles y que se dedican al tema de la demoscene por simple hobby.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Reconozco que he echado de menos ver a grupos no Húngaros, como por ejemplo Future Crew. Es más, hasta creo que el documental debería haber incluído demos como “Second Reality” para disfrutarla desde su principio a su fin.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Lo que más me ha sorprendido del documental es que existan las “demotools”. En la época de las demos que viví yo (Intel 286-386-486), todo se hacía “a mano”. Las demos se programaban desde cero, un efecto detrás de otro. En este vídeo podemos ver cómo algunos demosceners, cansados de programarlo todo desde cero, se crean herramientas para componer las demos como si fuera un editor de vídeo no lineal, generando esta herramienta después el código (ver el documental a partir del minuto 55m:40s). Con esta herramienta, el programador “diseña” los modelos 3D, importa texturas, las “inserta”, les aplica efectos, y puede mover todos los efectos y modelos por el “timeline”, definiendo cómo será la demo, cuándo entra cada efecto y con qué parámetros, etc.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></b><br />
<b style="font-weight: normal;"><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghoeUl_YVj5NlwAyYlDxx_ZH_cP-s6Xn0Sswhb8EBSCtCSQH5ZFolOpUYSYDi5zF66TNLc6Rftj0jk3uX1VIrJHv0iaKkgFuzkcdRUTGMtdVTH_rpdcKVf9p_VFcS0XjHKBl38Jg/s1600/de_demotools.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghoeUl_YVj5NlwAyYlDxx_ZH_cP-s6Xn0Sswhb8EBSCtCSQH5ZFolOpUYSYDi5zF66TNLc6Rftj0jk3uX1VIrJHv0iaKkgFuzkcdRUTGMtdVTH_rpdcKVf9p_VFcS0XjHKBl38Jg/s320/de_demotools.jpg" width="320" /></a></div>
<br />
<b style="font-weight: normal;"></b><br />
<div style="text-align: center;">
<b style="font-weight: normal;"><b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><i>Aspecto de la demotool de Conspiracy </i></span></b><b style="font-weight: normal;"></b></b><br />
<div style="display: inline !important;">
<b style="font-weight: normal;"><b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span></b></b></b><br />
<div style="display: inline !important;">
<b style="font-weight: normal;"><b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b id="internal-source-marker_0.35476381494663656" style="font-weight: normal;"><span style="vertical-align: baseline;"><i>(captura del videodocumental)</i></span></b></span></b></b></b></div>
<b style="font-weight: normal;"><b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">
</span></b></b></b>
<b style="font-weight: normal;"><b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b></b></b>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfjqAeRq0JBJLmDZwRi5m6EuVaHNARIwhCqHviGgGmrSQizAJdfhNQwodWc34Tbo691OF0_BCeNTaWmAMf8HRKkY0YoZN-XV_a8lAgMH5f81ySelCbbs5OBJ-z5G21LsfnxezUA/s1600/de_detalledemotools.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVfjqAeRq0JBJLmDZwRi5m6EuVaHNARIwhCqHviGgGmrSQizAJdfhNQwodWc34Tbo691OF0_BCeNTaWmAMf8HRKkY0YoZN-XV_a8lAgMH5f81ySelCbbs5OBJ-z5G21LsfnxezUA/s320/de_detalledemotools.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<i><span style="font-family: Arial, Helvetica, sans-serif;">Detalle del timeline</span></i></div>
<b style="font-weight: normal;"><b style="font-weight: normal;"><b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b></b></b></div>
<b style="font-weight: normal;"><b style="font-weight: normal;">
</b></b></div>
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" />Esto, que podría parecer que choca contra el espíritu de “superación” de las demos (programar para superar a otras personas, otros retros o mejorar algo), se produce porque las máquinas modernas ya no tienen las limitaciones de las antiguas.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Antes (por ejemplo, en C64, Amiga o PCs antiguos sin GPU), teníamos unas limitaciones de hardware especificas que obligaban a que la “carrera” del demoscener fuera la de superar estas limitaciones. A optimizar para llegar más allá de lo que alguien pensara que se podía llegar. Cuando veías un efecto espectacular en un C64, un Amiga, o un PC antiguo, sabías que lo que estabas viendo era en tiempo real, creado desde cero, sin usar ningún tipo de aceleración ni bibliotecas de terceros, y sentías cómo explotaba la máquina más allá incluso de lo que mostraban los juegos comerciales.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">En esa época la clave la marcaba la limitación del hardware, como he dicho, y la superación era técnica: exprimir la máquina un poco más de lo que se hacía hasta el momento, para dejar con la boca abierta a quien pensara que ese sistema no era capaz de eso.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Actualmente el hardware está a tal nivel que la “carrera” ya no es la técnica sino la de diseño. Las demos deben de ser bonitas, la música espectacular, los efectos ser “plásticos”... </span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Las únicas limitaciones que te puedes imponer para poner coto a los resultados son artificiales: por ejemplo, el tamaño. Intentar que la demo no supere 4KB ó 64KB implica forzar al programador a utilizar gráficos procedurales (nada de incluír imágenes), a generar el sonido él mismo (nada de incluír audio digitalizado), etc. También a devanarse los sesos para hacer efectos con las texturas y los sistemas de partículas, las cámaras y las fuentes para que el resultado sea espectacular, largo, y de reducido tamaño de ejecutable.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" />Aparte de estas limitaciones artificiales de tamaño, podemos forzarnos a programar sobre máquinas antiguas, que todavía tiene mucho tirón.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">En cualquier caso, como he dicho, algunos demosceners, ya no teniendo “barrera técnica” que superar, se centran en la parte artística y plástica, el diseño y el “montaje”, y para eso las demotools ayudan, porque lo espectacular ya no es “programar los efectos” sino usarlos correctamente y no tiene sentido reprogramar el mismo efecto gráfico desde cero. Así que las demotools permiten abstraerse de la “pérdida de tiempo” de reprogramar algo que no supone un reto, que se presupone ya sabido, para centrarse en el montaje en sí.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Si recordáis la anterior entrega (la de la Edad de Oro del Videojuego Español), acabé hablando de la frustación que supuso entrar en un mundo concreto y ver que está ya todo realizado y que no puedes ponerte al nivel de lo que ya hay. Me pasó con el Spectrum y después con el PC. Incluso a día de hoy pasa con los juegos para móviles, ya que hace unos años podías desarrollar cualquier cosa para móvil pero hoy hay juegos HD que tienen detrás equipos más gandes que juegos de PC o de consola.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Pues en el mundo de las demos, al final del vídeo puede verse como sucede lo mismo. Después de 30 años de demos, ¿qué ocurre con aquellos que les pica el gusanillo y quieren meterse en esto?</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Pues que no pueden competir a ningún nivel con lo que ya hay. Viendo demos de 1993 (Second Reality) que son ya casi insuperables, y demos de estos últimos años que tienen efectos dignos de Pixar, supongamos que entras tú y empiezas con tu pequeño cubo rotando. Necesitarás DECADAS para ponerte al nivel de lo que hay AHORA. Sólo si lo haces por diversión puedes dedicar el tiempo necesario y no sentir tal frustración inicial que abandones.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">De nuevo, alguien (por más brillante que sea) que quiera entrar este mundillo, llega muchos años tarde. Quien podría haber sido la estrella hace 30 años, cuando un rotozoom o rotar modelos 3D en un C64 era impresionante, ahora se pierde entre el mar de genialidades pasadas.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Casi que me queda una conclusión que se merece un artículo aparte.</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">¿Debería existir </span><span style="font-family: Arial; font-size: 15px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;">un hueco</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> para los relevos generacionales? ¿Deberían haber “categorías de demoscene” para novatos, y verse y valorarse dentro de lo que representan y no en un marco general? ¿Acaso se hace ya esto? ¿Deberían existir canales de distribución de juegos amateurs (aparte de las Store)?</span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">Finalizo el artículo dejándoos algunos vídeos que no os podéis perder:</span></b><br />
<br />
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b>
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<center>
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='480' height='399' src='https://www.youtube.com/embed/-UUvrj9yVVw?feature=player_embedded' frameborder='0'></iframe></center>
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></b>
<br />
<div style="text-align: center;">
<b style="font-weight: normal;"><span style="font-family: Arial;"><b style="font-weight: normal;"><span style="vertical-align: baseline;"><i>Música: "Elysium" de Jester/Sanity, reproducida en el Impulse Tracker</i></span></b></span></b></div>
<div style="text-align: center;">
<b style="font-weight: normal;"><span style="font-family: Arial;"><b style="font-weight: normal;"><span style="vertical-align: baseline;"><i><br /></i></span></b></span></b></div>
<div style="text-align: center;">
<b style="font-weight: normal;"><span style="font-family: Arial;"><b style="font-weight: normal;"><span style="vertical-align: baseline;"><i><br /></i></span></b></span></b></div>
<br />
<div style="text-align: center;">
<center>
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b></center>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<center>
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='480' height='399' src='https://www.youtube.com/embed/tCMo-bJQC8A?feature=player_embedded' frameborder='0'></iframe></center>
<b style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b>
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"></span></span></b><br />
<div style="text-align: center;">
<b style="font-weight: normal;"><span style="font-family: Arial;"><b style="font-weight: normal;"><span style="vertical-align: baseline;"><i>Intro (64KB!!!): "Heaven Seven" de Exceed. Repito: 64KB.</i></span></b></span></b></div>
<br />
<b style="font-weight: normal;"><br /></b>
<b style="font-weight: normal;"><br /></b>
<b style="font-weight: normal;"> Que las disfrutéis.</b>sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-77419181677555194052012-11-20T19:51:00.002+01:002012-12-06T12:23:42.334+01:00Ocho Quilates - La Edad de Oro de los Videojuegos en España<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<b id="internal-source-marker_0.1613951213657856" style="font-weight: normal;"><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">En apenas 3 días, en los ratos muertos (a veces a base de quitarme alguna hora de sueño) me he leído los 2 volúmenes de “Ocho Quilates”, la obra de Jaume Esteve sobre “La Edad de Oro” del software Español.</span></b><br />
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></b>
<b style="font-weight: normal;"><span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifNhO_SI-D0i2Gqgw2dyz1mJNPxPUKJEA-DR3CJLq9BamuauUwwKYxKKkcHRPW_92f3zuTbYyn5FmBYIMAccu_5GJgHPbNS1z2AGg2kQTt3i6UM_eraHJR3ue_rfjP7qh9DLEymQ/s1600/8q_8quilates.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifNhO_SI-D0i2Gqgw2dyz1mJNPxPUKJEA-DR3CJLq9BamuauUwwKYxKKkcHRPW_92f3zuTbYyn5FmBYIMAccu_5GJgHPbNS1z2AGg2kQTt3i6UM_eraHJR3ue_rfjP7qh9DLEymQ/s320/8q_8quilates.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<i>La edición física de "Ocho Quilates"</i></div>
<br />
<br />
<b><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span style="font-weight: normal;">Si os gusta mi reflexión / resumen, os recomiendo comprar el libro y leer esta historia de una forma más detallada:</span></span></b><br />
<br />
<br />
<ul>
<li><a href="http://www.ochoquilates.com/pages/ochoquilates">Ocho Quilates - El libro</a></li>
</ul>
<div>
<br /></div>
<b><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span style="font-weight: normal;">Yo, sin dudarlo, me hice tanto con la edición física como con la edición digital.</span></span></b><br />
<br />
<br />
<b><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span style="font-weight: normal;">El libro </span></span></b><b><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><span style="font-weight: normal;">relata la historia del software de Español desde sus inicios en 1984 hasta el ocaso de las grandes compañías en 1992. Por el camino, el autor nos presenta la historia de </span>Dinamic<span style="font-weight: normal;">, </span>Made In Spain /<span style="font-weight: normal;"> </span>Zigurat<span style="font-weight: normal;">, </span>Opera Soft<span style="font-weight: normal;">, </span>Topo Soft<span style="font-weight: normal;">, etc. y lo hace en base a una labor de documentación sobre revistas de la época y con jugosas entrevistas con los autores materiales de las obras. Os recomiendo su lectura, la verdad es que es un libro bastante ameno y “concentra” (entre entrevistas y referencias a revistas de la época) mucha información que estaba dispersa.</span></span></b><br />
<b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">No voy a hacer un resumen del libro como tal pero sí que voy a hacer breves comentarios sobre las distintas etapas que pasó nuestra “industria“ de los 8 bits, y en algún caso reflexiones personales sobre ello, en la parte que me toca, la del “programador de videojuegos frustrado”.</span></b><br />
<b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b>
<b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Como única pega al libro, diré que peca de lo mismo que pecaron las revistas originales y muchos círculos actuales retro, de exagerar un poco la calidad de algunos juegos que, realmente, no serían tan alabados si no fuera productos de casas españolas. Quiero decir que sin desmerecer a la Edad de Oro del Soft Español, muchos juegos de UK eran superiores en cuanto a calidad (especialmente las conversiones), siempre dejando de lado ciertos títulos españoles que estaban a un nivel casi insuperable; enseguida me viene a la mente "La Abadía del Crimen", "Sir Fred", </span></b><b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">"París Dakar", "Livingstone, Supongo", </span></b><b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">las aventuras míticas de AD como "La Aventura Original" o "Cozumel", etc. Pero bueno, se lo perdonamos porque, al fin y al cabo, existe ese pequeño plus patrio-nostálgico que por otra parte los ingleses también aplicaban sobre sus juegos y contra los juegos españoles.</span></b><br />
<b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b>
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: bold; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Los inicios: jóvenes "de garaje"</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Esta parte del libro narra cómo son los inicios de Dinamic o de Made In Spain, entre otros. En resumen: jóvenes en cuyas manos caen microordenadores como el ZX81, y que después descubren un universo de posibilidades con el ZX Spectrum. Jóvenes que compatibilizan sus estudios con la creación de juegos simplemente por hobby.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Los propios autores nos hablan de inversiones iniciales “mínimas” (al menos, abordables por unos estudiantes). De incontables horas de trabajo en su propia casa programando. De juegos sacados adelante por una única persona que realiza tanto código como gráficos como sonido, o bien a lo sumo equipos de 2 ó 3 amigos repartiéndose los roles de programador, grafista o músico. De tardes y noches programando juegos mientras durante el día se estudia. Vamos, chavales que empezaron, como en el caso de Apple, “en un garaje” (o en su habitación, o en una buhardilla en el caso de Dinamic).</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis2NKr5MX10VzokKXjBn71dHKYwyeLwQxJZWRwipzMxoHHja42GDpKPL4OJzKzMz_7Z0ijJ91JpKD6i8HIdqHyODUrcWWVzVNAS9m8b9wARmMnZM9O0ZJuT7cTy_IzMdTaBITGhA/s1600/8q_made_in_spain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br class="Apple-interchange-newline" /><img border="0" height="153" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis2NKr5MX10VzokKXjBn71dHKYwyeLwQxJZWRwipzMxoHHja42GDpKPL4OJzKzMz_7Z0ijJ91JpKD6i8HIdqHyODUrcWWVzVNAS9m8b9wARmMnZM9O0ZJuT7cTy_IzMdTaBITGhA/s320/8q_made_in_spain.png" width="320" /></a></div>
<div>
<br /></div>
<div style="text-align: center;">
<i>(Equipo de Made In Spain - de las páginas del Vol. 1)</i></div>
<div style="text-align: center;">
<i><br /></i></div>
<b></b><br />
<div style="text-align: center;">
<b><br /></b></div>
<b>
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Todo el proceso de producción, aquí, es “artesanal”, desde la codificación (ya sea en BASIC o incluso ensamblando a mano, sin programas ensambladores) a los gráficos. También el soporte físico y la “publicidad”: folletos dibujados a mano, carátulas fotocopiadas y duplicación de cintas en casa con cassettes de doble pletina o con “copiones”. Y venta local, dejando copias del juego en alguna tienda cercana, o bien a nivel nacional por correo (sí, por carta).</span></b><br />
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFTKFM0eWeNjIwVvezBJwB3zYhVU857xLJV65XwlfsQorrtVyjq3-WPr5IHauo01f6joVXXyMBRpUI6C5zPCNCsFJ__oWstbJ5Cf3oocFNPck0z6y5MT4Pvt3ZNOVenKAGjSExvg/s1600/8q_yenght_y_artist.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFTKFM0eWeNjIwVvezBJwB3zYhVU857xLJV65XwlfsQorrtVyjq3-WPr5IHauo01f6joVXXyMBRpUI6C5zPCNCsFJ__oWstbJ5Cf3oocFNPck0z6y5MT4Pvt3ZNOVenKAGjSExvg/s320/8q_yenght_y_artist.png" width="320" /></a></div>
<div>
<br /></div>
<div style="text-align: center;">
<i>Yength y Artist, las primeras creaciones de DINAMIC </i></div>
<div style="text-align: center;">
<i>(por 1000 pts cada uno)</i></div>
<b></b><br />
<div style="text-align: center;">
<b><b><br /></b></b></div>
<b>
<br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Es la época donde nada está hecho y todo es nuevo. Los chavales, programando juegos “por hobby”, sin esperar “nada a cambio”, empiezan a recibir dinero y reconocimiento por sus productos. Es el momento en el que se da un paso adelante y equipos como Dinamic (que no dejaban de ser 3 hermanos, Pablo, Víctor y Nacho Ruíz) empiezan a pensar en profesionalizar su trabajo. Y otros equipos les siguen en este movimiento.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Por otro lado, Paco Pastor, en ERBE, realiza distribución en España del software de UK, comprando el producto final y traduciendo sus instrucciones, vendiendo productos de calidad (acabado de UK). De nuevo hablamos de un proceso “artesanal”, que aunque tiene resultados profesionales, finaliza con un precio de producto superior a las 2000 pesetas, una enorme cantidad para la época.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">En esta etapa, hay tímidos intentos de exportar nuestro software a otros países (fundamentalmente UK), con resultados muy variopintos: se obtienen pocas ventas, malas distribuciones, pocos royalties o directamente no reciben nada. Básicamente, el trabajo de los equipos españoles en general no estaba bien considerado y los juegos distribuídos siempre eran criticados por su elevada dificultad. </span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">La profesionalización del hobby</span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"> </span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Cuando hablo de “</span><span style="font-family: Arial; font-size: 15px; font-style: italic; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">profesionalización</span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">”, no quiero que se confunda con “</span><span style="font-family: Arial; font-size: 15px; font-style: italic; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">industrialización</span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">”. Me refiero a que el proceso de producción se profesionaliza, es decir, se mejora en general tanto la metodología y el ambiente de trabajo, como la calidad final de los productos.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Duplicación de cintas en empresas destinadas a ello, portadas y anuncios creados por ilustradores de prestigio, cajas formato estuche, canales de distribución como El Corte Inglés, cambio de la habitación o buhardilla por unas oficinas, publicidad en revistas, etc.</span></b></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg80evjCtc8OdFmdMDcxL5pCLwKctuCGdBd0l9LgbjPD6v_s5Dj9fpQ_W4mBzgi8Uz4L93B_VGxHOfbmL45utqMENDbF7PCEQBW4v9pg5swGK8TlVRP9Gr_LgY1bvOxAAZk3w4eoQ/s1600/8q_caja_abusimbel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg80evjCtc8OdFmdMDcxL5pCLwKctuCGdBd0l9LgbjPD6v_s5Dj9fpQ_W4mBzgi8Uz4L93B_VGxHOfbmL45utqMENDbF7PCEQBW4v9pg5swGK8TlVRP9Gr_LgY1bvOxAAZk3w4eoQ/s320/8q_caja_abusimbel.jpg" width="320" /></a></div>
<div>
<br /></div>
<div style="text-align: center;">
<i>El aspecto de un bonito estuche de DINAMIC</i></div>
<div style="text-align: center;">
<i>(foto extraída de images.google.es)</i></div>
<div style="text-align: center;">
<i><br /></i></div>
<b><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Pese al gran parqué de Spectrum en España, apenas se vendían unas miles de copias de cada juego, a precios de aprox. 2000 a 2500 pesetas (unos 12 a 15 EUR) los juegos importados, y 1000 a 1200 pesetas (de 6 a 8 EUR) los nacionales, pero daba el suficiente rédito para que esos jóvenes pudieran vivir de lo que les gustaba: la creación de juegos.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Los juegos se creaban como obras artesanales y no estaban sujetos a plazos estrictos o campañas/fechas concretas, ni se buscaba un mercado específico u otro. Simplemente, seguían haciendo los juegos que tenían en su mente, a veces simplemente “homenajes” a las recreativas del momento. Pero lo importante es que los juegos se intentaban hacer lo mejor posible y se distribuían cuando estaban listos y no en base a un calendario o a acciones meramente comerciales.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">En esta ocasión, por fin, las casas españolas comienzan a distribuir en UK primero con compañías pequeñas y luego con algunas de las grandes, y comienzan a recibir dinero de verdad con las ventas fuera de España (algunas compañías con más fortuna que otras).</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">En esta profesionalización nos encontramos con que las casas de software se centran en el desarrollo y salvo alguna excepción, pasan a confiar en ERBE para la distribución. ERBE hace duplicaciones profesionales de cintas en una discográfica, y tiene contactos con grandes canales de distribución y revistas, por lo que los estudios pueden dejar de invertir su tiempo en duplicación de cintas, de carátulas, de instrucciones, distribución, etc.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">La piratería y la bajada de precios</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Centrados en el mercado Español, los desarrolladores comienzan a preguntarse cómo es posible que en UK se vendan decenas de miles de copias de los juegos y en España apenas se vendan unidades (1000, 2000 copias algunos juegos). </span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">No podía ser por escaso parqué de hardware porque el Spectrum arrasaba en España. Además, se vendían 100.000 revistas Microhobby semanales, signo de que había una enorme base de usuarios.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Paco Pastor (de ERBE), cuyo sector es la distribución, estudia el caso y llega a la conclusión de que sólo el 2% de los juegos en casa de los usuarios son copias legales, siendo el resto copias piratas que podías comprar por correo o en los mismos rastros. Incluso las tiendas hacían pedidos de juegos originales y los usaban para vender copias.</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Las copias, que las había desde 350 pesetas (poco más de 2 EUR de los de ahora), costaban mucho menos que los originales (que podían llegar a 2500 pesetas, unos 15 EUR).</span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Pastor se pone en contacto con los mayores grupos de desarrollo (a los que distribuye) y les convence para dar un golpe de efecto: bajada de precio de los juegos hasta las 875 pesetas (unos 5 EUR), que es, según un estudio de mercado realizado con los propios usuarios, la cantidad para la cual el usuario compraría un original en vez de una copia.</span></b><br />
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-5FtMwhq6aP_OSESqN_DzIEfCDdsivZUTZrCZwjJpe3-56xzLKfkDX67FIwesMw3kZ7wPx1T9mHoHw3t_SPwgt-pL6q8eb9Qq5mhnBp0S84KxUsRu_3uC-qJNmwn-vvf6NHBsRQ/s1600/8q_erbe875.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-5FtMwhq6aP_OSESqN_DzIEfCDdsivZUTZrCZwjJpe3-56xzLKfkDX67FIwesMw3kZ7wPx1T9mHoHw3t_SPwgt-pL6q8eb9Qq5mhnBp0S84KxUsRu_3uC-qJNmwn-vvf6NHBsRQ/s320/8q_erbe875.jpg" width="234" /></a></div>
<div>
<br /></div>
<div style="text-align: center;">
<i>"Ser original cuesta muy poco" - El slogan de ERBE para convencer</i></div>
<div style="text-align: center;">
<i>a los jugadores de comprar originales con el nuevo precio rebajado.</i></div>
<b><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<i><br /></i></div>
<div>
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Esta bajada de precio resulta un éxito, comenzando por fin a venderse cantidades de cintas lógicas (10.000, 40.000 e incluso juegos de DINAMIC llegaron a las 100.000 copias), pero tiene varias pegas. </span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Por un lado, queda menos margen en cada venta por lo que es necesario vender 3 veces más que antes para ganar lo mismo. Este mismo “menor margen” no deja lugar al error en el desarrollo: si un juego no es un éxito, es difícil recuperar la inversión. Esto produce mella en algunas casas de software, que no distribuyen con ERBE pero se ven obligadas a bajar el precio para poder competir, y no les queda margen de fallo: o el juego triunfa, o se hunden.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Por otro lado, se comienza a generar un producto de peor acabado, las típicas cintas de ERBE de cajetín simple. Adiós a las cajas de cartón o estuches, a las cajas dobles, o a los libros de instrucciones. Salvo recopilatorios y algún otro trabajo de DINAMIC, los juegos aparecen en cajas con menos personalidad que las anteriores distribuciones.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfeFVaj5Xz0cF7WzcgN72iAB8iDp7kwuGhsRmXsPecejX-8nI9BVHywoLPH_1tKpB-1XDUT-npDxFUE7LSU_U7S7rMipwlJqC4QR924F8pQfld_A8NntI_KO_XzDOVLlZJ8mdbZw/s1600/8q_edicion_erbe.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br class="Apple-interchange-newline" /><img border="0" height="274" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfeFVaj5Xz0cF7WzcgN72iAB8iDp7kwuGhsRmXsPecejX-8nI9BVHywoLPH_1tKpB-1XDUT-npDxFUE7LSU_U7S7rMipwlJqC4QR924F8pQfld_A8NntI_KO_XzDOVLlZJ8mdbZw/s320/8q_edicion_erbe.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<i>El aspecto de las cajas "clónicas" (lomo rosa) de ERBE</i></div>
<div class="separator" style="clear: both; text-align: center;">
<i>(foto extraída de images.google.es)</i></div>
<div>
<i><br /></i></div>
<span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">Para mí este cambio es similar al que sufrieron las preciosas cajas de cartón de los juegos para convertirse a las cajas de CD/DVD totalmente impersonales que se venden ahora.</span><br />
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<br />
<b><span style="font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">La industrialización : de afición a negocio</span></b></div>
<div>
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Ahora sí que llega el momento en se produce la industrialización del hobby, a cuando la afición se convierte en negocio.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">La bajada de precios no sólo acarreará la pérdida de las bonitas ediciones en caja a cambio de cassettes todos iguales con el lomo rosa o blanco... como ya dicho, también trae detrás de sí la necesidad de vender muchas unidades para que los desarrollos salgan rentables.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Eso implica un número mínimo de lanzamientos anuales para ser rentables, con plazos estrictos de lanzamiento. Ponerle plazos a un proyecto de software basado en la creatividad, en este caso, sirvió para que muchos dejaran de disfrutar de su trabajo, tuvieran una gran presión y se lanzaran juegos con menos calidad de la deseada. Ojo, no digo que no salieran productos de enorme calidad, sino que había mucho más producto de relleno.</span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">Programadores como Paco Menéndez, autor de <i>La Abadía del Crimen</i>, dejaron la industria del videojuego en este punto ya que, como decía el propio Menéndez en Microhobby, "<i>Antes programar era un arte, ahora es todo Marketing.</i>"</span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JEr946vhX23R4XhbrGJBlnqTvEVwlyXcqJgnlhN3hq4ul2yPRSnmRY57iSHmXhwueIiFaahafkP_P7CQ4IWHdN_WcShMbcpsFJmWsuGze35r6t2CyI2t5s_BEJo0WP5YqXlaJQ/s1600/8q_paco_menendez.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JEr946vhX23R4XhbrGJBlnqTvEVwlyXcqJgnlhN3hq4ul2yPRSnmRY57iSHmXhwueIiFaahafkP_P7CQ4IWHdN_WcShMbcpsFJmWsuGze35r6t2CyI2t5s_BEJo0WP5YqXlaJQ/s320/8q_paco_menendez.jpg" width="320" /></a></div>
<div>
<br />
<div style="text-align: center;">
<i style="font-family: Arial; font-size: 15px; white-space: pre-wrap;">Paco Menendez (La Abadía del Crimen)</i></div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Se editaban recopilatorios con “fondo de armario” (productos que ya no tenían vida comercial) y se hacía uso de las licencias (famosos) para promocionar los juegos, siendo a veces esto más importante que la calidad del propio juego.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Lo que eran grupos de amigos, se convirtieron en organizaciones empresariales con jefes que no eran informáticos sino “coordinadores” (como el caso de Topo y Gabriel Nieto). El videojuego era ahora negocio y había que rentabilizarlo: segundas partes, juegos de licencias y plazos estrictos, así como la obligación de hacer el mayor número de versiones posible (Spectrum, Amstrad, MSX, C64, PCW, PC...). Para realizar estas versiones, las empresas más grandes compran hardware especializado de desarrollo que permiten programar sobre un PC y portarlo a diferentes hardwares. Esto queda fuera del alcance de empresas más pequeñas y la brecha se hace más grande entre ellas.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">En resumen: muchos más juegos, pero ya no de producción artesanal sino industrial. Todavía se puede ver el mimo de los creadores, porque siguen siendo sus productos, pero ya no hay la misma sensación de que se está en algo más grande que uno mismo, como al principio.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Los que realmente aquí hacen de dinero de verdad, son los distribuidores como ERBE, que además se hace con el monopolio absoluto de la distribución en España.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<b><span style="font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">La caída</span></b></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><b><u><br /></u></b></span></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Y aquí, a partir de 1990 en adelante (y en algunas compañías, ya desde 1989), es cuando empieza el fin de la Edad de Oro del Software Español.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">En Europa hace ya meses (si no más) que las ventas de software de 8 bits han caído y que triunfan las máquinas de 16 bits como Atari ST y Commodore Amiga. Así, UK deja de convertirse en un importador de nuestro software, porque allí ya no vende, y a las desarrolladores españolas sólo le queda nuestro mercado, que tiene precios bajos y está saturado.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">La empresa de software española se encuentra entonces con la duda de que si desarrolla para 8 bits, no puede exportar a UK y sólo tiene el mercado español, pero si se pasa a los 16 bits, entonces no vendería nada en España y dependería de la exportación. No sólo había apenas Amiga y Atari ST en España (por su precio) sino que además el coste de producir para esas máquinas era muy elevado y el resultado (el diskette) muy fácilmente pirateable.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Algunas compañías se ciñeron a los 8 bits asumiendo que no podía entrar en los 16 bits (inversión impensable) y otras, como Topo, se lanzaron (Viaje al Centro de la Tierra), “quemando” enormes cantidades de dinero en el desarrollo. Ya no podía hacer un juego un único desarrollador o un pequeño equipo y en un corto espacio de tiempo. Así que las versiones que se hacían para 16 bits eran conversiones casi directas de los títulos de 8 bits, que no aprovechaban las capacidades de las nuevas máquinas y por tanto no podían competir con las empresas que sí las explotaban, por lo que la inversión en su desarrollo no se podía rentabilizar.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Los pequeños equipos españoles ya no podían crear los juegos que compitieran con lo que llegaba, que eran verdaderas superproducciones con decenas de personas en plantilla, localización a múltiples idiomas.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Voy a poner el ejemplo de Aventuras AD, sección de DINAMIC dedicada a crear aventuras conversacionales con varios empleados a cargo de Andrés Samudio. Tenían que sacar una decena de aventuras al año para ser rentables, y apenas sacaban un par, y en pleno proceso de creación, aparece LucasArts con sus aventuras gráficas, creadas por decenas de personas, con animaciones, diálogos, música, bellos gráficos a color y en formato point-n-click. Imposible competir con eso. España estaba anclada en el pasado, el resto de la industria europea y norteamericana habían superado los 8 bits hacía mucho y nosotros no sólo no lo habíamos hecho si no que estábamos en disposición de hacerlo.</span><br />
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvb3xYboBBVseeLeHgsc_hQwRT7LuEpe29pQWRuuZ_2gJrsh6aiFC3atwurABBRNq16jqGKnvL44IGRtbNELfY98P8llikUGQcxqxsesW_6Oy_reDINBOzFLFWrpnv0Va53oNTQ/s1600/8q_avorig2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br class="Apple-interchange-newline" /><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvb3xYboBBVseeLeHgsc_hQwRT7LuEpe29pQWRuuZ_2gJrsh6aiFC3atwurABBRNq16jqGKnvL44IGRtbNELfY98P8llikUGQcxqxsesW_6Oy_reDINBOzFLFWrpnv0Va53oNTQ/s320/8q_avorig2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
"La aventura Original (Spectrum)" VS "Indiana Jones (PC)"</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNNCAOwUtJRBKFtM3o4TNRVLDs010Fcl26Mkfhn7rlzEDOuN7h5YG-VnJAWK-Lz5y65cxfUKtBywCkV_HNVEaeMNXvNG6VhITqQFdKokKK7n4Gu_pzSqE_vNLbKy5sl6tKLnp-A/s1600/8q_indi_ultimacruzada.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNNCAOwUtJRBKFtM3o4TNRVLDs010Fcl26Mkfhn7rlzEDOuN7h5YG-VnJAWK-Lz5y65cxfUKtBywCkV_HNVEaeMNXvNG6VhITqQFdKokKK7n4Gu_pzSqE_vNLbKy5sl6tKLnp-A/s320/8q_indi_ultimacruzada.jpg" width="320" /></a></div>
<br />
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Y aquí comenzó el fin de muchos estudios, manteniéndose algunos todavía gracias a que el mercado español no pasaba aún de los 8 bits, cosa que duró poco, hasta que Megadrive, Gameboy y SuperNintendo, así como el PC, barrieron cualquier atisbo de negocio con los 8 bits.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Cabe pensar que podría haber sido incluso peor si en este impás los estudios españoles hubieran hecho la inversión de meterse en los 16 bits. No hay más que ver el caso de Topo y Viaje al Centro de la Tierra. Pero imaginamos que todos los demás estudios lo hacen e invierten en desarrollo de Atari ST y Amiga: en apenas unos meses/años, las consolas NES, SNES, Master System y Megadrive enterrarían a los ordenadores de 16 bits.</span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">He intentado resumir el libro en la medida de lo posible, pero los 2 volúmenes son bastante densos y probablemente preferiréis su lectura completa para no perder ni un sólo detalle.</span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">A continuación viene mi reflexión personal sobre los cambios que ha habido en el ciclo de desarrollo y cómo se ha perdido el sueño del "desarrollador de garaje".</span></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<a name="reflexion"></a>
<b><span style="font-family: Arial; font-size: 15px; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Frustración (reflexión personal)</span></b></div>
<div>
<br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Conforme leía el segundo volumen iba sintiendo (igual que supongo en su momento sus protagonistas) <i>frustración</i>. Por un lado por lo que pudo ser y no fue, y por otro frustración que ya viví en su momento como desarrollador, y por duplicado. </span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Yo llegué bastante </span><span style="font-family: Arial; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><b>tarde</b></span><span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"> a la época del Spectrum (con un +2A, la última etapa del Spectrum cuando era la marca era ya propiedad de Amstrad) y en muy poco tiempo aprendí a programar sacándole partido a la Microhobby y a la tabla de nmemónicos en ensamblador del manual del +2A pero ya llegaba tarde a desarrollar nada para Spectrum. El mercado estaba saturado, no quedaba nada por “inventar” y la época de los “desarrolladores de garaje” ya había pasado, pero aún así podías soñar con desarrollar algo y que se viera publicado. No obstante, muy pronto llegó la muerte comercial del Spectrum y me ví abocado a continuar el desarrollo en PC. </span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Cuando hablo de PC hablo de la época de 286, 386 y 486, donde se repiten un poco las premisas iniciales de la edad de oro: tenías ante tí todo el universo de creación por delante, con una máquina con mucho mejores recursos que un Spectrum y una sóla persona o un equipo muy pequeño podía prácticamente desarrollar cualquier cosa. Esto era así porque la programación estaba casi acotada a MCGA (320x200x256 colores) y esa limitación (para los grandes equipos gráficos) te permitía poder ponerte a su altura aunque no contaras con recursos, de igual forma que 3 chavales en su buhardilla pudieron crear juegos de Spectrum de calidad comercial.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Desarrollé todo tipo de bibliotecas de programación para modo 13h (fuentes, scroll, tilemaps, editores de mapeados, sprites, animación, etc) y mientras estaba en ello, y madurando pequeños juegos y demos (para aprender a programar efectos gráficos), llegó el boom del multimedia, el momento en que se abandonaron los diskettes y llegó el CD. Y se abandonó el 486 y llegó la escalada de los Pentium. Y se abandonó 320x200 y llegó SVGA (VESA). Vamos, que desapareció ese momento en que tú, en tu casa, podías hacer un producto del mismo nivel que los comerciales que existían, y llegó ese momento en que un producto comercial venía en CD, estaba en varios idiomas, tenía voces digitalizadas, banda sonora orquestada, gráficos diseñados por decenas de profesionales, animadores, equipos completos de programadores... llegó el momento en que tu juego ya no podía ni siquiera mostrarse al lado de esos monstruos que iban apareciendo.</span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<span style="font-family: Arial; font-size: 15px; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Hoy en día, gracias a Internet, tenemos la suerte de que podemos volver a aportar algo a este mundillo: vía web (HTML5/JS), en móviles (iOS, Android), en consolas (XBLA, WiiWare) o en PC, pero sigue siendo una competición muy complicada donde, ahora sí, casi está ya todo inventado.</span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">No obstante, no pierdo la esperanza de que algún día podré quitarme la espinita de sacar algo (para Spectrum o para cualquier otro sistema) aunque sea por puro hobby o entretenimiento. Sólo falta conseguir el tiempo para hacerlo. El tiempo, el eterno problema... cuando teníamos tiempo no teníamos ni dinero ni conocimientos, y ahora que tenemos dinero y conocimientos no tenemos tiempo... pero esto da para otro artículo / reflexión en sí mismo :-)</span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;">Un saludo.</span></span></div>
<div>
<span style="font-family: Arial;"><span style="font-size: 15px; white-space: pre-wrap;"><br /></span></span>
</div>
</div>
</div>sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com1tag:blogger.com,1999:blog-9180313.post-16273532634492308692012-11-13T14:24:00.000+01:002012-11-15T15:31:08.251+01:00Procrastinación, o el "arte" de aplazar tareas <br />
Se dice que el primer paso para solucionar algo es aceptar que lo padeces.<br />
<br />
Pues bien, ahora mismo hay una epidemia que padecen muchos integrantes de la sociedad (y especialmente de la sociedad de la información), y reconozco que no me había planteado que tuviera nombre o que existieran formas de combatirla.<br />
<br />
Estoy hablando de la <b>procrastinación</b> (<i>procrastination</i> en inglés).<br />
<br />
<br />
<b>
¿QUE ES LA PROCRASTINACION?<br />
</b><br />
<br />
Procrastinación es <i>el acto de aplazar tareas que tienes que hacer y reemplazarlas por tareas más sencillas o más apetecibles en ese momento.</i><br />
<br />
Este problema afecta tanto a las personas que no tienen ningún tipo de planificación como a las que se organizan con agendas, listas de tareas, blocks de notas...<br />
<br />
Simplemente, cuando llega el momento de enfrentarse a la tarea que debemos hacer (<i>escribir un informe, colgar un cuadro, fregar los platos, ir al gimnasio, hacer dieta, organizar los papeles de la casa...</i>), nos ocurre que la sentimos titánica, enorme, extenuante, tediosa, poco motivadora, o imposible de realizar. Realmente nos damos cuenta de que no nos apatece siquiera empezarla y además parece tan larga que no nos va a dar tiempo a finalizarla.<br />
<br />
No importa que la tarea nos llegue porque nos hayamos acordado o percatado de que tenemos que hacerla, o porque venga de un detallado planning en una aplicación de tareas (es decir, que no importa que seamos organizados o no). El asunto es tenemos que realizar esa tarea, y no nos apetece.<br />
<br />
Y entonces decidimos retrasar esa tarea para que la realice un "<b>Yo Futuro</b>" (por ejemplo, nuestro <i>yo del mañana</i>, o el <i>yo de la semana que viene</i>), porque pensamos que ese yo estará en una situación mucho mejor para tratarla. Pero la realidad es que nuestro "Yo Futuro", cuando se convierta en "Yo Presente", volverá a sufrir la misma sensación de imposibilidad de ejecución de la tarea y la tentación de postergarla.<br />
<br />
Así que en lugar de realizar la tarea que debemos hacer, acabamos realizando tareas más sencillas que queremos hacer: revisamos nuestro correo, vemos una película, echamos una siesta, realizamos otras cosas intranscendentes o más sencillas, damos un vistazo a las redes sociales, etc. A veces incluso realizamos otras tareas menores que teníamos planificadas para realizar (tareas reales pendientes), pero no la que estamos considerando, la que debemos hacer.<br />
<br />
<u>
El resultado es que las tareas realmente importantes son postergadas una y otra vez</u>. Es el motivo por el que nunca aprendemos a hablar ese segundo lenguaje, a tocar ese instrumento, acabamos no yendo al gimnasio, ni siquiera empezamos la dieta, o retrasamos ese informe y finalmente tenemos que hacerlo en el último minuto.<br />
<br />
La procrastinación es <b><u>muy grave</u></b>. Es un problema real, que puede producir <b>insatisfacción personal</b> al no conseguir metas que realmente te has planteado alguna vez en tu vida. <br />
<br />
Es también grave en el mundo laboral, donde cualquier distracción (correo, tareas menores, etc) aplaza una y otra vez acciones o proyectos complejos pero que normalmente son los más importantes.<br />
<br />
Cuando hablo de aplazar tareas no estoy diciendo que no hagamos nada a lo largo del día. No. La procrastinación se da especialmente cuando tienes muchas tareas, y tienes que cambiar entre ellas. Me considero una persona con mucha productividad laboral, que intenta abarcar muchas áreas de aplicación y mucho trabajo de forma simultánea, y este es precisamente el problema, que tengo muchas tareas donde elegir y muchos problemas que atacar. Esto no le sucede en la misma medida a personas más especializadas o personas con trabajos "físicos" (como el fontanero que viene a tu casa a cambiar una tubería, y que no tiene más opciones o elecciones que hacer ese cambio).<br />
<br />
Así pues, soy una persona muy activa laboralmente, productiva y trabajadora, y sin embargo "procrastino", tanto personal como laboralmente. Tengo pendiente mejorar mi inglés. Tengo pendiente salir más a hacer deporte, como hacía antes. Tengo pediente terminar unos programas que tenía en desarrollo. Tengo pendientes muchos libros interesantes por leer. Tengo pendientes muchas cosas...<br />
<br />
El problema de la procrastinación se basa en que nuestro cerebro nos engaña, y lo hace de diferentes formas:<br />
<br />
<br />
<br />
<b>
ENGAÑO 1.- PLANIFICACION OPTIMISTA<br />
</b><br />
<b><br /></b>
A la hora de decidir que queremos abarcar un nuevo proyecto o tarea, y de añadirla a nuestro "calendario" o "nuestra lista de tareas", <b>nuestro cerebro planifica la tarea de forma optimista</b>, es decir: es incapaz de planificar los problemas que surgirán, las partes de la misma que son complejas, su duración real. En lugar de hacer una planificación real, estima que es una tarea muy sencilla y que nos va a dar mucha recompensa ejecutarla.<br />
<br />
Por ejemplo, supongamos que tenemos un cuadro por colgar. Bien, <i>lo haremos hoy mismo, total, sólo hay que hacer un agujero y colgar el cuadro, son apenas 2 minutos y quedará muy bien en nuestra parted</i>.<br />
<br />
<br />
<br />
<b>
ENGAÑO 2.- PRE-EJECUCION PESIMISTA<br />
</b><br />
<b><br /></b>
Cuando llega el momento de enfrentarse a la tarea o mientras lo estamos haciendo, nuestro cerebro hace todo lo contrario, <b>la afronta de forma realista o incluso pesimista</b>: detecta las partes problemáticas de la tarea y nos hace ver que ni era tan sencillo como pensábamos, ni vamos a tardar tan poco. Y además, deja de percibir la recompensa que sí que anticipamos cuando planificamos por primera vez la tarea.<br />
<br />
En ese momento, nuestro cerebro libra una guerra interna entre el <b>DEBO</b> y el <b>QUIERO</b>. La procrastinación se produce cuando elegimos el QUIERO sobre el DEBO.<br />
<br />
En nuestro ejemplo anterior, cuando cogemos el cuadro en la mano <i>nos damos cuenta de que para colgarlo, tenemos que coger el metro y medir tanto el cuadro como la pared, y calcular la posición y altura a la que lo queremos. Además hay que ir a por el taladro y las brocas. Y un alargador, porque no hay un enchufe cerca. Vaya, esto ya no son 2 minutos, me va a costar más tiempo del que pensaba, y no sé si tengo ese tiempo</i>. Ahora mismo es que además, tampoco me apetece. Creo que lo colgaré este sábado que viene, que tengo más tiempo libre; en cambio, me echaré un rato en el sofá y veo mi correo nuevo.<br />
<br />
DEBO colgar el cuadro, pero no QUIERO ahora mismo. Además, DEBO, me suena internamente a obligación, lo que hace que la tarea que me iba a proporcionar una recompensa (un bonito cuadro en la pared) se convierta en una obligación que se me impone.<br />
<br />
<i>
Pero no pasa nada, porque nuestro Yo Futuro del sábado que viene lo colgará, y entonces seré feliz</i>.<br />
<br />
<br />
<br />
<b>
ENGAÑO 3.- CONFIANZA EN EL YO FUTURO (FUTURO ERRONEO)<br />
</b><br />
<br />
Nuestro cerebro nos engaña entonces haciéndonos pensar que nuestro "Yo Futuro" sí que va a estar en disposición de afrontar esa tarea, y además lo hará encantado, con tiempo de sobra y con éxito en la misma.<br />
<br />
Volvemos a caer en la <u>PLANIFICACION OPTIMISTA</u>, y para la misma tarea, olvidando la <u>PRE-EJECUCION PESIMISTA</u> que nos acaba de hacer postergarla. <br />
<br />
Pero cuando nuestro "Yo Futuro" se vuelve a convertir en "Yo Presente", nos encontramos de nuevo en la misma situación inicial. Nos encontramos en la <b>realidad</b>. Una tarea que nuestro cerebro nos dice que será tediosa y larga, y que no nos apetece realizar. Entonces, volvemos a postegarla a cambio de una tarea menor (ver la TV, leer el correo, ver redes sociales) y que hace que pasado un tiempo sintamos internamente "<u>vergüenza</u>" y "<u>fracaso</u>".<br />
<br />
La tarea no se realizará nunca, o en el mejor de los casos, se demorará. <br />
<br />
<i>
El sábado que viene, no colgaremos el cuadro. Mañana, no iremos al gimnasio. El lunes, no empezaremos la dieta. Este año, no aprenderemos ese segundo idioma. No nos sacaremos esa certificación. No haremos el informe hoy</i> (en el mejor de los casos, y por obligación, a última hora).<br />
<br />
Nuestra sensación será entonces que no acabamos nada. A nivel personal, que la vida pasa y no estamos finalizando nuestras metas, nuestros hitos y nuestros sueños. A nivel laboral, que los proyectos se enquistan y que se nos acumula el trabajo que realmente es importante a cambio de trabajo "menor" que sí hemos abordado porque era más fácil de realizar.<br />
<br />
Este engaño se basa en que<b> la percepción que tenemos ahora de cómo será el futuro es errónea</b>.<br />
<br />
No hay más que darse cuenta de que nuestra mente hizo una planificación ideal de la resolución del problema a la hora de "aceptar la tarea" basándose en un futuro irreal donde no se presenta ningún problema ni dificultad para realizarla. Se basa en que nuestro "Yo Idealizado" resolverá la tarea sin problemas en nuestro "Futuro Idealizado". Sin embargo, cuando ese "Futuro Idealizado" se convierta en "Presente", la realidad será la misma que cuando hemos retrasado la tarea.<br />
<br />
<br />
<br />
<b>
¿TIENE SOLUCION?<br />
</b><br />
<br />
La procrastinación no tiene solución total, porque está arraigada en la mente humana. Pero podemos aprender a vivir con ella y reducirla a la mínima expresión.<br />
<br />
Como dicen algunos análisis al respecto, no es que seamos malos gestores del tiempo, sino que nuestro cerebro nos engaña, que perdemos la batalla mental entre el debo y el quiero.<br />
<br />
Y saber qué es la procrastinación y cómo se manifiesta (es decir, lo que hemos hablado hasta ahora) es la forma de detectarla y de no caer en sus trampas. Esto nos permite tomar medidas contra ella.<br />
<br />
Aunque lo que voy a decir a continuación pueda parecer evidente, darnos cuenta de por qué se produce este proceso es un enorme paso: sabemos que tenemos ese problema y sabemos que en realidad no es real (es un engaño de la mente) y por lo tanto tenemos la llave de la realización personal, simplemente atacando a las causas:<br />
<br />
<ul>
<li><b>Estimación realista</b>: A la hora de plantearse realizar una tarea, detenerse a realizar mentalmente una estimación correcta de su dificultad y su duración. Es decir, no dejar que nuestro cerebro nos engañe con planificaciones optimistas. Ser realista y plantearse si somos capaces de llevar a cabo esa tarea y en cuánto tiempo podemos hacerlo.</li>
</ul>
<ul>
<li><b>Planificación y diseño</b>: Para abordar una tarea, separarla en subtareas individuales y atómicas y atacar una detrás de otra, de forma que podamos considerar la satisfacción de ir acabando cosas y además tener claro qué falta por hacer (% de cumplimiento). Esto tiene la ventaja de que tenemos la tarea totalmente identificada y que no pueden surgir "sorpresas" que nos tienten a abandonarla. Si la procrastinación nos vence en algún momento en una subtarea, por lo menos cuando volvamos a ella sabremos por dónde íbamos y qué queda pendiente. </li>
</ul>
<ul>
<li><b>Visualizar la recompensa</b>: Apuntar junto a la tarea cuál es la recompensa que obtenemos por realizarla, para que cuando vayamos a procesarla tengamos claro cuál era nuestra motivación cuando nos la propusimos.</li>
</ul>
<ul>
<li><b>Visualizar el fracaso</b>: Pensar en cómo nos sentiremos si postergamos la tarea y nuestro Yo del Futuro la vuelve a postergar. Es decir, ponernos en la situación de que la tarea nunca va a ser ejecutada, y darnos cuenta de la sensación de irrealización personal y laboral que supone eso.</li>
</ul>
<ul>
<li><b>Quiero vs Debo</b>: Convertir mentalmente el DEBO en QUIERO. DEBO implica "obligación" y QUIERO implica "interés personal". No "DEBO" aprender Inglés. QUIERO aprender Inglés.</li>
</ul>
<ul>
<li><b>Ejecutar sin evaluar</b>: Cuando seleccionemos una tarea para empezarla, no dar tiempo a nuestro cerebro a que comience a mostrarnos la visión pesimista de la ejecución. Nada más "leamos" la tarea, lanzarse a ejecutarla (por ej. la primera subtarea de la misma) sin pararse a evaluarla. Una vez hemos comenzado a ejecutarla, nuestro cerebro queda ocupado por la tarea y desaparece el efecto pesimista.</li>
</ul>
<ul>
<li><b>Visión real del futuro</b>: Cuando nos tiente la posibilidad de abandonar algo, plantearse que nuestro "Yo Futuro" se encontrará en la misma situación y que probablemente volverá a postergarla, con lo que nunca la realizaremos. Plantearse de nuevo la satisfacción de hacerla, y pensar en qué nos va a reportar realmente dejar esa tarea y qué nos reporta realmente la tarea sencilla con la que pretendemos sustituirla.</li>
</ul>
<br />
Tal y como he abierto este artículo, la solución a un problema implica aceptar que se padece el problema. Y aceptar que somos procrastinadores por naturaleza es el primer paso para solucionarlo.
<br />
<br />
En cuanto te das cuenta de que realmente nuestra mente nos "pinta" futuros ideales para realizar las tareas y "pasajes desoladores" cuando las vas a abordar, estás en disposición de no caer de nuevo en la tentación. Si a esta detección de las trampas del cerebro sumamos tareas correctamente planificadas y estructuradas (subdivididas) y una visión clara de la recompensa de su finalización y el perjuicio que nos supone el no realizarla, estamos ante la forma de acercarnos a nuestra realización personal y laboral.<br />
<br />
Finalmente, hay una teoría interesante sobre realización personal y procrastinación que invita a embarcarse en proyectos paralelos para evitar la procrastinación "en casa". Para sacar provecho de nuestro tiempo, vamos, sin perderlo "procrastinando". El artículo en cuestión es <a href="http://www.minid.net/2012/11/09/deja-ya-de-procrastinar-e-inicia-proyectos-paralelos/" target="_blank">"Deja ya de procrastinar e inicia proyectos paralelos"</a>.<br />
<br />
Os dejo un vídeo sobre procrastinación (en inglés). El vídeo es un trailer del libro "<i>You are not so smart</i>" (No eres tan inteligente), que trata este problema entre otras cosas relacionadas con la psicología humana:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/DJ2T4-rUUcs?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
Recordad que <b>el refranero español</b>, que es tan sabio, ya nos hablaba cuando éramos pequeños, e incluso a nuestros padres, sobre procrastinación:<br />
<br />
<i>
"No dejes para mañana lo que puedas hacer hoy".<br />
</i><br />
<br />
Un saludo.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com2tag:blogger.com,1999:blog-9180313.post-56302101142610666062012-10-17T14:10:00.000+02:002012-10-17T14:10:06.312+02:00Soportar múltiples resoluciones en un desarrollo moderno en 2D<br />
<br />
Me ronda por la cabeza una pregunta sobre la programación de juegos 2D en entornos modernos con un problema que no se sufre en los juegos 3D (ni en el Spectrum, claro). Se me dió hace uno o dos años cuando me planteé la posibilidad de acabar mi PCMaziacs y hacerlo multiplataforma e incluso de hacer algún otro remake de juego de Spectrum. La he planteado en los foros de Speccy.org, por curiosidad (sección de desarrollo) en la siguiente URL:<br />
<br />
<a href="http://foro.speccy.org/viewtopic.php?f=6&t=2913&p=30576#p30576" target="_blank">[Enlace a consulta en foros de Speccy.org]</a><br />
<br />
Hago la versión resumida de la pregunta, y luego la exposición. Ojo, es posible que la pregunta no tenga una respuesta directa o fácil. Yo tengo mi propia idea de cómo atacar el problema, pero lo que quiero saber no es cómo se puede hacer sino cómo se debe hacer o cómo se hace normalmente a día de hoy.<br />
<br />
<br />
<b>--- Pregunta versión resumida: ---</b><br />
<br />
<i>¿Cómo se tiene que diseñar o programar un juego 2D en cuanto a los gráficos y el GUI para que pueda funcionar en diferentes resoluciones y aspects ratios, es decir, poder llegar tanto a PC, como a iOS, Android, etc?</i><br />
<i><br /></i>
<i>Me estoy refiriendo a soportar:</i><br />
<br />
<ul>
<li><i>Diferentes resoluciones (sin perder calidad gráfica).</i></li>
<li><i>Diferentes aspects-ratios (4:3, 16:9, 16:10...) (e incluso orientación vertical/horizontal!)</i></li>
</ul>
<br />
<i>Y me refiero a soportarlo en estos aspectos:</i><br />
<br />
<ul>
<li><i>Gráficos de fondos y personajes (calidad de los mismos, ¿varios sets?, ¿gráficos vectoriales? ¿2.5D?, ¿renderizar escena+zoom?).</i></li>
<li><i>Elementos del GUI (fuentes, menúes, inventarios, puntuación) : posicionamiento en pantalla, etc.</i></li>
<li><i>Velocidades y posiciones de los personajes proporcionales a la resolución .</i></li>
</ul>
<br />
<i><br /></i>
<i>La duda puede ser tan simple como elegir en qué resolución hacer un remake, y que el usuario no lo vea en una ventanita de tamaño ridículo o en un fullscreen de píxeles del tamaño de un puño porque la resolución nativa del monitor es FullHD. De elegir entre varias resoluciones, o de cuál elegir.</i><br />
<i><br /></i>
<b>--Fin pregunta resumida--------------------------------</b><br />
<br />
<br />
Ahora viene el contexto histórico y el torrente de dudas e ideas.<br />
<br />
Personalmente, siempre que he programado aplicaciones gráficas (demos, juegos, lo que sea) ha sido con una resolución fija.<br />
<br />
En el Spectrum no tenías ninguna duda con la resolución: 256x192 y a trabajar. En el PC, en la época del 486 y Pentium MMX, lo habitual era tanto en MSDOS como en Windows elegir una resolución fija (320x200, 320x240, 640x480...) y lanzar el juego en fullscreen. Tampoco había muchas resoluciones a elegir: 320x200, 640x480, 800x600 y 1024x768 en 4:3 eran los "estándares".<br />
<br />
La selección fija de resolución te permitía utilizar un único set de gráficos, y (erróneamente) mover todo el entorno de juego (personajes, etc) con "coordenadas de pantalla" en lugar de utilizar "coordenadas de mundo" y después transformarlas (ej: la bala se mueve 2 píxeles por segundo, la nave 3 píxeles por segundo, etc). Incluso se fijaba el número de cuadros por segundo y se asumía que no variaba.<br />
<br />
Si querías soportar más de una resolución en un PC, como eran "conocidas" (desde 320x200 a 1024x768), podías optar por 2 sets gráficos a diferentes resoluciones y "hardcodear" (también error) en cierta manera todo (GUI, movimientos, etc) según si estabas en una resolución u otra.<br />
<br />
Cuando entraron en juego hardwares más potentes, tenías la posibilidad de alcanzar más cuadros por segundo y los podías aprovechar bien especificando una tasa de FPS fija superior (normalmente la máxima del refresco 50-60Hz, y asumiendo que el juego no iría bien en sistemas más antiguos) o basando el movimiento de los personajes en el tiempo transcurrido desde el anterior fotograma, lo que adaptaba los frames a la velocidad de la máquina de forma "automática" (más fluído en hw potente, más "choppy" en hardware antiguo). Esto solucionaba el problema del "posicionamiento" y "movimiento", en cierta medida.<br />
<br />
Los problemas aparecen por la parte de las resoluciones y los gráficos, cuando:<br />
<br />
<br />
<ul>
<li>Entran en juego diferentes resoluciones.</li>
<li>El jugador puede tener monitor panorámico 16:9, 16:10, o un monitor 4:3.</li>
<li>Entran en juego tablets, móviles, etc, con resoluciones variadas o desconocidas a priori y con 2 posibles orientaciones.</li>
<li>Entra en juego permitir al usuario CAMBIAR de resolución (en ordenadores).</li>
<li>Los LCDs/TFTs tienen una resolución nativa y forzar una resolución en FULL SCREEN queda horroroso.</li>
</ul>
<br />
<br />
<br />
Concretamente:<br />
<br />
<br />
<b><u>Caso Monitor panoramico 16:9/16:10 vs 4:3:</u></b><br />
<br />
Si eliges una única resolución "base" (por ej 800x600) y fuerzas ese modo de pantalla en fullscreen, puede darse el caso de que el usuario tenga un monitor panorámico (aparte de que se vea horrible en un LCD/TFT por la diferencia con la resolución nativa). En ese caso se me ocurre que tienes que detectar la resolución y elegir entre dos opciones:<br />
<br />
a.- El juego transcurre en 4:3 a todos los efectos, tanto internamente como visualmente -> Si el monitor es 4:3 no se cambia nada al renderizar la escena y si el monitor es 16:9 se selecciona el modo equivalente en 16:9 y o bien se centra la imagen en pantalla (con bandas negras) o bien se pone algún tipo de marco decorativo, o bien se aprovecha el área para mejorar los marcadores / inventario / etc. Lo ideal supongo que sería asumir que el juego sea 16:9 y hacer la "adaptación" para 4:3, por eso de que casi todos los monitores hoy en día son panorámicos, pero ... el iPAD es 4:3 y no se puede despreciar su público en número de usuarios.<br />
<br />
b.- El juego se adapta a la resolución adicional -> Se diseña para "jugar" 4:3 pero según el tipo de juego, puede ser factible o no mostrar más área de pantalla. Por ejemplo en un juego con vista superior tipo Advance Wars o Zelda, podemos elegir mostrar más área de juego pero en otros puede no serlo. Por ejemplo, en un Bubble Bobble o un FinalFight ver más cantidad de pantalla no es lo adecuado.<br />
<br />
Con lo que la primera duda es: ¿programas pensando en 4:3 y desaprovechando panorámicos (cuando todos los monitores de PC son panorámicos)? ¿Se puede o debe hacer la inversa? (para panorámicos y recortar de alguna forma a 4:3).<br />
<br />
<br />
<b><u>Caso diferentes resoluciones:</u></b><br />
<br />
Vas a diseñar un remake de un juego... ¿qué resolución eliges?<br />
<br />
a.- Si eliges una resolución baja y fuerzas FULLSCREEN, en monitores grandes se ven píxeles como puños.<br />
<br />
b.- Si eliges una resolución alta, puede haber equipos incapaces de moverlo.<br />
<br />
Además, si no es la nativa del monitor y es LCD/TFT el resultado es difuso.<br />
<br />
c- Si eliges soportar varias resoluciones, tienes 2 opciones:<br />
<br />
c.1. Dar soporte a varias resoluciones preseleccionadas, con lo que tienes el problema de que necesitas varios sets de gráficos si quieres que el área de juego sea la misma en las diferentes resoluciones (y no que en cada resolución sea vea mayor área de juego con los gráficos más pequeños).<br />
<br />
c.2. Dar soporte a todas las posibles resoluciones eligiendo una resolución base contra un buffer y escalando el volcado de ese buffer a la resolución de pantalla. De nuevo tienes que tener en cuenta además el aspect ratio para esto. Es decir, si queremos dar soporte no sólo al PC y a varias resoluciones concretas en 4:3 y 16:9, y queremos añadir iOS, Android, etc, la cantidad de resoluciones destino disponibles es enorme. Y puede que el dispositivo no sea lo bastante potente (y esto es CPU) para el escalado en tiempo real de todo el área de trabajo a la resolución destino.<br />
<br />
Más posibilidades y problemas:<br />
<br />
<br />
<ul>
<li>¿Escalar los personajes? -> definir los gráficos para la mayor de las resoluciones y escalar para las menores o viceversa.</li>
</ul>
<ul>
<li>¿Diferentes sets gráficos? -> requiere un enorme trabajo gráfico para juegos 2D.</li>
</ul>
<ul>
<li>¿Gráficos vectoriales tipo svg? -> ¿Realmente se usa esta técnica?</li>
</ul>
<ul>
<li>La solución pueden ser los 2.5D (2D hecho con opengl renderizado con una cámara "lateral" o "superior").</li>
</ul>
<br />
<br />
Las múltiples resoluciones y aspect ratios también te obligan a adaptar la "velocidad" de los personajes según la resolución y los widgets del gui (menúes, marcadores, fuentes, etc). Esto no debería ser problema si las velocidades no se definen en "pixeles por segundo" sino en "unidades de movimiento del mundo virtual por segundo" (ej: metros por segundo) y después se escala lo que es "un metro" a las dimensiones en píxeles de los gráficos en la pantalla (según la resolución). Pero ya no es la facilidad de decir "esta nave se mueve 2 pixeles por segundo y esta mas rapido, a 3", hay que andar haciendo conversiones para todo lo que se va a trazar en pantalla.<br />
<br />
<br />
¿Cuál es la mejor opción entonces para este problema?<br />
<br />
<br />
<ul>
<li>Sets de gráficos -> "formatos gráficos pequeños + escalar hacia arriba" (entiendo que horrible a menos que quieras zoom de tipo 2x, 3x puro estilo retro), "formatos gráficos grandes + escalar hacia abajo" (entiendo que mejor, aunque el resultado del escalado sea "fuzzy"), "varios formatos (pequeño, mediano, grande) y escalar el más cercano", "2.5D y utilizar opengl"?.</li>
</ul>
<ul>
<li>16:9 vs 4:3 -> ¿Marco? ¿centrar? ¿y si el juego no permite "dar más área visible?"</li>
</ul>
<ul>
<li>Menúes, fuentes, pantallas intermedias y de fin de fase -> ¿tenerlas en diferentes resoluciones? ¿de resolución fija y escalar?</li>
</ul>
<br />
<br />
PD: Veo que no soy el único que se plantea o se ha planteado estas preguntas:<br />
<br />
<br />
<ul>
<li><a href="http://www.pascalgamedevelopment.com/showthread.php?13111-Resolution-and-Aspect-Ration-Independent-2D-Game-Engine-Design" target="_blank">Resolution-and-Aspect-Ration-Independent-2D-GameEngine-Design</a></li>
<li><a href="http://www.gamedev.net/topic/619264-different-screen-resolutions-in-a-2d-game/" target="_blank">Different-screen-resolutions-in-a-2d-game</a></li>
<li><a href="http://jharbour.com/forum/index.php?topic=1991.0" target="_blank">Different screen resolutions in a 2D game</a></li>
<li><a href="http://gamedev.stackexchange.com/questions/18534/what-should-i-keep-in-mind-when-making-2d-games-for-multiple-resolutions" target="_blank">What-should-i-keep-in-mind-when-making-2d-games-for-multiple-resolutions</a></li>
</ul>
<br />
<br />
Por desgracia, no veo muchas soluciones más allá de "<i>ceñirse al dispositivo mayoritario al que apunta el juego y escalar al vuelo el buffer resultante para el resto, en cada fotograma</i>"... o "<i>hacer diferentes versiones (ipad, pc, android) centrando cada una en una resolución estándar</i>".<br />
<br />
Ya ni siquiera considerando Android, sino simplemente el PC, si tuviera que hacer un remake y tuviera que elegir una o varias resoluciones, me veo en un dilema por la existencia de 4:3/16:9/16:10 o de gente con monitores de portátil de 1280x800 y gente con monitores FullHD donde cualquier tamaño tipo 640x480 se vería horrible.<br />
<br />
¿Opiniones?<br />
sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com2tag:blogger.com,1999:blog-9180313.post-91853608950880833382012-05-17T19:51:00.002+02:002012-05-17T19:51:20.947+02:00Cita del día (17-05-2012)<br />
"Hemos construído un sistema que nos persuade a gastar el dinero que no tenemos en cosas que no necesitamos para crear impresiones que no durarán en personas que no nos importan." <br /><br />(Emile H. Gauvreay)sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com1tag:blogger.com,1999:blog-9180313.post-37293198137756317842012-05-03T20:03:00.001+02:002012-05-03T20:03:27.481+02:00Load Balancing en NGINXNueva entrada en mi web:<br />
<ul>
<li><a href="http://www.sromero.org/wiki/linux/servicios/nginx_loadbalancing" target="_blank">Load Balancing en NGINX</a></li>
</ul>
<br />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-4708405521306689932012-05-02T12:03:00.002+02:002012-05-02T12:03:48.925+02:00Purgado de elementos en caché y Load Balancing en VarnishHola a todos,<br />
<br />
Dos entradas nuevas en mi web:<br />
<br />
<ul>
<li><a href="http://www.sromero.org/wiki/linux/servicios/varnish_purging" target="_blank">Purgado de elementos en caché en Varnish</a>.</li>
<li><a href="http://www.sromero.org/wiki/linux/servicios/varnish_backends" target="_blank">Load Balancing y HA en Varnish.</a></li>
</ul>
<br />
Espero que os sean de utilidad.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-11381698629364965162012-05-01T16:48:00.001+02:002012-05-01T16:49:03.346+02:00Tutorial básico de VarnishHe publicado en mi web un nuevo tutorial (básico) sobre el acelerador HTTP <b>Varnish</b>:<br />
<br />
<ul>
<li><a href="http://www.sromero.org/wiki/linux/servicios/varnish_basico" target="_blank">http://www.sromero.org/wiki/linux/servicios/varnish_basico</a></li>
</ul>
<br />
Espero que os resulte de interés.sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com0tag:blogger.com,1999:blog-9180313.post-44445253378413972372012-04-30T09:25:00.000+02:002012-04-30T09:26:17.003+02:00Mentir a los ciudadanos debería ser constitutivo de delito<br />
Qué bueno es Internet y tener acceso a los vídeos y noticias, para poder demostrar qué embusteros son los políticos, y cómo lo que antes no valía (para el anterior gobierno), ahora sí que vale.<br />
<br />
<br />
<u><b>ANTES (2010, subida del IVA por parte del Gobierno del PSOE):</b></u><br />
<br />
<ul>
<li>
<u>María Dolores de Cospedal</u>, septiembre de 2009. : “<b>Subir el IVA un 2% es como bajar el 2% el salario de los trabajadores</b>” - <a href="http://www.youtube.com/watch?v=a6vV1eC_LOY" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li>
<u>Soraya Sáenz de Santamaría</u>, 10 de marzo de 2010. “<b>La subida del IVA es la puntilla para el comercio, el turismo y la industria</b>” - <a href="http://www.youtube.com/watch?v=5Jj-NQxSYH0" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li>
<u>Mariano Rajoy</u>, 16 de marzo de 2010. "<b>La subida del IVA es un disparate</b>” - <a href="http://www.youtube.com/watch?v=t1vfkNZAgFY" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li>
<u>Cristóbal Montoro</u>, 17 de marzo de 2010. "<b>No rotundo a la subida del IVA</b>” - <a href="http://www.youtube.com/watch?v=gxfzrtvagqc%20" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li><u>PP de Madrid</u>: 17 de Abril del 2010, <b>Campaña No Más IVA</b>, - <a href="http://www.ppmadrid.es/el-domingo-18-de-abril-comienza-la-campana-no-mas-iva/" target="_blank">[enlace]</a> </li>
</ul>
<ul>
<li><u>Esperanza Aguirre</u>, 17 de Abril del 2010, llama a la rebelión contra la subida del IVA del Gobierno del PSOE. Los carteles argumentan que <b>subir el IVA es producir paro y recesión</b> - <a href="http://actuable.es/system/images/4892/big/Esperanza%20Aguirre.jpg?1335620776" target="_blank">[imagen]</a> </li>
</ul>
<ul>
<li><b></b><u>Mariano Rajoy</u>, 14 de Marzo del 2010: “<b>la subida del IVA es el
sablazo que el mal gobernante le pega a todos sus compatriotas que ya
están muy castigado por la crisis</b>”, y que “tras fracasar en sus plantes,
ahora pretende que lo paguemos todos los españoles”. - <a href="http://www.youtube.com/watch?v=pfl0m4iJvvc" target="_blank">[vídeo]</a> </li>
</ul>
<br />
<u><b>EN ENERO Y MARZO DEL 2012 (hace apenas unos meses): </b></u><br />
<u> </u><u> </u><br />
<ul>
<li><u>Mariano Rajoy</u>, 10 de enero de 2012.: “<b>No está en nuestras previsiones subir el IVA</b>” - <a href="http://www.youtube.com/watch?v=omzhjXyui04%20" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li>
<u>Cristóbal Montoro</u>, 15 de marzo de 2012. “<b>No habrá subida del IVA</b>” - <a href="http://www.youtube.com/watch?v=8Kym1ioxX4g%20" target="_blank">[vídeo]</a></li>
</ul>
<ul>
<li>
<u>Soraya Sáenz de Santamaría</u>, 30 de marzo de 2012. “<b>Este Gobierno no va a subir el IVA</b>” - <a href="http://www.youtube.com/watch?v=8qukmChyRcQ%20%20%20%20" target="_blank">[vídeo]</a></li>
</ul>
<br />
<u><b>AHORA:</b></u><br />
<br />
<ul>
<li><u>Luís de Guindos</u>, 27 de Abril del 2012: "<b>El Gobierno del PP anuncia la subida del IVA ("impuestos al consumo") en 2013</b>" - <a href="http://www.cincodias.com/economia/videos/gobierno-anuncia-subida-iva-2013/20120427cdscdseco_1/" target="_blank">[enlace noticia y vídeo]</a></li>
</ul>
<br />
<br />sromerohttp://www.blogger.com/profile/16934380035433493234noreply@blogger.com1