Absolutely, the goal isn’t to create some Platonic ideal of a society, it’s to make tangible material improvements and iterate on that. That’s really what dialectical materialism is all about. It’s a scientifically minded approach to improving society where we try things, see how they work out, and iterate on that.
My prediction is that he’ll absolutely dump Ukraine once he realizes what the actual cost of keeping the war going is going to be. Right now he seems to be under the impression that he can strong arm Russia into some kind of a deal, but once Russia rejects that then he’s not gonna have any cards left to play.
I’ve seen plenty of useful code written by LLMs. In fact, I use DeepSeek R1 all the time now, and I’m shocked at how good it is at writing clean code that generally works out of the box. Just the other day, I threw a json schema at it, and asked it to create a relational table schema to store it in SQL which it did respecting relationships like foreign keys. That would’ve been a couple of hours of work for me of just typing it all out. Not only that, but it actually explains its reasoning step by step, and a lot of that looks just the same way I would think about solving a problem. Here’s a concrete example for you from a recent session.
write a clojure function to use http-kit client to download an image from a given url and save it in sqlite
<think> Okay, I need to write a Clojure function that uses the http-kit client to download an image from a URL and save it into an SQLite database. Let’s break this down step by step.
First, I know that http-kit is a Clojure library for making HTTP requests. So I’ll need to include the http-kit dependency in the project.clj or deps.edn file. But the user probably just wants the code, so maybe mention the dependencies they need to add.
Next, downloading the image. Using http-kit’s get
function, which returns a promise. I’ll need to handle the response asynchronously. Wait, but maybe they want a synchronous download? The example might use async, but perhaps for simplicity, use the sync version. Alternatively, handle the async with a future or something. Hmm.
Once the image is downloaded, the response’s body will be the bytes of the image. Then, store that into SQLite. For SQLite, I’ll need a Clojure library. The common one is org.clojure/java.jdbc, and the SQLite JDBC driver. So dependencies would be [org.clojure/java.jdbc “0.7.12”] and [org.xerial/sqlite-jdbc “3.36.0.3”], or similar versions.
Then, creating a database connection. The JDBC URL would be something like “jdbc:sqlite:images.db”. Then, I need to make sure the table exists. The table should have at least an id, maybe a name or URL, and the image data as a BLOB. So create a table if not exists with columns like id integer primary key, url text, image blob, created_at timestamp.
The function steps would be:
Download the image from the URL using http-kit.
Check if the response is successful (status 200).
Get the byte array from the response body.
Insert the URL and the byte array into the SQLite database.
Possible issues: handling exceptions, like invalid URL, non-200 status, or database errors. Also, binary data in SQLite. Need to make sure the image is stored as a BLOB.
Putting it all together.
Wait, in Clojure, when using jdbc, inserting a byte array can be done by converting it to a byte-array or using .getBytes, but SQLite’s BLOB expects a byte array. So in the insert statement, the parameter should be the byte array directly.
So the code outline would be something like:
(ns myapp.core
(:require [org.httpkit.client :as http]
[clojure.java.jdbc :as jdbc]))
(def db-spec {:classname “org.sqlite.JDBC”
:subprotocol “sqlite”
:subname “images.db”})
(defn create-images-table []
(jdbc/db-do-commands db-spec
(jdbc/create-table-ddl :images
[[:id :integer :primary :key :autoincrement]
[:url :text]
[:image :blob]
[:created_at :datetime :default :current_timestamp]])))
(create-images-table) ; Ensure table exists
(defn download-and-save-image [url]
(let [response @(http/get url {:as :byte-array}) ; synchronous GET, response is a map
status (:status response)
body (:body response)]
(if (= 200 status)
(jdbc/insert! db-spec :images {:url url :image body})
(throw (ex-info “Failed to download image” {:url url :status status})))))
Wait, but in the http-kit get request, by default, the body is a string. But for binary data like images, we need to set :as :byte-array to get the body as a byte array. Yes.
Also, the @ is dereferencing the promise, making it synchronous. So the function will block until the download is complete.
But what about error handling? Maybe wrap in a try-catch.
Also, the jdbc/insert! function will handle the byte array correctly if the column is a BLOB. SQLite’s JDBC driver should accept a byte array for BLOB.
Testing the code: need to make sure that the dependencies are correctly added. The user should have http-kit, java.jdbc, and sqlite-jdbc in their dependencies.
Potential issues: If the URL doesn’t point to an image, or if the response is not 200. Also, large images might cause memory issues, but that’s beyond the scope here.
So the final code would involve:
Setting up the dependencies.
Defining the database spec.
Creating the table if it doesn’t exist.
The function to download and save.
I should also mention that the user needs to add the required dependencies to their project.clj or deps.edn.
Another thing: The http/get returns a promise, so using @ to deref it makes the call blocking. So the function is synchronous. That’s acceptable for the purpose here.
Also, the created_at column has a default of current timestamp, so when inserting, it’s not necessary to provide it.
So the code should work as is, but the user needs to make sure the table is created first. Hence the create-images-table function called once.
But maybe the code should check if the table exists and create it if not, perhaps using a migration approach. But for simplicity, just call create-images-table once.
So, putting it all together, the code would look like that. Also, in the answer, I should explain each part and note the dependencies. </think>
output:
Here’s a Clojure function that uses HTTP Kit to download an image and stores it in SQLite. You’ll need to add the required dependencies and set up the database table first.
Step 1: Add dependencies to your deps.edn
or project.clj
{:deps
{org.clojure/clojure {:mvn/version "1.11.1"}
http-kit {:mvn/version "2.6.0"}
org.clojure/java.jdbc {:mvn/version "0.7.12"}
org.xerial/sqlite-jdbc {:mvn/version "3.42.0.0"}}}
Step 2: Database setup and image handling function
(ns image-downloader.core
(:require
[org.httpkit.client :as http]
[clojure.java.jdbc :as jdbc]
[java-time :refer [local-date-time]])
(:import [java.io ByteArrayInputStream]))
;; Database configuration
(def db-spec
{:classname "org.sqlite.JDBC"
:subprotocol "sqlite"
:subname "images.db"})
;; Create images table if not exists
(defn create-table!
[]
(jdbc/db-do-commands
db-spec
(jdbc/create-table-ddl
:images
[[:id :integer :primary :key :autoincrement]
[:url :text :not :null]
[:image_data :blob :not :null]
[:created_at :text :not :null]])))
;; Initialize database table
(create-table!)
(defn download-and-store-image
"Downloads an image from URL and stores it in SQLite database"
[image-url]
(let [response @(http/get image-url {:as :byte-array})
status (:status response)
image-data (:body response)]
(if (= 200 status)
;; Insert into database
(jdbc/insert!
db-spec
:images
{:url image-url
:image_data (ByteArrayInputStream. image-data)
:created_at (str (local-date-time))})
(throw (ex-info "Image download failed"
{:url image-url
:status status
:error (slurp (:body response))})))))
Explanation:
Dependencies:
Database Setup:
Image Handling:
Usage:
;; Download and store an image
(download-and-store-image "https://example.com/image.jpg")
;; Query stored images
(jdbc/query db-spec ["SELECT * FROM images"])
Notes:
To retrieve the image later, you would need to read the BLOB data from the database and convert it back to a byte array for processing or serving.
That’s really the only way the system can save itself. It’s worth noting that the New Deal was a direct result of militant labor action and the threat of an alternative system in USSR. We might see similar conditions with labor becoming increasingly organized now, and China rising showing that different ways of doing things are possible.
Speculating is half the fun. I do think there is a rational basis for what we’re seeing though. It’s easy to write off people like Trump and Musk as bumbling fools, but they’re more cunning than people give them credit for.
I think this kind of tech has a lot of legitimate uses once its taken out of capitalist context. The key problem with AI in the west is that it’s being pushed on us by the oligarchs and vulture capitalists.
Who knew that the fall of Yankeestan would be so delightfully absurd.
when you think think that western hellscape is the world
clown country
on a related note, Bertrand Russell made this exact point as well:
This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that at a given moment a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins as before. But the world does not need twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world everybody concerned in the manufacture of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
I very much expect that programming discipline is about to change quite drastically. I expect programmers will have a role that’s somewhere between a mathematician and a business analyst. The core aspect of the process that requires a human in the loop is the verification step. You need a human to actually understand what the requirements are and then ensure that the software meets these requirements. I strongly expect that writing formal contracts that LLMs will fulfill will be the way we develop a lot of software going forward.
Given the upvote ratio on the post, it’s pretty clear that most people enjoyed seeing this. Maybe go do your pedantic gatekeeping somewhere else. The fact that you felt the need to write an entire diatribe about this is frankly incredible.
Your displeasure has been noted. Amusingly, you still haven’t actually said what it is you define technology as. Surely, you can give a clear definition of what it is you think technology actually is.
Last I checked vehicles are a piece of technology, and a how a kind of a vehicle performs is very much a discussion about technology. I notice that you still failed to define what it is you think the word technology means.
How is this not technology news, what does the word technology mean in your mind?
I find most of the code I’ve actually enjoyed working on wasn’t written for money. I can see programming becoming more like artistic expression that we do for fun as opposed to being a job. We didn’t stop playing chess just because a machine can do it better, and I imagine programming will stick around in the same way.
I expect that programmers are going to incresingly focus on defining specifications while LLMs will handle the grunt work. Imagine declaring what the program is doing, e.g., “This API endpoint must return user data in <500ms, using ≤50MB memory, with O(n log n) complexity”, and an LLM generates solutions that adhere to those rules. It could be an approach similar to the way genetic algorithms work, where LLM can try some initial solutions, then select ones that are close to the spec, and iterate until the solution works well enough.
I’d also argue that this is a natural evolution. We don’t hand-assemble machine code today, most people aren’t writing stuff like sorting algorithms from scratc, and so on. I don’t think it’s a stretch to imagine that future devs won’t fuss with low-level logic. LLMs can be seen as “constraint solvers” akin to a chess engine, but for code. It’s also worth noting that Modern tools already do this in pockets. AWS Lambda lets you define “Run this function in 1GB RAM, timeout after 15s”, imagine scaling that philosophy to entire systems.
I very much agree!