HNHacker News
TopNewBestAskShowJobs

danneu

1,932 karma · joined February 2, 2011

submissionscomments
danneu··on GitHub Security Update: Reused Password Attack
You use the customer support backdoor.
danneu··on Show HN: Bot to steer discussions from Slack to Discourse
The tree structure is pretty useless and incomplete on a traditional forum. The only information you have is when the user explicitly opts in to a quote-reply.

Most replies are written in the quick-reply box (no parent) because they are responding to what is being said in the last X posts. Assuming orphan posts are top-level replies to the topic is nonsensical, and you can verify this by toggling on threaded-view on forums that support it.

The next best thing is to just link the upstream post from a post that quoted/replied to another, which is what Discourse and traditional forums already do.

danneu··on Show HN: Bot to steer discussions from Slack to Discourse
Meanwhile you can't have deep discussion on Reddit or HN. When a new submission is made, the peanut gallery storms the top-level. Then a little bit of discussion nests a few levels, but it's pretty much a one-on-one discussion due to the nesting. And since topics can't be bumped, the discussion is ephemeral. And if you have something to say on a topic that's more than 24 hours old, then only the person you're replying to will see it.

Traditional forums have other issues, but longform discussion among multiple people over periods of time is possible.

danneu··on MongoDB queries don’t always return all matching documents
You can normalize data in Mongo and replicate relational database features in your application layer.

I'm just curious how that's an upside to using a relational database from the beginning when your plan is to migrate to a relational database anyways.

Switch out "Mongo" for "Postgres" in your bulk paragraph and you have the same scenario but with less work on your part and more features to help establish your data model.

One upside I can see if it you're more familiar with Mongo where using a relational database slows you down.

danneu··on MongoDB queries don’t always return all matching documents
Meanwhile, normalized data is what gives me so much flexibility when using Postgres at the start of an app. I just store my data as generically as possible and usually all I need to change under churn is the queries.

Denormalizing on day 1 (Mongo) has you making guesses about your data access patterns at the worst possible time instead of just thinking about the data itself.

danneu··on Integrating Elm and Phoenix Channels via Elm-Phoenix-socket
http://package.elm-lang.org's source code is online and implemented in Elm. Not a large application, but it demonstrates a way to break up components like the header, sidebar, and a main content area across files. It's maintained by Elm's creator and stays up to date with Elm upgrades.

https://github.com/elm-lang/package.elm-lang.org/tree/master...

danneu··on Facebook disabling messaging in its mobile web app to push people to Messenger
I'm sure if I fussed enough, I could get a handful of my friends to use some app I was fixated on, just for me, and they'd do it just to avoid stressing our friendship to its end as I drone on and on about privacy and encryption and sheeple.
danneu··on The impossible task of creating a “best VPNs” list
If almost all of your Tor traffic is abuse, exposing it to your users to vote on doesn't solve the problem, it just gives them a worse experience.

Obviously every service has different trade-offs to consider, which is why "Tor traffic is always worth it" is HN comment idealism.

danneu··on Show HN: Reactpack – one command to build your React front end
I don't think you're reading the situation accurately. Debating and improving our development tools is a sport across the entire field of programming.

The status quo already is to keep on using what we're using. That doesn't need to be said. But if it wasn't for our endless search for nirvana, people would be stuck on Vim and 4-space tabs.

No developer left behind.

danneu··on Async and Await
Most examples of callback hell on blogs and forum comments are just linear pyramids where each callback neatly waterfalls into the next. They are manageable but ugly which I think is why it's common to dismiss promises/await as cosmetic.

In practice, callbacks become a problem when you need conditional async logic. Like if you have your simple callback pyramid but want to fork the chain at some level and merge it back at the end.

What would've been a basic if-condition with promises/await is often an invasive change with callbacks where your only tool is to extract and rewrite logic into helper functions. A simple conceptual change easily blossoms into heavy indirection where taming the complexity becomes an engineering feat.

At the end of the day, we all have different appetites for trade-offs.

danneu··on Drop jQuery as a dependency from Rails
"There is nothing so permanent as a temporary solution"
danneu··on Voxel art
Might as well say "because I watch Netflix, what I make would not turn out so pretty".
danneu··on WebGazer.js: Eye Tracking on the Browser
You need to click.

Open the game and follow the mouse with your eyes while you click each 8-directional edge of the game's viewport and then click the center.

Now you can let go of the mouse (don't need to move it out of the game) and the game should follow your gaze.

This demo is impressive. It's accurate enough for me to isolate the orange ball from the cluster.

On a website, the calibration could be done in a modal overlay. "Look at this dot while clicking it wherever it appears". After then Nth click, the modal goes away and the user lands on the website ready to gaze.

danneu··on WebGazer.js: Eye Tracking on the Browser
Maybe it could be used for modal keybindings if your gaze changes modes e.g. focus between the panes of an IDE. hjkl moves the cursor when looking at the code, but it traverses the file hierarchy when looking at the sidebar, and enumerates tabs when looking at widgets.

Kind of like how keys are reused in Vim yet have similar meanings across each mode. You don't have to remember so many unique keybindings.

Some editors let you switch between panes with keybindings, but once you have more than a few or some in weird shapes, you end up needing tmux's `C-b q` pane selector. Seems like gaze could replace most of that.

danneu··on In a Room with Radiohead

    > Do adolescents today have this kind of relationship with bands?
The big difference is that CDs would cost $15 a pop. $15 being the perfect price point for me, as an incomeless preteen, to get just one CD for my birthday and maybe one in my Christmas stocking. And then I'd be stuck with those CDs for a year. Or stuck with the one CD I had loaded in my portable player during school or family road trip or furniture store excursion.

I was stuck with Radiohead for a long time. I remember I'd get so tired of listening to a CD that I would pull the headphone jack a millimeter out of the slot. It had the effect of muting the bass frequencies and sound terrible, but it sounded different. Breathed new life into my meager CD collection when I discovered that lifehack one day in sex ed.

I happily upgraded out of the CD era as quickly as I could, but I can look back and appreciate how well it forced me to get to know the few artists I had in my collection. Though it also came with a certain destitution of choice.

danneu··on Reverse Engineering a Mysterious UDP Stream in My Hotel
If I throw a banana peel on the ground like the prankster I am, my expectation isn't that everyone is going to slip on it. Most people won't, but I might prank someone if I'm lucky.

Spare us next time, please.

danneu··on Forbes Tests New Tactics to Combat Ad Blocking
Of course ads are a good business model for journalism.

The dying business model is easily-detectable, obvious ads that can get defeated by NoScript or a regular expression.

danneu··on Swift 3.0 Release Process
I've seen ++i vs i++ cause so many bugs that whenever I see it, I stop to ponder if the author got it right. It's like in Javascript where I stop to check if the author intended for `if (x)` to take the false path if x is "" and 0.

It's death by a thousand papercuts for my mental load.

danneu··on After a year of using Node.js in production
I reckon it's common for Heroku apps to be deployed as one process per dyno.
danneu··on GitHub has 11,995,200 open issues
That makes sense for endpoints like /admin, but it's more confusing than it's worth for users when the endpoint is otherwise rather public. Well, just see this comment thread.

As an example, in this case with the /issues page, redirecting to `/login?redirect-to=/issues` would be more user-friendly since it signals that the page exists but you must authenticate.

danneu··on Show HN: I made an interactive Bootstrap 4 cheat sheet
So basically not issues with Bootstrap, but an avenue for people on the internet to feel superior to a group that I'm not even all that convinced exists in any real quantity.

The problem with Clojure is those developers that just copy and paste code off Stack Overflow. Clojure is just so darn composable that it probably really causes problems for people out there with those copy-cats on the loose!

danneu··on Apple rolls out a new App Store developer site
Yeah, reads like the guidelines I would've written when I was a 17-year-old forum moderator.
danneu··on Clojure, the Good Parts
Compojure is pretty standard for routing on top of the simple Ring abstraction.

I start projects with the template:

    lein new compojure my-app
Ring quickstart: https://github.com/ring-clojure/ring/wiki

Ring API docs: http://ring-clojure.github.io/ring/

danneu··on Pagination with rel=“next” and rel=“prev” (2011)
OFFSET is not "handled by the engine". It heapsorts the entire dataset before you offset to a page.

The top-level comment is asking for good ways to paginate. OFFSET works on localhost and with hundreds of rows. My solution is one that works in production once OFFSET fails you. For me, it was day 2.

danneu··on Pagination with rel=“next” and rel=“prev” (2011)
The downside is that OFFSET is slow if you have a lot of items, like on a forum.

At which point you could assign each post in a topic an indexed `position` column that always increases from 0 within that topic, which lets you jump to arbitrary pages and parameterize perPage.

    fromPos = (page - 1) * perPage
    
    SELECT *
    FROM posts
    WHERE topic_id = $1
      AND position >= fromPos
      AND position < fromPos + perPage
    ORDER BY id
For simpler needs, your "Next" button could load items that come after the last ID on the current page but with a LIMIT.

    <ul>
      {% for item in items %}
        <li>{{ item }}</li>
      {% endfor %}
    </ul>

    <a href="/items?afterId={{ items[items.length - 1].id }}">Next</a>

    SELECT *
    FROM items
    WHERE id > $afterId
    LIMIT $perPage
That's fast and really easy.
danneu··on Gone in Six Characters: Short URLs Considered Harmful for Cloud Services
I'll use the shortened Google Maps link over the full URL param mess every single time. Why wouldn't I, article aside?

And bit.ly gives you analytics. That's their service.

danneu··on Visual Studio Code 1.0
Then you have people like me that use so many different editors because I'm burned out on learning to use new software.

For a task I'll use whichever editor needs to least amount of learning, re-learning, and fiddling.

It amazes me that there was a time where I learned Emacs just for Clojure.

danneu··on Facebook Messenger Platform
You don't see the difference between this and hanging around with a phone to your ear listening to an audio user-interface synchronously waiting until it's ready for you to input commands with your numpad?
danneu··on It's time to dispel the myths about nuclear power
Well, that's not by all accounts. That's by one account: direct deaths, which isn't the worst part of a nuclear catastrophe.

Only 31 people died during the Chernobyl meltdown, according to its wiki page.

The nice thing about an earthquake or tsunami is that they kill and then go away.

danneu··on Semicolons matter
Yes, at which point the prefixes are easier to notice when they are missing.

http://blog.izs.me/post/2353458699/an-open-letter-to-javascr...

Either way, no matter your preference, the issue is resolved by having a linter, not by scrutinizing your code for missing semicolons. The OP post feels very dated.

← PreviousPage 4 of 26Next →