Programming Ada: Records And Containers For Organized Code

Writing code without having some way to easily organize sets of variables or data would be a real bother. Even if in the end you could totally do all of the shuffling of bits and allocating in memory by yourself, it’s much easier when the programming language abstracts all of that housekeeping away. In Ada you generally use a few standard types, ranging from records (equivalent to structs in C) to a series of containers like vectors and maps. As with any language, there are some subtle details about how all of these work, which is where the usage of these types in the Sarge project will act as an illustrative example.

In this project’s Ada code, a record is used for information about command line arguments (flag names, values, etc.) with these argument records stored in a vector. In addition, a map is created that links the names of these arguments, using a string as the key, to the index of the corresponding record in the vector. Finally, a second vector is used to store any text fragments that follow the list of arguments provided on the command line. This then provides a number of ways to access the record information, either sequentially in the arguments vector, or by argument (flag) name via the map.

Continue reading “Programming Ada: Records And Containers For Organized Code”

Tech In Plain Sight: Theodolites

We take it for granted that you can look at your phone and tell exactly where you are. At least, as exact as the GPS satellites will allow. But throughout human history, there has been a tremendous desire to know where here is, exactly. Where does my farm end and yours start? Where is the border of my city or country? Suppose you have a flagpole directly in the center of town and a clock tower at the edge of town. You know where they are precisely on a map. You also know how tall they are. What you need is a theodolite, which is an instrument that measures angles very precisely.

Continue reading “Tech In Plain Sight: Theodolites”

A Treasure Trove In An English Field

This is being written in a tent in a field in Herefordshire, one of the English counties that borders Wales. It’s the site of Electromagnetic Field, this year’s large European hacker camp, and outside my tent the sky is lit by a laser light show to the sound of electronic music. I’m home.

One of the many fun parts of EMF is its swap table. A gazebo to which you can bring your junk, and from which you can take away other people’s junk. It’s an irresistible destination which turns a casual walk into half an hour pawing through the mess in search of treasure, and along the way it provides an interesting insight into technological progress. What is considered junk in 2024?

Something for everyone

As always, the items on offer range from universal treasures of the I-can’t-believe-they-put that-there variety, through this-is-treasure-to-someone-I’m-sure items, to absolute junk. Some things pass around the camp like legends; I wasn’t there when someone dropped off a box of LED panels for example, but I’ve heard the story relayed in hushed tones several times since, and even seen some of the precious haul. A friend snagged a still-current AMD processor and some Noctua server fans as another example, and I’m told that amazingly someone deposited a Playstation 5. But these are the exceptions, in most cases the junk is either very specific to something, or much more mundane. I saw someone snag an audio effects unit that may or may not work, and there are PC expansion cards and outdated memory modules aplenty.

Finally, there is the absolute junk, which some might even call e-waste but I’ll be a little more charitable about. Mains cables, VGA cables, and outdated computer books. Need to learn about some 1990s web technology? We’ve got you covered. Continue reading “A Treasure Trove In An English Field”

Sometimes It’s Not The Solution

Watching a video about a scratch-built ultra-precise switch for metrology last week reminded me that it’s not always the projects that are the most elegant solutions that I enjoy reading about the most. Sometimes I like reading about hackers’ projects more for the description of the problem they’re facing.

A good problem invites you to brainstorm along. In the case of [Marco Reps]’s switches, for instance, they need to be extraordinarily temperature stable, which means being made out of a single type of metal to avoid unintentional thermocouple joints. And ideally, they should be as cheap as possible. Once you see one good solution, you can’t help but think of others – just reading the comments on that article shows you how inspiring a good problem can be. I’m not worried about these issues in any of my work, but it would be cool to have to.

Similarly, this week, I really liked [Michael Prasthofer]’s deep dive into converting a normal camera into a spectrometer. His solutions were all very elegant, but what was most interesting were the various problems he faced along the way. Things that you just wouldn’t expect end up mattering, like diffraction gratings being differently sensitive across the spectrum when light comes in from different angles. You can learn a lot from other people’s problems.

So, hackers everywhere, please share your problems with us! You think that your application is “too niche” to be of general interest? Maybe it’s another example of a problem that’s unique enough to be interesting just on its own. Let’s see what your up against. A cool problem is at least as interesting as a clever solution.

Hackaday Podcast Episode 273: A Tube Snoot, Dynamic Button Blobs, And Tokamaks Aren’t Whack

This week, it was Kristina’s turn in the hot seat with Editor-in-Chief Elliot Williams. First up in the news: Germany’s solar and wind power generation have resulted in excess energy, which some people think is bad. In Hackaday news, the entries in the 2024 Business Card Challenge are really stacking up.

Then it’s on to What’s That Sound, which Kristina provided this week and managed to stump Elliot. Can you get it? Can you figure it out? Can you guess what’s making that sound? If you can, and your number comes up, you get a special Hackaday Podcast t-shirt.

Then it’s on to the hacks, beginning with an improved spectrometer that wasn’t easy, and a rotary phone kitchen timer that kind of was. We’ll talk about badges turned invitations, reinventing rotary switches, and dynamic button blobs. Finally, we get the lowdown on the state of nuclear fusion, and posit why chatting online isn’t what it used to be.

Check out the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

Download and savor at your leisure.

Continue reading “Hackaday Podcast Episode 273: A Tube Snoot, Dynamic Button Blobs, And Tokamaks Aren’t Whack”

How Facebook Killed Online Chat

In the early days of the internet, online conversations were an event. The technology was novel, and it was suddenly possible to socialize with a whole bunch of friends at a distance, all at once. No more calling your friends one by one, you could talk to them all at the same time!

Many of us would spend hours on IRC, or pull all-nighters bantering on MSN Messenger or AIM. But then, something happened, and many of us found ourselves having shorter conversations online, if we were having any at all. Thinking back to my younger days, and comparing them with today, I think I’ve figured out what it is that’s changed.

Continue reading “How Facebook Killed Online Chat”

The Tragic Story Of The Ill-Fated Supergun

In the annals of ambitious engineering projects, few have captured the imagination and courted controversy quite like Gerald Bull’s Supergun. Bull, a Canadian artillery expert, envisioned a gun that could shoot payloads directly into orbit. In time, his ambition led him down a path that ended in both tragedy and unfinished business.

Depending on who you talk to, the Supergun was either a new and innovative space technology, or a weapon of war so dangerous, it couldn’t be allowed to exist. Ultimately, the powers that be intervened to ensure we would never find out either way.

Continue reading “The Tragic Story Of The Ill-Fated Supergun”