skysight-inc/HackerNews huggingface dataset:
A few years ago I remember seeing strl* mentioned in a slide presentation for something that must have come from the oBSD camp.

Since then I thought, not knowing any amount of C, that strl* was part of the language and available to all.

Imagine if you will my confusion everytime I read people complaining about C being insecure.

Your comment corrected my perception of this.
Thank you.
By 'mistake' I am considering the context of the times in which C was developed. Most of the UBE in C is there because of (1) the cost of mitigating it and (2) specifying it would impede portability.

Buffer overflows are UBE, too. But the way I proposed the fix is a pretty much cost-free solution, and it's optional.

Redefining C so that struct padding is always 0'd is an expensive solution, and rarely needed.
Trivial doesn't mean it wasn't well thought out. On the contrary the more trivial the abstraction the more likely its more general, since it has less constraints.
It feels like decent VR has been 'any time now' away for decades. Is Oculus still the only real attempt at it these days?
> The proposal here is way too vague. And if you flesh it out, things start to fall apart

No, it's not, those ideas were implemented in practice in D and Rust, and there are no real issues with those. This feature could be easily implemented in C, there are no dependencies on features that C doesn't have.

> If nul-termination of strings is gone, does that mean that the fat pointers need to be three words long

No need to store the capacity. This is a slice, not a buffer. Go conflates those two for user's convenience, but this is not necessary, and in fact is waste of RAM - not an issue for Go, but it is an issue for C. For instance, `&str` in Rust is a pair of pointer to a string and its length and it works really well.

