strenholme

Joined 7 years ago

Karma
1,643
Submissions
564
Member since
Mar 5
Single parent. Electronic musician. Lua and open source developer. https://samboy.github.io/ — https://github.com/samboy

  #include<stdio.h>//RadioGatun
  #include<stdint.h>/*32-bit\*/
  #define b(z) for(c=0;c<z;c++)
  uint32_t c,e[42],f[42],g=19,h
  =13,n[45],i,j,k;void m(){j=0;
  b(12)f[c+c%3*h]^=e[c+1];b(g){
  i=c*7%g;k=e[i++];k^=e[i%g]|~e
  [(i+1)%g];j=j+c;n[c]=n[c+g]=k
  >>j%32|k<<-j%32;}for(i=39;i--
  ;f[i+1]=f[i])e[i]=n[i]^n[i+1]
  ^n[i+4];b(3)e[c+h]^=f[c*h]=f[
  c*h+h];*e^=1;}int main(int c,
  char**v){char*q=v[--c];for(;;
  m()){b(3){for(j=0;j<4;){f[c*h
  ]^=k=(*q?255&*q:1)<<8*j++;e[c
  +16]^=k;if(!*q++){b(18)m();b(
  8){j=c;b(4)printf("%02x",(e[1
  +j%2]>>8*c)&255);c=j;if(c%2)m
  ();}return 0&puts("");}}}}}//
View on Hacker News

Recent submissions

Comment · 2 days ago
While Righthaven LLC v. Hoehn did rule that copying and pasting an entire newspaper article is fair use, this ruling was vacated on appeal and instead the lawsuit was nullified because they ruled Righthaven never had the right to bring the lawsuit in the first place. So, yes, one can be sued for copying and pasting a newspaper article verbatim.
Comment · 3 days ago
Comment · 3 days ago
LuaJIT handles double, strings, and dictionaries at near C level performance. Also, arrays, but Lua’s data model has dictionaries and arrays be the same data structure. Lua 5.1 (i.e. LuaJIT) only supports double numeric types,[1] and its strings are immutable.

Lua 5.1’s edge over Javascript and Python is that it’s a lot smaller and simpler.

[1] It’s possible to recompile Lua 5.1 to have the numeric data type be an int, but the standard compiles of Lua5.1 only have double precision floats for numbers. Bitwise operators are technically not part of Lua 5.1, but a library to add support is easy and is usually done: Most Lua5.1 forks including LuaJIT and MediaWiki’s version of Lua5.1 have such a library available. Later versions of Lua have both int and float support.

Comment · 3 days ago
One legal way to share news stories which generate controversy is to have an AI make a summary of the article, rewording it to remove any copyright from the article (this legal trick only works when the news site in question is reporting on factual events, since facts can’t be copied as per Feist vs. Rural 1991, and I make sure that the summary has “a different sequence, pace, and setting than the original article” as per legal judgments on whether an AI summary of factual events as reported by a news source is subject to copyright).
Comment · 3 days ago
And, indeed, you can use archive.today to get past the login wall:

https://archive.ph/HcOq2 (This is a link to the post for this article)

(If one’s ISP can’t access archive.today, I find that Firefox’s built in free VPN can usually access them)

Or, you can use on of the various Reddit scrapers, e.g:

https://redlib.catsarch.com/r/Seattle/comments/1xhf6qp/archi...

Here’s a list of Reddit scrapers:

https://github.com/redlib-org/redlib-instances/blob/main/ins...

Personally, as scummy as archive.today is at times, I can generally trust them to have an honest archive about, say, someone’s drunk post before said drunk deletes the post.

Comment · 3 days ago
I have moved my more complex scripting from Perl/PHP/Python to Lua for a lot of reasons. One being that Lua (even PUC Lua) is a good deal faster than Python (or /bin/sh); another is that, if I want even more speed, I can use LuaJIT (which keeps me stuck at Lua 5.1, but Lua 5.1 is perfect for my needs).

I wish Lua 5.1 could become part of POSIX; there are a lot of implementations of it out there.

Comment · 4 days ago
I fixed it with print-color-adjust:

  background: #eee;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
Comment · 5 days ago
The advantage of a COLR font over SVGs is that they are functionally identical for this use case (indeed, the font in question was converted from SVG vector files) and a good deal more compact to boot.
Comment · 5 days ago
Having horizontal scroll is annoying, yes, but I don’t think it makes a website unusable on a mobile device.

The way to handle elements wide enough to induce horizontal scrolling is to put them in a <div> (or make CSS for the tag in question) and make CSS with overflow-x: scroll; for just that element. An example from one of my webpages:

  pre {max-width: 90vw; overflow-x: scroll;}
Comment · 5 days ago
One issue with making websites printable is that printing, by default, removes background colors and images. So, for the chess diagrams I have on my webpage, I use background colors to have the chessboard be a checkerboard instead of a white background (the chess pieces are a color webfont)—but since web printing removes backgrounds, the chessboards have white backgrounds unless the person printing the webpage chooses “print backgrounds”.

The only way to work around this is to have two sets of chess pieces in the font, one with a white background for pieces on light squares, and one with a colored background for pieces on dark squares.

Printing web pages is rare enough I just assume someone doing that will also click on “print backgrounds”.

(The reason to not use images for the chessboard diagrams is because they use more bandwidth and can’t have usable “dark mode” colors)

Comment · 5 days ago
I did. It’s perfectly readable. What was the issue you experienced on your phone?
Comment · 6 days ago
Well done. It’s important to know the difference between a real world exploitable bug and hot air; as an open source maintainer, over half of the bug reports I get are “hot air” bugs.
Comment · 6 days ago
Comment · 6 days ago
I’m surprised this level of surveillance from a smart TV (if this is real; right now the only sources are social media) doesn’t open up Samsung to a lawsuit.

To wit: There was a lawsuit where Susan Clements-Jeffrey sued Absolute Software (Lojack) for a stolen laptop she acquired; Lojack used surveillance to track down the stolen laptop and Susan successfully sued for invasion of privacy (Lojack settled instead of trying to fight it).

Comment · 8 days ago
“Forced” is a little strong. RedHat/Fedora filed a bug report, and I felt it was prudent to have a patch for them to use, even though I explained why they didn’t need to use the patch.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton