None
const axios = require("axios");
const { setTimeout } = require("timers/promises");

const HOST = "https://rdrama.net";
const REPLY_URL = `${HOST}/reply`;
const UNREAD_URL = `${HOST}/unread`;
const REPLY_MESSAGE = ":marse#ykys:";

const ACCESS_TOKEN = "YOUR_TOKEN_HERE";

async function execute() {
  while (true) {
    const config = { headers: { Authorization: ACCESS_TOKEN } };

    console.log("CHECKING UNREADS");
    const response = await axios.get(UNREAD_URL, config);

    for (const unread of response.data.data) {
      console.log("FOUND UNREAD\n", unread.author_name);

      if (unread.author_name === "SomeStupidAsshole") {
        const form = new FormData();
        form.append("parent_id", unread.id);
        form.append("body", REPLY_MESSAGE);
        await axios.post(REPLY_URL, form, config);
        console.log("SENT REPLY");
      }
    }

    await setTimeout(60000);
  }
}

execute().then(() => process.exit(0));

If you don't know how to into Javascript, reply here. This site doesn't yet allow you to check DMs without marking them as read, so I won't see any DMs while this script is needful for me

None

orange sight: https://news.ycombinator.com/item?id=40237745

Completely free (video lectures and textbook) graduate level course on crypto

None

Full story.

https://restofworld.org/2024/tsmc-arizona-expansion/

None
32
I ported :marseybug2: THOUSANDS of apps to Windows 95 :marseybsod: (1hr :marseylongpost: but 100% worth the watch if you have :marseylaptop: :autism: )
None

source for that is https://www.theinformation.com/articles/how-amazons-big-bet-on-just-walk-out-stumbled, which I cannot bypass the paywall on :marseyshrug:

None
35
RDrama's Official Programmer Socks Reading Group

The Official RDrama Computer Science Reading Group

My dear !codecels, hello and welcome to the first meeting of RDrama's Computer Science Reading Group! Here's the idea - we (read: I) pick a computer science textbook, then post a list of sections and exercises from that textbook each week. In the thread, feel free ask questions, post solutions, and bully people for asking stupid questions or posting stupid solutions. If you don't want to read along, I'll post the complete exercises in the OP, so you can solve them without needing to read the book.

SICP

The book I'm starting with is 'the Structure and Interpretation of Computer Programs' (abbreviated SICP). It's a software engineering textbook written by Gerald Jay Sussman and Hal Abelson from MIT. The book builds programming from the ground up: starting with a very simple dialect of Scheme and growing it into a language with lazy evaluation, object-orientation and a self-hosting compiler. It's a fun book: the exercises are hands-on and interesting, the writing is informative without being droll, and both the book itself and a corresponding lecture series (complete with a 80s synth rendition of 'Also Sprach Zarathustra') are available for free online.

Languages

The book uses (a small subset of) Scheme as its primary language, but feel free to try using a different language. The book's dialect of scheme is available through Racket, but most lisps will work with only minor changes. Other dynamically-typed, garbage-collected languages with higher-order functions will also not require much hacking: there is an edition written in JavaScript :marseywebshit:, as well as a partial adaptation to python :marseysnek:. High-level, statically typed languages might also work: Java/Kotlin/C# :marseytunaktunak: seem doable, but I don't know those languages well. Strongly typed languages like Haskell will require some real hacks, and I'd avoid doing it in C, C++ or Rust.

Exercises

The book is split into five chapters:

  • Building Abstractions with Procedures
  • Building Abstractions with Data
  • Modularity, Objects and State
  • Metalinguistic Abstraction
  • Computing with Register Machines

This week, I'll be posting exercises from the first chapter. The chapter is pretty easy for those familiar with programming already, so I just want to get it out of the way. Here are the selected exercises:

Exercise 1.8

Newton's method for cube roots is based on the fact that if y is an approximation to the cube root of x, then a better approximation is given by the value (x/y² + 2y) / 3. Use this formula to implement a cube-root procedure which is wrong by at most 0.01.

