HN user

bakhy

549 karma

https://github.com/jbakic

Posts15
Comments340
View on HN
Maybe Functions 2 years ago

This looks too easy, the first solution. If there is no logged on user, which User object is fetchUser going to return? Which friends? At the top level, if I were to forget to check if someone is logged in, who knows what would happen here.

I've worked on codebases where people were so allergic to the "billion dollar mistake" of nulls, that they created empty objects to return instead of returning null. This bit us in the ass a couple of times, e.g., when caller code was mistakenly passing the wrong ID variable into a fetch method, and just happily continued working and writing garbage into the DB, because it did not realize that its fetch had actually failed. It took data from the empty result object and happily continued its computation with it.

This is quite easy to reproduce. Wow.

IMO they should just remove the password generator feature. It's barely usable, and with this behavior it's just dangerous.

Why barely usable? Some really simple features are missing. I miss the ability to specify password requirements - for annoying sites which specify length, require so and so many these and those types of characters, or even forbid some types. And another one is that it's not possible to manually generate a password, not even in the password storage UI, when manually adding a new entry. So, if a site did not correctly declare a password field, which happens, you must generate a password yourself somehow.

Just BTW on the Netflix subtitles issue - I live in Germany, but I'm not German and generally prefer original audio on everything, typically with English subtitles. And some movies and series on Netflix will really only offer German subtitles, or, even worse, only German audio. No option to choose original.

All movies that have such limited audio/subtitle options, when I play them, start with a title card of a German distributor, so I would believe Netflix on that one.

Not only resets, you cannot activate the old way in the Settings anymore. It is hidden in about:config (set browser.download.improvements_to_download_panel to false), but even if you switch back to it, there's still changes that break things.

* With the about:config setting off, tabs that had PDF files from the internet open in them will now, when first loaded, suddenly show the popup. If you choose "Open in Firefox" there, the file gets downloaded to a temp folder, opened in a new tab for some reason, and the new tab's address is the temp file. So, after restarting the browser again, it's broken, because the temp file has been deleted.

* In the new mode (I switched back because of the above...), I have set ZIP files to "Ask me", and even if I pick "Open with ..." in the popup, it still downloads the file into the default downloads folder, instead of the temp folder. So now I have to clean that folder up regularly, I guess.

* Lots of people on connect.mozilla.org are complaining that the little Download Manager, the popup you get when clicking on the Downloads icon in the toolbar, now annoyingly always opens whenever you download any file.

The FAQ (https://support.mozilla.org/en-US/kb/manage-downloads-prefer...) about this also sounds kinda condescending:

I want to approve each download before it happens, is there still a way to do this? Firefox no longer shows the dialog because downloads are usually intentional. Having to click a second time for a download to start is usually unnecessary.

This is really irritating, I'm for the first time in a long while considering switching to Chrome.

There's a contradiction in the conclusion. Foucault was an academic philosopher, got a degree in philosophy, was awarded a doctorate, and is respected by many people who also got a lot of education in philosophy. So, how is more philosophy education supposed to have stopped him?

You're right, my mistake!

But it still should not be an issue, since according to what you quoted an acceptor will not reply to a second proposal that bears the same number ("If an acceptor receives... number n greater than...), which means only one of the two proposers can gather the required majority of promises to move to the next phase, and thus only one of the values can end up being accepted. After the crash you describe, there will be only one accepted value the Proposer-C will receive.

I think you're mistaken about the ability of 2 proposers to move to phase 2 - once an acceptor has agreed to a proposal with a certain seq number, it cannot just agree to another one with the same seq number. And that means only one of the two proposers can obtain the required majority of votes to start sending Accept messages, and thus only one of the two values can be accepted by any acceptor.

Maybe read the papers on Paxos, like the "Paxos Made Simple" one, it's not too big (though it's not all that simple either, at least to me...).

I've had lots of ideas like that, things I'd like to do which I never get around to. The one I did go through with and still keep working on it on and off is the one that had a connection to my job.

I worked on a very concurrent system and thought maybe STM would be a nice fit for it. I found the concept of STMs very interesting. And I noticed that, although there were many implementations for .NET, all were one-off projects, not maintained, and in my opinion not very nice to use. So I ended up writing one myself.

I guess that sweet spot for me was having a problem that I dealt with on a daily basis, which gave me the drive and a clear picture of what I'm trying to achieve, and the fact that it was a fun challenge to implement and a learning experience related to a concept that intrigued me. The other ideas I had would mostly have just that second part - they're fun, challenging, but not really solving something I deal with too often.

So, I don't have much experience, I don't have many side projects, but for what it's worth, my advice is to try to find something in your day-to-day which bugs you, and for which you have some interesting idea that you'd like to experiment with.

C# has LINQ. Implement Select and SelectMany extension methods for whatever you like, and you can use the LINQ syntax with your type just as easily as with IEnumerable. Foreach and async/await are baked in, that's true, but the LINQ syntax is easily extendable to new use cases.

I don't know if this works well on JS, but there is a purely functional way that avoids most of the performance hit - generator methods. In C#, I'd write functions that return IEnumerable<T>, using yield return, and others that combine them with LINQ's Concat, and aside from many iterator objects, only one big array would need to be allocated.

When it happens that parts of this work later turn out not to be needed, it's easy to discard an enumerable, and the iteration is not actually performed. It can sometimes lead to really ellegant code that also performs well.

I'm currently working on a side project, a distributed in-process key/value store for .NET Standard, which might be interesting in this context. I hope you'll pardon the shameless plug, but I'm interested in getting feedback. Particularly, what to focus on, what use cases, missing features... And of course, if you see any issues with the approach.

https://github.com/jbakic/Shielded.Gossip

It needs more work, but I think the eventually consistent part could already be useful for a simple distributed cache layer atop a classic relational DB.

I think I get it. With doubling, the sum of all the work done for resizing is roughly (written chonologically backwards): n/2 + n/4 + ... ~= n, and O(n) + O(n) is still O(n). Thanks!

This is what I'd do too, and it is quite strange that it was dismissed like that. Maybe because it's not as much fun :)

