HNHacker News
TopNewBestAskShowJobs

efaref

1,217 karma · joined July 16, 2014

submissionscomments
efaref··on Japanese Government Workers Wary of My Number Cards as ID
> “There should be no worries about personal information being leaked,”

This always makes me more worried about personal information being leaked, as it implies they haven't considered the possibility carefully enough.

efaref··on Ad Blockers Will Change How Ads Are Sold
I was with some friends travelling to central London recently, and we exited the tube system at Tottenham Court Road station. This station is currently undergoing refurbishment as part of the new Crossrail extension, and you now leave through a recently constructed exit.

On the way up the escalators, we all commented to each other how the station felt considerably different to other tube stations. It felt better, nicer, more pleasant. This was strange, as the fit and finish is no different to other new tube stations. Eventually one of my friends realised the difference: there was no advertising.

I think we underestimate the mental load that advertising clutter causes us, even when it's merely in the background. We're so used to it that it's not until it's gone that we realise how burdensome it actually is.

efaref··on We can't see our culture very well, because we see with it
Like how we never notice air.

Oh wait...

efaref··on The Case Against the Universal Basic Income
You're right to be unsure of (1); it is often claimed and simply isn't true. Of the top thirty jobs in the United States, 29 existed in some form or another 300 years ago. Only number thirty (computer programmer) is new.

I've linked https://www.youtube.com/watch?v=7Pq-S557XQU many times and I'll do it again.

Recently I've been coming to the conclusion that whilst free market capitalism deals very well with a fairish distribution of scarce resources, it doesn't deal very well with abundance (or rather, it deals ruthlessly with it - the price drops to near zero). We're facing an abundance of labour, and I don't think things are going to end well if the market rate for that ends up so low that labourers can't eat.

efaref··on 80x40
I thought punchcards were 80x1. This is a stack of 40 cards.
efaref··on The Nightmare of Replacing a Battery on a Mac Laptop
If you try to please everyone, you'll please no-one. Most people, certainly most Apple customers, don't care that the battery is not replaceable. In fact, it works in their favour as they can use the failing battery as justification for getting a shiny new MacBook Pro in a few years' time.
efaref··on Morocco poised to become a solar superpower with launch of desert mega-project
It's also a massive producer of greenhouse gasses.

https://www.newscientist.com/article/dn7046-hydroelectric-po...

efaref··on Environment Variables and Path in Windows 10
> ... I have extra layer of shell ...

Fix that by running:

    $ exec /bin/bash -l
instead.
efaref··on A small British firm shows that software bugs aren't inevitable (2005)
> In a language that lacks maybes, but has nulls, what is the equivalent of the type Maybe (Maybe Int)?

    int **
> Even ignoring the lack of composability, flatMap is an operation on a broad category of which Maybe is one example; that generality is a key part of its utility.

While it's certainly part of it, I would disagree that it's the key part. The ?. operator is flatMap in the context of Maybes, and Maybes alone are useful for preventing a class of bug (NullPointerExceptions) even without the rest of Monadkind.

> ?. is a special-case operation on nullables, if you want to use it on any of the other things that flatMap works on (e.g., lists), you need a different operation, so you can't build generic algorithms.

Being able to use generic algorithms like sort() on Maybes-as-collections-of-arity-[0,1], while very cute, isn't actually that useful in real code. Particularly real C# or Java code.

Don't get me wrong, I've written code in Scala, and I love the generality of Maybe and related collection types, even though I have hit some interesting issues where I've needed to call .toSeq on my Maybe in order to get the right thing to happen, because they're not quite equivalent. But being pragmatic, and given that C# (and Java) don't have proper Monadic Maybe, and are unlikely to ever get them, I'd quite like the ?. and ?? operators, please.

efaref··on A small British firm shows that software bugs aren't inevitable (2005)
With nicer syntax, nulls are equivalent to Maybe types. Recent C# for example has the ?. and ?? operators, which are flatMap and orElse.
efaref··on A small British firm shows that software bugs aren't inevitable (2005)
Interesting. The bug in the proof is in the assumption that ints contain any integer and addition operates the same in normal mathematics, when in fact they're the set of values in [INT_MIN, INT_MAX] and addition has overflow behaviour.

Arguably addition (or any operation) that overflows with signed integers ought to cause some kind of SignedIntegerOverflow exception. If you want to do modulo mathematics in the set of [0, 2^n) then you should explictly use unsigned integers, which are defined to work that way.

efaref··on Convicted by Code: Defendants should be able to inspect code used in forensics
Scams like this absolutely do happen, with potentially deadly consequences.

http://www.bbc.co.uk/news/uk-29459896

efaref··on Linux kernel dev Sarah Sharp quits
So it boils down to "I'm incapable of controlling how I react to you, so I want you to control how you react to {me, other people}."

It's just selfish and rude, and yet Linus is called that when when calls these people out.

efaref··on Whence function notation?
Interesting that the two operators that aren't associative are the two that you don't typically write as operators in mathematics.
efaref··on “On Accident” or “By Accident”?
It sounds like old-style BASIC exception handling.

    ON ACCIDENT GOTO EMERGENCYROOM
efaref··on The HTTP/2 implementation
Hmmm...

http://imgur.com/WyjSpBK