Exercise 1.12

The following pattern of numbers is called Pascal's Triangle.

    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
   ...

The numbers at the edge of the triangle are all 1, and each number inside the triangle is the sum of the two numbers above it. Write a procedure that computes elements of Pascal's triangle.

Exercise 1.18

Devise a procedure generates an iterative process for multiplying two integers in terms of adding, doubling, and halving and uses a logarithmic number of steps.

Exercise 1.31

Write a procedure called product that returns the product of the values of a function at points over a given range (product(l, r,step,f) = f(l) * f(l+step) * f(l + 2 * step) * ... * f(r)). Show how to define factorial in terms of product. Also use product to compute approximations to using the formula π/4 = (2 * 4 * 4 * 6 * 6 * 8 ...) / (3 * 3 * 5 * 5 * 7 * 7 ...)

Exercise 1.43

If f is a numerical function and n is a positive integer, then we can form the nth repeated application of f, which is defined to be the function whose value at x is f(f(...(f(x))...)). For example, if f is the function x → x + 1, then the nth repeated application of f is the function x → x + n. If f is the operation of squaring a number, then the nth repeated application of f is the function that raises its argument to the 2 * nth power. Write a procedure that takes as inputs a procedure that computes f and a positive integer n and returns the procedure that computes the nth repeated application of f. Your procedure should be able to be used as follows: repeated(square,2)(5) = 625

Have fun! :marseytype:

None

black lives matter less

None
42
IT dramatards: I need YOUR help on starting a homelab :marseyhacker:

I've been wanting to build a beginner home lab for a couple of months. I plan on using a type 2 hypervisor as I'm more familiar with workstation pro compared to bare metal. I want more practice with AD and also plan on setting up game servers for games like Minecraft. Don't plan on making a NAS or media server yet because I'm poor.:marseywagie:

Got myself a 12600k and have an unused Netgear GS305E managed switch.

Any tips or resources to look at before completing my PC build?

Thinking of just using Sata ssd/nvme drives. I also have a gaming pc and laptop and wondering if I should use one of them as a terminal and /or just make one network instead of setting up the vlans.

None
72
AT&T Future Technology Predictions from 30 Years Ago

What all did they get right?

The tech looks cooler in the ads as opposed to what we ended up with. These were directed by David Fincher, so maybe he's just good at making shit look cool :marseysadge:

None
204
:marseylibations: Omegle shut down, for real. :marseyitsover:

Apparently this lawsuit was the breaking point.

https://www.bbc.com/news/technology-64618791

Foid decided 10 years later to sue the site that allowed her and her abuser to meet. Not sure how omegle is responsible for the actions of the abuser. However, it doesn't matter because it seems omegle doesn't have the means to fight the battle and decided to close shop. RIP.

Here's an excerpt from the founder's final thoughts. This hit me pretty hard and kinda sums up the noticeable decline of the internet.

I worry that, unless the tide turns soon, the Internet I fell in love with may cease to exist, and in its place, we will have something closer to a souped-up version of TV – focused largely on passive consumption, with much less opportunity for active participation and genuine human connection.

omegle.com

None
Reported by:

https://i.rdrama.net/images/1692850200125958.webp

@pizzashill discuss

orangesite https://news.ycombinator.com/item?id=37237583

None
39
Community FOSS PCBs and prototypes :marseyshook: :marseychemist2:

Similar to thingaverse

https://www.thingiverse.com

for 3D printers and CNC. PCBway has a community platform for PCB designs and chipsets that allow you to automatically order any popular product to be manufactured at will :marsey: :marseythebuilder:

This is really cool for modding game consoles, hobby electronics, DIY or home automation without globohomo IOT data mining. Very useful :marseywave2: My relative is an electrician and raves about it being an amazing company.

Just wanted to make sure people here were aware of these resources for any fellow hobbyist :marseylove:

!chuds !nonchuds APPLY YOURSELVES :marseyannoyed:

None
25
Running bark ai with pytorch 2 on a rx580 2048SP 8gb

Bark is an AI text to speech generator

WARN: You will NOT be able to run the full sized model with this card, you need 12gb of VRAM for that. You can however use the small model

Following the guide here you can get the last supported version of rocm installed

sudo echo ROC_ENABLE_PRE_VEGA=1 >> /etc/environment
sudo echo HSA_OVERRIDE_GFX_VERSION=8.0.3 >> /etc/environment
# reboot

wget https://repo.radeon.com/amdgpu-install/22.40.3/ubuntu/focal/amdgpu-install_5.4.50403-1_all.deb
sudo apt install ./amdgpu-install_5.4.50403-1_all.deb
sudo amdgpu-install -y --usecase=rocm,hiplibsdk,mlsdk

sudo usermod -aG video $LOGNAME
sudo usermod -aG render $LOGNAME

WARN: Do NOT use default options for amdgpu-install (run without any flags)! This will install a non-working driver and your card will bootloop until the software is uninstalled!

Then you install to install NCCL. If you have a nVidia dev account you can download the deb, if not you'll need to compile it.

git clone https://github.com/NVIDIA/nccl.git
cd nccl/
make -j src.build

WARN: It took 16gb of ram and 32gb of swap for me to compile it. If you don't have enough swap run

sudo fallocate -l 32G ./swapfile
sudo chmod 600 ./swapfile
sudo mkswap ./swapfile 
sudo swapon ./swapfile

You will also need to install nvidia-cuda-dev, but this is in Ubuntu repos!

sudo apt install nvidia-cuda-dev

From there run

git clone https://github.com/pytorch/pytorch.git -b v2.0.1
cd pytorch
export PATH=/opt/rocm/bin:$PATH ROCM_PATH=/opt/rocm HIP_PATH=/opt/rocm/hip
export PYTORCH_ROCM_ARCH=gfx803
export PYTORCH_BUILD_VERSION=2.0.1 PYTORCH_BUILD_NUMBER=2
python3 tools/amd_build/build_amd.py
USE_ROCM=1 USE_NINJA=1 python3 setup.py bdist_wheel

After compilation is finished the .whl file should be under /dist/

I strongly recommend NOT installing this system wide. Make a virtual env for the project you're going to use it in and install it there.

python -m venv venv --system-site-packages

source venv/bin/activate
pip install /path/to/pytorch-2.whl

Now you're ready to install torch audio

export BUILD_VERSION=2.0.2
git clone https://github.com/pytorch/audio.git
cd audio
mkdir build
cd build
MAKE_CXX_COMPILER=/usr/bin/hipcc cmake -DBUILD_BENCHMARK=ON -DCMAKE_PREFIX_PATH=/home/$USER/code/bark/venv/lib/python3.10/site-packages/torch  ../.
FORCE_CUDA=1 ROCM_HOME=/opt/rocm/ python3 setup.py bdist_wheel

Make sure you build version 2.0.2! It's the only version that works with pytorch 2.0.1!

From start to finish counting download (pytorch is fucking massive!) it took me a little over 8 hours to get everything working.

Cuda init error:

To bypass the cuda init check (which our GPU will crash because cuda assumes we have a nVidia named card not gfx803) open the file venv/lib/python3.10/site-packages/torch/cuda/http://__init__.py, search for def _check_capability(): and add return under it. It should end up looking like

