Hackaday Hacked!

Well, that was “fun”. Last week, we wrote a newsletter post about the state of Hackaday’s comments. We get good ones and bad ones, and almost all the time, we leave you all up to your own devices. But every once in a while, it’s good to remind people to be nice to our fellow hackers who get featured here, because after all they are the people doing the work that gives us something to read and write about. The whole point of the comment section is for you all to help them, or other Hackaday readers who want to follow in their footsteps.

Someone decided to let loose a comment-reporting attack. It works like this: you hit the “report comment” button on a given comment multiple times from multiple different IP addresses, and our system sends the comments back to moderation until a human editor can re-approve them. Given the context of an article about moderation, most everyone whose comment disappeared thought that we were behind it. When more than 300 comments were suddenly sitting in the moderation queue, our weekend editors figured something was up and started un-flagging comments as fast as they could. Order was eventually restored, but it was ugly for a while.

We’ve had these attacks before, but probably only a handful of times over the last ten years, and there’s basically nothing we can do to prevent them that won’t also prevent you all from flagging honestly abusive or spammy comments. (For which, thanks! It helps keep Hackaday’s comments clean.) Why doesn’t it happen all the time? Most of you all are just good people. Thanks for that, too!

But despite the interruption, we got a good discussion started about how to make a comment section thrive. A valid critique of our current system that was particularly evident during the hack is that the reported comment mechanism is entirely opaque. A “your comment is being moderated” placeholder would be a lot nicer than simply having the comment disappear. We’ll have to look into that.

You were basically divided down the middle about whether an upvote/downvote system like on Reddit or Slashdot would serve us well. Those tend to push more constructive comments up to the top, but they also create a popularity contest that can become its own mini-game, and that’s not necessarily always a good thing. Everyone seemed pretty convinced that our continuing to allow anonymous comments is the right choice, and we think it is simply because it removes a registration burden when someone new wants to write something insightful.

What else? If you could re-design the Hackaday comment section from scratch, what would you do? Or better yet, do you have any examples of similar (tech) communities that are particularly well run? How do they do it?

We spend our time either writing and searching for cool hacks, or moderating, and you can guess which we’d rather. At the end of the day, our comments are made up of Hackaday readers. So thanks to all of you who have, over the last week, thought twice and kept it nice.

If You Can’t Say Anything Nice

[Editor’s Note: After we posted this, we got hit by a comment-report attack, and about 1,000 (!) comments across the whole site got sent back into the moderation queue on Saturday. We’ve since re-instated them all, but that took a lot of work.

About halfway down the comments in this article, the majority of comments are “hey, why did you delete this?”  We didn’t, and they should be all good now. We debated removing the “try deleting this!” comments, but since we didn’t delete them in the first place, we thought we should just leave them. It makes a royal mess of any discussion, and created a lot more heat than light, which is unfortunate.]

You know what your mom would say, right? This week, we got an above average number of useless negative comments. A project was described as looking like a “turd” – for the record I love the hacker’s angular and futuristic designs, but it doesn’t have to be to your taste. Then someone else is like “you don’t even need a computer case.” Another commenter informed us that he doesn’t like to watch videos for the thirtieth time. (Yawn!)

What all of these comments have in common is that they’re negative, low value, non-constructive, and frankly have no place on Hackaday. The vast majority are just kind of Eeyorey complaining about how someone else is enjoying a chocolate ice cream, and the commenter prefers strawberry. But then some of them turn nasty. Why? If someone makes a project that you don’t like, they didn’t do it to offend you. Just move on quietly to one you do like. We publish a hack every three hours like a rubidium clockwork, with a couple of original content pieces scattered in-between on weekdays.

And don’t get us wrong: we love comments that help improve a project. There’s a not-so-fine line between “why didn’t you design it with trusses to better hold the load?” and “why did you paint it black, because blue is the superior color”. You know what we mean. Constructive criticism, good. Pointless criticism, bad.

It was to the point that we were discussing just shutting down the comments entirely. But then we got gems! [Maya Posch]’s fantastic explainer about the Lagrange points had an error: one of the satellites that Wikipedia said was at an earth-moon Lagrange point is actually in normal orbit around the moon. It only used the Lagrange point as a temporary transit orbit. Says who? One of the science instrument leads on the space vehicle in question. Now that is a high-value comment, both because it corrects a mistake and enlightens us all, but also because it shows who is reading Hackaday!

Or take [Al Williams]’s article on mold-making a cement “paper” airplane. It was a cool technique, but the commenters latched onto his assertion that you couldn’t fly a cement plane, and the discussions that ensued are awesome. Part of me wanted to remind folks about the nice mold-making technique on display, but it was such a joy to go down that odd rabbit hole, I forgive you all!

We have an official “be nice” policy about the comments, and that extends fairly broadly. We really don’t want to hear what you don’t like about someone’s project or the way they presented it, because it brings down the people out there who are doing the hard work of posting their hacks. And hackers have the highest priority on Hackaday.

Thanks For The Great Comments!

Every once in a while, there’s a Hackaday article where the comments are hands-down the best part of a post. This happened this week with Al Williams’ Ask Hackaday: How Do You Make Front Panels?. I guess it’s not so surprising that the comments were full of awesome answers – it was an “Ask Hackaday” after all. But you all delivered!

A technique that I had never considered came up a few times: instead of engraving the front of an opaque panel, like one made of aluminum or something, instead if you’re able to make the panel out of acrylic, you can paint the back side, laser or engrave into it, and then paint over with a contrast color. Very clever!

Simply printing the panel out onto paper and laminating it got a number of votes, and for those who are 3D printing the enclosure anyway, simply embossing the letters into the surface had a number of fans. The trick here is in getting some contrast into the letters, and most suggested changing filament. All I know is that I’ve tried to do it by painting the insides of the letters white, and it’s too fiddly for me.

But my absolute favorite enclosure design technique got mentioned a number of times: cardboard-aided design. Certainly for simple or disposable projects, there’s nothing faster than just cutting up some cardboard and taping it into the box of your desires. I’ll often do this to get the sizes and locations of components right – it’s only really a temporary solution. Although some folks have had success with treating the cardboard with a glue wash, paint, or simply wrapping it in packing tape to make it significantly more robust. Myself, if it ends up being a long-term project, I’ll usually transfer the cardboard design to 3DP or cut out thin plywood.

I got sidetracked here, though. What I really wanted to say was “thanks!” to everyone who submitted their awesome comments to Al’s article. We’ve had some truly hateful folks filling the comment section with trash lately, and I’d almost given up hope. But then along comes an article like this and restores my faith. Thanks, Hackaday!

In Search Of The First Comment

Are you writing your code for humans or computers? I wasn’t there, but my guess is that at the dawn of computing, people thought that they were writing for the machines. After all, they were writing in machine language, and whatever bits they flipped into the electronic brain stayed in the electronic brain, unless punched out on paper tape. And the commands made the machine do things, not other people. Code was written strictly for computers.

Modern programming practice, on the other hand, is aimed firmly at people. Variable and function names are chosen to be long and to describe what they contain or do. “Readability” of code is a prized attribute. Indeed, sometimes the fact that it does the right thing at all almost seems to be an afterthought. (I kid!)

Somewhere along this path, there was an important evolutionary step, like the first fish using its flippers to walk on land. Comments were integrated into programming languages, formalizing the notes that coders of old surely wrote by hand in the margins of the paper first-drafts before keying it in. So I went looking for the missing link: the first computer language, and ideally the first program, with comments. I came up empty handed.

Or rather full handed. Every computer language that I could find had comments from the beginning. FORTRAN had comments, marked by a “C” as the first character in a line. APL had comments, marked by the bizarro rune ⍝. Even the custom language written for the Apollo 11 guidance computers had comments — the now-commonplace “#”. I couldn’t find an early programming language without comments.

My guess is that the first language with a comment must have been an assembly language, because I don’t know of any machines with a native comment instruction. (How cool and frivolous would that be?)

Assemblers simply translate mnemonic names to their machine instruction counterparts, but this gives them the important freedom to ignore anything starting with, traditionally, a semicolon. Even though you’re just transferring the contents of register X to the memory location pointed to in register Y, you can write that you’re “storing the height above ground (meters)” in the comments.

The crucial evolutionary step, though, is saving the comments along with the code. Simply ignoring everything that comes after the semicolon and throwing it away doesn’t count. Does anyone know? What was the first code to include comments as part of the code itself, and not simply as marginalia?