BTW I believe it may be a bit more than just O(n) time on the whole. If your hash-table is auto-growing, you'll have to pay for its resizing. And OTOH if it's sized up front, then you'll have to allocate something proportional to the size of the full array, not just to the number of distinct elements.

I was also wondering why simply opening curly braces after the => was not allowed. It would be consistent with lambda syntax generally.

This is a weird title. The article says that the people on basic income were equally likely to find a job as those who were not receiving it. I was expecting that basic income might make people less motivated to find jobs, and that would have been an issue. But this result seems like a positive outcome for UBI.

This is a bit off-topic, but on another occasion, Scott Hanselman infamously used the term "5:01 developers" targetted at many of the same people ;)

Did you check if the "nouveau" OSS Nvidia driver was still installed? Happened to me all the time, so I got used to always checking and removing it manually before letting him reboot.

Why always Peano numbers? If it's doable, I'd love to see something like a web server with provable safety guarantees (e.g. eliminating any SQL injection risk), or a concurrent system with the compiler proving there are no races, even though the code is sharing memory. Or just proving that some simple business rules hold. Is stuff like that doable in a dependently typed language?

Ok, I misunderstood. I agree with you. I think it's an interesting situation - the broader term is more relevant, but it's also less measurable. So we settle for what we can measure and kinda forget that it doesn't capture the full picture.

You are implying that conspiracy theorists are unintelligent. Though it is a very tempting assumption :) I don't know if it's fully warranted. From my experience, ignorance is more essential to conspiracy theory thinking. People lack the will and/or time to learn all they need to make sense of the world, so they fall prey to overly simple, manipulative stories. And furthermore, it is known that more intelligent people tend to be more naive... I'm not saying you're fully wrong, lack of intelligence can surely help, but I think on the whole it's more complicated than just a lack of intelligence.

...possibly negative for women.

I hope I won't be downvoted crazy for this, but wasn't feminism offered as an answer to this? Better educated women have a bit more trouble having babies and keeping their career, since lots of men find it offputting to be dependent on their wives, due to traditional gender roles. Some developed countries have experienced normalization of fertility rates, and I've heard that more gender equality was a possible good explanation for this - more women can have both the baby and the career... This would also fit with the phenomenon you describe, of educated men having more kids, but educated women having less.

Sounds like a really bad IQ test. I took a Mensa IQ test once, and all the questions were grids, 3x3, with various patterns in all cells except the lower right one, and 6 (I think) offered answer patterns. You pick the one that you think best fits into the overall pattern of the grid. Such a test seems much better to me, since it does not depend on what you know, though I guess even that might have some issues. Many popular IQ tests are really full of trick questions that mostly depend on whether you've seen the trick before...