News for hackers. Stuff that matters.

ynfnehf

Re:Whence '\N'? on Sunday October 06, 2024 @01:43PM (#41758702)
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."

Re:Perfect Circle on Friday January 06, 2023 @06:00PM (#34282610)
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.
Re:Perfect Circle on Friday January 06, 2023 @05:46PM (#34282430)
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.
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.
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.
Re:Integers in C quiz on Sunday September 04, 2022 @11:36AM (#32714151)
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.)
Re:Integers in C quiz on Sunday September 04, 2022 @11:23AM (#32714025)
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.
At least it is still optional to allow for stack allocated VLAs. Which is the attack vector you mentioned.
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".
I once implemented FizzBuzz using this trick https://www.reddit.com/r/C_Programming/comments/qqazh8/fizzb...
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.)

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.
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.

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.
So you think it is reasonable to spread what is essentially a conspiracy theory? Why should I not trust a public library that it is difficult to find a replacement for a Russian-speaker willing to read stories for children?
The cancelling of Russian-language reading hours in Sweden was not due to the war. That was fake news. Please be more careful about spreading misinformation in the future.
Re:Writing UTF-8 Programs in Plan 9 on Sunday February 27, 2022 @06:26AM (#30487302)
How is that any different than reversing the English digraphs? "th", "ch", "wh", etc. Reversing English doesn't usually produce something meaningful either.
Note that it has been the choice of Sweden and Finland not to be a part of NATO. NATO would be more than happy to let them join, and the process would probably be quite quick as well. I think this is quite a significant difference from the situation with Ukraine.
The former Secretary General of NATO disagrees with you. For Sweden and Finland at least. Source in Finnish, but google translates it pretty well https://yle.fi/uutiset/3-12268949 https://yle-fi.translate.goog/uutiset/3-12268949?_x_tr_sl=fi... "Finland and Sweden meet the membership criteria and accession would be done quickly by NATO, even overnight."
Re:Some argue that synthetic data can make AI systems better on Friday February 18, 2022 @05:37PM (#30392083)
You can train an AI to do the inverse of the existing program (as is the case for the self-driving described in the article.) Take some input, generate output using the existing program, and then train the AI with the input/output reversed.
49% of infected having symptoms a year later is ridiculous and obviously not true. Unless you define symptoms extremely broadly.

I have not read the study you are referring to. Are you sure it is not specifically about hospitalized patients? Even then it sounds extreme.

But you are right that vaccines are clearly better when given a choice.

Re:How Sweden became the Silicon Valley of Europe on Wednesday August 11, 2021 @07:56AM (#28140886)
Those specific quotes (or rather direct translations of quotes) were said in regards to bad integration policy (by Stefan Löfven in 2015 and 2019).

There has probably been said things with similar sentiment in regards to the pandemic. But not those two specific ones.

Even though I agree OP is pushing a narrative a bit too much, your correction is also wrong. Since these were not said during the pandemic.

Re:Starlink Requires $30B Investment on Tuesday June 29, 2021 @05:54PM (#27682233)
Your math is off by an order of magnitude. 40Gbps/100Mbps=400.

It should also be able to handle at least 4000 customers (10x) through oversubscrpition.

Calling another virus infection flu isn't actually wrong anyways. The word has been used that way for centuries before we actually were able to identify the virus.
Re:What Oxford taught me about posh people on Thursday June 03, 2021 @10:43AM (#27382121)
Sure, which means that they were greatly affected by the war. Thus, according to you, they should not have been able to create a successful welfare state.
Re:Virtual deck of cards using just a browser on Tuesday June 01, 2021 @08:19PM (#27363257)
You don't actually need two arrays to implement your idea. Since the combined size will be constant, just one array with an index indicating the split is enough.

When moving cards from one side to the other a lot of elements will have to be moved around. But for small n it should be much faster than using linked lists. And also relatively easy to implement in C.

The shifting of elements when inserting can be avoided by only swapping two positions. (ABXDEFC instead of ABXCDEF, when inserting X into ABCDEF). But by then you have just reinvented Fisher-Yates.

So the swapping in some of these algoritms is basically an implementation of your idea.

Re:What Oxford taught me about posh people on Tuesday June 01, 2021 @11:10AM (#27355574)
> I'm still sceptical if there even exists a successful welfare state that does not rely on natural resources, or the aftermath of some war.

I was referring to this. Both Denmark and Finland were to a large extent involved in WW2, and neither have natural resources of the same kind as Norway.

Or is your opinion that they are not successful welfare states?

Re:What Oxford taught me about posh people on Tuesday June 01, 2021 @08:09AM (#27353307)
What is your explanation for Denmark and Finland then?
Re:Modern C for C++ Peeps (2019) on Wednesday May 26, 2021 @12:39PM (#27292719)
The _t suffix is also reserved by posix. (And by the C standard if the name starts with int or unit.)

I agree with just using struct foo, as does the Linux style guide.

(Edit: I just noticed the page mentions this, but it is perhaps useful to reiterate.)

Re:The end of the pandemic is near on Wednesday May 26, 2021 @08:24AM (#27289587)
Cases are not the same thing as infections. Comparing cases between countries doesn't work, even when corrected for positivity rate. Deaths should be a more fair comparison. Then there are a lot more countries with higher death rate.

I didn't mean that it is fair to compare a metropolis to Sweden when it comes to "who did the right thing". But it is a fair comparison when considering the effects of longcovid.

Sweden only stands out when compared to Nordic countries, not when compared to the rest of the world. Thus bad effects from longcovid should be more visible in harder hit places.

Older »