Naming Names

We have all heard that good variable names are important for creating readable programs — advice that will serve you well when you come back to your code two years later, or even twenty. Sometimes, when you are so deep in the zone and begin to question a variable name that you made three levels up the calling hierarchy, it can be helpful to take a step back and review your variable naming conventions. The wikipedia article on computer program naming conventions is a good starting point, where you can dig into the nitty gritty of Hungarian notation like bFlag, case separated names like camelCase, and so on. But sometimes you have to go meta, and need names to describe the names themselves.

For example, in everyday usage the terms parameter and argument are often used interchangeably. But strictly speaking, a parameter is a placeholder, the variables in a function declaration for example (see image above). An argument is the actual value itself, say the number 50.334 in the example.

We recommend that units of measure should always be clearly specified in your comments, perhaps even in the variable names if you’re mixing different systems in the same program. At Hackaday we prefer to use SI units, check out NIST SP 330 if you’re interested. But invariably, there are going to be exceptions for years to come. We like to deal with those at the edges during I/O if possible, thus keeping a consistent set of units in the core of the program.

What about the terms number and value? We like to think of a number as being a kind of value. For example, a function’s return value could be a number, say a velocity. Or it could return an enumeration or a boolean. Sometimes the perfect meta-name for something will collide with a reserved keyword in your programming language, names like string or data for example. In these cases you have to be creative and find suitable synonyms, perhaps text and payload.

Using consistent and precise language can be tedious, but it can be just as helpful as good commenting and variable naming practices. Do you have any examples where precise terminology such as this has been been helpful or perhaps tripped you up? If so, share in the comments section below.

 

 

Hackaday Passes 1,000,000 Comments

For just over sixteen years we’ve been publishing fresh hacks every day. We’ve just passed another milestone: the one millionth Hackaday comment was made just a few minutes ago.

A million of anything is impressive, but it’s not the sheer volume that’s on my mind today, but how time and again I’m gobsmacked by the insightful comments I find on these pages, and the people who put them there. We find leads for futures stories, answers to unknowns voiced in the articles, and have conversations with thousands of people whose paths we never would have crossed otherwise.

Not a week goes by that I don’t lose myself in a comment thread, usually taking me down the rabbit hole of exploring a bit of technology previously hidden to me but revealed by a few words. How many Hackaday articles were spawned by someone posting just the right link in the comment section?

Too often the people who moved the world with interesting technologies move through their careers and beyond without anyone to really tell their stories to, and those are some of the best stories from the people working with the tech on a daily basis for decades. But then we publish an article that puts a spotlight on their corner of knowledge and we get to hear how it was from their perspective. It’s so gratifying to get these moments of insight on who and what have kept humanity’s relay-race of science forward.

So thank you! Keep those comments and those stories coming!

Continue reading “Hackaday Passes 1,000,000 Comments”

This Machine Learning Algorithm Is Meta

Suppose you ran a website releasing many articles per day about various topics, all following a general theme. And suppose that your website allowed for a comments section for discussion on those topics. Unless you are brand new to the Internet, you’ll also imagine that the comments section needs at least a little bit of moderation to filter out spam, off topic, or even toxic comments. If you don’t want to employ any people for this task, you could try this machine learning algorithm instead.

[Ladvien] goes through a general overview of how to set up a convolutional neural network (CNN) which can be programmed to do many things, but this one crawls a web page, gathers data, and also makes decisions regarding that data. In this case, the task is to identify toxic comments but the goal is not to achieve the sharpest sword in the comment moderator’s armory, but to learn more about how CNNs work.

Written in Python, the process outlines the code itself and how it behaves, setting up a small server to host the neural network, and finally creating the webservice. As with any machine learning, you need a reliable dataset to use for training and this one came from Wikipedia comments previously flagged by humans. Trolling nuance is thrown aside, as the example homes in on blatant insults and vulgarity.

While [Ladvien] notes that his guide isn’t meant to be comprehensive, but rather to fill in some gaps that he noticed within other guides like this, we find this to be an interesting read. He also mentioned that, in theory, this tool could be used to predict the number of comments following an article like this very one based on the language in the article. We’ll leave that one as an academic exercise for now, probably.