HNHacker News
TopNewBestAskShowJobs

robertelder

3,325 karma · joined May 18, 2011

I enjoy writing computer programs.

@RobertElderSoft

submissionscomments
robertelder··on What can we learn from how compilers are designed?
My experience has been that you can get incredibly far (much farther than you'd think) without any form of AST and just iterate over the raw parse tree and tokens, but the problem you eventually encounter when you do this is that if you want to support all the different cases in a 'real' and messy evolved language like C is that you get a combinatorical exposion when you try to support all the corner cases of the language. A great example of this would be if you try to figure out how to write a function to iterate over the tokens that make up a struct definition in C:

http://blog.robertelder.org/magical-world-of-structs-typedef...

This is the reason for needing the extra 'abstract' syntax tree layer that lets you generalize over all those different cases and avoid having 20-level nested if statements in your compiler.

robertelder··on There's a Persistent Hum in Windsor, Ontario, and No One Knows Why
Cool, thank you for the link. To measure and correct for the frequency response of the microphone, can't you just play a range of known frequencies that each have known power levels, and then measure the gain/loss in power level that gets recorded by the mic, and then solve for a filter that gives you unity gain on the mic? I assume that you'd have peaks in the frequency response around the natural resonance and harmonics of the mic, and you'd basically just be adjusting for those.
robertelder··on There's a Persistent Hum in Windsor, Ontario, and No One Knows Why
Since you seem fairly knowledgeable about this subject, perhaps you could answer a related question I've been wondering: Would an effective low-cost way of measuring low frequencies (let's say ~20hz) be to use a subwoofer speaker (used as a microphone) hooked up to something that would amplify and recording of the signal? My reasoning is that they're naturally designed to work with low frequencies to begin with (more so than a typical microphone anyway). I would also reason that you could also do a frequency response test over a range of known frequencies and power levels for the specific subwoofer to begin with, and then write a specific software filter to normalize whatever you record from it to get the 'true' sound. Does that make sense?

Edit: Also, note that I mean doing hardware amplification of the electrical signal in the wire coming directly from the motion of the magnet of the speaker.

robertelder··on Jim Roskind's C/C++ grammar
This is a dupe of

https://news.ycombinator.com/item?id=16389624

I find it a bit frustrating that I wrote this article in an afternoon and it made the front page twice at once, while things that I spent several months working on don't even get a single upvote. I guess that's a lesson in how marketing works.

robertelder··on Age of Empires 2 Scenario Editor Is Turing Complete
This was literally how I learned the basics of programming, before I ever encountered a real programming language (I was probably ~13 at the time). I used to spend hours creating elaborate scenarios with tons of complicated triggers and effects, and then never play them.
robertelder··on How did Google Talk change from a dream to a nightmare?
Oh hey Michael, how's it going?

Yeah, Microsoft has a lot of amazing initiatives to virtualize, emulate, and wrap interfaces around everything in the universe, which is a smart idea long-term, but they never seem to get to the phase of actually optimizing it. Someday, when we convert our entire race into pure energy, we will be able to seamlessly shift between between different levels of indirection in our matrix-like universe, but for now I'm having a lot of trouble just trying to open a single application in the first 4 minutes of booting up a Windows machine. It never used to be so bad, but every year it just keeps getting worse.

robertelder··on Live Views of Starman
This is the kind of marketing that blows everybody else out of the water.
robertelder··on Changes to the YouTube Partner Program
I just got an email that my channel will de-monetized by this. I thought it was pretty funny actually. There are all these huge content creators losing out on their livelihoods because of Google's unpredictable de-monetization behaviour, and then Google even decides to demonetize even my tiny channel with only a few videos (that are over 9 years old).

I turned on monetization a few years ago and I think I've made maybe $20 so far. For a while, I actually considered investing time in making more videos with the idea that the present value of a large number of videos might be pretty considerable over the long term (say 30 years or so).

A few years ago one of my most popular videos (tens of thousands of views) was flagged as being 'not family friendly'. The video was a screen capture of me scrolling through a notepad.exe list of documentary titles with no audio. It was just a list of nature/space documentaries that were already on YouTube. Nothing offensive or controversial.

I guess this is the final nail in the coffin for my YouTube career.

robertelder··on Norwegian Student Takes Secret Street Photos In The 1890s
I visited this page two times and it caused my browser to download a file called 'n5hm6dsspmjfor3d5akscs.gz' and then another called 'rblsat02tsnsr899bpjig2.gz'.
robertelder··on A $47B Emergency-Response Network That’s Already Obsolete
This question is a bit out my domain, but I believe the answer boils down to being able to re-use one antenna for send and receive with push-to-talk, but for full-duplex communication you either need another antenna, or more complex signal processing.
robertelder··on Ask HN: What do you love/hate about terminals? Would you change them?
Love:

- Being super productive with terminals

Hate:

