Hacker Newsnew | past | comments | ask | show | jobs | submit | ynfnehf's commentslogin

First place I read about this idea (specifically newlines, not in general trusting trust) was day 42 in https://www.sigbus.info/how-i-wrote-a-self-hosting-c-compile...

"For example, my compiler interprets "\n" (a sequence of backslash and character "n") in a string literal as "\n" (a newline character in this case). If you think about this, you would find this a little bit weird, because it does not have information as to the actual ASCII character code for "\n". The information about the character code is not present in the source code but passed on from a compiler compiling the compiler. Newline characters of my compiler can be traced back to GCC which compiled mine."


I was hoping GCC would do the same, leaving the decision about the value of '\n' to GCC's compiler, but apparently it hardcodes the numeric values for escapes[1], with options for ASCII or EBCDIC systems.

[1] https://github.com/gcc-mirror/gcc/blob/8a4a967a77cb937a2df45...


But these numeric values are also ASCII representation of numbers, rather than being the actual byte that is written to the output. Maybe there is hope still. Where do the byte values for those numbers come from when the compiler writes output?


The C standard (see C23 5.2.1p3) requires the values of '0' through '9' to be contiguous, so it doesn't matter if you only care about round-tripping. '7' - '0' == 7 no matter the character set. Though, for round-tripping I suppose this isn't strictly necessary, but it certainly makes parsing and printing decimal notation very convenient. Notably, for both ASCII and EBCDIC 'A'..'F' and 'a'..'f' are also contiguous, so parsing and printing hexadecimal can be done much the same as decimal.


Maybe the assembler?


By cheating with a Python script to move the mouse, I managed to get 99.9%. Seems difficult to get higher than that, perhaps due to the mouse position having integer coordinates.


I literray came here to see who is going to proclaim automation first (and in what way) :) Unsurprinsingly, it was the first comment.

100% perfect circle is a pure math thing and can't be achieved with drawing in any way.


In a similar vein, people claim it's impossible to draw a heptagon with a straight edge and ruler.

Sure, but good luck pulling of a perfect octagon either, given the limitations of pen and paper.

And there's a perfectly good approximation that'll very quickly produce a theoretical heptagon with error margins less than the thickness of a pencil.

1/7 ~= 1/8 + 1/64 + 1/512 + 1/4096

(1/n = sum(1...infinity) of 1/((n + 1) ^ i)

(A perfect heptagon requires infinitely many steps.)


    %!PS-Adobe-3.0 EPSF-3.0 
    %%DocumentMedia: a4 595 842 80 () ()
    newpath
    300 500 moveto
    /poly {
            /side exch def
            /angle  360 side div def
           side {
           angle rotate
           720 side div  0 rlineto
            } repeat
            stroke
            closepath 
    } def
    7 poly
    showpage

Save it as figure.ps. Also, you can try "8 poly", or "1000 poly" above "showpage".


Octagons are great fun to draw on graph paper. They're just a truncated square.


Sure, but if you want an octagon of a specific edge length then that won't help you.

Or if you want the largest octagon that fits in a given circle (octagon of a given radius).


If you draw the diagonal sides as the diagonals of squares, they will have the square root of two times the length of the vertical or horizontal sides.


Fair enough. But you can get pretty close if you draw a 10x10 with 4 squares on the sides parallel to the graph. Or 5x5 with 3 on each side. The former is 6% over and the latter 6% under. And if you go juust a hair outside of the lines you're dead on. Such as a pencil tip's width off of the ruler.

I just worked that out with a calculator, but I'm fairly sure I worked that out empirically while bored in math class one year. My very wise teacher put me and the other bored kid way to the opposite side of the classroom from where his chalkboard was and looked the other way when we played 'squares' in class, safely out of the peripheral vision of any of the other kids. Probably the only time I ever dared 'pass notes' in class.


They are! But the octagons you draw that way aren’t regular (basically because sqrt(2) is irrational)


You can get pretty close with a pencil and a ruler though, if you have the right diameter of mechanical pencil. If you place the ruler dead on the corners of the squares and draw the line offset that tiny little bit, the error is barely perceptible without magnification.


Throw a compass into the mix and you'll get close enough.

But you like, fall off the grid man.


Are you trying to square a circle? We don't tolerate that witchcraft around these parts. Now git.


No - you can't square the circle, but you can get the square-root of 2.

Choose a corner and truncate, measure the edge length using a compass, and use that to draw the rest of the owl.

You can do it, but you end up with horizontal and vertical edges that are misaligned with the grid.

And I saw the opportunity to make a bad joke.


https://news.ycombinator.com/item?id=34284790

This bookmarklet also "only" gets 99.9%


A mac or windows app controlling the mouse I presume?


I used the pyautogui library on Linux. Then just a simple loop with an incrementing angle, with some overshoot in the end in order for the webpage to recognize that the circle was complete. First time using the library, worked pretty well, except I had to figure out that I had to use pyautogui.PAUSE = 0 to make it not pause between mouse movements.


Did you film it by any chance? This would be a good throw-away Twitter or blog post


Arduino controlling a robotic arm holding a mouse, written in C.


powered by a large language model


What is the point in implementing a cookie banner if you are still breaking the law in an obvious way? Why not just break the law by not having a cookie banner? That way it would at least be less annoying for your users.


I think a lot of companies comply with cookie banners the way that they do just to annoy users, as a protest against regulation. If they can irritate users as much as possible while complying, they think they can turn users against the regulation itself rather than the way that they comply. I don't know if this applies in this particular case, but I know at least some companies do that so it's worth considering. Other than that, maybe the answer is that they were just trying not to be obvious, or that it was totally different divisions responsible for each?


But almost no company complies with the law anyways. They need to have a "reject all" button; a "more options" button is not enough. So any company that has a cookie banner without a "reject all" option might as well not have a banner at all.


A lot of European companies do have a reject all button thank god :) But yeah more need that.


