HNHacker News
TopNewBestAskShowJobs

xenomachina

471 karma · joined April 15, 2010

submissionscomments
xenomachina··on The Big TDD Misunderstanding (2022)
> I especially dont see what is gained by writing the test after.

I assume you mean versus writing it first, rather than versus not writing it at all.

I've found that TDD works well for bottom-up coding, but not so well for top-down.

With bottom up, I can write the test for a piece at the bottom, write the code to pass the test, and move on. With top-down, if I write the test first, it might be a long while before I have that top-level working, because the bottom bits don't exist yet.

When I feel it's better to write things top-down, I'll often use TDD for the bottom bits I need to write, but for the bits above that, I'll write the tests "on my way back up".

xenomachina··on Mali Government takes back .ml domain, brings down one of largest Lemmy servers
How?
xenomachina··on The hidden cost of gasoline
s/Below/Above/ ?
xenomachina··on Gitless: A simple VCS built on top of Git
Sure. My point was just that contrary to what programmers typically think, people don't use binary search to look up things in a dictionary.
xenomachina··on Show HN: Text a photo to send as a postcard
Or a web app?
xenomachina··on Gitless: A simple VCS built on top of Git
When people search through alphabetical listings, they usually don't use plain old binary search, but instead use something like interpolation search. For example, if you want to find the word "xylostroma” in the dictionary, you aren't going to start in the middle. Instead, you'll start about 90% of the way through, and then make adjustments based on how far off you were.
xenomachina··on Moving fast with the core Vim motions
About 20 years ago I had two computers at work: a Windows PC and a Sun workstation. I used Vim on both. I knew about the vi ]] command, and I'd learned some Vim script. I thought it would be great to have a key binding to take me to the innermost surrounding curly braces, so I wrote a vim script to do this. I picked ]} and [{ as the key bindings.

One day I used the key binding and then realized a few minutes that I hadn't installed the script on that computer yet. After some searching in :help I realized that I'd not only reimplemented a feature that already exists in vim, but I mapped it to the exact same keys.

xenomachina··on Ask HN: Best Bank for Startups? (US, 2023)
That's what comments in the other post said, but I don't know if there's new info in the last 3 years.

