PSA for anyone playing around with that haveibeenpwned file: the text list is 30 GB after un7zipping but every line is padded with many trailing spaces (up to 61 chars I think, making all lines equal in length) and the line endings are the Windows ones (\r\n, instead of just a \n). With trailing spaces and \rs stripped the file is 'just' 21 GB and fits onto a RAM disk on a 32 GB machine with no swapping.
This has bit me because I was playing with that file and to save space and fit it onto a RAM disk (to save time) I've converted it to binary and then when converting it back it had a different hash despite being 'exactly the same', only later I've realized it's using Windows line endings and trailing spaces padding (and that I didn't even have to bother with binary, since 21 GB comfortably fits in a RAM disk on a machine with 32 GB RAM while 30 GB didn't with browser, Windows, etc. running).
Troy said it's a quirk of the export, might be fixed in next version of the file but doesn't matter for the compressed 7z size (which is true, I've checked personally with 7z going at it for hours and it really did compress those line endings and spaces down to nothing).
Edit: Also see my other comment about how very overly eager at rejecting passwords this filter might be (unless I've made an error in my reasoning that someone has since pointed out): https://news.ycombinator.com/item?id=17323068
I've reported someone leaking Polish court documents of an ongoing case on Facebook - nothing happened.
I've reported a YouTube video praising Anders Breivik as an European hero defending whites from Marxists, Leftists and Muslims - it's still up.
I've created a Twitter account and it got instantly locked for being 'suspicious' or 'automated' (but of course giving them my phone number would fix it instantly) - https://news.ycombinator.com/item?id=17014511
This doesn't mean Facebook should get a free pass. If anything it should get less of a pass because governments love to use the hands of corporations to do what they do (e.g. Hollywood blacklists of communists back in the day, dipping into Facebook's or Google's data stash with a warrant, etc.).
At this point private corporations 'helping' the government is exactly the worrying part because the government at least has some decorum and is keeping up some pretenses and you have to really be in the wrong place, at the wrong time and have an ethnicity that somewhat matches the supposed crime.
Meanwhile with corporations it's starting to look like a free for all between machine learning, big data, hidden internal Terms of Service kangaroo courts and so on. You can get blacklisted, flagged, (shadow)banned and not even know it. And then government or other corporation buys that Big Data DB and real fun starts.
If the government actually wants to capitalize on the data it has there is a lot of instant red tape applied. You can't just get arrested, told you're a terrorist and put in jail for 10 years with 0 process, 0 appeal and 0 documents (well, except with Gitmo but it's a special case).
Meanwhile the corporations can turn you into a functional half-leper in the modern increasingly online society and deny you business arbitrarily (or even secretly) as hell because their deep learning said so (and what they feed in there, what comes out, who made it and how - you don't get to know that), they don't care enough to admit a mistake and the most appeal opportunity you get is customer support ran by lobotomy patients. There's 0 recourse to being shadowbanned, hellbanned, blacklisted, whatever, sometimes even 0 contact option other than making a new account (which breaks their ToS in itself) and unlike the government that has watchful eyes on it from all sides for abuses you'll be told it's "a private business so they can do anything" or that you deserved it because it's a Cool and Good Company.
There was a story that some Palestinian guy got arrested because Facebook translated his "good morning" in some Arabic dialect into "attack them"[0]. If it wasn't the Israeli police arresting him but instead Facebook doing some deep mind big data crap and covertly flagging him as a potential terrorist then he might have found out 5 or 10 years from now that he can't get a plane ticket because some airline or other secretly sourced Facebook's DB and he has no way to even find out where that flagging came from because corporations are free to be secretive in their decision making.
Government also follows some logic (simplistic, biased, populist, racist or reductionist - sure, but still), while corporations can just spit out a verdict with 0 explanations with a link to 20 page ToS written in pseudo-lawyer pseudo-English and say that a video making fun of a mass shooter is suitable for advertisers and one of eating a carrot in a silly hat or swinging a banana around (it's not an euphemism, I mean an actual banana) is not[1].
> I really do not understand why 'single header' is considered a good thing, but I see this more and more often on libraries. What is the reason all the code is put in the header file?
With:
> I have mostly seen it done by (young) people who come from web dev. They bring their bad habits together with them. And they usually don't get a very warm welcome for that. (...)
And now you ask why I've listed all these libraries to prove otherwise? This is what I'm disproving with this list of old, experienced, non web devs writing good libraries that are well received and reliable.
You can't make a sweeping statement about an entire paradigm of writing libraries and then claim you just happened to ignore all of the facts that contradicted it like existence of SQLite, STB and the entire gamedev industry. Your logic is on the level of saying that "most nuclear power plants go boom" and claiming you just don't care about any except Chernobyl personally.
Where are your examples of these bad libraries made by young web devs that are not well received? Between few examples I gave you should have at least 10 by now but instead you tell me that some people learn C because it's 'hardcore' and that new C programmers struggle with C linking (both of which are obvious facts to any C or C++ programmer).
And there's nothing special with single file libraries about avoiding building or lack of updates, people can (and do) dump entire source trees into their projects to avoid having to build a separate library and it works just as well most of the time. People also do things like ship prebuilt binaries (especially C ones, which have a very stable ABI even on Windows, unlike C++) with their C or C++ project which is just as bad from the update standpoint as embedded source is or it's even worse since it tasks anyone trying to replace these with finding out how to build that library (which between CMake, premake, Scons, even changing compiler defaults - which once bit me when building a project with GCC - and God knows what else might be quite an adventure compared to just dumping the source into the project itself and rebuilding that).
I have not heard this 'criticism' ever before and it's absolutely ridiculous on so many levels to me as a person tangentially interested in gamedev, C, C++, runtimes, system programming, retro stuff, history of gaemdev, etc.
1. Why would a web dev suddenly decide to write in such a spartan way an algorithm heavy library in C or C++? This makes no sense except to somehow tie modern web dev failures like left pad with this style of libraries to portray them in negative light...
2. In gamedev neat organization is/was not some golden long standing standard, i.e. in comments under[0] you can find information that with 3D graphics it was customary to use a single file to let the early compilers do a better job since they didn't optimize across translation units and many old codebases have no problem with thousands of lines of spaghetti per file.
3. These libraries are meant to be compiled once ever per project (except when you clean out all your object files) with a define in a single source file (which any modern compiler should handle), otherwise most of their text is thrown away in a single ifdef which should be trivial and speedy on a modern compiler. The resulting header shouldn't be a problem for any modern compiler and is as light or lighter than an entire include tree would be. Most of these libraries are also single purpose and have very small API and C is light compared to template heavy C++ anyway. If you develop such a library you can keep it split up and ship merged files, i.e. SQLite does that. If anything this might speed up the execution (optimization in single TU), compilation (a single TU for entire library) and linking (no dynamic nor static linking but a single object) but to me that tangential compared to convenience itself.
4. I've never seen such libraries to have been badly received - quite the contrary, SQLite might be the most widely deployed piece of software actually and it's recommended consumable form is a single pair of files (plus an ext file, for a total or 3 in the official 'amalgamation').
5. I've personally yet to see a 'young web dev' create such a library. If anything it's the grizzled veterans of gamedev, runtimes, compression, middelware, cross platformness, systems programming, people with university education that includes CS heavy stuff, etc.
Libraries I use or like that use this (single file or single header + source) style are:
- very popular PD libraries by Sean T Barret, thanked in this linked repo's README. He arguably popularized this style, maintains a list of such libraries and has a FAQ and a guide about this style of libraries. He is over 50 (or maybe over 60, he was a teen in the 80s), is a gamedev veteran with software and hardware graphics and runtimes - Thief 1, Iggy (Flash runtime) at RAD, etc. His website is also hardly something that a modern web dev would make[1].
- pugixml by Arseny Kapoulkine - gamedev veteran: PS3, physics, rendering, etc. not a web dev, not young (definitely over 30, unless you happen to redefine young to 'under 40' which makes 0 sense in industry as young as ours but considering your other claims is totally likely).
- SQLite which is shipped and recommended to be used like that (and I think Python embedds it like that) - D. Richard Hipp, Tcl, over 50 now, total veteran of world class between Fossil, Tcl, SQLite, etc., educated and programming since 90s, his personal website is also hardly modern web dev.
- ClipperLib by Angus Johnson, a hardcore clipping 2D library, it has single/two file versions in C#, Delphi and C++ (are these the languages young web devs know well now too?) - another person who was a programme rin the 90s and is from very Enterprise-y background (Delphi Object Pascal, yikes), not a web dev, nor with a web dev worthy web page[3] (I don't mind it, I even find it nice to look at, but it's another hint of the lack of supposed web dev blood in him).
Honorable mentions are the two people related to imgui concepts and also thanked in this linked repo's README:
- Casey Muratori - programmer in the 90s already, over 30 or 40 years old, another (along STB) RAD tools related person, worked on Granny (animation for games) and Bink (video compression for games), total veteran in low level stuff, not a young web dev.
- Omar Cornut - maker of Dear IMGUI, was an intern in the 90s, has a very non web dev website[4].
All in all I'm truly baffled about where you got the 'mostly young people who come from web dev' bit, especially since it's no secret many people are inspired to write them by STB himself (and mention that in their READMEs, as seen here) who is none of that. Your comment seems very hearsay, dishonest disingenuous.
If anything I feel like this is a set up of a Yerevan (communist, post communist, Eastern Europe, Eastern Bloc, [5], etc.) joke I happen to know in Polish (translation mine): "Dear Radio Yerevan, is it true they give out free cars on the Red Square in Moscow?" - "That's mostly true but it's bikes, not cars, they are stolen, not given out, and not in the Red Square in Moscow but in the Prague district of Warsaw".
He is REALLY good at it for a foreigner. It's 100% understandable (both content as a whole and every single word on its own) but it still sounds clearly off (a bit too soft and very American, Polish accents vary a lot in places but no native Polish speaker has one like his) and he makes some mistakes with conjugations and weird phrasing that no Pole would use.
[0] - American ambassador to Poland at the time who also says he has no Polish ancestry so I assume he learned via this American program at the minimum (plus his own practice in Poland).
A devil's advocate is not an annoying person but someone who argues against something he truly believes in or hopes to be true in order to provide a debate and help prove the point in stronger ways and show onlookers that contrary opinions were considered.
It comes from canonization process in Vatican where someone (who is not an actual satan worshiper or against the church) argued in favor of the devil (against the candidate) to force the other pro-sainthood side to provide good solid proof of the sainthood, miracles done, etc. of the candidate.
What you're doing is just being annoying by nitpicking the casual wording. There is no debate to be had from "parentheses are kinda operators" and the meaning of the original line was understandable, even if you consider parentheses operators.
I wouldn't call it 'not in development' and even if, then 5.1 is a fine version of Lua and LuaJIT is battle tested very well and rock solid still. Changes in Lua 5.2 and 5.3 are breaking (and some are deep, like the ints, bit ops, function environments) but most of 'usual' code is compatible between 5.1, 5.2 and 5.3.
I learned Lua 5.2 and then went back to 5.1 when 5.3 came out because I didn't like the int stuff in 5.3 and didn't want to use an obsolete version (5.2) with no upsides (5.1 has the upside of being compatible with LuaJIT).
I like the article and the tricks. I recall seeing a presentation by a game developer who mentioned something similar, something about intermixing actual data pages with something else (read only ones or even unusable ones?) to trigger an error in case of an out of bounds read/write that was far enough (which apparently happened often enough for this to be helpful).
The address space is not actually 64 bit and it's not just the OS limiting it. The CPU/MMU/IDK (I'm not low level enough to get all this stuff) does too in some ways. I assume these values mean that I can have 2^39 bytes of actual RAM and 2^48 bytes of virtual address space:
This also came up back when I was looking through PUC Lua 5.1 code for a paper and (out of curiosity) looking into code of PUC 5.2 and 5.3 to see the changes and into code of LuaJIT for comparison.
This reminds me I should probably do my write up of how PUC Lua 5.1 VM works and implements it's features in English finally. If someone's interested in any way I'd appreciate dropping me a word to let me know that there's market for that so I don't fear that I will be writing down stuff I already grok for no one to read and benefit from.
My first language in high school was actually Pascal (as in - Delphi) but now I love C, C++, Lua and Python and barely can write Pascal at all, especially since it's so separate from the C inspired syntaxes and semantics. For job reasons I'll also probably learn something 'proper', mainstream, industrial, etc., but not relearn Pascal. But for trolling, having fun or some private GUI work (especially that, thanks to Lazarus) it's just great.
When I got to university they (the university, not the high school, no idea about them) dropped it from the curriculum so my Pascal skill makes me quite unique in that sense.
I only used it once or so during university to troll one doctor leading a class, an old homework grading system still had Pascal available in it in addition to C and C++ so I submitted a Pascal program. In a twist of irony the next class after that assignment was led by another person, a really smart professor who usually teaches in Warsaw who also happened to be quite a good sport about jokes and such, who quickly sarcastically remarked to my Pascal program: we've got a connaisseur in here.
And this whole joke was actually in response to story the person usually leading that class told, about how once during a competitive coding competition (allowing C, C++ and Pascal) where everyone was using C or C++ he was first to submit a correct program and it was in Pascal to which the live judges commented that Pascal is making a grand return, since even back then it was on its way out.
Recently I picked it up again when I needed to do something quite graphical for statistics class on a short notice that would be dealing with graphs and I didn't want to fight Qt, GTK+, HTML5 or whatever into submission and having recently discovered Lazarus I knew it can do it. I quickly whipped up the program, the graphing components were great with API and all but were poorly documented (or not at all). Sadly there were no funny comments from the doctor on that one.
Part of using Pascal for anything at all or even knowing it is actually the funny comments and reactions of others. Some people seem to think Pascal is properly dead, as in - no longer usable, no longer worked on, no longer coded in, at all. Like COBOL or something but with no 'old bank software' and such to save it. When looking for a job I actually even forgot to put Pascal on my CV as being one of my 'very weak' skills but I imagine it didn't hurt my chances... I even share the first name with Blaise Pascal (the French mathematician the language was named for) so that makes my use of Pascal even more appropriate and allows for even more jokes.
After that I also did few UVA[0] tasks but sadly Pascal seems to be broken for many tasks so I gave up (I get an error saying 'mv failed: program.pas and program.pas are the same file').
Later, to not waste and forget what I relearned for the graph program homework and since GUI in Lazarus is so easy to do, I also (shameless plug) wrote a notes program[1] for myself and it was a breeze thanks to Lazarus and the LCL components. Now I use that program daily for my various notes, todos, etc.
C++ with Doxygen and Java with Javadoc are much saner formats for this purpose.
What's even worse is that Visual Studio 2015 just vomits out that the XML is malformed when I have C++ headers with Doxygen style comments in them. It detects the three slashes and tries to apply C# XML docs parsing to them and that of course fails. Meanwhile NetBeans can handle them no problem and display parsed docs in pop ups.
It isn't legal but USA has an interesting (as in the curse "may you live in interesting times") legal system where this is rampant and no one will ever be punished for it.
Companies use it to hide criticism (VW with emission, game developers with reviews, etc.) and YouTube is full of whining on their idiotic quasi-DMCA process where companies can claim and then take down or monetize content they don't own (Kevin MacLeod's royalty free music, public domain music, static noise, game reviews that conain gameplay and are negative, etc.) and you have to dispute it and provide your real life details to Google as if they are a court to make it go away.
Some games on PS2 like Fatal Frame or Haunting Grounds are impressive even by today standards and could pass for double A games nowdays (entire 17 years later). That's just impressive. And their hardware specs read like a real spec for a gaming machine (the EE's 2 VPUs, the PSX in PS2 for compatibility, etc.), not just "bunch of PC CPUs and GPUs from AMD in a box + blueray drive". Ironically, first original XBox prototype was actually (I think or maybe its a rumor) made out of laptop components.
NES was a bit weak in comparison but very cheap (Pegasus costed like 50 PLN in the early 2000s).
Call me old fashioned or stupid (just not nostalgic, the best I ever owned was Pegasus, a hardware clone of a NES/Famicon) but whenever I see these issues with older Sony or Nintendo stuff I a in awe.
Today's consoles seem like repacked PCs with few changes but the older ones seem like actual dedicated gaming hardware, especially PS2 with Emotion Engine and PS1 as disk controller, what the hell (in a good way)?!
I've never seen Haskell people (I'm relatively fresh here, 2 weeks, as evident in my lack of fitting into echo chambers) and Haskell is entirely different beast so that's different, especially if they were okay with F#. Rust is pretty much claiming to be doing same stuff in same niche (efficient native code) as C and C++ except better, it's like reverse of Haskell vs. the world except F#, it's Rust vs. C and C++.
I wasted an hour and a half or even two here today as well, I at least got a reply from a Rust core team member who responded to me (yay), was nice enough and told me the community rules disallow wars, that's something I'd not get otherwise, but still, this feels very very unproductive in the end...
I'm an outsider and there is a war every damn time the word Rust comes up on HN. I've yet to see bashing any language to that degree in Erlang threads, Python threads, etc. Something has to be up with that.
I'm not using C and C++ professionally at all so the only place Rust has to fit in is fun or potential long term professional opportunity (assuming Rust is a fair bit more widespread than now by then, otherwise C and C++ win in the native field for employment opportunities), I'll not have fun (and I won't learn anything I don't immediately need that won't bring me fun) in a sea of vitriol against anyone who doesn't hate C and C++ so I'm happy Rust community guidelines forbid such idiocy in official spaces and documentation.
Rust is apparently targeting C and C++ devs but at the same time the ones that like it are going crazy and saying stuff about C and C++ being impossible languages (I agree they are by far the most spartan and hardest in the mainstream right now but not impossible as evidenced by lots of quite reliable software written in it, some that lives depend on).
The garbage I was referring to was in the comments "below". Namely: "Some people may reasonably, with some extreme care and diligence, maybe try to claim they can write safe and UB-free C code. If stars align properly" and "writing C++ code longer than a few lines without UB is humanly impossible", not the article, I quoted the latter shorter one in my original message.
I consider Java browser applets unsafe trash and I'd never run one I don't absolutely trust. This person has similar (or even worse) opinion of C and C++ languages but runs tons of software in them with seemingly no problems since his idiotic comment made it in here and arrived to me intact despite all the C and C++ software on the way from him to HN to me.
As someone who really likes C and C++ I feel like the biggest reason for me not even thinking of Rust as a viable language right now is the community attitude. It seems so damn hostile to C and C++. Anyone who thinks C and C++ is viable is a misguided idiot, bad programmer, writing unsafe software, etc. to these people.
Some badass below even just said that "writing C++ code longer than a few lines without UB is humanly impossible". Apparently all these FUBAR C/C++ systems (Linux and Windows kernels, all? web browsers, LLVM that the dear rust uses, device drivers, web servers, router software, VMs of Lua, Python, C#, Java, ..., etc.) work well enough to transfer that kind of garbage to me.
It's a bit like the decades old vim vs. emacs, C vs. C++, C++ vs. C# vs. Java, etc. feuds.
This has bit me because I was playing with that file and to save space and fit it onto a RAM disk (to save time) I've converted it to binary and then when converting it back it had a different hash despite being 'exactly the same', only later I've realized it's using Windows line endings and trailing spaces padding (and that I didn't even have to bother with binary, since 21 GB comfortably fits in a RAM disk on a machine with 32 GB RAM while 30 GB didn't with browser, Windows, etc. running).
Troy said it's a quirk of the export, might be fixed in next version of the file but doesn't matter for the compressed 7z size (which is true, I've checked personally with 7z going at it for hours and it really did compress those line endings and spaces down to nothing).
Edit: Also see my other comment about how very overly eager at rejecting passwords this filter might be (unless I've made an error in my reasoning that someone has since pointed out): https://news.ycombinator.com/item?id=17323068