Programming Leftovers
-
Java 19
Java 19 is now released, and it’s a big deal, as it ships with Virtual Threads (JEP 425), among other goodies, like structured concurrency (JEP 428), or improvements to pattern matching (JEPs 405, 427). I haven’t been as excited about a Java release in a long time.
-
DjangoCon US 2022
DjangoCon US is a six-day international conference for the community by the community about the Django web framework, held each year in North America.
-
New Tool: split-overlap.py
split-overlap.py is a tool to split a binary file in parts of a given size.
For example: split-overlap.py 1000 test.data
When test.data is a binary file with size 2500 bytes, the above command will create 2 files of 1000 bytes and one file of 500 bytes.
It’s also possible to split a file with some overlap.
-
Perl Weekly Challenge 182: Unique Array and Date Difference
-
course change for Kephra | lichtkind [blogs.perl.org]
Kephra, an editor for programming (mostly Perl) written in WxPerl is my main project since I stumbled into the Perl community. Most people I know already heard of it - but I want to write about a new development that might be helpful for some, which might consider to use it even if it has a very limited feature set (forth rewrite baby!).
It was silent for some time - because being my main project - I tried to cram all my other ideas, mainly KBOS into it which bogged progress down. Maybe there will be an Object System just for Kephra, solving some issues I saw nowhere else dressed. But for now I'm surprised how much progress is possible, If you just focus on churning out features.
I took stage sed (which is the bare minimal editor I once wrote as proof of concept) and just started to adding features and fixing issues. Sed stands for Single document EDitor and that is all what next release will bring. Am I serious ? and why should you care? Well I'm German - we never joke and it has strengths in its editing capability which sound like - 'duh its an editor - but if you see how many so called Editors and IDE neglect this area while focusing on the big guns like refactoring, debugging and git integration.
-
Why Javascript is Retarded: Part 1
-
Durden | datagubbe.se
Durden is a program that identifies, counts and, optionally, marks and/or cuts out and saves unique tiles in a given image file.
-
It's Just a Tarball
Sometimes complex software is simple when you go a few layers down.
For example, take the container image. There's so much complexity around building, deploying, and managing containers at scale. Yet, container images are just tarballs. With a few metadata files, you could quickly build one without any special tooling. In an unprivileged environment, in code, or even by hand.
Or git's object model. Git is known for its terrible UX, so sometimes, we assume that everything under the porcelain is also complex. Yet Git's object model is pretty simple – content-addressed blobs (file-like), trees (folder-like), and commits that get stored in a .git/objects folder.
-
Social Coding
Fortunately, we have an interesting counterfactual – GitLab, which among other things, is GitHub but de-emphasizes the social features – it's more likely to be deployed on-prem and overall has significantly fewer consumer public users and projects. GitLab's current market cap is $8.5b (GitHub was acquired by Microsoft in 2019 for $7.5b).
-
A minimal distributed key-value database with Hashicorp's Raft library | notes.eatonphil.com
When I wrote the "build a distributed PostgreSQL proof of concept" post I first had to figure out how to use Hashicorp's Raft implementation.
There weren't any examples I could find in the Hashicorp repo itself. And the only example I could find was Philip O'Toole's hraftd. It's great! However, I have a hard time following multi-file examples in general.
So I built my own single-file example. It's not perfect but it helped me get started and may help you too. We'll walk through that code, ~260 lines of Go, in this post.
-
View and Access Threads in GDB
Another name for a debugger would be a debugging utility. By spotting the code problems at different phases of an operating system or an application creation, it is considered to be a computer program that may enhance the process of building a software. A trial run may be examined by certain debuggers to determine which sections of code were skipped. The GNU Debugger is one of the many debugging tools that is available for C programmers and is the greatest debugging tool. It offers some tools that let the user view and assess a program while it is being run. Another excellent debugging functionality is to support many programming languages including C, C++, Ada, Fortron, and Pascal
-
POSIX Open Function in C
Although there are a lot of libraries in C, the POSIX library is very well-known among the developers due to its wide range of system call functions, especially the system function calls for “files”. POSIX library for Linux operating system provides you with a variety of functions. There is an open() function that is purposely used to open a specific file from a system in one of those POSIX calls. It utilizes many options to create, open, read, write, and do many things on the Linux files.
-
API as a package: Logging
Part 1 of this series laid out some ideas for how one might structure a {plumber} application as an R package, inspired by solutions such as {golem} and {leprechaun} for {shiny}. In this installment of the series we look at adding some functions to our package that will take care of logging as our application runs. If you haven’t already, we recommend reading the first installment of this series as the example package created for that post will form the basis of the starting point for this one.
-
Game Emulation via Neural Network
Although this looks like a video game, I did not write any game code.
-
Valuable News – 2022/09/05
The Valuable News weekly series is dedicated to provide summary about news, articles and other interesting stuff mostly but not always related to the UNIX or BSD systems. Whenever I stumble upon something worth mentioning on the Internet I just put it here.
Today the amount information that we get using various information streams is at massive overload. Thus one needs to focus only on what is important without the need to grep(1) the Internet everyday. Hence the idea of providing such information ‘bulk’ as I already do that grep(1).
-
When To Roll Your Own X
When should you reuse code and modify it to your requirements? When should you roll your own? There's no general answer to this question, but a few guidelines that I've picked up over the years.
-
Hello World Haskell
Teacher: Hello class! Welcome to your first day of functional programming. Today, we’re going to be talking about how to write the classic "Hello, World!" program in Haskell. It’ll be slightly more involved as we’ll ask for the user’s name and then greet them. I’m sure many of you have heard scary things about Haskell, but I promise you it’ll be fun.
Student: I heard we have to learn about IO. That sounds scary!
Teacher: What? No, there’s no need to worry about IO. In Haskell, when we want to perform an effect, we simply define a GADT to represent the capabilities of the effect.
-
Minimax Estimation and Identity Testing of Markov Chains | R-bloggers
We briefly review the two classical problems of distribution estimation and identity testing (in the context of property testing), then propose to extend them to a Markovian setting. We will see that the sample complexity depends not only on the number of states, but also on the stationary and mixing properties of the chains.
-
Top 10 Best PhpStorm Themes and Color Schemes in 2022
There’s no doubt that Phpstorm is by far the best IDE for PHP language with framework support. However, IDEs can get rather dull to work with sometimes or may lack the necessary optimization. The solution for that is to browse through Phpstorm themes and activate the one you like best.
IntelliJ, Phpstorm and Webstorm are all Jetbrains products. They are all integrated development environments compatible with different languages. However, having the same parent company, IntelliJ-based templates are usable as Phpstorm and Webstorm themes. That said, our focus remains on Phpstorm only today – so let’s explore the options it has in store.
-
Rust Hello World reduced to 31KB
A criticism that I have of Rust is that it creates very large binaries. Yes, there are websites that explain how to reduce the size, but have to go through a lot of steps.
This evening I was looking at this site, and compiled the first example:
-
You Can't Do That: Abstracting over Ownership in Rust with Higher-Rank Type Bounds. Or Can You?
A few years ago I wrote about how to get better at Rust by knowing when what you want to do is impossible. Sadly in many ways I don't learn from my own mistakes and I keep running into a particular issue over and over again: Rust's restrictions about being able to abstract over the borrow status / ownership of a values in some hard to discover situations involving higher-kinded type bounds.
A few days ago I wrote a (now unpublished) article about how you can't express a certain problem I keep manuvering myself with Rust's lifetimes. However that post set in motion a chain of events that lead to a solution that actually works. Yet at the same time even though I thought it was impossible I don't think the solution is obvious, I could have found it myself and it does not even work reliably. But more about that later.
Let's set the stage first: The problem I'm talking about relates to abstracting over borrows and owned values when combined with functions or something that uses higher-kinded trait bounds. In other words: one wants to create an API where it's possible to either borrow or clone out of some input value. Think of a generic function that can produce both a String and a &str.