American companies are the worst: "Accept" and "More info". :)


We do. At least for the part of the product I was responsible for I made sure that the tracking script is really only loaded if the user explicitly clicks yes.

It's sometimes hard to make marketing understand why this is an issue in the first place but then we are B2B in a mostly offline industry so it doesn't matter as much.


>I think a lot of companies comply with cookie banners the way that they do just to annoy users,

in my experience they don't actually understand what they are required to do, they then think the easiest way to handle it is to pay for some outside expertise with of course the understanding that they would still like to get some ad money.


This is exactly it. We have web properties that only have one cookie at all - the cookie to store the result of the cookie pop up!


There are benefits to being a US based company that doesn't target EU users, even if it doesn't reject EU users, I guess.

I can't think of a way to actually use any kind of tracking cookies, even non-ad/sales/data-harvesting related that wouldn't be annoying in EU.

Of course, if you manage your own load balancing, could definitely combine a load-balancer pinning cookie (uuid) for "all" uses as a single "essential" cookie.


Load balancing would fall under "essential" cookies that don't require a permissions. No banner necessary.

See GitHub.

You can't use the data for other purposes though.

Tracking without cookies requires consent no matter how you implement it. Claiming it to be essential won't fly if, say your Marketing or sales team has access.


Why cannot load balancing be implemented without cookies?


using a cookie that is essential for non-essential purposes, is not allowed. So using a load-balancer cookie is fine, as long as it's only used for load balancing.

Once it's used for other (technically non-essential) needs as well, one needs to find another basis for processing or ask permission for that second purpose(consent basis).

Also, if the LB cookie can be non-identifying, while fullfilling the stated technical purpose, it must not allow identifying users. So for LB cookies, one must not use a unique ID per user, but an LB ID instead. Something like "node1", "node2" etc...


To be more inconspicuous ?


I honestly don't know how people in Europe surf the web, it's so annoying now. When I was just in Germany, every site I'd have a GDPR popup, then the ads would load, then some random ad would popup with a close button the size of a pixel. This was on major sites. The modern web is so broken, the GDPR popup made it worse. Why can't you just have a browser wide setting to accept or deny GDPR in force. In the US it's bad enough, now with the GDPR popups, it has become almost unusable, especially on mobile.


I don’t understand why the blame is put on GDPR (which is NOT the reason for cookie banners btw, it’s the ePrivacy directive). Websites choose to have cookie banner because they have abusive cookies, tracking, etc. Some websites such as GitHub famously made the choice to remove tracking cookies, and now do not need a cookie banner. Forcing websites to clearly display their crappy practices is a good thing. Forcing websites to ask for user consent before tracking them is good.


The GDPR just missed a step. They should have mandated an automated way for users to present their preference. Like the old DNT flag for instance. With the legal framework behind it that would have made that flag actually useful and browsers would have brought it back quickly.

I assume this didn't happen due to industry lobbying.


AFAIK there was a legislative initiatives to do exactly that and the ad industry whined about it.