I'm probably an outlier.

efaref··on Joint Allocations in C++
Rather than two pointers I would probably have pointer + len. Storing the length of your arbitrary memory block is no bad thing, imo.

In any case, having a sensible copy constructor on the memory_block (and any necessary associated data) would at least make the copy constructors in the client classes (assuming you have more than one user of this pattern) cleaner.

It's a really good pattern, though. Excellent blog post.

efaref··on Joint Allocations in C++
The number of errors there is frightening. I only noticed the use of void-pointer arithmetic and lack of alignment processing.

I would say the code doesn't go far enough. Instead of using `std::unique_ptr<char[]>`, it should define some kind of memory_block abstraction (using `unique_ptr` internally), where the copy constructor and `operator=` both do a byte-wise copy of the data. Then alongside `make_contiguous`, you would have an analogous `copy_contiguous`, where the base case of `make_contiguous_helper` would instead call `memory_block.resize(total_size)` and the base case of `copy_contiguous_helper` would call memory_block = other_memory_block. This would remove the boiler-plate code for the copy constructor in Mesh, which can instead be:

    Mesh::Mesh(const Mesh& other)
      : memory_block(copy_contiguous(other.memory_block,
                                     positions, other.positions,
                                     indices, other.indices,
                                     vertices, other.vertices))
    {
    }
and similar for `operator=`.
efaref··on Is it just me or is networking really hard?
I would hardly call protocols like [SIP](https://www.ietf.org/rfc/rfc3261.txt) and [RTP](https://www.ietf.org/rfc/rfc3550.txt) "custom". There are many more standard protocols out there than just TCP and UDP. There's even a "better TCP" in the form of [SCTP](https://tools.ietf.org/rfc/rfc4960.txt).

The fact is that TCP was the MVP for reliable streams of data on the 1970s internet, and is woefully inadequate for modern usage, but we're stuck with it (including its oft-disabled parts like Nagle's Algorithm) because it's what's available everywhere.

Game network protocols are pretty easy in comparison with some of the protocols I've encountered in my day job, especially once you've learned the lessons of people like the author of that article.

efaref··on The Pixel Factory
But you only have to spend those 20 hours once.
efaref··on Entrepreneurs don’t have a gene for risk – they come from families with money
Agree. The risk of having to run back to mummy and daddy with their tail between their legs is no risk at all. I could be quite entrepreneurial if I didn't also have to pay for my apartment and food every month without fail.
efaref··on Bill Gates: Ctrl+Alt+Del was a mistake (2013)
Indeed, it was an important security feature. I think Bill is just saying that they should've got PC manfacturers to add a "Log On" key to the keyboard which they could've caught in the OS in the same way as Ctrl+Alt+Del.

I think the only other key that has this low-level trap feature is SysRq (usually Alt+PrintScreen), which, of course, Linux uses for [Magic SysRq](https://en.wikipedia.org/wiki/Magic_SysRq_key).

Now that I think of it, "Press 'System Request' to log on" has a nice ring to it. A shame it was it in the shifted position on IBM PC keyboards.

efaref··on Science vs. Engineering
Does that mean mad science is about 'why not'?

:)

efaref··on Science vs. Engineering
> If you invent a new need for people and fill it with a toy, that would be marketing.

Surely marketing is creating markets. You have a thing, and you make people want to buy it, thus creating a market. Marketing.

efaref··on Science vs. Engineering
"Computer science" courses are mostly misnamed. The research faculties they're located in are usually scientific (in that they concern research into computability and computation), however what undergraduate students mostly learn is the primitive form of engineering that we've gleaned from that science so far.

I have an MEng in Computing, because my alma mater is one of the few that realises the distinction.

efaref··on Science vs. Engineering
It's missing the engineer frame where he has the box open and the apparatus in pieces.
efaref··on How Google Sparsehash achieves two bits of overhead per entry using sparsetable
Surely that's 1 bit overhead per element or element slot (where if you're aiming for 50% occupancy means at least 2 bits per element).

Or are these magic bits where zeroes are free?

efaref··on Why do you not make the code available under a 'source code repository'?
The quality of their code looks pretty terrible too. For starters, just look at their genMakefiles script (something of a WTF itself - y u no configure?):

https://github.com/hackeron/live555/blob/master/genMakefiles

It should be more like:

    os=$1
    modules="liveMedia groupsock ..."
    
    for module in $modules
    do
      /bin/rm -f $module/Makefile
      cat $module/Makefile.head config.$os $module/Makefile.tail > $module/Makefile
      chmod a-w $module/Makefile
    done
efaref··on Why I dislike systemd
Reading a file is not even atomic - you can race with concurrent writes.

The only safe way to update a config file of a running service is with POSIX atomic rename, and most editors don't do that by default.

efaref··on Why I dislike systemd
I assume the next version of systemd will include git.

Actually, it's not that bad an idea:

    cd /home/efaref/config/servername
    vim blahd.service
    git commit -m "Update blahd service file to increase widget count"
    git push live master
Then have something else watching the master branch of the live repo do a git pull, systemctl daemon-reload. It doesn't even have to live on the same server. If one of the config files is a puppet script, you can maintain everything.
← PreviousPage 10 of 12Next →