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
76
:marseypikachu2: Facebook/Meta spied on millions of people with illegal spyware

"Documents and testimony show that this “man-in-the-middle” approach – which relied on a technology known as a server-side SSL bump performed on Facebook's Onavo servers – was in fact implemented, at scale, between June 2016 and early 2019,” plaintiffs claim.

The spyware capable of acquiring, decrypting, and transferring the data was allegedly deployed against YouTube in 2017-2018 and against Amazon in 2018.

The code included a client-side “kit” that installed a root certificate on Snapchat users' mobile devices. Server-side code allegedly used Facebook's servers to create fake digital certificates to impersonate the apps' trusted analytics servers in order to redirect and decrypt the analytics traffic for Facebook's own analysis.

Facebook's secret program likely violated the Wiretap Act, which prohibits intentionally intercepting electronic communications and using such intercepted communications.

TL;DR apps using facebook/meta api (and some VPN they have bought up) to collect data from millions of users and spy on competition. Naturally, a minuscule fine was applied, a slap on the wrist would have been excessive, judges say.

None

https://media.giphy.com/media/cjc7LcP6GyXbGlKy3e/giphy.webp

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

https://www.forbes.com/sites/bernardmarr/2023/02/21/ai-can-now-make-you-immortal--but-should-it/

https://www.forbes.com/sites/traversmark/2023/12/18/a-psychologist-explains-the-appeal-of-mind-upload-technology/

How times have changed. Imagine if all this technology just fails?

None

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

None
50
:marseydance:
None

!codecels :marseygiveup:

!chuds :marseynooticeglow:

https://i.rdrama.net/images/17098184380879538.webp https://i.rdrama.net/images/1709818438362093.webp https://i.rdrama.net/images/17098184387126412.webp https://i.rdrama.net/images/170981843883113.webp https://i.rdrama.net/images/17098184390250685.webp

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

None
58

The company is Varda Space. They are experimenting with manufacturing drugs in space. Their first batch returned to earth today, landing in the Utah desert.

I know you're asking: why manufacture drugs in space? Well basically when creating crystals on earth, there is sometimes a more stable but less useful form that ends up emerging. I don't really understand this ( I failed chemistry lol) but kinda interesting

https://en.wikipedia.org/wiki/Disappearing_polymorphs

The specific drug made in space is called Retonavir, which is used for helping with HIV patients. So no, the title of this post wasn't even a joke. Lest you think that I made this up:

https://www.healio.com/news/infectious-disease/20240222/hiv-drugs-manufactured-in-space-return-to-earth

Outside of the memes, this is pretty neat. Who knows what other stuff we will manufacture in orbit, with the cost of space launches decreasing?

None

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

MOAR FREE CODESHIT FRICK YEA

None

Here's a Eurobeat song about Marsey trolling on the internet

Here's some folk songs about !jinxthinkers

None
45
Redis is now Redict

Are you familiar with Redis, the in-memory key-value store used as commonly cache or database? It's been quite a busy week for them.

First, it is now Redict.

Second, Redis Labs, the company - not to be confused with Redis the product - has changed the Redis license from BSD-3 to Server Side Public License SSPLv1.

https://ssplisbad.com/

Timeline of Redis the product:

  • 2008: Salvatore 'Antirez' Sanfilippo creates Redis the product

  • 2015: Antirez gets hired by Redis Labs (formerly Garantia Data)

  • 2018: Antirez sells the trademark and IP rights of the product to the company

  • 2020: Antirez quits and goes away from Redis Labs the company

  • 2024: Redis Labs changed license

This announcement is just after the company released a blog "The Future Of Redis" where they started yapping about AI :marseyemojirofl:

Making Redis the Go-To for Generative AI

we're staying at the forefront of the GenAI wave

There's barely any drama :marseycry: But before we explore the tepid tea, I'd like to do a throwback :marseyxd:

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

Github announcement thread

First of all he's corny as frick

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

One of the handful of contributors doing this. Is this valid?

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

Oh okay it isn't valid then..?

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

Predicting the future

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

Github jannies cleaned this up?

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

Moral of the story: Don't contribute to projects with BSD licenses

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

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

:marseymerchant:

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

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

As forks are being made left and right, this codecel is concerned that the repos are not hosted on Github :marseypearlclutch:

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

Orange site discusses

The creator, Antirez, responds

They seem supportive

Classical "bait-and-switch". Bait users and developers with a fully-open and freely-licensed project, wait for it to gain enough market share, then switch the license to a more restrictive one...

Is it really bait and switch if almost zero users are affected by the change? (except philosophically)

:marseyhesright:

Will no one think of Amazon's profit margins?

We need new licenses that let developers get more of the pie because no one is benefiting from the GPL in the age of cloud computing. Who cares that Linux is open source when I'm locked in aws and can never leave? What does it matter to users when their data is stolen to train Ai models and they don't even know what's in it?

[more arguing]

the trend of milking revenue from a few sources with license changes is cringe.

:marseytroublemaker:

It's about time we stopped calling projects that require copyright assignments "open-source", because they aren't. Regardless of license.

:marseyeyeroll:

As usual, the comment section is full of entitled people whining about “muh open source”.

Like others have said, OSI definition of open source is very outdated and needs to be updated.

Interestingly Microsoft just released https://github.com/microsoft/garnet, it's a research project so I don't hope anything for it, it's gonna fail and die alongside MAUI and WinUI and WPF and everything in the dumpster :marseydead:

None
71
old.reddit.com now blocking access :marseybarrier: if you're using a VPN and no login

Up until today, you couldn't access Reddit while using a VPN, unless you were logged in. A workaround was to use https://old.reddit.com.

But today, you get the same soy-based message "whoa there, pardner!" on https://old.reddit.com too.

None

However, that data was being shared with data brokers LexisNexis Risk Solutions and Verisk, who'd then sell it to the insurance industry. Earlier this month, the NY Times reported that an owner of a Cadillac XT6 in Florida sued GM after he saw his insurance rates double due to data collected about his driving.

None
None
44
Nerds don't like being told their use of adblockers is immoral
None

Orange Site:

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

:marseysnoo:

https://old.reddit.com/r/technology/comments/1bmkk0x/china_blocks_use_of_intel_and_amd_chips_in/?sort=controversial

https://old.reddit.com/r/hardware/comments/1bmjlza/china_blocks_use_of_intel_and_amd_chips_in/?sort=controversial

None
61
Humans are winning at mammalian biomass!

Source, they are upset about this because they hate humanity

None

The original post was deleted but it linked to this article: https://www.rollingstone.com/music/music-features/suno-ai-chatgpt-for-music-1234982307/

TLDR: Suno is a new startup that started with a text to speech AI called bark, but now their latest project is chirp which is for text to music. A new version was just released with results that are almost indistinguishable from real music plus a bunch of new features, and they now offer a subscription that gives you the rights to use them in content or sell on streaming services.

I hate this so much.

Give me a real musician making real music with real instruments and real voices over this crap.

Funny thing is, sometime within the next 5 years, you'll find yourself really enjoying a piece of music, it will be AI generated, and you won't even know.

 

Maybe you have no idea how music is made these days. Most of it, certainly 99% of pop music, is using samples, not live musicians.

:marseyhesright#:

Great, another spam generator in another medium to devalue music as much as possible for basically no good reason.

Who does this help, exactly? People who hate artistic expression?

Ladies and gents, we've reached peak dystopia.

Enjoy the fallout.

:#marseyitsover:

None

Students get only two bathroom breaks a day for seven minutes each during classtime, and in order to request “bathroom privileges,” they must key in their student ID numbers to the app. It only green-lights them if there are fewer than 25 students taking restroom breaks, and when they return to class, they must key in again or risk losing the right to relieve themselves.

:#marseyxd:

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

None
20
TIL Intel annouced the specs for Thunderbolt 5 late last year - PCIe 4.0x4 support, 80Gbps :marseymindblown: :marseysonic:
None

In case you wanted to trust Scroogle and the US Government even less!

From Forbes

Federal investigators have ordered Google to provide information on all viewers of select YouTube videos, according to multiple court orders obtained by Forbes. Privacy experts from multiple civil rights groups told Forbes they think the orders are unconstitutional because they threaten to turn innocent YouTube viewers into criminal suspects.

In a just-unsealed case from Kentucky reviewed by Forbes, undercover cops sought to identify the individual behind the online moniker “elonmuskwhm,” who they suspect of selling bitcoin for cash, potentially running afoul of money laundering laws and rules around unlicensed money transmitting.

In conversations with the user in early January, undercover agents sent links of YouTube tutorials for mapping via drones and augmented reality software, then asked Google for information on who had viewed the videos, which collectively have been watched over 30,000 times.

The court orders show the government telling Google to provide the names, addresses, telephone numbers and user activity for all Google account users who accessed the YouTube videos between January 1 and January 8, 2023. The government also wanted the IP addresses of non-Google account owners who viewed the videos. The cops argued, “There is reason to believe that these records would be relevant and material to an ongoing criminal investigation, including by providing identification information about the perpetrators.”......

:#marseynotesglow:

>be spook

>send spooky youtube link

>ask youtube who watched your spookiness so you can go spook them at home

:#marseyveryworriedfed:

r/privacy discombobulates

None
19
Unpatchable crapple exploit found

https://arstechnica.com/security/2024/03/hackers-can-extract-secret-encryption-keys-from-apples-mac-chips/

None

I was thinking about having several bots, but didnt want to hammer the rdrama API so I split the api querying part of my application off.

Its designed to publish events to redis maintaining an nosqlish database of the retrieved items set to time out in 1 hour.

You could subscribe pretty much as many apps as you want to it and that way only one thing is hitting rdrama at a time

Its also leveraging bottleneck, so if you use bottleneck in your API calls back to rdrama and configure it to use the redis instance, you wont exceed rate limiting, and all your applications will share bandwith nicely

I might grab posts or other things, for now Its just focused on comments.

  • Efficient Data Retrieval: Fetches comments and posts directly from rDrama's APIs, optimized for minimal bandwidth usage.

  • Redis Integration: Utilizes Redis for caching content, significantly enhancing data retrieval speed and reducing API call redundancy.

  • Incremental Fetching: Employs smart fetching strategies to avoid duplicate data retrieval, ensuring that only new or updated content is processed.

  • Scheduled Fetching: Automatically executes data retrieval operations at configured intervals, enabling up-to-date synchronization with rDrama content.

  • Graceful Shutdown: Implements robust error handling and graceful shutdown processes, ensuring data integrity and application stability.

  • Scalable Architecture: Designed with scalability in mind, allowing for easy horizontal scaling to accommodate growing data volumes.

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