Drops of Jupyter Notebooks: How to Keep Notes in the Information Age

Our digital world is so much more interactive than the paper one it has been replacing. That becomes very obvious in the features of Jupyter Notebooks. The point is to make your data beautiful, organized, interactive, and shareable. And you can do all of this with just a bit of simple coding.

We already leveraged computer power by moving from paper spreadsheets to digital spreadsheets, but they are limited. One thing I’ve seen over and over again — and occasionally been guilty of myself — is spreadsheet abuse. That is, using a spreadsheet program to do something I probably ought to write a program to do. For those times that you want something quick but want something more than a spreadsheet, you should check out Jupyter Notebooks. The system is most commonly associated with Python, but it isn’t Python-specific. There are over 100 languages supported — many community-developed. You can even install a C++ interpreter backend for it. Because of the client/server architecture, it is very simple to share notebooks with other users.

You can — in theory — use Jupyter for anything you could use Python for. In practice, it seems to get a lot of workout with people analyzing large data sets, doing machine learning, and similar tasks.

The Good: Simple, Powerful, Extensible

The idea is simple. Think of a Markdown-enabled web page that can connect to a backend (a kernel, in Jupyter-speak). The backend can run on your machine or remotely and will support some kind of language — often Python. The document has cells that line up vertically (like a single wide spreadsheet column). For example, here’s a simple notebook I created to explain how a bunch of sine waves add up to a square wave:

Continue reading “Drops of Jupyter Notebooks: How to Keep Notes in the Information Age”

Building A Simple Python API for Internet of Things Gadgets

It’s no secret that I rather enjoy connecting things to the Internet for fun and profit. One of the tricks I’ve learned along the way is to spin up simple APIs that can be used when prototyping a project. It’s easy to do, and simple to understand so I’m happy to share what has worked for me, using Web2Py as the example (with guest appearances from ESP8266 and NodeMCU).

Barring the times I’m just being silly, there are two reasons I might do this. Most commonly I’ll need to collect data from a device, typically to be stored for later analysis but occasionally to trigger some action on a server in the cloud. Less commonly, I’ll need a device to change its behavior based on instructions received via the Internet.

Etherscan is an example of an API that saves me a lot of work, letting me pull data from Ethereum using a variety of devices.

In the former case, my first option has always been to use IoT frameworks like Thingsboard or Ubidots to receive and display data. They have the advantage of being easy to use, and have rich features. They can even react to data and send instruction back to devices. In the latter case, I usually find myself using an application programming interface (API) – some service open on the Internet that my device can easily request data from, for example the weather, blockchain transactions, or new email notifications.

Occasionally, I end up with a type of data that requires processing or is not well structured for storage on these services, or else I need a device to request data that is private or that no one is presently offering. Most commonly, I need to change some parameter in a few connected devices without the trouble of finding them, opening all the cases, and reprogramming them all.

At these times it’s useful to be able to build simple, short-lived services that fill in these gaps during prototyping. Far from being a secure or consumer-ready product, we just need something we can try out to see if an idea is worth developing further. There are many valid ways to do this, but my first choice is Web2Py, a relatively easy to use open-source framework for developing web applications in Python. It supports both Python 2.7 and 3.0, although we’ll be using Python 3 today.

Continue reading “Building A Simple Python API for Internet of Things Gadgets”

The Woeful World of Worldwide E-Waste

How large is the cache of discarded electronics in your home? They were once expensive and cherished items, but now they’re a question-mark for responsible disposal. I’m going to dig into this problem — which goes far beyond your collection of dead smartphones — as well as the issues of where this stuff ends up versus where it should end up. I’m even going to demystify the WEEE mark (that crossed out trashcan icon you’ve been noticing on your gadgets), talk about how much jumbo jets weigh, and touch on circular economies, in the pursuit of better understanding of the waste streams modern gadgets generate.

Our lives are encountering an increasing number of “how do I dispose of this [X]” moments, where X is piles of old batteries, LCDs, desktop towers, etc. This leads to relationship-testing piles of garbage potential in a garage or the bottom of a closet. Sometimes that old gear gets sold or donated. Sometimes there’s a handy e-waste campaign that swings through the neighborhood to scoop that pile up, and sometimes it eventually ends up in the trash wrapped in that dirty feeling that we did something wrong. We’ve all been there; it’s easy to discover that responsible disposal of our old electronics can be hard.

Fun fact: the average person who lives in the US generates 20 kg of e-waste annually (or about 44 freedom pounds). That’s not unique, in the UK it’s about 23 kg (that’s 23 in common kilograms), 24 kg for Denmark, and on and on. That’s quite a lot for an individual human, right? What makes up that much waste for one person? For that matter, what sorts of waste is tracked in the bogus sounding e-waste statistics you see bleated out in pleading Facebook posts? Unsurprisingly there are some common definitions. And the Very Serious People people at the World Economic Forum who bring you the definitions have some solutions to consider too.

We spend a lot of time figuring out how to build this stuff. Are we spending enough time planning for what to do with the gear once it falls out of favor? Let’s get to the bottom of this rubbish.
Continue reading “The Woeful World of Worldwide E-Waste”

Security Engineering: Inside the Scooter Startups

A year ago, ridesharing scooter startups were gearing up for launch. Workers at Bird, Lime, Skip, and Spin were busy improving their app, retrofitting scooters, and most importantly, figuring out the logistics of distributing thousands of electronic scooters along the sidewalks of the Bay Area. These companies were gearing up for a launch in early summer, but one company — nobody can remember exactly who — decided to launch early. First mover advantage, and all. Overnight, these scooter companies burst into overdrive, chucking scooters out of panel vans onto the sidewalk simply to keep up with the competition.

The thing about San Francisco, and California in general, is that it’s a very direct democracy masquerading as a representative government. Yes, there are city council members and a state legislature, but the will of the people will rule. No one liked tripping over the scooters littering the sidewalks, so the scooters ended up at the bottom of a lake. Or in trees. Or in the trash. In time, city permits were issued, just like a hot dog cart or any other business operating on a public sidewalk, and the piles of electric scooters disappeared. Not before hundreds of scooters were vandalized, that is.

It’s still early in the electric scooter rental startup space, but if there’s one company leading the pack, It’s Bird. they’re getting the most press, the CEO was formerly at Lyft and Uber (which explains the press), and they’ve raised nearly a half Billion dollars in funding (which explains the press). Bird is valued at two Billion dollars, and it’s one of four major ridesharing scooter startups. Pets.com had nothing on this.

Despite how overvalued you think a scooter startup might be, they’re still a business, and they’re ruled by the bottom line. Bird has grown a lot in the past year, and with that comes engineering challenges. The Bird scooters must be more resistant to vandalism. The Bird scooters must be harder to steal. Above all else, they must remain in service longer. This is the teardown of how Bird managed to improve their bottom line and engineer a better scooter.

Continue reading “Security Engineering: Inside the Scooter Startups”

The Deep Space Energy Crisis Could Soon Be Over

On the face of it, powering most spacecraft would appear to be a straightforward engineering problem. After all, with no clouds to obscure the sun, adorning a satellite with enough solar panels to supply its electrical needs seems like a no-brainer. Finding a way to support photovoltaic (PV) arrays of the proper size and making sure they’re properly oriented to maximize the amount of power harvested can be tricky, but having essentially unlimited energy streaming out from the sun greatly simplifies the overall problem.

Unfortunately, this really only holds for spacecraft operating relatively close to the sun. The tyranny of the inverse square law can’t be escaped, and out much beyond the orbit of Mars, the size that a PV array needs to be to capture useful amounts of the sun’s energy starts to make them prohibitive. That’s where radioisotope thermoelectric generators (RTGs) begin to make sense.

RTGs use the heat of decaying radioisotopes to generate electricity with thermocouples, and have powered spacecraft on missions to deep space for decades. Plutonium-238 has long been the fuel of choice for RTGs, but in the early 1990s, the Cold War-era stockpile of fuel was being depleted faster than it could be replenished. The lack of Pu-238 severely limited the number of deep space and planetary missions that NASA was able to support. Thankfully, recent developments at the Oak Ridge National Laboratory (ORNL) appear to have broken the bottleneck that had limited Pu-238 production. If it pays off, the deep space energy crisis may finally be over, and science far in the dark recesses of the solar system and beyond may be back on the table.

Continue reading “The Deep Space Energy Crisis Could Soon Be Over”

Hacking the humble Roadster Bicycle

Think of bicycles, and your first mental image could be something pretty fancy. Depending on which side of the sport you favor, you could end up thinking of a road bike or an MTB, maybe DH, CX, BMX, TT, tandem or recumbent.

But for people in most parts of the World such as Asia, Africa and South America, the bicycle conjures up a very different image – that of the humble roadster. And this simple, hardy machine has spawned innumerable hacks to extend its usefulness and functionality by enterprising people with limited means. For them, it is not as much a means of transport, as a means for livelihood and survival.
Continue reading “Hacking the humble Roadster Bicycle”

NVIDIA’s A.I. Thinks It Knows What Games Are Supposed Look Like

Videogames have always existed in a weird place between high art and cutting-edge technology. Their consumer-facing nature has always forced them to be both eye-catching and affordable, while remaining tasteful enough to sit on retail shelves (both physical and digital). Running in real-time is a necessity, so it’s not as if game creators are able to pre-render the incredibly complex visuals found in feature films. These pieces of software constantly ride the line between exploiting the hardware of the future while supporting the past where their true user base resides. Each pixel formed and every polygon assembled comes at the cost of a finite supply of floating point operations today’s pieces of silicon can deliver. Compromises must be made.

Often one of the first areas in games that fall victim to compromise are environmental model textures. Maintaining a viable framerate is paramount to a game’s playability, and elements of the background can end up getting pushed to “the background”. The resulting look of these environments is somewhat more blurry than what they would have otherwise been if artists were given more time, or more computing resources, to optimize their creations. But what if you could update that ten-year-old game to take advantage of today’s processing capabilities and screen resolutions?

NVIDIA is currently using artificial intelligence to revise textures in many classic videogames to bring them up to spec with today’s monitors. Their neural network is able fundamentally alter how a game looks without any human intervention. Is this a good thing?

Continue reading “NVIDIA’s A.I. Thinks It Knows What Games Are Supposed Look Like”