Friday, September 11, 2015

7 Books That Will Train Your Brain to Overachieve

These must-read books explain how and why you can radically improve your ability to think clearly and creatively.
MMENT
IMAGE: Getty Images
The human brain is the most powerful tool you can possibly possess. Are you training and using your brain to its full potential? These seven books will help you achieve the peak performance you’ll need to compete, today and in the future.

1. Curious

Subtitle: The Desire to Know and Why Your Future Depends on It
Author: Ian Leslie
5-second summary: Harness your natural curiosity to develop the ability to think more broadly and deeply.
Best quote: "Curious learners go deep, and they go wide. They are the people best equipped for the kind of knowledge-rich cognitively challenging work required in industries such as finance or software engineering. They are also the ones most likely to make creative connections between different fields, of the kind that lead to new ideas and the ones best suited to working in multidisciplinary teams. Consequently, they are the ones whose jobs are least likely to be taken by intelligent machines. In a world where technology is rapidly replacing humans even in white-collar jobs, it's no longer enough to be merely smart. Computers are smart. But no computer, however sophisticated, can yet be said to be curious."
Fun factoid: Your brain stopped growing when you were 18 but continues to make new neurons throughout your life in response to mental activity.

2. Thinking, Fast and Slow

Author: Daniel Kahneman
5-second summary: Your success in life depends upon mastering your brain's two systems, one of which is fast, intuitive, and emotional, and the other of which is slow, deliberate, and logical.
Best quote: "When confronted with a problem--choosing a chess move or deciding whether to invest in stock--the machinery of intuitive thought does the best it can. If the individual has relevant expertise, she will recognize the situation, and the intuitive solution that comes to mind is likely to be correct. This is what happens when a chess master looks at a complex position: the few moves that immediately occur to him are all strong. When the question is difficult and a skilled solution is not available, intuition still has a shot: an answer may come to mind quickly--but it is not an answer to the original question. This is the essence of intuitive heuristics: when faced with a difficult question, we often answer an easier one instead, usually without noticing the substitution."
Fun factoid: The human brain activates (fires) roughly 20 quadrillion neurons every second.

3. Think Like a Freak

Subtitle: The Authors of Freakonomics Offer to Retrain Your Brain
Authors: Steven D. Levitt and Stephen J. Dubner
5-second summary: A blueprint for coming up with new solutions to old problems, accompanied by amusing examples.
Best quote: "It's tempting to run with a herd. Even on the most important issues of the day, we often adopt the views of our friends, families, and colleagues. On some level, this makes sense: it is easier to fall in line with what your family and friends think than to find new family and friends! But running with the herd means we are quick to embrace the status quo, slow to change our minds, and happy to delegate our thinking."
Fun factoid: According to one study from theLondon School of Economics and Political Science, liberal atheists have IQs that are six points higher on average than devout conservatives.

4. The Power of Habit

Subtitle: Why We Do What We Do in Life and Business
Author: Charles Duhigg
5-second summary: A guide for using the human tendency toward habitual behavior to positive use.
Best quote: "In the past decade, our understanding of the neurology and psychology of habits and the way patterns work with in our lives, societies, and organizations has expanded in ways we couldn't have imagined fifty years ago. We now know why habits emerge, how they change, and the science behind their mechanics. We know how to break them into parts and rebuild them to our specifications. We understand how to make people eat less, exercise more, work more efficiently, and live healthier lives. Transforming a habit isn’t necessarily easy or quick. It isn't always simple. But it is possible. And now we understand how."
Fun factoid: Your brain uses 20 percent of the total oxygen in your body and 20 percent of the blood circulating in your body.

5. Moonwalking With Einstein

Subtitle: The Art and Science of Remembering Everything
Author: Joshua Foer
5-second summary: A journalist is coached by the world's foremost "mental athletes" on the latest methods for improving memory.
Best quote: "The brain is like a muscle and memory training is a form of mental workout. Over time, like any form of exercise, it’ll make the brain fitter, quicker, and more nimble... But while there is much solid science to back up the dementia-defying effects of an active brain, [the] most hyperbolic claims about the collateral effects of 'brain exercise' should inspire a measured dose (at least) of skepticism. Nevertheless, it was hard to argue with the results. I just watched a forty-seven-year-old competitor recite, in order, a list of 100 hundred random words he’d learned a few minutes earlier."
Fun factoid: While awake, your brain generates up to 23 watts of electricity, which is roughly enough energy to power three iPhones.

6. The Future of the Mind

Subtitle: The Scientific Quest to Understand, Enhance, and Empower the Mind
Author: Michio Kaku
5-second summary: The latest breakthroughs in neuroscience and physics suggest that several science fiction tropes (mind control, telekinesis, etc.) might eventual become realities.
Best quote: "To witness the mystery of our mind, all we have to do is stare at ourselves in the mirror and wonder, What lurks behind our eyes? This raises haunting questions like: Do we have a soul? What happens to us after we die? Who am 'I' anyway? And most important, this brings us to the ultimate question: where do we fit into this great cosmic scheme? As the great Victorian biologist Thomas Huxley once said, 'The question of all questions for humanity, the problem which lies behind all others and is more interesting than any of them, is that of the determination of man’s place in nature and its relation to the Cosmos.'"
Fun factoid: The first successful brain surgeries took place during the Stone Age, roughly around 7000 BC.

7. A Mind for Numbers

Subtitle: How to Excel at Math and Science (Even If You Flunked Algebra)
Author: Barbara Oakley
5-second summary: An engineering professor provides alternative and often simple strategies for learning complex subject matter.
Best quote: "Mathematics, as it's generally taught in American school systems, can be a saintly mother of a subject. It climbs logically and majestically from addition through subtraction, multiplication, and division. Then it sweeps up towards the heavens of mathematical beauty. But math can also be a wicked stepmother. She is utterly unforgiving if you happen to miss any steps of the logical sequence--and missing a step is easy to do. All you need is a disruptive family life, a burned-out teacher, or an unlucky extended bout with illness--even a week or two at a critical time can throw you off your game.
"Or, as was the case with me, simply no interest or seeming talent whatsoever."
Fun factoid: Some researchers believe neurons are quantum computers, which means your brain is more powerful than all the digital computers in the world combined.

Thursday, September 10, 2015

Stress or Pressure?

One of the things that is really important to me is making sure working on Windows and Windows Live is a low-stress job.  Stress is evil, in fact stress is defined as:
stress: strain felt by somebody: mental, emotional, or physical strain caused, e.g. by anxiety or overwork. It may cause such symptoms as raised blood pressure or depression.
The thing about stress is that it is both physical and emotional.  Stress is all about a loss of control (anxiety).  Loss of control comes from not really knowing the goals, not understanding what success looks like, and in our vernacular, about being random. Stress comes because the work required is incompatible with your capabilities or your view of success.  Stress is about a mismatch between your reality and the reality of your manager or team.
Stress in the workplace is 100% incompatible with building great software.
On the other hand, pressure is all around us.  We have pressure to succeed.  Pressure to get the build right.  Pressure to get the design right.  Pressure to go live with content.  Pressure is a motivator.  Pressure is defined as:
pressure: urgency, as of affairs or business
The thing about pressure is that it comes from within.  Pressure is about the plan.  Pressure is about your own goals (affairs).  By operating with a plan and the details of that plan were created by the team we transform what might be stress into pressure.  Pressure comes because you want to be successful against the goals you have set out.  Pressure comes because the peers you depend on are expecting you to deliver what was communicated.  Pressure is about the constant force in our environment to deliver on the plan we developed together.
Pressure in the workplace is how we stay on our toes and put forth our best efforts.  Performing under pressure, while challenging, is what helps us as engineers to make great choices and use the constraints to our (and our customers) advantage.
No one works well under stress—the physical toll is real and provable.  Some folks don’t work well under pressure.  You don’t have to put yourself under pressure, but we’re a competitive company and like a great athletic team we do want that effort to go above 100%, but we can do so in a constructive way by using pressure to our advantage.
We’ve got some pressure going on now on our team.  IE 8 in the final milestone.  Integrating the M1 build of Windows Live.  Windows 7 moving to M3.  We’re excited.  The pressure is real.  It is pressure like being in the World Cup because we know what got us here and we know what it takes to be successful.
—Steven Sinofsky (@stevesi on Twitter).
PS: Yes these words are similar.  The beauty of words are the subtle differences that make them special.
PPS: I’m just excited to use the new build of LiveWriter – and the whole Wave 3 suite!

Tuesday, September 8, 2015

El Wi-Fi, Un Recurso que muy Pocas Universidades lo Aprovechan Inteligentemente

