Unable to load image
Reported by:
  • rDramaHistorian : We have so many cute codecels :marseyhappytears: thigh high pink&blue socks for everyone of u

NYT r-slur who self-describes as a "coder" writes about robots taking our jerbs :marseygigaretard:

The author of this article is hilarious. Here are some choice quotes:

>At one point, we wanted a command that would print a hundred random lines from a dictionary file. I thought about the problem for a few minutes, and, when thinking failed, tried Googling. I made some false starts using what I could gather, and while I did my thing—programming—Ben told GPT-4 what he wanted and got code that ran perfectly.

:marseylaugh: How the fuck does that take you multiple attempts, require you to Google shit, and then eventually take so long that your incrementally less r-slurred friend has to get ChatGPT to do it?

>when I was in high school I went to the Borders bookstore in the Short Hills mall and bought “Beginning Visual C++,” by Ivor Horton. It ran to twelve hundred pages—my first grimoire. Like many tutorials, it was easy at first and then, suddenly, it wasn't. Medieval students called the moment at which casual learners fail the pons asinorum, or “bridge of asses.” The term was inspired by Proposition 5 of Euclid's Elements I, the first truly difficult idea in the book. Those who crossed the bridge would go on to master geometry; those who didn't would remain dabblers. Section 4.3 of “Beginning Visual C++,” on “Dynamic Memory Allocation,” was my bridge of asses. I did not cross.

Out of curiosity I looked up the table of contents of this book: https://catdir.loc.gov/catdir/toc/ecip063/2005032051.html

Contents
1\. Programming with Visual C++ 2005
2\. Data, Variables, and Calculations
3\. Decisions and Loops
4\. Arrays, Strings, Pointers, and References

Thats right, this guy got filtered right after the chapter that explains if and for statements :marseylaughpoundfist:

Theres more r-sluration just after this paragraph as well, where he struggles to write a Hello World program and frames it as an epic intellectual struggle:

>I remember the moment things began to turn. I was on a long-haul flight, and I'd brought along a boxy black laptop and a CD-ROM with the Borland C++ compiler. A compiler translates code you write into code that the machine can run; I had been struggling for days to get this one to work. By convention, every coder's first program does nothing but generate the words “Hello, world.” When I tried to run my version, I just got angry error messages. Whenever I fixed one problem, another cropped up. I had read the “Harry Potter” books and felt as if I were in possession of a broom but had not yet learned the incantation to make it fly. Knowing what might be possible if I did, I kept at it with single-minded devotion.

The rest of the article is equally braindead, it looks like hes a CRUD front end dev or something. He brags about some of his high-octane :marseyairquotes: "craftsmanship" :marseyairquotes: here :

>A few months ago, I came home from the office and told my wife about what a great day I'd had wrestling a particularly fun problem. I was working on a program that generated a table, and someone had wanted to add a header that spanned more than one column—something that the custom layout engine we'd written didn't support. The work was urgent: these tables were being used in important documents, wanted by important people.

This really makes the rest of the articles pseudointellectual posturing extra hilarious to me.


This isn't really drama but I thought it was funny, so there :marseysunflower:

Theres a hackernews discussion but I don't think any of them read the article (or maybe they are all equally :marseybrainlet: ) because almost nobody is pointing out how retarded this article is.

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

75
Jump in the discussion.

No email address required.

At one point, we wanted a command that would print a hundred random lines from a dictionary file. I thought about the problem for a few minutes, and, when thinking failed, tried Googling. I made some false starts using what I could gather, and while I did my thing—programming—Ben told GPT-4 what he wanted and got code that ran perfectly.

:#marseyrofl:

Jump in the discussion.

No email address required.

Isn't this like literally 2 lines in C#?

Jump in the discussion.

No email address required.

def randlines(dict_file, n=100):
    import random
    d = open(dict_file, 'r').readlines()
    return random.sample(d, min(n, len(d)))
Jump in the discussion.

No email address required.

>Import statements inside a function body.

>reading the entire file into memory

>not using a context manager to clean up your file handles

:marseypuke:

Jump in the discussion.

No email address required.

Selecting random lines with uniform probability requires processing the entire file to know how many entries there are