I think the result would have been similar to what happened when apple did it's Facebook nerf. Within the margin of error no one wants to be tracked and the ad industry knows this despite their fake "user-benefit" Spiel.

In the end it didn't happen and I can't recall what it was called.


It was a mistake though. Because now the politicians get blamed for the cookie banner chaos.

I hope they will go back on this and mandate DNT after all.


> Why can't you just have a browser wide setting to accept or deny GDPR in force.

Because that's what was tried before GDPR, and it has proven to be a conclusive failure. https://en.wikipedia.org/wiki/Do_Not_Track


It’s not the same thing. I’d love something like <meta> tags where the websites declare their cookies, with a standardized set of metadata. We could have a browser native permission system like we have for microphone, camera, geolocation, and the possibility to allow or disallow cookies in a unified way. Blocking the undeclared/disallowed cookies would then be done at the browser level, so there would be no need to trust that the websites actually respect the settings


I'd like something like an <ad> tag to go along with it, where the contents are sandboxed by the browser separate from the rest of the page. Mainly as a cudgel against sites which are very anti-adblocker.


Yeah it was by Microsoft https://en.wikipedia.org/wiki/P3P


It was only a failure because it was not mandatory to obey it. GDPR missed a big chance to do that.


> some random ad would popup with a close button the size of a pixel.

Run an adblocker. The Web was a total mess even before GDPR came along and not limited to Europe. If the issue of denying sites a revenue stream bothers you then perhaps make yourself a promise that you'll turn it off when ad networks stop being a vector for malware and/or stop engaging in the un-permitted collection and sale/abuse of personal data.

Personally, I run NoScript (as well as ad blockers) and so cookie popups are relatively rare on my Mac, but I still get them on iOS. I don't like them, but I see them as a warning that the site is going to try to exploit my personal data in return for serving me content.

It's also worth pointing out that there is no actual need to have a cookie banner unless you're doing something with the data that actually needs permission. For instance basecamp.com was GDPR/ePrivacy directive compliant when I was there, but never needed a banner because they decided to stop collecting and processing personal data in a way that required permission.


I use Consent-O-Matic browser addon which automatically hides cookie banners and rejects them in the background.


I don't think they thought they were breaking the law: you can read their arguments summarized in the decision and they're plausible: https://www.legifrance.gouv.fr/cnil/id/CNILTEXT000046768989. I also suspect that if they had been successful in keeping the jurisdiction to their home authority in Ireland (which has a reputation of being much less strict), they would not have been found to be out of compliance.


Lawyers are rarely hired by the defense to pen long arguments why they were intentionally breaking the law. They’re always going to argue that they didn’t do it, and if they did do it they didn’t intend to ( because intentionally violating can have higher penalties ).


> 46. En défense, la société explique que le cookie " MUID " est un cookie multi-finalités, utilisé à des fins essentielles et non essentielles pour éviter d’utiliser plusieurs cookies chacun pour une finalité, afin de réduire le nombre de lectures et écritures d’informations entre le terminal de l’utilisateur et " bing.com". La société indique que seules les finalités essentielles sont activées avant que l’utilisateur donne son consentement. La société fait valoir qu’elle considère comme des finalités essentielles à la fonctionnalité de " bing.com " : les finalités de lutte contre la fraude, y compris la fraude publicitaire, de sécurité telles que la prévention des attaques par déni de service, de détection des logiciels malveillants et de lutte contre la désinformation. La société soutient que ces finalités indissociables sont strictement nécessaires à la fourniture des services " bing.com " tels que demandés par l’utilisateur. La société précise qu’en l’absence de consentement de l’utilisateur, la seule finalité publicitaire pour laquelle le cookie " MUID " est utilisé est la publicité non ciblée dans le cadre de la lutte contre la fraude publicitaire.

They tried to be clever by re-using the same cookie for multiple purpose essential and non-essential (the “essential” purpose being related to ad fraud detection) so they claimed they did not need consent to set the cookie. And since they argued that they chose to use a single cookie “to reduce the number of reads and writes”, which is bullshit, they were clearly not acting in any kind of good faith here. The regulator did not condemn them for the bad faith argument though, but because “ad fraud detection doesn't qualify as essential”, so their “smart” move of mixing essential and non-essential purposes within the same cookie wasn't even properly done:

> En outre, le rapporteur précise, en réponse à l’argumentation de la société considérant la finalité de lutte contre la fraude au sens large comme une finalité essentielle exemptée de consentement, que seule la finalité de lutte contre les attaques en déni de service pourrait être exemptée de consentement. Le rapporteur relève que les autres finalités évoquées ne relèvent pas du champ des exemptions prévues par l’article 82 de la loi Informatique et Libertés puisqu’elles n’ont pas vocation à faciliter une communication électronique et ne sont pas strictement nécessaires à la fourniture d’un service expressément demandé par l’utilisateur.

The regulator then remarked that mixing both kinds of purpose within the same cookie is explicitely forbidden anyway: (emphasis mine, on the relevant part)

> En premier lieu, s’agissant des cookies et autres traceurs multi-finalités, la formation restreinte rappelle que l’article 82 de la loi Informatique et Libertés exige un consentement aux opérations de lecture et d’écriture d’informations dans le terminal d’un utilisateur mais prévoit des cas spécifiques dans lesquels certains traceurs bénéficient d’une exemption au consentement : soit lorsque celui-ci a pour finalité exclusive de permettre ou faciliter la communication par voie électronique soit lorsqu’il est strictement nécessaire à la fourniture d’un service de communication en ligne à la demande expresse de l’utilisateur.


Before this decision I think using the same cookie for both inessential and essential purposes was something that many people still thought was okay, as long as (as Microsoft claimed they were doing) when you do not have permission to use the cookie for inessential purposes you only use it for essential purposes.

But yes, this all ended up being irrelevant since the court decided that they were using it for non-essential purposes before getting permission.


Another fun one:

  struct { long unsigned a : 31; } t = { 1 };
What is t.a > -1? What about if a is instead a bit-field of width 32? (Assuming the same platform as in the quiz.)


ANSI describes why in their rationale: https://www.lysator.liu.se/c/rat/c2.html#3-2-1 .

    The unsigned preserving rules greatly increase the number of situations where unsigned int confronts signed int to yield a questionably signed result, whereas the value preserving rules minimize such confrontations.  Thus, the value preserving rules were considered to be safer for the novice, or unwary, programmer.  After much discussion, the Committee decided in favor of value preserving rules, despite the fact that the UNIX C compilers had evolved in the direction of unsigned preserving.


This usage of VLAs is once again mandatory for compilers to support, since C23. From Wikipedia: "Variably-modified types (but not VLAs which are automatic variables allocated on the stack) become a mandatory feature".


Oh well...


At least it is still optional to allow for stack allocated VLAs. Which is the attack vector you mentioned.


Tell me, what’s wrong with variably modified types specifically?


Sizeof, which used to be one of the very few things you could blindly do to an arbitrary (potentially UB-provoking) expression, can now have side effects.


I once implemented FizzBuzz using this trick https://www.reddit.com/r/C_Programming/comments/qqazh8/fizzb...


Wow, this is wizardry.


I am Swedish and very much enjoy the meatballs at IKEA. They do not taste significantly worse than homemade or those from a fancy restaurant.

Just as a counterpoint to all the negativity in here.

(To be honest, I have never had a bad meatball. So the problem might be with me. Edit: actually, I tested plant-based meat(?)balls once. They were not good.)


As a fellow Swede, I disagree. They taste just marginally better than what I would get back in school for lunch. However, I can still enjoy them for what they are and have a plate if I drop by IKEA abroad. =)


I recognize most of the names of the authors. Thus I am not very surprised about their conclusions. Nothing is actually new in this article. It is mostly incoherent writing, with some conspiracy theories thrown in. The usual stuff that has been coming from these authors since the beginning of the pandemic.

And for those confused: this is not published in nature, but in an open access journal owned by nature: "Humanities and Social Sciences Communications". This is not a subsection of Nature, and is rather obscure. I find it unclear what kind of peer-review has been done, but it has certainly not been done well.

This is not some kind of scientific proof of the "Swedish strategy" being crime against humanity. Merely a oddly placed opinion piece.


A person's opinion can be predictable in advance (1) because they are closed-minded and not responsive to evidence or (2) because they are responsive to evidence and the evidence is clear. Presumably you're saying #1 rather than #2 is going on with these authors; could you be a bit more specific about why you think that?

I had a quick look at the paper and it didn't seem obviously "incoherent writing" to me. Could you be a bit more specific about what you found incoherent?


In the abstract the authors refer to professors being dismissed from the national health authority. But the also say this happened in 2014 and that the professors were rehired at the very prestigious medical university hospital Karolinska Institutet. That kind of references to seemingly incriminating facts without actually explaining how they affected the policies recommend by the public health authority is not a serious way of making a scientific argument.

I have a hard time believing the dismissed professors had dissenting opinions on the validity of lockdowns or facemasks already in 2014.


It seems like you're suggesting that the authors of this paper are trying to imply that those professors were dismissed because they might give unwanted advice about Covid-19, or to hide the fact that they were re-hired at the Karolinska Institute. But the 2014 date, and the rehiring, are right there in the abstract in the same sentence as the one that says they were dismissed:

"In 2014, the Public Health Agency merged with the Institute for Infectious Disease Control; the first decision by its new head (Johan Carlson) was to dismiss and move the authority’s six professors to Karolinska Institute."

I'm not sure how these facts are any more "seemingly incriminating" than "actually incriminating", since the things you say (and I agree) make them less worrying are given plenty of prominence right up front.

It looks to me as if the argument the authors are trying to make is something like this: "The government moved the national health authority's actual experts out of the way several years ago, with the intention of making the health authority less an impartial scientific body and more a political tool. That meant that when the pandemic came along, politicians were able to persuade this body to make recommendations that were politically convenient even though they were scientifically unsound."

It may well be that that argument is a load of bullshit; I don't know. But, right or wrong or Not Even Wrong, it doesn't depend on hiding the 2014 date or the fact that the professors were given new jobs, and it doesn't need the people involved to have had the clairvoyance to predict what specific inconvenient scientific advice the professors might have insisted on giving.


That's a conspiracy theory that simply makes zero sense from a Swedish political perspective. Exactly none. They don't make that accusation explicitly in the article because it's so ridiculous. 1. It's not like the National health agency was a pain in the butt for the Social democratic government in 2014. 2. Professors at Karolinska institutet can make their voices heard if they want to. It's the most prestigious scientific institution in Sweden. Their roles as top academics are still to advice relevant authorities. 3. Why would politicians actively undermine their own scientific advisors? For what ideological reason? I simply see none *in this context*. If it was about national economy, gender, migration or environment it *might* make more sense. But national health policy? That's a totally apolitical question in Sweden 2014.

There's also a simpler explanation at hand: a change in the organizational structure. The health authority still relies on advice from researchers. Maybe the change was made to make the advisors *more independent* as they're not on the payroll of the people they are to advice. A general trend in public management the last decades has been to reduce inhouse staff and outsource expert competency, this is totally in line with that.

If anything the government listened too much to the expertise in early 2020. That's why they did not take action earlier.

Never assume malice when incompetency is a sufficient explanation.


>By scientific evidence, in the context of this paper, we refer to the advice of international authorities in infection control (including the World Health Organisation, (European) Centres for Disease Control and Prevention), and the body of peer-reviewed scientific papers.

Any further questions?

Advice of international authorities is taken as scientific evidence.

And now this piece of shit thinly veiled opinion piece gets echoed and propogated furher as "peer-reviewed scientific paper published in Nature" right here in this very thread.

It's beyond depressing.


No one is calling it a "peer-reviewed scientific paper published in Nature" in this thread. The only person who mentioned Nature in this thread did so exactly to point out that this paper isn't published in Nature but in another journal somehow associated with Nature.


> And for those confused: this is not published in nature, but in an open access journal owned by nature: "Humanities and Social Sciences Communications".

Worth noting for those unfamiliar with academic publishing, "open access" does not necessarily mean anything for what it takes to get published. It's "open read" not "open write".


Yeah, I didn't mean open access as an insult. I just included it for description. Sorry for the confusion. I have published open access before, so I would be equally guilty in that case.


Isn't it just wonderful when the country we most hate for having implemented different covid policies to the suggested by the establishments of all of the countries in the West, coincidentally, is also morally terribly evil, they were giving end-of-life treatment when unnecessary!


The Swedish government does not consider that it followed significantly different policies from most other developed countries. They just implemented various policies at different times, which is true of every country depending on their phase of the pandemic. There were a lot of unknowns early on, and even countries that followed very similar policies often had very different outcomes depending on their demographics, geography, etc. The early differences in approach in Sweden are greatly overblown.


I'm sure there were situations in Swedish hospitals, in particular around Stockholm during the early stages of the pandemic, were patients were not given appropriate care because of the enormous pressure from COVID. No doubt this increased the number of deaths.

Did this happen because politicians and officials in Sweden despise the scientific method? No.


For each specific fusion reaction there is an optimal temperature (for maximum reactivity). Usually around a billion kelvin or so, plus or minus a few orders of magnitude.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: