Posts

Showing posts from February, 2014

Mantra

Image
Live this day.   Don’t live in the past.   Regret for the past is a waste of spirit.   The future is a season unborn.   Don’t stare off into the east hoping for a better day tomorrow.   This moment is now.   It is all we have. Live this day.   The rain has come after a mild winter and a long drought.   It flows through canyons and stream beds that were dry only yesterday.   Things change.   Impermanence.   Suffering.   These are the companions accompanying us on our journey.   Embrace them. Live this day.   Listen to the music and the silence.   Dance, even when you are the only one who hears the drumbeats in the distance.   Speak only when you can improve the silence.   The way that can be spoken is not the way.   Bear witness. Live this day.   We are all dying from the moment we are born.   All stories move to their inevitable conclusions.   In every death, a resurrection.   In every cross, a redemption.   Open the church of your heart.   See infinity in the eyes of the other.   The

Taking a break

I’ll be back on Monday, 17 March 2014 and will announce if and how 2ality will continue.

Evangelii Gaudium

Image
Evangelii Gaudium , Pope Francis’ recent apostolic exhortation, sets a tone and direction for Catholics the world over.   The document is a breath of fresh air after the closed and vaguely malevolent papacy of Benedict XVI. Here is a rundown of Francis’ ideas:   a new chapter of evangelization—check; the evils of consumerism and the pursuit of material goods—check; a call to renew the joy of faith, even in crisis—check; the need to serve the poor—check; revamping the Church’s rituals, methods, language and structure—check; a revitalization of parishes and schools—check; the need for Catholics to be bold and creative in thought and action—check; the call to remember Church history, Aquinas, Vatican II, etc.—check; the exhortation to abandon our throw-away culture and global indifference to the plight of others—check; the call to recognize laity as central to the Church’s mission—check; the recognition of the importance of women in the Church, although not important enough to be ordaine

JavaScript time values: dates as milliseconds since 1970-01-01

This blog post explains how JavaScript dates are stored internally as time values , milliseconds since 1970-01-01. What the date API calls time is called a time value by the ECMAScript specification. It is a primitive number that encodes a date as milliseconds since 1 January 1970 00:00:00 UTC. Each date object stores its state as a time value, in the internal property [[PrimitiveValue]] (the same property that instances of the wrapper constructors Boolean , Number , and String use to store their wrapped primitive values). Warning: Leap seconds are ignored in time values. The following methods work with time values: new Date(timeValue) uses a time value to create a date. Date.parse(dateTimeString) parses a string with a date time string and returns a time value. Date.now() returns the current date time as a time value. Date.UTC(year, month, date?, hours?, minutes?, seconds?, milliseconds?) interprets the parameters relative to UTC and returns a time value. Date.prototype.getTi

What are integers in JavaScript?

According to the ECMAScript specification, all numbers in JavaScript are floating-point. Yet, the notion of integer comes up occasionally. This blog post explains what it means. What are integers? JavaScript has only floating-point numbers. Integers appear internally in two ways. First, most JavaScript engines store a small enough number without a decimal fraction as an integer (with, for example, 31 bits) and maintain that representation as long as possible. They have to switch back to a floating point representation if a number’s magnitude grows too large or if a decimal fraction appears. Second, the ECMAScript specification has integer operators: namely, all of the bitwise operators. Those operators convert their operands to 32-bit integers and return 32-bit integers. For the specification, integer only means that the numbers don’t have a decimal fraction, and 32-bit means that they are within a certain range. For engines, 32-bit integer means that an actual integer (non-floatin

Video: Fake operator overloading

On 2012-05-31, I held the talk “Fake operator overloading” at Fluent Conference , in San Francisco. The video is now publicly available (go there for a larger version of the video). The actual beginning of the talk (a few seconds where I say the talk’s title) is missing. But my mic test is there! ;-) Abstract: This presentation explains how to achieve a limited form of operator overloading in JavaScript. You’ll learn tricks that allow you to write code like this: var p = new Point(); p._ = new Point(1, 2) + new Point(3, 4) + new Point(5, 6); p._ = new Point(1, 2) * new Point(3, 4) * new Point(5, 6); Related resources: Slides The blog post that the talk is based on