Readit News logoReadit News
fainpul commented on Using Git add -p for fun (and profit)   techne98.com/blog/using-g... · Posted by u/fixedprog
ellisv · 2 hours ago
also barely readable with dark mode
fainpul · 2 hours ago
Dark mode looks fine to me: light gray on black.

Light mode is terrible: dark gray on black.

fainpul commented on What is the nicest thing a stranger has ever done for you?   louplummer.lol/nice-stran... · Posted by u/speckx
Grazester · 8 hours ago
When I was 12 years old I got run off the road while riding my BMX bicycle when a car pulled into my lane to park on my side of the street. I was going about 12-20 mph and could not stop since I only had rear brakes. I just locked the rear tire and the bike continued sliding on the dust covered road side.

I went over a platform and into a small garage pit used for burning trash. After I stopped rolling, I dusted myself off and thought, "well, that could have been worse". Then came a man running towards me, grabs my elbow and pulls the head of a broken bottle out of it. Blood started spraying everywhere of course.

After one of my friends that was riding with me used his shirt as a tourniquet, the man flagged down a (private) mini bus(that provides public transportation), to me to the hospital, stayed with me then, paid my bus fare and then took me back home to my neighbourhood.

I never saw the man again even though he probably lived in the neighbourhood next to mine.

Recently in NYC, I was offloading my car when a girl with a box of croissants and cookies came up to me as asked if I wanted a croissant. She that she mistakenly bought more than she could eat. I looked at her as if she fell from space for a second and she noticed. She then said she bought the from a nearby bakery and they were perfectly fine as she continued eating one herself. I hesitantly took one, which was still warm and bite into it. It was great and I told her girl so and thanked her.

I went inside with my croissant in hand and told my wife what had happened. I got the scolding of my life for eating food from a stranger. I had to throw the rest of the crossiant away of course. That sucked because that one bite was so good.

fainpul · 2 hours ago
> grabs my elbow and pulls the head of a broken bottle out of it. Blood started spraying everywhere of course.

I learned in first aid courses that if something is stuck deeply in a wound, you should not pull it out, but instead fixate it with some bandage and go to the hospital like that. The reason is that it can start bleeding a lot more if the object is removed.

Deleted Comment

fainpul commented on Show HN: I made a spreadsheet where formulas also update backwards   victorpoughon.github.io/b... · Posted by u/fouronnes3
SoftTalker · 2 days ago
Can you enter an RSA key and have it produce two prime numbers?
fainpul · 20 hours ago
In Prolog you can write rules (similar to functions in other languages) so that they work "both ways". Let's say you have this rule that defines how pace ("runner's speed") relates to distance and time:

  :- use_module(library(clpr)).

  pace(Km, Minutes, Pace) :-
    { Minutes = Km * Pace }.

Even though the rule only specifies how Minutes are calculated, Prolog can now also calculate the other values.

You can query it, giving unknowns an uppercase `Name`, and it will give you the possible values for it:

  pace(5, 24.5, Pace)
  pace(40, Min, 5)
  pace(Km, 24.5, 5)
  pace(Km, Time, 5)
  
You can try it here: https://swish.swi-prolog.org/

So if you had a rule that defines RSA key calculation this way, you could enter a key and get all valid solutions for the primes. But of course complex calculations still take a long time. I assume it's similar to a brute force attack in that way (Prolog has clever strategies to explore the solution space though).

Disclaimer: I'm not an expert in Prolog or cryptography, so this might not be 100% accurate.

fainpul commented on Show HN: I made a spreadsheet where formulas also update backwards   victorpoughon.github.io/b... · Posted by u/fouronnes3
areyousure · a day ago
I have wanted one general application of this idea in a spreadsheet. Specifically, I track some of my running, including speed (pace), distance, and time. Under different circumstances, I have exactly two of the three available and I want the third to be computed, but it varies which. I have found it fairly difficult to implement this kind of data entry in Google Spreadsheets and Excel, even know conceptually it's a very simple constraint "a*b=c" where I know some two variables.

As a more substantive comment: You may find the thesis "Propagation networks : a flexible and expressive substrate for computation" by Alexey Radul interesting. https://dspace.mit.edu/handle/1721.1/54635

fainpul · a day ago
You could create a table with 3 columns: distance, time, pace. Set the display format for time and pace to "Duration".

Enter these formulas:

  distance = time / pace
  time = distance * pace
  pace = time / distance
Drag fill everything down. At this point you get reference errors, but once you enter any two values (thereby overwriting the formulas in those cells), you get your result.

fainpul commented on Sick of smart TVs? Here are your best options   arstechnica.com/gadgets/2... · Posted by u/fleahunter
itopaloglu83 · a day ago
Add a camera and microphone, and you have yourself a utopia that can control masses.
fainpul · a day ago
You mean dystopia, right?
fainpul commented on 4 billion if statements (2023)   andreasjhkarlsson.github.... · Posted by u/damethos
fainpul · 2 days ago
Any good engineer knows there is no "best" solution, only tradeoffs.

Save space.

  def even_flip_flop(number):
    even = True
    for _ in range(number):
      even = not even
    return even

Ditto. Sure, this overflows the stack, but you look cool doing it.

  def even_recursive(number):
    return True if number == 0 else not even_recursive(number - 1)

Save time. Just buy more RAM.

  table = [True, False] * 1000  # adjust to your needs
  def even_lookup(number):
    return table[number]

fainpul commented on Programmers and software developers lost the plot on naming their tools   larr.net/p/namings.html... · Posted by u/todsacerdoti
fainpul · 2 days ago
By the author's standard, macOS and iOS has some pretty much perfect program names, I suppose:

App Store, Mail, Photos, Music, Books, Podcasts etc.

fainpul commented on Rubio stages font coup: Times New Roman ousts Calibri   reuters.com/world/us/rubi... · Posted by u/italophil
pinkmuffinere · 4 days ago
I tend to agree with you, many people are passionate about typefaces, and dictators are no exception. [Passion about typeface] seems to be a low-signal detector for dictators. I'm passionate about lasagna, and I'll bet Mussolini was too -- but that probably doesn't mean I'm a fascist.
fainpul · 3 days ago
But if you go around and tell everyone you meet that they're doing it wrong and that lasagna MUST be prepared exactly the way you do it, because it's the one and only right way, then you're a lasagna-nazi :)
fainpul commented on Valve: HDMI Forum Continues to Block HDMI 2.1 for Linux   heise.de/en/news/Valve-HD... · Posted by u/OsrsNeedsf2P
tylerflick · 4 days ago
Monitor brightness is controlled over CEC which is just i2c. Windows most certainly supports this on an OS level.
fainpul · 3 days ago

u/fainpul

KarmaCake day611April 27, 2025View Original