lunes, octubre 27, 2008

minirants

1) a mi que me da verguenza cuando emesene se congela por unos segundos, la verguenza que deben pasar los de outlook que se congela todo el tiempo :P

2) aguante la opcion -c de wget

jueves, octubre 16, 2008

migrar access a postgres

aca hay un pequeño script que hice para migrar de access a postgres, tuve que hacer algunos trucos para que ande bien. si a alguien le sirve...
import os
import commands

archivo = "archivo.mdb"

tables = commands.getoutput("mdb-tables -S %s" % (archivo,))
os.popen("rm carga.sql")
os.popen("rm schema.sql")

os.popen("mdb-schema -S %s postgres| sed 's/Postgres_Unknown 0x0c/Text/' | grep \"\-\-\" -v | grep \"^DROP TABLE\" -v | sed 's/Bool/Int8/' > schema.sql" \
% (archivo,))

for table in tables.split():
cmd = \
# si tenes el postgres con locales que te pide insertar la fecha con un
# formato no ISO (MDY) correr la siguiente linea antes de los inserts
# SET DateStyle TO 'MDY';
"mdb-export -I -S %s %s | sed -e 's/)$/)\;/' | sed -e s/\\\"/\\'/g >> carga.sql"
if not table.startswith('MSys'):
os.popen(cmd % (archivo, table))

domingo, octubre 12, 2008

cosas locas de java

en una clase tengo dos atributos privados, los cuales solo son modificados por un método. Hasta ahí todo bien.
El problema es que para poder serializar esa clase a json y para poder guardarla en Hibernate tienen que ser beans (osea esos atributos tienen que tener getter y setters) por lo cual me rompe todo el bendito encapsulamiento, ya que cualquiera manipulando un objeto puede romper la consistencia y relacion de los dos atributos usando el set de uno (no, no puedo deducir que hacer con el otro en base al valor de uno).

Cosas que pasan.

PD: puede que haya una forma de arreglarlo, yo no la se.

jueves, octubre 02, 2008

Quote

And do you have any advice for up-and-coming programmers? I think it’s important to try to master the different paradigms of programs that are out there. The obvious object oriented programming is hopefully something that you will be taught in school. Hopefully school will also teach you functional programming, if not, that is a good thing to go look at.

Go look at dynamic languages and meta-programming: those are really interesting concepts. Once you get an understanding of these different kinds of programming and the philosophies that underlie them, you can get a much more coherent picture of what’s going on and the different styles of programming that might be more appropriate for you with what you’re doing right now.

Anyone programming today should check out functional programming and meta-programming as they are very important trends going forward.

del creador de C#

Seguidores

Archivo del Blog