Looking at their site, the features sound good (though I'm not thrilled about Plaid integration, TBH). They aren't a real bank, though, from their own site:

> Mercury is a financial technology company, not a bank. Banking services provided by Choice Financial Group and Evolve Bank & Trust®; Members FDIC.

The page that links to, https://mercury.com/how-mercury-works, seems to suggest that by using "sweep networks", their clients are able to get even better than normal FDIC protection. Their FAQ also says "Mercury checking and savings deposits are FDIC-insured up to $1M. As a broader effort, we are working on expanding all coverage up to $4M. You can learn more about FDIC insurance through their own FAQ here."

The marketing copy sounds good, but I'm curious to know what others think about these claims.

xenomachina··on SVB in talks to sell itself after attempts to raise capital fail
One other thing in recent years: if you used Stripe Atlas to get incorporated, they made it very easy to get an SVB account.
xenomachina··on Idiot Proof Git
I agree with most of this, except:

> 5. When merge happens a dev's PR is squashed into one commit that gets appended to `main`

I don't know if GitHub supports this, but GitLab has a semi-linear history feature. When enabled, it won't let you merge unless a fast-forward merge is possible, but it never does a fast-forward merge.

This give you (IMHO) the best of both worlds: your history is pretty linear and easy to reason about. The "first parent" of each commit on the main branch is a linear chain of the main branch history. However, for more complex changes you don't have to squash. Those intermediate commits will be on the second parent of merges, so they're easy to filter out:

    M─┐ [main] merge
    │ o commit
    M─┤ merge
    │ o commit
    M─┤ merge
    │ o commit
    │ o commit
    M─┤ merge
    │ o commit
> If you want interactive rebase then make 2 PRs.

What do you mean?

xenomachina··on Idiot Proof Git
> Yes, it can be annoying if your developers are committing nonsense, but then just tell them to not do that, or to rebase locally before pushing.

I'm pretty sure rebasing locally is exactly what the person you're arguing with is arguing for. The original comment in this thread was saying you should never rebase, always just merge.

xenomachina··on HDD Clicker – HDD Sound Simulator
Years ago, a friend and I talked about a similar idea. We called it a log file "audiolizer" (as opposed to visualizer). The idea is was you'd tail log files through it, and it would produce sound based on the log lines. The hope was that you'd learn what things should normally sound like, and if it started to sound "weird", you could investigate.
xenomachina··on Ted Nelson on What Modern Programmers Can Learn from the Past (2018)
Even C89 supports block-level variable declarations. I think many C programmers are unaware of this, though, and mistakenly think that declarations are function-level only.
xenomachina··on Ted Nelson on What Modern Programmers Can Learn from the Past (2018)
> In C, you used to have to declare all local variables at the top of the function rather than throughout the body.

This is true, but support for block-scoped (as opposed to function-scoped) variable declarations was added to C a long time ago. Every version of ANSI C supports them, and this stack exchange answer, https://softwareengineering.stackexchange.com/a/300274/19196, suggests that support was added to K&R C since at least 1978.

xenomachina··on Microsoft Windows is prohibited at Gitlab
There can be weird differences that show up on different operating systems, even with the same browser.

For example, we ran into a difference between Chrome on Linux vs Chrome on macOS where it turns out that on macOS, if you right-click on a link (to open a context menu) it selects the text of the link, while on Linux it does no such thing. Initially we'd tested on only one platform because we assumed they'd behave the same, and this difference resulted in buggy behavior on the untested platform.

xenomachina··on Ask HN: Who is hiring? (August 2022)
Niphtio | Senior Product Manager | Full Time | Remote (USA or Canada) | $130k - $175k USD (DOE)

The web is full of engaging and informative content, but staying organized and focused can be challenging. At Niphtio, our mission is to enable people to achieve their reading goals by providing our users with tools to keep track of content that's interesting to them on the web, while helping them feel in control, and without feeling overwhelmed or manipulated.

As our first dedicated Product Manager, we are looking for someone to seek, understand, and become the expert in the market segments where we can make the biggest impact and deliver experiences customers need. Your expertise will be used to influence strategy and execution, and you'll work with our cross-functional team to plan and deliver features that customers love. Our ideal candidate has a good sense of what's out there, what customers really want, and knows how to effectively communicate their ideas to an analytical audience.

We are an early-stage, self-funded start-up, founded by one of the creators of Google Reader. You'll have a creative, intelligent, and supportive group of people to help imagine ways to address user needs and measure outcomes. Our in-house designer will work with you to translate solutions into polished user experiences. Our experienced software development team will work with you to ensure that we address our users' needs in a reasonable amount of time.

For more information, and to apply:

https://nipht.io/careers/2022-product-manager?source=hn

xenomachina··on Emoji Kitchen
The pistol emoji originally looked like a real gun. I think only Windows had a fake looking gun (more of a ray gun than a water pistol) initially.

https://web.archive.org/web/20150625033351/https://unicode.o...

The change to a water pistol started with Apple in 2016, and then other companies followed:

https://blog.emojipedia.org/apple-and-the-gun-emoji/

xenomachina··on To download from Google Drive, you must enable third party cookies?
Yes, that's exactly what I mean by it not being useless. If everything is working perfectly, then perhaps ends up not doing anything, but it's good to have another line of defense for when things go wrong. It's the safety net for when someone messes up CSP.
xenomachina··on To download from Google Drive, you must enable third party cookies?
Using a separate domain for user generated content is usually done for security reasons. For example, if a user-generated chunk of JavaScript was executed from drive.google.com, then it could potentially gain access to your drive.google.com, or maybe even *.google.com, authentication cookies. Scripts running on an unrelated domain have no such access.

This usually isn't the only thing protecting against this, and is instead used as an additional safeguard.

I believe Google's use of this practice also predates widespread support of Content Security Policy, which isn't to say that this is a useless practice, but perhaps it isn't as important as it used to be.

xenomachina··on GitHub Copilot is generally available
Open source licenses aren't a free-for-all. Many have terms like GPL's copyleft/share-alike or the attribution requirements of many other licenses. If copilot was trained on such code, then it seems that it, and/or the code it generates, violates those licenses.
xenomachina··on Gitlab: “required pipeline” moved from Premium to Ultimate tier in version 15
Approval rules are also arguably a "compliance feature". If they moved those up to Ultimate, I think they'd be making Premium useless for many teams.
xenomachina··on The unreasonable effectiveness of f-strings and re.verbose
Python doesn't have regex literals.
xenomachina··on Instant Heatmap with pg_featureserv
Is the link wrong? The title of the linked post is "Instant Heatmap with pg_featureserv", and from a quick skim, I don't see how the HN title applies.
xenomachina··on How Swipe Typing Works
I still use Swype as well. I'd installed it from the Play store prior to it being discontinued.

It still works fine, but hasn't had any updates in 2 years. I've also noticed that if I open the Play store link (below) in incognito mode, it says "not found", but if I'm logged into my Google account, it brings up the app's info.

https://play.google.com/store/apps/details?id=com.nuance.swy...

I've tried switching to Gboard a number of times, but its swipe typing is way less accurate. Swype also has a bunch of gestures that are very convenient, like one to toggle the current word between UPPER, lower, and Title case, if you swipe from apostrophe to s, it'll insert "'s", and it's trivially easy to add new words to its dictionary. Overall, I'm not looking forward to when I eventually have to give up using Swype.

xenomachina··on Stephen E. Wilhite has died
It isn't uncommon for letters in an acronym to be pronounced differently from they are in the words they originated in. eg: laser, scuba, and NASA aren't pronounced "lah-seer", "scuh-bah", "nay-sah".
xenomachina··on Android 12 forces you to choose a default browser unless you disable Chrome
Two things the new system has broken for me:

1. Previously, installing a reddit app meant that it would become the default handler of reddit links. Worst case, I'd be prompted when I opened a reddit link, and I could choose the app I wanted, and say to use it every time or continue prompting.

In Android 12, I have to go to settings and preemptively check a checkbox for every kind of url my reddit app can handle. Worse, every time my reddit app updates, these settings seem to get reset, and I have to go back and fix them.

2. It used to be possible to register an app with a file type. For example, MX Player registers itself with video file types. Firefox even has some special support for this, so if you're on a page with an embedded video, you can long press on the video and select "Open in external app". Prior to Android 12 this would give you a chooser, and you could select an installed video player.

In Android 12, it just takes you straight to the default browser. It is no longer possible to register a default handler by file type.

> I have to say that this permission-style model is an improvement IMO.

What does the new system make better? All it does is remove user choice. If I wanted a walled garden I'd use iOS.

xenomachina··on What things cost in Ancient Rome (2007)
Immediately after:

> As a final measure, if a seller refused to sell his goods at the stated price, the penalty was death.

So if you have something you don't want to sell, too bad? But then there's a simple loophole, too: once you've sold the thing, you can buy it back for the same price, and the original buyer, now the seller, can't refuse.

xenomachina··on Why does Google use location for language rather than browser settings?
I worked at Google in 2000, and I found this annoying too, so I asked about it. The official reason was that a lot of browsers defaulted to en-US, so Google effectively treats an Accept-Language of en-US as a no-op, and then it falls through to location-based. (I don't agree with this rationale, and said as much, but there you have it.)

Note that other values for Accept-Language are not ignored. I haven't tried it myself, but I've heard some people say that setting their language to en-GB or en-CA works well.

You can also use &hl=en-US, which always takes precedence.

xenomachina··on The Perils of RSS
There are at least a couple of ways of indicating that an entry should be deleted in RSS and Atom, but they don't seem to be well-supported.

This blog post mentions a couple: https://oleb.net/blog/2015/11/rss-feed-item-deletions/

I vaguely recall that Microsoft also had some proposed mechanism, but I can no longer find any trace of it. I doubt anything supports it.

xenomachina··on How can we know if paid search advertising works?
> Its an auction selling space on page for a supplier to provide their own textual content.

Are you referring to the things that say "Ad" next to them on Google's search result pages? If so... those are ads.

Page 1 of 7Next →