- The #1 thing by far in my book is not having better support for unicode. It is not possible to accurately determine the width of a unicode character in advance of printing it in the terminal. I'm aware that there are many non-printable and control characters with unicode that don't have a 'width', but even if you neglect those, the code that determines how wide a unicode characer is, is terminal specific and there is no way to access the information in advance in order to correctly align text that contains unicode, for example with whitespace padding.

This is the kind of problem that will never bother you until it does, but then when you do encounter it, you can beat your head against the wall for weeks without finding a satisfactory solution, and the only thing that comes close is something that detects aspects of your environment on every terminal out there.

I think that improving support for unicode in terminal is something that would be a good idea to do sooner rather than later, because unicode will only get more important, and in the meantime, people will continue to build abstractions upon very poor interfaces that will need to be supported in the future. Unicode is insanely complicated, so it might be too much work to support it fully, so one solution might be to expose some API that gives people the power to make their own work around (for example, through access to an snprintf like function for where n = max print width). You could add other kinds of 'empirical test' functions that allow you to avoid the work of actually understanding the entire unicode standard (which is still changing).

Here is a github repo that documents the unicode problems I have encountered:

https://github.com/RobertElderSoftware/roberteldersoftwaredi...

If I had to build one from scratch:

- If I was building one from scratch, I would probably put a better focus on separating out all the different components that actually make up the 'terminal'. In a typical bash session, you've got: /bin/bash, ttys, ptys, the terminal emulator, readline (possibly), process groups, session leaders, file descriptors, etc. This stuff is all extremely difficult to learn, and it is very 'invisible' to the average user. Most people don't need to think about it, but when you want to do certain kinds of automation tasks, they become very important.

It would be cool, if each of these concepts was formalized to provide a well-defined interface and reduce tight coupling between these components. As it is, to an average user these concepts blur together and seem like they're 'the same thing'.

robertelder··on Oroville Dam: Cost to repair spillways nearly doubles in price to $500M
I'll second that. I've been checking in on his videos every once in a while ever since the original Oroville dam crisis.
robertelder··on Equihax
Cool, this is good news as it means I might actually be able to find out my credit score.

I recently sent in an application to Equifax to get my credit score along with all the security documents, proof of address, passport, drivers license, registered mail etc. and they rejected my application because I didn't provide a hydro bill. Unfortunately, I live in an apartment and I don't pay hydro, so I sent in a copy of the lease agreement instead but that wasn't good enough :(

robertelder··on Lessons learned from implementing a text editor related to front-end development
A student in the class fo 2021 in software engineering at Waterloo would currently be about to go into their 2A term:

https://uwaterloo.ca/software-engineering/current-undergradu...

(click on course sequence)

The first year of SE is almost purely mathematics and electromagnetism. The first year programming courses are simple and are designed to simply get people up to speed who may have never programmed before (most already have).

The course which focuses on even-driven programming for user interfaces is 'CS 349 User Interfaces' which isn't until the 3A term. This is the course where students are exposed to MVC, observer pattern, avoiding polling etc. Second year term is also where you would get a lot of exposure to state machines.

As a note to the author of this post: Don't take any criticism that appears elsewhere in these comments too harshly. People who comment here often don't take much time to pay attention to the person who actually made their contributions, and as a result their level of expectations are usually the same regardless of whether a piece of work is created by someone who is a tenured professor, or a first year university student. If you continue to write and work on projects like this, you'll turn out great in the long run. You'll also grow thick skin.

robertelder··on Netlify Raises $12M from A16Z
For me the biggest appeal of static sites is that I now have significantly less attack surface to think about. The chances of someone finding an RCE in Amazon S3 are way less than than the same occurring on some old Apache 2 server where auto-update broke a couple months ago because of the linux kernel headers eating up all my inodes.
robertelder··on Jeff Dean’s Lecture for YC AI [video]
In this case I think most jurisdictions would treat the AI as just another tool or piece of equipment.

If you asked a similar question about who would take the blame if a piece of X-ray equipment was not working properly and caused some form of harm, the liability might fall on the X-ray machine manufacturer who guaranteed a certain level of accuracy, or it might fall on the hospital that procured the (potentially unsafe/certified) equipment. It might also fall on the physician who wasn't following the proper protocol for using the equipment.

robertelder··on Samsung ends Intel's 2-decade-plus reign in microchips
I watched this video yesterday, and it seems to explain a lot about how Intel has been less focused on building better technology in the last 10-15 years:

https://www.youtube.com/watch?v=osSMJRyxG0k

I'm not sure how balanced the viewpoint in the video is, but the author comes up with a lot of references.

robertelder··on In Conversation: Trent Reznor
Fun fact: "Reznor graduated in 1983 and enrolled at Allegheny College, where he studied computer engineering."

[1] https://en.wikipedia.org/wiki/Trent_Reznor

robertelder··on The End of Arduino 101: Intel Leaves Maker Market
I'd be interested to hear more about which specific features of maker-grade hardware are particularly problematic for taking things to production.
robertelder··on Path Guide: A New Approach to Indoor Navigation
Crowd-sourcing the data is going to cost less, but this will also produce lower quality results. I think that's why all the pros use Mappedin:

https://mappedin.com/

robertelder··on Rooting a Printer
I recall in the recent past a situation where plugging in a USB flash drive to a computer with Ubuntu installed would cause a wireless printer on the same LAN network to make a beeping sound. The printer in question was not added to the printer with the USB, nor had this computer ever been used to print anything before.

I did some Googling to understand how that could happen, and I didn't find much, except for someone claiming that there is a printer daemon that runs in Ubuntu by default and performs various plug and play notifications (I forget the details)?

I didn't have time to investigate more, but that experience made me wonder how many vulnerabilities there are silently laying around in a service that notifies printers about what I'm doing on my local laptop.

robertelder··on Scandalous Weird Old Things About The C Preprocessor (2015)
Can you give me an example grammar to help visualize your statement? I can probably make a note or clarification. I think one other point I forgot to mention was that the production rule for the # directives would have to look something like

    include-directive:
        beginning-of-file # INCLUDE ...
        newline-from-previous-line # INCLUDE ...
Since 'beginning-of-file' isn't really something you can reduce to a token I justified that it would be context sensitive.
robertelder··on Tagger News takes a subset of HN articles, analyzes using ML, and applies tags
I think the biggest value proposition of this is the ability to do sub-reddit like filtering on specific tags. As Hacker News grows I think dealing with the number of new submissions would become a bottleneck. During high-traffic times, new submissions sometimes drop of the first 'new' page in around 10 minutes. Of course there is more traffic during these times to upvote good content, but I'm not sure that is better than letting a smaller number of people have a longer period of time to filter a smaller collection of content.
robertelder··on Silently Corrupting an Eclipse Workspace on Windows
You were correct. I went back to do some experimenting on file sizes and I was able to update the images to .png with substantially better picture quality and a file size that was lower that the originals that had the artifacts. The page size is now about 20-30k lower than it was originally.
robertelder··on Silently Corrupting an Eclipse Workspace on Windows
I just updated the site to decrease the compression on the images. I took the compression level from 30 to 80 at a cost of adding about 70k to the total page size. I often try to avoid using png for any images that don't need to look really high quality because the files sizes generally seem to be larger. Having said that I don't know much about the internals of these image formats, so I suppose I should read up on them one of these days.
robertelder··on Reddit Is Being Manipulated by Professional Shills [video]
I'm a huge fan of Elon Musk, and I really want him to be successful, but sometimes I feel that the overzealous tendency of his fans (and likely PR people) to automatically give praise for anything he does or says (here on HN or on reddit) is actually counter-productive.

What if Elon starts doing something dumb some day and then when well-informed people try to provide meaningful criticism, they just get criticised and downvoted? I think that could actually undermine support from some of the people that Elon wants it from the most.

robertelder··on Ask HN: What is 1 thing that can take a Junior's career to the next level?
I would say that getting the right internship will make a huge difference.

In 2009 before I went to university I was still living at home, splitting firewood in the middle of nowhere in New Brunswick, Canada to make a bit of extra money. This turned out to be an activity with an effective wage of about $10/hour.

In 2012 I was interning at NVIDIA in Santa Clara. Interns get lots of special treatment to indoctrinate you into the company, so I got to meet the CEO and he invited all the interns over to his house. Of course, he would probably never remember me, but I can't think of many other ways to move so quickly into a place where you could actually have some influence.

robertelder··on Linus' reply on Git and SHA-1 collision
I posted this on the reddit thread, but I thought it would be interesting to hear feedback here too:

I don't know much about git internals, so forgive me if that is a bad idea, but what does everyone think about it working like this:

If future versions of git were updated to support multiple hash functions with the 'old legacy default' being sha1. In this mode of operation you could add or remove active hashes through a configuration, so that you could perform any integrity checks using possibly more than one hash at the same time (sha1 and sha256). If the performance gets bad, you could turn off the one that you didn't care about.

This way by the time the same problem rolls around with the next hash function being weakened, someone will probably have already added support for various new hash functions. Once old hash functions become outdated you can just remove them from your config like you would remove insecure hash functions from HTTPS configurations or ssh config files. Also, you could namespace commit hashes with sha1 beging the default:

git checkout sha256:7f83b1657ff1fc53b92dc18148a1d...

git checkout sha512:861844d6704e8573fec34d967e20bcfef3...

Enabling/disabling active hash functions would probably an expensive operation, but you wouldn't be doing it every day so it probably wouldn't be a huge problem.

robertelder··on The perils of reporting on China's GDP
I have been watching this guy's videos, and there are a lot of interesting details about what life is really like in China:

https://www.youtube.com/watch?v=1At2H-lIJog

robertelder··on Browser auto-fill phishing
I really with that browsers didn't autocomplete ever. I've had instances where they will happily auto-complete my entire credit card number. Usually, they'll only memorize the first 4 digits, but sometimes they memorize the entire thing.
← PreviousPage 3 of 7Next →