El Wi-Fi, más que un servicio, es el recurso más importante en aquellas universidades que han decidido trazar la ruta para el profesional digital.
Realmente son contadas con los dedos de una sola mano aquellas universidades y centros de enseñanza superior que consideran al Wi-Fi el recurso más valioso de todo su ecosistema de enseñanza. Para estas instituciones, el Wi-Fi, aparte de representar su red local inalámbrica, es el vehículo más poderoso para llegar a sus clientes, que son: visitantes, docentes, staff y estudiantes. 
A continuación, les detallo algunos ejemplos de como es que éstas instituciones, que han decidido firmemente seguir el camino de la transformación digital, están aprovechando el Wi-Fi para ser mejores instituciones.
1.- Crean Nuevas Experiencias 
Hoy en día, el "Wi-Fi de Alta Velocidad"es tan valorado por los estudiantes, a tal punto que muchos de ellos prefieren acudir a universidades que cuentan con Wi-Fi de alta velocidad en cualquier lugar del campus. Hay universidades que ponen como slogan "Tenemos Wi-Fi de 1000 Mbps 24/7 en Toda la Universidad", otros dice "Tenemos el Mejor Wi-Fi del Planeta". La experiencia del estudiante al navegar a velocidades inimaginables, viendo una clase en vivo, un video de youtube, descargando un documental  o las clases a las que no pudo acudir en cuestión de minutos, son experiencias que no se olvidan fácilmente.
2.- Un Vehículo de Promoción en Múltiples Formatos Digitales 
Con su propia red Wi-Fi, estas universidades pueden llegar a todos los dispositivos móviles de los estudiantes en cuestión de segundos. Por ejemplo si la universidad desea promocionar charlas, talleres, ofertas, seminarios, exposiciones, lo hace a través de la propia red Wi-Fi enviando pantallas "splash" a todos los dispositivos móviles. Estos splash pueden tomar diferentes formatos: video, audio, fotos, brochures, mensajes cortos, etc. No necesitan mandar a la imprenta folletos, volantes, etc. En otras palabras son universidades 100% amigables con el medio ambiente y lo hacen de manera eficiente. 
3.- Encuestas Online 
Las universidades que saben utilizar el Wi-Fi ya no contratan personal para hacer encuestas a los estudiantes. A través de la misma red Wi-Fi , ellos pueden lanzar encuestas a todos los dispositivos móviles dentro de la red Wi-Fi y hacer que los estudiantes den su voz, su voto, o su elección para cualquier tipo de encuestas o trabajos de investigación que se desea realizar. 
4.- Servicios de Localización
Al contar con una red Wi-Fi propia, las universidades del futuro pueden implementar una red Wi-Fi lo suficientemente inteligente para que les brinde la ubicación geo-referenciada de donde se encuentran los alumnos, docentes, staff, activos de la universidad, equipos, etc a cualquier hora. Algo asi como una micr0 implementación de Google Maps pero para el interior del campus universitario. 
5.- Analytics y Big Data
Las universidades del futuro recopilan datos a cada instante. Ellas saben si el estudiante asistió o no a clase, en que clase se encuentra, cuantas horas está en clase durante el día, si es que hace uso de los recursos de la biblioteca, etc.  Esta captación de datos, comparados con los datos de rendimiento de cada alumno puede servir para que los consejeros o "advisors" conozcan mejor a sus alumnos y prevean deficiencias y bajos rendimientos antes que sucedan. 
Como verá usted, el Wi-Fi no es simplemente un servicio a internet. Si usted deja que un operador o un tercero se apodere de su recurso más importante, pues dejará de tener la oportunidad de ser participe activo de esta Nueva Era Digita

Thursday, September 3, 2015

vnc.js: how to build a JavaScript VNC Client in a 24 hour hackday

All the source code for this post is available on GitHub: vnc.js and tcp.js.
Last summer, as a LinkedIn intern, I participated in LinkedIn's first public Intern Hackday. Interns from all over Silicon Valley came down to LinkedIn's headquarters in Mountain View to hack all night, eat free food, pound energy drinks, and compete for awesome prizes. With Macbook Airs, iPads, and bragging rights on the line, my team decided to go big. Our goal:
Build a VNC client in 100% JavaScript that will run in the browser and be able to connect to any remote host... and do this all in under 24 hours.
In this post, I'll tell you how we combined Node.js, socket.io, HTML5 canvas, and a solid understanding of the RFB protocol to create vnc.js.

Architecture

In order to get a VNC client working the browser, we needed the following pieces:
  1. A way to connect to a remote server: the only way to do this within a browser is to use a proxy. We built the proxy using Node.js and established a persistent connection to it using socket.io.
  2. Implement the RFB protocol: with Node.js abstracting away the TCP connection, the next step was to use the RFB protocol to communicate with the remote server.
  3. Render the image in the browser: once the server was sending us data, we used the HTML5 canvas element to render it in the browser. This worked well, as we can conveniently transfer the 32bit pixel data in row major order directly to the canvas.
vnc.js architecture

tcp.js: A TCP proxy written on top of Node.js and Socket.IO

The first step was establishing connectivity between the browser, the Node.js proxy, and a remote VNC host. Communication between the browser and Node.js is handled easily using socket.io. However, communication between Node.js and the VNC host is more complicated: it requires TCP.
Connectivity between components in vnc.js
We recognized the inevitable complexity of our hack and chose to spend a little extra time up front to cleanly abstract all of our connectivity concerns. Because we're using the same language in both the browser and the server (JavaScript), the result was a very clean abstraction that we called tcp.js. It's dead-simple to use:
var host = "127.0.0.1";
var port = 5900;
var sock = new TCPClient(host,port);
sock.on("connected", function() {
log("connected to " + host + ":" + port);
sock.send("Hello from a browser!");
});
sock.on("closed", function() {
log("The connection has closed :(");
});
sock.on("data", function(msg){
log("data arrived: " + msg);
});
sock.connect();
view rawjsvnc_connecting.js hosted with ❤ by GitHub

Implementing the RFB protocol in the browser

Given our time constraints, we decided to implement a subset of the RFB protocol 3.3. Namely, we would only use encryption during the authentication phase (which uses the very simple DES block cipher) and we would only support Raw and CopyRect encodings.
We broke the RFB implementation into the following four steps:
Part 1: Authentication
We supported two different versions of authentication: None and VNC Authentication. There isn't much to say about the former, so I'll outline VNC Authentication. It turns out that the RealVNC RFB spec we were using was not entirely accurate. It lays out the following steps:
  1. The server sends a random 16 byte challenge.
  2. Tthe client encrypts that challenge with the user entered password and sends back the encrypted version.
Unfortunately, the spec left out several very important details:
  1. The key must be null padded to 8 bytes before encryption. This seems obvious after the fact, but it wasn't called out and had us scratching our heads.
  2. The encryption must be done in two phases: you must encrypt the low 8 bytes and then the high 8 bytes and append the results into a single 16 byte response.
  3. The bits must actually be flipped (not inverted). Think bit level endianness: the most significant bit will become the least significant bit and so on.
Luckily there were several open source VNC clients written in C that we were able to reference to understand why our authentication was failing. We also found an open source JavaScript DES implementation that we could use with only minor tweaking. Finally, we found a really neat (hack) way to flip the bits of our challenge response:
var vnc_8_byte_key_arr_int = [0,0,0,0,0,0,0,0];
for(i = 0; i < vnc_auth_password.length; i++){
var char_at = vnc_auth_password.charCodeAt(i);
var new_char = ((((char_at * 0x0802 & 0x22110) | (char_at * 0x8020 & 0x88440)) * 0x10101 >> 16) & 0xFF);
vnc_8_byte_key_arr_int[i] = new_char;
}

Part 2: ServerInit and Synchronization
The ServerInit phase is straightforward: the server sends a message with the machine name, the dimensions of the screen, and the pixel format. Once we've received the screen dimensions we create an HTML5 canvas with the same dimensions. Given the time restrictions, we didn't attempt anything fancy like scaling. The advantage of using a canvas that's the exact same size as the remote frame buffer is that mouse movements and clicks are translated 1 to 1.
Part 3: Continuous Frame Buffer updates
The update process works as follows: the client sends a FrameBufferUpdateRequest specifying the encoding methods it supports and the server sends back the content using one of the encoding formats you've requested. The RFB protocol supports incremental updates, so we would request a full update at the start followed by incremental updates at some periodic interval.
To keep it simple, the only encoding methods we implemented were Raw and CopyRect. Raw encoding is just the raw pixel data. CopyRect is the server taking advantage of the fact that it knows exactly what the client has in its buffer, so it is able to tell you to move a portion of your buffer to another part of the screen. CopyRect is significantly more efficient than Raw, especially for operations such as window dragging.
The FrameBufferUpdate messages, which are the messages that contain the screen pixel data, had one gotcha: after the initial implementation, we found that our screen updates were working only ~30% of the time. As it turns out, the RFB spec allows for multiple updates to be sent in a single message. Once we were able to understand exactly what the server was sending back, we were able to correctly process the FrameBufferUpdate messages and at that point we had working screen viewer!
Part 4: Mouse and Keyboard Support
After around 17 straight hours of hacking, we were rounding the home stretch and had only mouse and keyboard support left to build. Luckily, the event-based nature of JavaScript made it very easy to implement keyboard and mouse support: all we needed was a simple translation from the key press events and mouse move events to the equivalent RFB messages.

The Final Product

In less than 24 hours, we had built a VNC client entirely in the browser using only JavaScript. Here's a screenshot of my browser with vnc.js running and rendering the desktop of a remote VNC host:
vnc.js screenshot
Grab the code on Github - vnc.js and tcp.js - and try it out for yourself! Of course, the usual hackday disclaimer applies: the project was thrown together in under 24 hours, may contain bugs, and has almost no documentation.

Acknowledgments

A huge thanks to my teammates, who sacrificed much sleep to make this hack possible: Avik Das,Fabio Angius, and Ferris Jumah.