def _check_capability():
    incorrect_binary_warn = """
    Found GPU%d %s which requires CUDA_VERSION >= %d to
     work properly, but your PyTorch was compiled
     with CUDA_VERSION %d. Please install the correct PyTorch binary
     using instructions from https://pytorch.org
    """

    old_gpu_warn = """
    Found GPU%d %s which is of cuda capability %d.%d.
    PyTorch no longer supports this GPU because it is too old.
    The minimum cuda capability supported by this library is %d.%d.
    """

    if torch.version.cuda is not None:  # on ROCm we don't want this check
        return
        CUDA_VERSION = torch._C._cuda_getCompiledVersion()
        for d in range(device_count()):
            capability = get_device_capability(d)
            major = capability[0]
            minor = capability[1]
            name = get_device_name(d)
            current_arch = major * 10 + minor
            min_arch = min((int(arch.split("_")[1]) for arch in torch.cuda.get_arch_list()), default=35)
            if current_arch < min_arch:
                warnings.warn(old_gpu_warn % (d, name, major, minor, min_arch // 10, min_arch % 10))

You are now ready to test your bark install

from bark import SAMPLE_RATE, generate_audio, preload_models
from scipy.io.wavfile import write as write_wav
from IPython.display import Audio
import os
os.environ["SUNO_OFFLOAD_CPU"] = "True"
os.environ["SUNO_USE_SMALL_MODELS"] = "True"

# download and load all models
print("Preloading models")
preload_models()
print("Loaded")

# generate audio from text
text_prompt = """
     Hello, my name is Suno. And, uh — and I like pizza. [laughs] 
     But I also have other interests such as playing tic tac toe.
"""
print("Generating text")
audio_array = generate_audio(text_prompt)
print("Done")

# save audio to disk
write_wav("bark_generation.wav", SAMPLE_RATE, audio_array)
  
# play text in notebook
Audio(audio_array, rate=SAMPLE_RATE)

Save the above to a file named test.py and run it.

YOU SHOULD NOT SEE ANY WARNINGS ABOUT AN UNUSED GPU. IF YOU DO REINSTALL TORCH pip install .//path/to/whl/ and try again.

If you see a bunch of errors about missing libs you probably forgot to source your venv source /venv/bin/activate

If you get undefined symbol errors (gsm_create, gsm_destroy ect) you compiled using your systems libgsm and not the version in torchaudio. You can work around this by running export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgsm.so.1

If everything's working at this point you'll see some warnings about "AMD Radeon RX 580 2048SP with CUDA capability sm_80 is not compatible with the current PyTorch installation." and "Can't initialize NVML" these are both false warnings and can be ignored.

On the first run you should see the script reach out and download a bunch of models

When finsihed you should have a file named "bark_generation.wav"

!codecels

None

Just lol

None

A study found that anti-piracy messages work on women but actually make men MORE likely to pirate (because dudes rock :marseyjam:).

One brave slashdotter has to remind everyone that this is because women get punished for rebelling ( :marseyrofl: )

Meanwhile the rest of the comments have entirely too many people fully admitting that they don't pirate because they "have too much to lose" and apparently don't know what a fricking VPN is, which is a truly darning indictment of what used to be one of the best tech-literate forums on the interwebs.

None

https://nap.nationalacademies.org/catalog/11763/lost-crops-of-africa-volume-ii-vegetables

https://nap.nationalacademies.org/catalog/11879/lost-crops-of-africa-volume-iii-fruits

https://nap.nationalacademies.org/catalog/1398/lost-crops-of-the-incas-little-known-plants-of-the

Pretty based set of ebooks on native crops in these regions that have a lot of potential.

None
126
California Personalized License Plate Requests Flagged for Review 2015-2016

https://i.rdrama.net/images/1700957389357714.webp

Can't believe PEEPEE OUT didn't make it. RIP Harambe, you were too good for this world.

None
94

i thought this already but now its real

also !codecels come laugh and point

https://graz.social/@publicvoit/111147782761723981

https://i.rdrama.net/images/169601269182137.webp

slack my nuts

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

https://i.rdrama.net/images/16960126921676342.webp

:marseyhappening: :marseypenguin:

None

orangesite: https://news.ycombinator.com/item?id=37267597

nobody there yet but will be because PG tweet: https://twitter.com/paulg/status/1695197772448686507

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.