Readit News logoReadit News
kayge commented on 4 billion if statements (2023)   andreasjhkarlsson.github.... · Posted by u/damethos
kayge · 4 days ago
> any value over 2^31 seems to give random results.

Wow he really lucked out... On his way to perfecting a fully functioning and performant Even/Odd Detector, he stumbled upon a fully functioning and performant Coin Flip Simulator!

kayge commented on Size of Life   neal.fun/size-of-life/... · Posted by u/eatonphil
ekipan · 6 days ago
Cannot stand robot code. Thanks for the genuinely cool thing though. I hope you don't mind me rewriting, if only for my own satisfaction.

  {
    const s = window.scroller = {}
    const press = (key, code) => () =>
      document.dispatchEvent(new KeyboardEvent('keydown', {
        key: key, keyCode: code,
        which: key, code: code, bubbles: true
      }));
    const step = () => {
      const div = document.querySelector('.animal-name')
      const name = div?.textContent.trim()
      if (name === 'Pando Clone') s.dir = s.left
      if (name === 'DNA') s.dir = s.right
      s.dir()
    }
    s.left = press(37, 'ArrowLeft')
    s.right = s.dir = press(39, 'ArrowRight')
    s.start = (ms) => s.ival = setInterval(step, ms)
    s.stop = () => clearInterval(s.ival)
  }
  scroller.start(5000)

kayge · 5 days ago
I don't mind at all, your rewrite looks much more elegant. Thanks!
kayge commented on Size of Life   neal.fun/size-of-life/... · Posted by u/eatonphil
kayge · 6 days ago
If anyone wants to set this up to auto-run all the way to the right and then all the way back to the left, here is a vibe-coded (sorry) browser console script. Makes a great "screen-saver" if you kick off the script and then put your browser in full screen mode :)

    (function() {
        let direction = 'right'; // Start by going right
        let intervalId;

        function getCurrentAnimalName() {
            const animalDiv = document.querySelector('.animal-name');
            return animalDiv ? animalDiv.textContent.trim() : '';
        }

        function pressKey(keyCode) {
            const event = new KeyboardEvent('keydown', {
                key: keyCode === 37 ? 'ArrowLeft' : 'ArrowRight',
                keyCode: keyCode,
                code: keyCode === 37 ? 'ArrowLeft' : 'ArrowRight',
                which: keyCode,
                bubbles: true
            });
            document.dispatchEvent(event);
        }

        function autoScroll() {
            const currentName = getCurrentAnimalName();
            
            if (direction === 'right') {
                pressKey(39); // Right arrow
                
                if (currentName === 'Pando Clone') {
                    console.log('Reached Pando Clone, switching to left');
                    direction = 'left';
                }
            } else {
                pressKey(37); // Left arrow
                
                if (currentName === 'DNA') {
                    console.log('Reached DNA, switching to right');
                    direction = 'right';
                }
            }
        }

        // Start the interval
        intervalId = setInterval(autoScroll, 3000);
        
        // Log start message and provide stop function
        console.log('Auto-scroll started! To stop, call: stopAutoScroll()');
        
        // Expose stop function globally
        window.stopAutoScroll = function() {
            clearInterval(intervalId);
            console.log('Auto-scroll stopped');
        };
    })();

kayge commented on What will enter the public domain in 2026?   publicdomainreview.org/fe... · Posted by u/herbertl
Night_Thastus · 15 days ago
Something about this page doesn't seem to work for me. Clicking the tiles doesn't do anything. It's not ad-blocker-related, I disabled those to test.
kayge · 14 days ago
If you want to skip to December 31st, you can enter the following into your browser console to make all the tiles/doors openable:

  const elements = document.querySelectorAll(".countdown-calendar__door");
  elements.forEach(element => {
    element.classList.add("will-open");
  });

kayge commented on Yann LeCun to depart Meta and launch AI startup focused on 'world models'   nasdaq.com/articles/metas... · Posted by u/MindBreaker2605
debo_ · a month ago
en deux
kayge · a month ago
I think it was more than 2 though... en few? En feux.
kayge commented on LLMs are steroids for your Dunning-Kruger   bytesauna.com/post/dunnin... · Posted by u/gridentio
hathawsh · a month ago
Most of HN has probably seen this gem about "thinking meat", but in case you haven't: https://www.mit.edu/people/dpolicar/writing/prose/text/think...
kayge · a month ago
Also a great read-through of this by H. Jon Benjamin (Archer / Bob's Burgers) and Maeve Higgins: https://www.youtube.com/watch?v=5usXhX0zaO4
kayge commented on Armed police swarm student after AI mistakes bag of Doritos for a weapon   dexerto.com/entertainment... · Posted by u/antongribok
kayge · 2 months ago
I wonder if the AI correctly identified it as a bag of Doritos, but was also trained on the commercial[0] where the bag appears to beat up a human (his fault for holding on too tight) and then it destroys an alien spacecraft.

[0] https://www.youtube.com/watch?v=sIAnQwiCpRc

kayge commented on The Rapper 50 Cent, Adjusted for Inflation   50centadjustedforinflatio... · Posted by u/gaws
mk_stjames · 2 months ago
I was prepared to be absolutely fucking disgusted by such a comment but I.... shit. I mean... this is.... this is wild

I gotta go contemplate 'where we're at' again it seems. If that is truly a straight generative audio diffusion model.... wait, how did they get the same verse by verse chord progressions to match? this has to be professionally post-produced, right? AI models aren't able to do this end-to-end yet, right?

kayge · 2 months ago
As a big fan of Chris Cornell I went through the same stream of emotions with their Motown version of Like a Stone[0]. And if you can get past the thumbnail, check out the 2000s Rock version of Many Men[1]

[0] https://www.youtube.com/watch?v=_88Qg8FGrqY [1] https://www.youtube.com/watch?v=8gFKREP3gPg

kayge commented on The Rapper 50 Cent, Adjusted for Inflation   50centadjustedforinflatio... · Posted by u/gaws
earlyriser · 2 months ago
Conversions to Nickelback, Poundz, Los Pesos, DJ Euro and Yen.
kayge · 2 months ago
Don't forget Johnny Cash and Eddie Money :D
kayge commented on A macOS terminal command that tells you if your USB-C cable is bad   kau.sh/blog/usbi/... · Posted by u/freetonik
bediger4000 · 2 months ago
Two years ago, I wouldn’t have bothered with the rewrite, let alone creating the script in the first place. The friction was too high. Now, small utility scripts like this are almost free to build.

This aligns with the hypothesis that we should see and lots lots of "personalized" or single purpose software if vibe coding works. This particular project is one example. Are there a ton more out there?

kayge · 2 months ago
Yep! Nothing worth sharing/publishing from me, but quite a few mini projects that are specific to my position at a small non-tech company I work for. For example we send data to a client on a regular basis, and they send back an automated report with any data issues (missing fields, invalid entries, etc) in a human-unfriendly XML format. So I one-shotted a helper script to parse that data and append additional information from our environment to make it super easy for my coworkers to find and fix the data issues.

u/kayge

KarmaCake day464February 1, 2012
About
Programmer by day, bug bounty hunter by night; lots of other stuff in between. At protonmail if you'd like to reach out.
View Original