Tech roundup 55: a journal published by a bot

Read a tech roundup with this week’s news that our powerful bot has chosen: blockchain, AI, development, corporates and more.

Gooooooood morning, Multitude!!! Hey, this is not a test, this is a tech roundup. Time to rock it from the Delta to the DMZ.

AI, bots and robots

Blockchain and decentralization

Woman computer scientist of the week
Julia Hirschberg is an American computer scientist noted for her research on computational linguistics and natural language processing. She is currently the Percy K. and Vida L. W. Hudson Professor of Computer Science at Columbia University. She served as Chair of the Computer Science Department from 2012-2018. She is also noted for her leadership in broadening participation in computing. She has served as a member of CRA: the CRA Committee on the Status of Women in Computing Research CRA-W since 2010.

Cloud and architecture

Development and languages

Quote of the week

Not only is UNIX dead, it’s starting to smell really bad.

        — Rob Pike circa 1991

Enterprises

Other news

Suscríbete al blog por correo electrónico

Introduce tu correo electrónico para suscribirte a este blog y recibir avisos de nuevas entradas.

Tech roundup 54: a journal published by a bot

Read a tech roundup with this week’s news that our powerful bot has chosen: blockchain, AI, development, corporates and more.

Gooooooood morning, You all!!! Hey, this is not a test, this is a tech roundup. Time to rock it from the Delta to the DMZ.

AI, bots and robots

Blockchain and decentralization

Woman computer scientist of the week
Gillian Lovegrove is a retired computer scientist and academic. She was Dean of the School of Informatics at Northumbria University, president of the Conference of Professors and Heads of Computing and was Higher Education consultant to the British Computer Society and manager of its Education and Training Forum. She is known for her interest in gender imbalance in computer education and employment, and her public discussion of possible solutions to a shortage of information technology graduates in the UK.

Cloud and architecture

Development and languages

Quote of the week

Unix is simple. It just takes a genius to understand its simplicity.

        — Dennis Ritchie

Enterprises

Other news

Suscríbete al blog por correo electrónico

Introduce tu correo electrónico para suscribirte a este blog y recibir avisos de nuevas entradas.

Tech roundup 53: a journal published by a bot

Read a tech roundup with this week’s news that our powerful bot has chosen: blockchain, AI, development, corporates and more.

Gooooooood morning, Horde!!! Hey, this is not a test, this is a tech roundup. Time to rock it from the Delta to the DMZ.

AI, bots and robots

Blockchain and decentralization

Woman computer scientist of the week
Andrea Goldsmith is an American electrical engineer and the Stephen Harris Professor in the School of Engineering at Stanford University, as well as a faculty affiliate at the Stanford Neurosciences Institute. Her interests are in the design, analysis and fundamental performance limits of wireless systems and networks, and in the application of communication theory and signal processing to neuroscience. She also co-founded and served as chief technology officer of Plume WiFi and Quantenna Communications.

Cloud and architecture

Development and languages

Quote of the week

You can’t trust code that you did not totally create yourself.

        — Ken Thompson

Enterprises

Other news

Suscríbete al blog por correo electrónico

Introduce tu correo electrónico para suscribirte a este blog y recibir avisos de nuevas entradas.

¡Ojo! Cuidado en Firebase con el forEach de los Snapshots de la Realtime Database

Firebase es un PaaS de Google con un nivel de abstracción muy alto que te permite tener un completo backend serverless. Hacía años que no lo usaba y estoy encantado con él, pero hay que andarse con ojo porque ningún entorno ni tecnología llega a ser perfecto.

La semana pasada estaba programando una cosa en Javascript usando la librería de Firebase, para un proyecto en el que he usado su Realtime Database para montar un sistema de presencia que me diga en todo momento quién está on y quién está off.

En un momento dado, detecté un problema que no entendía de dónde podía venir:

Hacía una query a la base de datos, que me devolvía unos resultados que yo procesaba. Sin embargo, el resultado era un único dato cuando en la BBDD tenía que haber más. Tras unos cuantos tests, me di cuenta de que si lo mismo lo programaba de distintos modos (que deberían comportarse igual) ¡el resultado era distinto!

snapshot.forEach(s=> array.push(s.val()));
//vs
snapshot.forEach(s=>{array.push(s.val())});

Esas dos estructuras, daban resultados distintos ¿cómo podía ser?

Tras darle unas cuantas vueltas con cara de absoluta incredulidad llegué a la clave del asunto en el último sitio que me quedaba por mirar de la documentación de Firebase:

Último ejemplo de la documentación de Firebase
https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#for-each

Se habían alineado Roma con Santiago:

  • Un desarrollador/diseñador había elegido usar un nombre habitual, dándole un comportamiento no habitual.
  • En Javascript todo lo que no sea falso/0/undefined se evalua como true.
  • La información referente a como funcionaba estaba en el último rincón de la documentación.

Todo habría sido distinto si el método se hubiese llamado cancellableForEach; o si al menos hubiesen comprobado que el valor recibido era verdadero comparándolo con el operador de igualdad estricta (“=== true”); o si, ya cogiéndolo por los pelos, la ejecución del método cuando reciba algo que no sea booleano arrojase un warning…

En cualquier caso, tras un rato de frustración el problema quedó solucionado.

Valga este post tanto para recordar que hay que tener cuidado en Firebase con el forEach de los Snapshots de la Realtime Database, como para recordar la importancia de los nombres que ponemos a las cosas.

Tech roundup 52: a journal published by a bot

Read a tech roundup with this week’s news that our powerful bot has chosen: blockchain, AI, development, corporates and more.

Gooooooood morning, Hyperspace!!! Hey, this is not a test, this is a tech roundup. Time to rock it from the Delta to the DMZ.

AI, bots and robots

Blockchain and decentralization

Woman computer scientist of the week
Pattie Maes is a professor in MIT’s program in Media Arts and Sciences. She founded and directed the MIT Media Lab’s Fluid Interfaces Group. Previously, she founded and ran the Software Agents group. She currently acts as the associate Department Head for the Media, Arts and Sciences Department. Prior to joining the Media Lab, Maes was a visiting professor and a research scientist at the MIT Artificial Intelligence Lab. She holds bachelor’s and PhD degrees in computer science from the Vrije Universiteit Brussel in Belgium.

Cloud and architecture

Development and languages

Quote of the week

One of my most productive days was throwing away 1000 lines of code.

        — Ken Thompson

Enterprises

Other news

Suscríbete al blog por correo electrónico

Introduce tu correo electrónico para suscribirte a este blog y recibir avisos de nuevas entradas.