Programming Leftovers
-
Rlang ☛ A Guide to Selecting Rows with NA Values in R Using Base R
Dealing with missing data is a common challenge in data analysis and machine learning projects. In R, missing values are represented by NA.
-
Hackaday ☛ Compiling And Running Turbo Pascal In The Browser
When a friend of [Lawrence Kesteloot] found a stack of 3.5″ floppy disks, they found that it contained Turbo Pascal code which the two of them had worked on back in the Summer of 1989. Amidst reminiscing about the High School days and watching movies on VHS, [Lawrence] sought a way to bring these graphical applications once more back to life. Not finding an easy way to compile Turbo Pascal code on Mac even back in 2013 when he started the project, he ended up writing a Turbo Pascal compiler in JavaScript, as any reasonable person would do in this situation.
-
Livin’ on the Edge: Why WebAssembly Belongs in CDNs
WebAssembly is fit for serverless functions because of its secure runtime, access to system resources, and multi-language support across architectures and operating systems.
-
LWN ☛ Book review: Practical Julia
A recent book by LWN guest author Lee Phillips provides a nice introduction to the Julia programming language. Practical Julia does more than that, however. As its subtitle ("A Hands-On Introduction for Scientific Minds") implies, the book focuses on bringing Julia to scientists, rather than programmers, which gives it something of a different feel from most other books of this sort.
The book begins with the preliminaries, as one might guess. It gives information on how and where to get Julia. There is also a description of Julia's read-eval-print loop (REPL) that can be used for interacting with the language, along with other options of that sort (e.g. computational notebooks, such as the Julia-specific Pluto or the multi-lingual Jupyter). The book also shows some of the more "modern" features adopted by Julia, like its use of colors in the REPL and its embrace of Unicode for identifiers, including allowing (some) emojis as variable names.
-
Python
-
TecAdmin ☛ Python Coding Challenge 001: Character Frequency Counter
In today’s blog post, we’re diving into a fun and educational Python coding challenge that will test your skills in string manipulation and dictionary handling. This challenge is perfect for beginners who are looking to get more hands-on experience with Python.
-
The New Stack ☛ What Are Python ‘Sets’ and How Do You Use Them?
A Python Set is a collection data type that is iterable, mutable, and cannot be duplicated.
-
Pete Zaitcev: sup Python you okay bro
What do you think this does:class A(object): def aa(self): return 'A1'class A(object): def aa(self): return 'A2'a = A()print("%s" % a.aa())It prints "A2".But before you think "what's the big deal, the __dict__ of A is getting updated", how about this:class A(object): def aa(self): return 'A1'class A(object): def bb(self): return 'A2'a = A()print("%s" % a.aa())This fails with "AttributeError: 'A' object has no attribute 'aa'".Apparently, the latter definition replaces the former completely. This is darkly amusing.Python 3.12.2
-