Programming Leftovers
-
Rlang ☛ How to Combine Rows with Same Column Values in R
Combining rows with the same column values is a fundamental task in data analysis and manipulation, especially when handling large datasets. This guide is tailored for beginner R programmers looking to efficiently merge rows using Base R, the dplyr package, and the data.table package. By the end of this guide, you will be able to seamlessly aggregate data in R, enhancing your data analysis capabilities.
-
[Old] NIH ☛ An empirical evaluation of Lex/Yacc and ANTLR parser generation tools - PMC
Parsing—also known as syntax or syntactic analysis—is the process of analyzing a string of terminal symbols conforming to the rules of a formal grammar [1]. Such a grammar may describe a natural language (e.g., English or French), a computer programming language, or even a data format. The process of recognizing the terminal symbols, also called tokens, from a sequence of characters is called lexical analysis [2]. Lexical analyzers are commonly called lexers or scanners.
-
[Old] OReilly ☛ 1. Introducing Flex and Bison - flex & bison [Book]
The earliest compilers back in the 1950s used utterly ad hoc techniques to analyze the syntax of the source code of programs they were compiling. During the 1960s, the field got a lot of academic attention, and by the early 1970s, syntax analysis was a well-understood field.
One of the key insights was to break the job into two parts: lexical analysis (also called lexing or scanning) and syntax analysis (or parsing).
Roughly speaking, scanning divides the input into meaningful chunks, called tokens, and parsing figures out how the tokens relate to each other. For example, consider this snippet of C code: [...]
-
[Old] Strumenta ☛ Why you should not use (f)lex, yacc and bison - Strumenta
Lex and Yacc were the first popular and efficient lexers and parsers generators, flex and Bison were the first widespread open-source versions compatible with the original software. Each of these software has more than 30 years of history, which is an achievement in itself. For some people these are still the first software they think about when talking about parsing. So, why should you avoid them? Well, we found a few reasons based on our experience developing parsers for our clients.
For example, we had to work with existing lexers in flex and found difficult adding modern features, like Unicode support or making the lexer re-entrant (i.e., usable in many threads). With Bison our clients had trouble organizing large codebases and we found difficult to improve the efficiency of a parser without rewriting large part of the grammar. The short version is that there are tools that are more flexible and productive, like ANTLR. It is a story both of weaknesses and of better alternatives.
The first part of this article explains the history of these two software, while the second one analyzes their flaws. If you do not care about their history, you can go to the second part using the handy table of contents.
-
[Old] Preston Thorpe ☛ PHP/Laravel: the good, the bad and the meh: Why we rewrote our app in Go
Like many, many developers out there over the age of 30, I basically started my programming journey with PHP (and perl). Circa ~’05, PHP was the go-to language for the web, and Adobe Dreamweaver supported it out of the box! Most HTML was hand-written, most connections were absent TLS, and lots of form data was still being stuffed raw-dog right into SQL queries.
This, I estimate, is what is responsible for 69.420% of the hate PHP gets today. (The rest comes from JS andys who have never seen or written a line of it, who likely just want to deflect some of the flak)
-
Addison Crump ☛ Why I don't write exploits*
In the past year, we've had a few discussions in my research group about joining various competitions, such as AIxCC, Pwn2Own, and others. These competitions are testing grounds for many of our research topics, as our research group primarily focuses on testing strategies for a wide variety of targets. We ultimately decided against it out of limited interest in taking part. From my part, my decision was guided out of a singular concern: the competitions often require the exploitation of vulnerabilities.
-
Rlang ☛ Standardising R Projects with the ProjectTemplate package workshop
Join our workshop on Standardising R Projects with the ProjectTemplate package, which is a part of our workshops for Ukraine series!
-
Ruby 3.4.0 preview2 Released
We are pleased to announce the release of Ruby 3.4.0-preview2.
Switch the default parser from parse.y to Prism. [Feature #20564]
String literals in files without a
frozen_string_literal
comment now emit a deprecation warning when they are mutated. -
Rlang ☛ oaqc: Orbit aware quad census package back on CRAN
This is just a short announcement post that the R package oaqc is back on CRAN.
The package provides an efficient algorithm to calculate for a given graph the orbit-aware quad census. -
Perl / Raku
-
Rakulang ☛ Rakudo Weekly 2024.41 KnowLite
Alexandr Zahatski (aka zag) has released the Raku Knowledge Base, containing all the Raku documentation and then some, as an example of the web publishing capabilities of Podlite. Although this has nothing to do with the Raku Programming Language (apart of its contents), it’s a nice PR moment for Raku nonetheless!
-
-
Python
-
Python ☛ What’s New In Python 3.13 — Python 3.13.0 documentation
This article explains the new features in Python 3.13, compared to 3.12. Python 3.13 was released on October 7, 2024. For full details, see the changelog.
-
Simon Willison ☛ What's New In Python 3.13
Python's dbm module has long provided a disk-backed key-value store against multiple different backends. 3.13 introduces a new backend based on SQLite, and makes it the default.
-
Miguel Grinberg ☛ The Ultimate Guide to Error Handling in Python
I'm going to start with something that I believe many of my readers already know or have seen discussed elsewhere. In Python, there are two main styles of writing error handling code, often called by their unpronounceable acronyms of "LBYL" and "EAFP". Are you familiar with these? In case you are not, below is a quick introduction to them.
-