Programming Leftovers
-
Trail Of Bits ☛ Catching OpenSSL misuse using CodeQL
I’ve created five CodeQL queries that catch potentially potent bugs in the OpenSSL libcrypto API, a widely adopted but often unforgiving API that can be misused to cause memory leaks, authentication bypasses, and other subtle cryptographic issues in implementations. These queries—which I developed during my internship with my mentors, Fredrik Dahlgren and Filipe Casal—help prevent misuse by ensuring proper key handling and entropy initialization and checking if bignums are cleared.
-
Uwe Friedrichsen ☛ Software - It's not what you think it is - Part 2
In the previous post of this blog series we discussed the assembly line fallacy, the misconception that software development is the same as building a car and learned that software development is part of the design, not the construction.
In this post, we will discuss the next misconception, the broken abstraction dilemma and its consequences. This is particularly relevant for the concept of AI solutions writing software based on the input of business experts. Let us get started.
-
James G ☛ Displaying Taylor Swift lyrics on my desk
This system to retrieve lyrics related to a text prompt (i.e. "dating" or "December") works using text embeddings. Text embeddings encode the semantics of text. These embeddings are calculated using machine learning models. You can compare two embeddings to see how similar they are. For this project, I compare a prompt (i.e. "dating") to every Taylor Swift lyric from her first nine albums. Then, I return the lyric whose embedding is most related to my query.
-
[Old] James G ☛ Building a lyrics recommendation bot
Have you ever wondered "What {artist} lyric would be most appropriate in this context?" when you are typing out a message, where "{artist}" is your favourite singer or band? I sure have! In my case, the artist of choice was Taylor Swift. If I said something like "cost", what Taylor Swift lyric would match? Herein lies a fun project.
I decided to create an IRC bot for use in a community I am in that, given any sequence of words, would return the most related song lyric. In this post, I want to talk about the three main stages of building this project, with reference to code, so that you can use the underlying technology to make your own bots (whether they are about song lyrics or something else entirely!).
-
Perl / Raku
-
Perl ☛ Elves Versus Unused Imports
If you're interested in an in-depth discussion of how perlimports and Perl's use and require work, check out this YouTube video from The Perl Conference in 2021: perlimports or "Where did that symbol come from?".
As a bonus, if you make it to the bottom of this article, we'll also explore a precious, which is a successor to Code::TidyAll.
-
Rakulang ☛ Day 23 – Optimizing Raku programs with Zig
Here is her current test implementation of the CRC32 processor in Raku: [...]
-
-
Python
-
James Bennett ☛ Set cookies the right way
Django’s request and response objects, and their attributes and methods, make dealing with cookies easy. You can read from the request.COOKIES dictionary to get a cookie, and you can use the response’s set_cookie() method to set cookies. What else do you need?
-
James Bennett ☛ Don’t use Python’s property
A property in Python lets you create a method — or up to three, for the operations to get, set and delete — which acts like a plain attribute. You don’t need to write parentheses to call it. For example, the following will work: [...]
-