12 de agosto de 2008

Un poco de postgres: Uso de funciones agregadas y subqueries

A continuación agrego algunos de los queries que ando probando en PostgreSQL:

/* MUESTRA LA SUMA DE MAYOR VALOR ENTRE LAS COLUMNAS -> o el mejor valor de captura */

SELECT max(capturas[1] + capturas[2]) FROM (SELECT cast(capturas[1:2] AS numeric[]) FROM cpm_tiempos) AS valores2;

/* MUESTRA EL USO DE LA FUNCION SUM() */

SELECT sum(capturas[1]) FROM (SELECT cast(capturas[1:2] AS numeric[]) FROM cpm_tiempos) AS valores2;

11 de agosto de 2008

Una librería de javascript tipo gtypist

Hace unos días descubrí la librería jsTypingTutor que se incluye en las ligas del proyecto de software libre GNU Typist. A continuación agrego la función que más me ha servido en mi desarrollo:

  1. // IMPRIME LOS CARACTERES PULSADOS / MINUTOS TRANSCURRIDOS (CPM) (INCLUYE SPACE BAR Y ENTER KEYS)

  2. // CAMPO NO. 1 A CAMPO NO. 2

  3. function timer() {

  4.   var dtNow_ = new Date();

  5.   rSecondsPassed_ = dtNow_.getTime();

  6.   rSecondsPassed_ = rSecondsPassed_ / 1000;

  7.   rSecondsPassed_ = Math.round(rSecondsPassed_ - rStartTime);

  8.   iStrLen_1 = document.frmTyping_.txtTop_1.value.length;

  9.   iStrLen_2 = document.frmTyping_.txtTop_2.value.length;

  10.   sStatMsg = Math.round((Math.round((iStrLen_1 + iStrLen_2))) / (rSecondsPassed_ / 60));

  11.   document.frmTyping_.txtStats_.value=sStatMsg;

  12. }



Por cierto que la sintáxis resaltada la hice con la aplicación Quick Highlighter.

3 de agosto de 2008

Talk Talk - Give it up



From the place that I
stand to the land that
is openly free;
Watching rivers run
black by the trees
that are vacant to greed.

Gotta give it up
gotta get a second chance

Gotta give it up
gotta get a second chance

and the tunes just started.
Gotta give it up
give it up
give it up
gotta give it up!

Or tell me why I'm so wrong
where does love come from

If you've sold your
reasoning out?

How can I learn if I
don't understand what
I see.
If I'm giving this mess
take a walk
through a nightmare so real.
Gotta give it up
gotta get a second chance
. . .

Or tell me if I'm so wrong
where does luck come from

When you've never been without?

Give it up
give it up
give it up
gotta give it up

Give it up
give it up
gotta give it up.
Tell me if I'm so wrong
where does love come from

If you've sold your
reasoning out?
Or tell me if I'm so wrong
where does luck come from

When you've never been without?

2 de agosto de 2008

Life is what you make it... can't escape it



Baby
life's what you make it - can't escape it.
Baby
yesterday's favourite - don't you hate it?
Ev'rything's alright - live's what you make it -
ev'rything's alright.

Baby
life's what you make it - don't backdate it.
Baby
don't try to shake it - beauty is naked.
Ev'rything's alright - live's what you make it -
Ev'rything's alright - what you make it.

Baby
life's what you make it - celebrate it

anticipate it - yesterday's faded.
Nothing can change it - life's what you make it.
Ev'rything's alright - life's what you make it.
Ev'rything's alright - life's what you make it.
Ev'rything's alright - ev'rything's alright.

1 de agosto de 2008

Unas ideas sobre un desarrollo de mi chamba.

La estadística es una rama de la matemática que se refiere a la recolección, estudio e interpretación de los datos obtenidos en un estudio. Es aplicable a una amplia variedad de disciplinas, desde la física hasta las ciencias sociales, ciencias de la salud como la Psicología y la Medicina, y usada en la toma de decisiones en áreas de negocios e instituciones gubernamentales. (Wikipedia)

Interpretación de los datos recolectados:
  1. Se saca un promedio de la rapidez de captura (wpm) en las 3 hojas (se utiliza javascript y PHP).
  2. Ese promedio asociado al login del capturista se inserta en una tabla (capturas_del_dia) de la base de datos de interes (se utiliza PHP y PostgreSQL).
  3. Se obtiene un promedio general de captura (WPM) basado en el cociente de la suma de todos los wpm_i entre el número total de capturas realizado por el capturista en su jornada (PostgreSQL y algo de PHP).
  4. Se realiza una gráfica que asocie en forma de rangos (de 0-10, de 11-20, de 21-30, etc) de wpm el número de capturas realizadas por jornada el capturista (PHP y la librería open flash).