> If not, how do you manage to get string variable on the stack if its length might change? How does concatenation work such that you can avoid horrible performance (think Java's String vs. StringBuffer)?

Use your own slice buffer abstraction for that purpose. It can be implemented as a struct storing a slice and its capacity. Pass a pointer to slice buffer abstraction, if you want a function to be able to add elements to it. This is also how it works in Go, for that matter.

Slices don't define concatenation. This is C, not a high level programming language.

> Am I able to take the address of an element of an array?

Yes. `&a[3]`. It's still an array, it just knows its size.

> Will that be a fat pointer too?

No.

> How about a pointer to a sequence of elements?

Probably you could add some sort of a range access syntax. Say, something like `&a[1:3]`.

> Can I do arithmetic on these pointers?

I don't know whether pointer arithmetic should be allowed or not, but even if it shouldn't be, there is nothing to stop you from doing `&a[4]` as a replacement for `a + 4`.

> How would you write Quicksort? Heapsort?

The same way you would with a regular array. Think of it as a struct storing an array pointer and its length. If you prefer to working with pair of start/end pointers instead of pair of start and array size, then note that `end - start` is array length, so getting an end pointer is trivial.
Mind Illuminated by Culadasa has been recommended here before. It gives a path to advance and helped people with years of experience in meditation to become unstuck.
It's not just argument passing, though. You also want to be able to return slices, store them inside structs etc.
But uint8_t will most of the time be typedefed to unsigned char in stdint.h. So your code should be fine right now but may or may not become undefined in the future
The unfixed type sizes are mostly just a nuisance, though I've wasted a lot of time dealing with them.
We all know what "makes it bad". It's a symbol of wealth that isn't nearly as expensive as it looks.

That's what offends people here. Everything else is the best excuse they can come up with.

The issue is that with things that are truly expensive are equally bullshit. Art, for instance, is first of all, mostly not even made by the artist that signed it, secondly, it doesn't have a deeper meaning, thirdly, the difference between absurdly celebrated art (say Gogh, or Michelangelo) and the (many) works of unknown masters is ... tenuous at best. Same with diamonds and gold, as pointed out many times in the economic discussions.

Symbols of wealth that don't prove wealth ... people feel this is how they "prove" their own value, how they get respect, and so on. And if a symbol of wealth gets reliably faked ... people are very upset. In reality we should celebrate that this is possible, of course, but in practice people who have paid a lot fear it will destroy their self-worth.
> Do you pass their dimensions alongside pointer

That is literally the meaning of "fat pointer", and the linked article even explains it.
https://ost.com/ could of some interest to you...
As it will allow companies to create their own branded token and offer everything needed to manage it through a REST API, a wallet... They are currently on alpha phase III focusing on the wallet https://medium.com/ostdotcom/announcing-ost-kit-alpha-phase-...
http://libgen.io/search.php?req=Handbook+of+Neuroevolution+T...
Those functions have a separate length parameter. There is no way to mechanically check that the length argument accurately reflects the length of the string. It's not an effective solution.
Nobody's saying the systems we've inherited are optimal.

What we (all four--me, the comment I'm replying to, the Tyranny of Structureless essay, and the article about Valve) -- what we're saying is that "no system" is not an improvement.
Ask HN: Must-read books for a Software Engineering student in his early 20s?
Doesn't have necessarily to be tech related, I'm open to anything. Suggestions are very appreciated. :)
The novelty of eye-popping direct deposits has worn off; the rate at which I shovel money from venture capital to real estate brings me no particular joy. Maximizing income can only inch me closer to the quality of living situation I'd have elsewhere. The point at which I'd be done increasing housing budget, and actually free to increase other investments or luxury consumption, does not appear attainable. (Consider savings for a down payment as part of housing budget here. And if I could buy a starter home, my next priority would be fixing either the commute time or neighborhood safety compromise that made it a starter home).

I'm not sure why maximizing income in the Bay Area is worthwhile. The pay here, while much higher in nominal terms, seems to level off well below my level of comfort for standard of living (and my parents who got me accustomed to it were in much less lucrative fields).

I stay becuase I like the work and the company, because why not take this opportunity while I'm young? But it's an indulgent youthful adventure, not a sustainable long-term plan.
Real LSD is not that rare. You know, people can and many do have their stuff tested. There was a bit of a dry season in the early 2000s but not anymore. This is variation of the stupid old "clean" vs "dirty" acid myth.

Anyway, you're probably right in the sense that there are only a handful of original sources for it. But once you get the production going, you quickly end up with a crapload of doses.
I like to fix things. Why not share a simple and effective fix?
My reading of the disassembled code on page 7 is that the "end" opcode actually takes one byte, and isn't just a syntactic structure that the assembler removes. As if a Lisp VM had a close-paren instruction.

+003Eh: i32.eqz
+003Fh: if $3
+0041h: br $2​ (---> break out of $2 (BLOCK))
+0043h: end
+0044h: get_local $12

What's the purpose of having an "end" opcode? Is there no overhead at runtime because it evaporates when the code is compiled? It it to avoid having forward referencing offsets in the code? Is it just in there for verification purposes?

It's kind of like a "comefrom" opcode, a target that other opcodes jump to (or after)!
I am curious why you say cost-free.

Using std::vector/array/string::at would literally eliminate buffer overflows and yet programmers aren't generally using this style.

I would love it if I could prove to my colleagues that mandatory bounds-checking would not result in a noticeable performance loss, but my gut feeling is that it's not so. Interestingly Rust (and I guess D) does just that and seems to be getting away with it.

However, in the C UB thread the author of a Rust crate mentioned that a case for using unsafe is exactly this: avoiding the performance loss of bounds checking.
I wish this was satire
So what’s your point? That gives the right to the US government to attack countries at whim?

At the same time they block the UN in everything related to the oppression of Plestinians by Isreal and US puppet governments.

Like I said, let’s start with the biggest global terrorist - the US government that btw helped in the creation of ISIL. There is a nice analysis here: https://www.google.com/amp/s/www.washingtonpost.com/amphtml/...
The good doctor was spoofing that.
Pointer arithmetic is mainly used to access arrays, and is where the buffer overflows come from. Using actual arrays instead allows the compiler to insert overflow checking code.
Thank you. Seeing 'track houses' gave me the shivers.
Plus: the people willing to sell their data for $5/month are absolutely worthless as advertising targets.
The original headline was "How many others are out there?" Which makes it not a yes/no question, and therefore Betteridge's Law of Headlines does not apply.
What is the motivation behind creating this app?
Rockstar programming language
Thanks for the support. Your instructions work, and I can switch back to the mobile site by closing the window and navigating back.
A brief history of the Devil's tritone
That's why I hope Red/System and just Red in general takes off https://static.red-lang.org/red-system-specs.html
Classifying the BSDs into "performance", "security", and "portability" has as little meaning as classifying people into blondes, brunettes, and redheads. It's trite and superficial, and not really how they differ.

They differ in their development models, families of related operating systems (consider TrueOS, DragonFly, MirOS, et al.), ports and packages mechanisms, extent of kernel APIs, filesystems, and toolsets.

Just three out of many examples:

* NetBSD's and OpenBSD's "wscons" subsystem for kernel virtual terminals is significantly different to FreeBSD's "syscons"/"vt" subsystem.

* OpenBSD's packing list files for pkg are different to FreeBSD's manifest files for pkgng.

* On OpenBSD, /bin/sh is the Korn shell, which is also the superuser's standard interactive shell, and the base toolset contains things such as doas and rcctl. On FreeBSD, /bin/sh is the Almquist shell, the superuser's standard interactive shell is the C shell (and the "toor" user exists), things like sudo come from ports, and the command for manipulating rcconf files is sysrc. /bin/sh is the Almquist shell on NetBSD, and the PD Korn shell on MirOS.
This article from 2017 appears to be the New York Times reporting (mentioned in the article but not linked directly) that brought down this trial: https://www.nytimes.com/2017/07/03/well/eat/alcohol-national...
Turning the bounds checking on/off is done with a compiler switch. There indeed is a cost for leaving it on. Most users, however, regard the cost as worth paying for the protection.

It's still up to you, the programmer. With C, though, you have no choice. No checking for you!

I meant cost-free in the sense that one way or another in C code you wind up passing the length anyway, or in the case of 0 terminated strings, you wind up recomputing it if you don't pass it.
>Isn’t most of the critique of crypto currencies that better systems already exist?

Of course there are other arguments. I even suggested I agreed with that one. I was just pointing out one kind of fallacy, of using current low adoption as evidence of a fundamental flaw.
The problem is that this is an assumption, not a guarantee. If somewhere, somewhen, some toolchain decides "actually, let's define this to __u8 and do fancy stuff with this compiler-internal type", your code breaks in the most mysterious way possible.
Hacker News has its own algorithm to detect dupes, but it only does that for 1 or 2 days (Sorry I don't know the specifics). However it means that there is nothing to mark.

Having said that, it is fine to repost a particular topic. What has been read by people in 2016, might still be interesting to read about in 2018 too, there might be people who didn't notice it in 2016 or people who didn't even visit the site in 2016.

The time interval doesn't even have to be that long.
This wouldn’t be obvious if met in the wild, but once you pointed that bug exists, it is clear. The problem here is that we trust written code (its author) and rarely go into deep analysis at each line.

But like you said, you have to be aware of this effect at least, and it is not possible to eliminate that by simply clearing all variables to zero. See,

p = (struct ip_weight *)some_used_mem;
p->ip = ip;
p->weight = weight;

At which point should imaginary p->garbage be set to zero? At cast? But that may again do unexpected thing, since casts usually do not modify data. The entire struct abstraction seems leaky as hell, but that’s the price of not dealing with asm directly.

These examples show that not C itself is hard, but low-level semantics are. You have to somehow deal with struct {x, y} and the fact that y has to be aligned at the same time. And have different platforms in mind. Maybe it is platforms that should be fixed? Maybe, but these are hardware with other issues that may be even harder to get right.

I think C is okay, really (apart from compilers that push ub to the limit). Type systems in successors try to hide its rough edges, but in the end of the day you end up with semantics of the compiler (c++, rust), that a regular guy has to understand anyway; it’s trading one complexity for another. C++ folks often seen treating it as magic, simply not doing what they’re not sure about. Good part is some languages force you to write correct code, no matter how much knowledge you have. But NewC could e.g. instead force one to create that ‘auto garbage’ to make it clear (why not, safety measures are inconvenient irl too).

I have no strong conclusion, but at least let’s think of all non-cs people who make their 64KB arduinos drive around and blink leds.
Yes, no, perhaps, yes.
It’s Not Just the Tampon Tax: Why Periods Are Political
The GDP share of manufacturing will decline. (I should have been more precise)
Although far from non-existent, none of the chemicals you list are more ubiquitous than acid nor usually sold as acid. Actually, their effective dose range is about 100x that of acid and it would be hard to impossible to fit them on a tab.

NBOMEs are something you did see sold as acid especially a few years back, so I'm not saying you shouldn't be careful. The difference in effect is fairly easy to tell, though, and I have no doubt most stuff sold is the real thing. There are some closely related and nearly indistinguishable compounds, but as far as I know, they are about as hard to synthesize and should have a similar risk profile as LSD.
You can't be serious. You want to downvote an article full of information, only because a person quoted in that article used the f word? So much that you feel the need to shout it out into the world?
The point is that most EV owners typically charge at home, or in some cases work, rather than take time out of their day to refuel (not to mention money out of their wallets!)

It's easy and inexpensive to install EV chargers at any home with a garage or parking space where electrical wiring can be installed. (In fact you don't even need to install a dedicated charger: you can charge an EV from any electrical outlet, if you don't mind slower charging speeds)

The vast majority of "typical suburban commuters" fit into that category, and they are the majority of car owners in North America and Europe.

OK, it's more of a challenge if you're an apartment dweller or live in a dense urban environment with only on-street parking.

But these are being solved, too: cities are installing kerbside chargers (including the ones built into lamp-posts that take advantage of existing wiring), and building regulations require new housing developments to include EV charging. Worst case, you can always make a trip to a nearby fast charger, but of course it's most convenient if you can charge at the location where you normally park anyway.

Dense cities like London and Amsterdam have exactly these issues, and it hasn't stopped an ever-increasing number of people from buying EVs.
Pretty unacceptable showing where people live. I mean seriously completely irresponsible, probably gleefully so by the sounds of it.
Delivery of Allwinner VPU driver main goals
British economists prove it: Sports destroy happiness
We at http://draftss.com strongly motivate our employees to indulge in side-projects. We have a strong team of expert graphic designers, developers, project managers, sales and marketing.

Right from the interviewing candidates, we prefer people who have come with a background of projects/startups created by candidates.

Based on past experiences, this has led the employees to come up with out of the box concepts that help in optimizing our existing services.
Agreed. Comparing the 'paradigm' of AI and blockchain makes no frigging sense at all.
It's actually frightening to see how little VCs have an understanding of the technical details, with blockchain very much still being in the hype zone where reason is not desirable.
Critical sat-nav guided systems should not rely on unprotected satellite navigation alone. You need complementary systems.

There already exists Wide Area Augmentation System (WAAS) and European Geostationary Navigation Overlay Service (EGNOS). They augment GPS, GNSS and Golnass and provide accuracy, integrity, and availability. They are used in aviation.

EU's GNSS has PRS (Public Regulated Service). It is authenticated and can be used in sensitive applications for civilian uses. US has GPS modes that are protected but they seem to be only for military.

---

ps. Many road navigation systems already have accelerometers in them. Relatively easy counter against road routing spoofing is to detect turns and directions. System could flash a warning that something is wrong if crude INS is not matching GPS signal. There are spoofing techniques that fool integrated GPS/INS but they are hard or impossible to use in roads.
> I also proposed adding slice syntax to C, so, when you want to talk about part of an array, you do it as a slice, not via pointer arithmetic.

I highly disagree with this. One of the advantages of conflating pointers with arrays is an obvious and very consistent way of indexing and slicing on the entire language that has minimal syntactic baggage.
Just for fun, type in this program:

int fred(int a[10]) {
return a[11];
}

It compiles without error with gcc and clang, even with -Wall. The code generated by clang is:

mov EAX,02Ch[RDI]
ret

i.e. buffer overflow, even though the array size is given. Compile the equivalent DasBetterC program:

int fred(ref int[10] a) {
return a[11];
}

fred.d(2): Error: array index 11 is out of bounds a[0 .. 10]

And the 32 bit code generated (when using 9 instead of 11 so it will compile):

mov EAX,024h[EAX]
ret
Cheap materials, no heart, excessive useless space
Supersonic flights will be very much a premium fare option, due to the significant increase in energy use and fuel required for supersonic flight.

Make a supersonic aircraft too big and you risk not being able to find enough passengers willing to pay fares that make it viable - which is one of the issues that killed Concorde.
How Races and Religions Match in Online Dating
seems like a copy of https://github.com/kasketis/netfox
Betteridges ‘law’ is a rule of thumb.

A rule of thumb needs to give you approximately the right answer more than 50% of the time without spending any effort to examine the particular problem in order to be useful.

So it really does not need to be pointed out every time this ‘law’ is broken.
Ok, so 99.5% of the time anything about Blockchain and AI is going to be nonsense. (Aside - this is an interesting application of Bayes law!)

One thing that wasn't, and was actual machine learning and was actual blockchain was the Algorithmia competition[1]. It's pretty interesting how it works, and wasn't an entirely stupid idea (faint praise I know, but most ideas in both AI and blockchain are).

[1] https://blog.algorithmia.com/trustless-machine-learning-cont...
Quite interesting essay, thank you!
LinkedIn is like one giant business motivational poster.
Years ago I worked on an ecommerce website that followed the "idiomatic variable names" recommendation. All (I mean literally all) the variables were called things like 'gunsandroses', 'meatloaf' etc. I don't know if they did it that way in the first place for shits and giggles or if they did an obfuscation pass at the end, but I didn't find that it assisted maintainability.
>I'm not sure why maximizing income in the Bay Area is worthwhile. The pay here, while much higher in nominal terms, seems to level off well below my level of comfort for standard of living

so, assuming you are a medium density type and can stomach an apartment with reasonable soundproofing, you are spending $3000/month on rent here, for a reasonably okay 1 bedroom apartment. (if you are willing to take a hit in quality, you can get more bedrooms or even a bad single family home for about that price)

So you move to a second-tier city and you get the same thing for $1500/month. Now, I don't make twice here what I would in a second-tier city, but I do make rather more than an extra $1500 a month.
I am always amazed by Americans love of 'period' style architecture in preference to a more modernist style. Especially when I see friends in my age group (30s) pack there homes with dark wooden furniture that looks like it would be more at home in Versailles. To me it is just visually exhausting and I crave the relative calm of some minimalist sleek lines.
I feel like he was right about it being worse, but didn't realize there would be so much more of it.
The stats over how large is the vocabulary of a hip-hop artist
I would rather work with a bunch of people that were similary grounded/jaded about work, but whatever floats your boat.

My team is a pile of nice people with no illusion of only showing up on Monday for the money. The work environment is great because we treat the whole game as a bad joke. Corporate makes some nonsensical decision? Let's all play along, might as well make the game fun.

I like coding but there's countless other things I would work on besides boring CRUD apps if I wasn't getting paid. I don't understand the people that insist you should like work. My opinion, these people should get out more because if work is fun then you probably haven't done much else
> If it can fit in RAM, it ain't Big Data. Multiple TBs fit in RAM

To be fair, the price for that RAM starts to steepen at (if not before) the 4TB mark, and 1.5TB might have been the limit on frugal main memory as recently as a year and a half ago.

OTOH, SSDs are very fast even at low cost, so I'd argue if it can fit in directly-attached storage whose aggregate bandwidth compares with the RAM's bandwidth, it ain't Big Data, either. Though even a single PB might be big enough, if the CPUs are too slow.
Xing, the German Linkedin throttles you after you send ~50 invites to strangers (first some have to be accepted before you can send more), Facebook even stops you from sending friend-requests after you sent 20 invites or so.

Not sure why Linkedin allows people to send 3000 contact-requests without throttling them. Any ideas?
The modern ML era is mired in hype and statistics. Most of the time, all there is to show for it is yet another expert system with baubles.

Neuroevolution is one of those overlooked niches where I think we'll see real progress in real AI.