None
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

https://twitter.com/mrkylefield/status/1769549346100629720

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

Some of the other hardcore offroading the Cybertruck os capable of

https://twitter.com/mrkylefield/status/1769416291650343372

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

https://twitter.com/mrkylefield/status/1770074529844646243

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

None
Reported by:
  • Sphereserf3232 : Wait apex is a source game? :marseygasp:
  • BWC : Yes, but it runs on a very modified version of the Source Engine iirc

Respawn and EA have postponed the North American Finals in the wake of the “competitive integrity” of the game being compromised. This involved a wild situation where someone was giving the pros hacks like aimbots and wallhacks as they were playing in the Finals event, effectively ruining the entire thing without anyone actually attempting to cheat. Here's what that looked like (warning: language):

This has led to a mass of complaints about Apex's anti-cheat systems, which clearly failed in a massive way for this situation. But it also speaks to just how advanced cheats have become as this is a private lobby for pros playing in an esports final.

Not that this is necessarily related, but Respawn was just hit days ago with 23 layoffs including Apex Legends developers, some of whom were longtime veterans. Though if anything, this shows that EA needs to beef up Apex's security team to some extent as something like this requires all hands, or more hands, on deck than they currently have now, it seems.

Should have learned to code better :marseysmug2:

Easy Anti-Cheat's response- It wasn't me

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

Kiwis discuss

None
None
None

Hacker News discussion: https://news.ycombinator.com/item?id=39709089

None
None

If you see this post, I was able to make this post on Ladybird Web Browser :marseybrave: lol

None
108
:marseyitsover: How to get completely free, unlimited access to the GPT-4 API (until they shut it down)

Love you !codecels, :marseycodecellove: so I'm gonna show you how to get GPT-4 access for free. A few major caveats:

  • Scale will definitely shut this down at some point, so use it while it's available.

  • This might not actually be GPT-4. There's not really a way of knowing. I'm about 98% sure it is, but they may swap it out for 3.5 Turbo during outages (?)

  • You need some form of API interpreter for the JSON it spits out. Here, I'm using TavernAI, which is designed to be a Character.AI-like "chat" interface, with the ability to import and design "personalities" of characters. Great for coomers. Here's some pre-made characters, if you're interested (Some NSFW). Just download the image and import it.

  • Every message you send will pass through OpenAI's API, Scale, and If you don't change the API key, it will also pass through the 4chan guy who hosts the github's Spellbook deployment. There is exactly ZERO expectation of privacy. Don't be retarded and type illegal shit or personal info.

  • As of right now, the OpenAI API is having an outage. These are pretty frequent. :marseyitsoverwereback: (This is why I'm writing this thread rn instead of fucking around with GPT-4)

Now, how to actually set this up, using TavernAI, for lazy retards:

  • Have Node.js and git installed and know how to use them. This is /h/slackernews, I won't explain this part.

  • Make a temporary email. Just google 'temp email'. Turn on a VPN for the entire session as well, if you're really paranoid.

  • Head over to https://spellbook.scale.com/ and make an account with the temp email.

  • Create an "App", name and desc. don't matter.

  • Make a variant, and select GPT-4 in the dropdown.

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

  • If you're wanting to use the API with Tavern to emulate a chatbot, you should add the following to the 'User' section:

Complete the next response in this fictional roleplay chat.

{{ input }}

  • Set the 'Tempurature' to somewhere between 0.6 and 0.9. 0.75 works fine for me.

  • Set the maximum tokens to 512 for chatbot length responses. (You can increase this but it requires tweaking the TavernAI frontend.)

  • Save the variant. Go to the variant and hit "Deploy". You'll see a "URL" and an "API Key". Copy these down or come back here in a minute.

  • Open a terminal in a new folder, and run git clone https://github.com/nai-degen/TavernAIScale

  • Now run cd .\TavernAIScale\ then .\Start.bat (or .\start.sh for lincux)

  • TavernAI should launch automatically, but if it doesnt, go to http://127.0.0.1:8000/ in your browser.

  • In Tavern, go to 'Settings' on the right. Switch API to 'Scale'. Copy the API Key from the Spellbook page that you saw earlier into the API Key field. Same thing with the URL. Press 'Connect' to verify it's working. If it fails, either the API is down or you pasted the wrong Key / URL. Make sure you're using the URL from the URL field here:

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

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

  • Now, use one of the default anime characters :marseypuke: , download a coomer character from here, or make your own.

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

  • The API has many other uses, obviously, but the chatbot is the simplest way to get this up and running. Try fucking around with the "Main Prompt" and "NSFW Prompt" in the settings for some interesting results, or to tweak your desired output. Try pressing "advanced edit" on a character (or making your own) and messing around with personas and scenarios. It's pretty damn cool.

That's it. Have fun until this shit dies in like 3-4 days. Please try not to advertise this or make it known outside of rdrama and /g/. We don't want Scale to shut this down earlier than they already will.

:#marseywave2:

None
None
138
ChatGPT goes crazy, tries to kill a user :marseyxd: :marseysweating: :marseysnappyenraged2:

Apparently other users were able to replicate this behavior

!friendsofbbbb

(Copilot is ChatGPT AFAIK)

None
None
30
The antichrist is rising.
None
None
None

TLDW

  • Hope you're having a lovely day :#marseyheart:

  • "Smart" shit connecting to the internet is fricking r-slurred and shady companies can and will abuse this to change Tos/features. Companies are scum

  • Roku's expensive butt TV literally told it's users to accept an update (no other options, you can't even change to a different input) and part of the update is accepting you can't sue them (you must accept binding arbitration)

  • Compares Roku to a male feminist

  • Makes a very oblique refrence to Gavin McGinnis not allowing his wife to own a car and how that was a form of control and part of their divorce (some pretty deep lore, idk why he knows about that unless he's a fellow MATI enjoyer)

  • Continues talking about how the elite (manufacturers) get the proletariat (consumers) to fight among each other (subversion of the masses)

  • General Opt-in vs opt-out complaints because glowie TVs are always opt-out (if that)

  • Call for freedom, gets close to Tedposting :marseyunabomber#: This will continue to happen as along as consumers don't opt-out of purchasing shit products. Collective action is necessary.

  • Hopes you learned something :marseybigbrain#:

:marseycomrade#:

None

Apparently they might make St Patrick out of an AI algorithm?

None
69
ABSOLUTELY BRUTAL MAC DESTRUCTION

None
None
148
This ai is beyond cucked man

It reacts to half of the slang words ever by saying they're harmful and literal hate speech man tf is that

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

My only previous prompt was asking for weather

None
30
Car companies :marseysteer: cuck carcels :soycry: out of their personal data, including data related to their "s*x life"

Bike chads :marseygigachad: stay winning

Discussion question for all of the carcels here: how are cars supposed to be promoting "freedom" again?

None

Orange Site:

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

None

I had to double check to see if I didn't accidentally click on /int/ a few times.

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