Jump in the discussion.

No email address required.

strictly speaking you could just keep a list of (offset, length) pairs, randomly select N of them, then seek around the file to read the actual data out. It's technically two reads but as long as the number of lines you're pulling is low it probably won't matter, and worst case you've scanned the file twice (which is likely still in the OS cache).

Jump in the discussion.

No email address required.

You have to read through the whole file, but you don't need to slurp the entire thing into RAM to do it. I think you could read it line by line and keep or drop each individual line according to some random probability.

Jump in the discussion.

No email address required.

How do you choose that probability, given that you don't know the number of lines beforehand? If you choose wrong, you'll significantly favor lines at the start or end of the file, and if it's not fast, you'll be generating random numbers for every single line.

Short of loading the whole file into memory, which for a dictionary is probably fine, you're looking at streaming through the whole file twice, once to count newlines and once to randomly select items.

Jump in the discussion.

No email address required.

You added the requirement of uniform probability, not in the original spec. Are you a product owner?

For most files types, you could probably ballpark the number of lines by looking at the size on disk (especially if you know what the data is) and that would get you close enough.

Jump in the discussion.

No email address required.

This is a p0 business requirement it has to select words properly, our customers rely on only the best. Please do the needful, this will come up during your performance review :marseymad:

Jump in the discussion.

No email address required.

More comments
Jump in the discussion.

No email address required.

pfft

cat words.txt | sort -R | tail -100

Jump in the discussion.

No email address required.

pfft

sort -R words.txt | head -100

Jump in the discussion.

No email address required.

:marseybabykiller:

Jump in the discussion.

No email address required.

why would you import in the function

Jump in the discussion.

No email address required.

Because I wrote it in ipython and copied what I did, and I forgot to include it until I already started the def.

Jump in the discussion.

No email address required.

That's not PIP37 compliant. :marseysoylentgrin:

Jump in the discussion.

No email address required.

shuf -n 100 <FILE> is probably the shortest way, you don't even need to code it

Jump in the discussion.

No email address required.

Using POSIX compliant programs and/or BASH doesn't count. It MUST be in an approved language like javascript or javascript and it must be the lowest big O notation. We're going forward with other candidates. :marseydisagree:

Jump in the discussion.

No email address required.

The shuf command isn't even POSIX though.

Jump in the discussion.

No email address required.

BASH programs are real programs. :marseyindignant:

Jump in the discussion.

No email address required.

They are but codecels don't understand. They just compile dey kode in dey IDE, install interpreters and lie.

Jump in the discussion.

No email address required.

find / | grep faggotry | xargs -I@ sh -c "rm -rf @"
Jump in the discussion.

No email address required.

XARGS ISN'T SAFE :marseysoylentgrin: You need to use a rewrite in a safe language with input sanitation.

Jump in the discussion.

No email address required.

I'm thinking you could do it in three lines of PowerShell


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

It's arguably far more work in old standard C++ but it's still simple.

Jump in the discussion.

No email address required.

Googling how to generate random numbers is impossible

Jump in the discussion.

No email address required.

Please :marseyinshallah: be respectful Chiobu :marseyarmy: thank you :marseybottom:

Jump in the discussion.

No email address required.

:#marseyprotestno:

Jump in the discussion.

No email address required.

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

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

what does this mean why does my drink :marcusbeachtowel: say duckshit im scared :marseywtf: :marseysad:

Jump in the discussion.

No email address required.

because you're drinking duck poop

The term comes from its Chinese name 鴨屎香 (ya shi xiang), which literally translates to "duck shit fragrance."

Legend has it the farmer who discovered or invented the tea deliberately chose an unappealing name to hide his secret gains.

Despite the name, the tea "tastes and smells nothing like duck shit." We'll have to take their word for it.

It's a variety of oolong that's lightly roasted, with floral and musky notes.

The tea leaves are half fermented and when brewed, produces a clear yellow-orange tea.

Jump in the discussion.

No email address required.

They...they shat in my tea? And peed in my coke???

https://media.giphy.com/media/6oMhPwjvQc6LAEpEuq/giphy.webp

Jump in the discussion.

No email address required.

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