Cloning Silicon Valley

Great one page article here from IEEE Spectrum about attempts to clone Silicon Valley and why they have generally failed. To cut a short story even shorter, it comes down to an entrepreneurial attitude, quality of life and history in the author’s opinion. I mostly agree except perhaps New York, Seattle and London should have got some sort of mention. Whatever, it’s certainly apparent from CrunchBase‘s daily funding round updates that San Francisco and New York are the locations that come up most consistently.

So, what do you need to create a great environment for high tech startups?

Continue reading “Cloning Silicon Valley”

Java: converting a float to a byte array and back again

Many physical variables are best represented as floats and sometimes it is necessary to pass these variables across a network link. Floats are very standardized and can be safely passed around between different architectures and operating systems but need to be converted to a byte stream first (something like JSON can send floats as strings but this is pretty inefficient in time and space). In C or C++ this is pretty easy but Java is strongly typed and doesn’t make it easy to convert a float value to a byte stream and vice versa. However it can be done…

public void convertFloatToByteArray(float f, byte[] b, int offset) {
   ByteBuffer.wrap(b, offset, 4).order(ByteOrder.LITTLE_ENDIAN).putFloat(f);
}

public float convertByteArrayToFloat(byte[] b, int offset) {
   return ByteBuffer.wrap(b, offset, 4).order(ByteOrder.LITTLE_ENDIAN).getFloat();
}

The elimination of non-compete agreements – it can’t happen too soon

Interesting piece here about the different situations in different US states regarding the enforceability of non-compete agreements. Once again, California leads the way. And also once again, Florida is one of the worst. We can only hope that these are outlawed everywhere in the very near future. Enforcement of non-compete agreements is the last refuge of the incompetent (which apparently is an out of context quote borrowed from Isaac Asimov :-)).

Raspberry Pi Compute Module

The Raspberry Pi Compute Module is a great step forward. It provides an easy way of using Raspberry Pi technology in commercial products which often require a customized physical format and I/O. This has been a problem in the past with other similar systems where they really were never intended for integration in real products. Now the Raspberry Pi provides a straightforward route to powerful commercial products with minimal NRE and risk compared to a full custom hardware design. Excellent!

Raspberry Pi I2C udev rules

Even when the I2C ports on the Raspberry Pi are enabled as described here, they are only accessible when running in supervisor mode, which is not terribly convenient. To fix that, it’s possible to add a udev rule to change the mode of the devices. The description here is borrowed from my friend at Jumpnow incidentally.

Create a file /etc/udev/rules.d/90-i2c.rules and add the line:

KERNEL=="i2c-[0-7]",MODE="0666"

Reboot the Pi and then the I2C ports will be accessible without having to run stuff with sudo.