Programming Leftovers
-
Pandas to Dictionary
In Python, a data structure called a dictionary is used to store information as key-value pairs. Dictionary objects are optimized to extract data/values when the key or keys are known. To efficiently find values using the related index, we can convert a pandas series or dataframe with a relevant index into a dictionary object with “index: value” key-value pairs. To achieve this task, the “to_dict()” method can be used. This function is a built-in function found in the pandas module’s Series class.
A DataFrame is converted into a python list-like data dictionary of series using the pandas.to_dict() method depending on the specified value of the orient parameter.”
-
Dirk Eddelbuettel: RcppArmadillo 0.11.4.3.1 on CRAN: Updates
Armadillo is a powerful and expressive C++ template library for linear algebra and scientific computing. It aims towards a good balance between speed and ease of use, has a syntax deliberately close to Matlab, and is useful for algorithm development directly in C++, or quick conversion of research code into production environments. RcppArmadillo integrates this library with the R environment and language–and is widely used by (currently) 1034 packages other packages on CRAN, downloaded 27.6 million times (per the partial logs from the cloud mirrors of CRAN), and the CSDA paper (preprint / vignette) by Conrad and myself has been cited 509 times according to Google Scholar.
-
Print Linked List in C++
When it comes to dynamically storing data items, linked lists are similar to an array. An array is a linear data structure that stores all of the data items, allowing us to transfer the elements of the array in a continuous operation. Whereas data elements in the linked list are not kept in continuous memory locations when they are stored. There is the starting point in the linked list which is called the head and the ending point is called the tail of the linked list in C++ programming language. In a linked list, there are nodes that store data objects in it. The node has two parts: the part contains the data object in itself and the second part contain the pointer toward the node after it. The final node of the linked list contains the null pointer.
We are using a linked list when we have an array to store the data because in arrays we have to tell the length of the array during the declaration of the array. But in linked lists sizing is not a problem anymore. The length of the linked list will expand as the program requires but the list is constrained by the capacity of memory that is available. The linked list can perform multiple operations in C++ language which are: insertion, deletion, traversal, search and sort operations. To understand these operations of the link list, let us implement the example and understand how a linked list works in C++ programming language. We also explore how these operations work in the linked list.
-
gokrazy: instance-centric configuration released - Michael Stapelberg
gokrazy is an appliance platform for Go programs: with just a few commands, you can deploy your Go program(s) on a Raspberry Pi or a (typically small) PC.
I’m excited to let you know that gokrazy now comes with a re-designed gok command line tool and gokrazy instance configuration mechanism!
-
How to use Next.js with Docker and Docker compose a beginner's guide
Next.js is a popular and opinionated React based meta-framework with a tagline of “Production grade React applications that scale”. Using Next.js with Docker has multiple advantages. This tutorial will walk you through setting up and running a Next.js project with Docker and Docker Compose, let's get started!
-
The beauty of CGI and simple design, by Hales
I was reading through some of Hales’ blog archives over Xmas, like a gentleman, and was reminded of his post about CGI, the simple application/web interface from the 1990s. And here’s the thing: he said it was good.
-
Escaping the Malthusian Trap - kieranhealy.org
The Broadberry et al GDP series has estimates of England’s real GDP and population from the year 1270 onwards. It’s available, along with a lot of other long-run data, from The Bank of England. Here’s an animation of the series. I sometimes use this as a scene-setter when teaching social theory. It’s great because, in addition to the basic story that the series tells (which I find the animation brings out very nicely), it also naturally invites questions about the nature of the data itself. How is a series like this even possible? How was it constructed? What do the estimates mean? What are their scope and limits? What can it tell us about the perspective of someone writing about society in 1600, or 1800, or 2000?
-
shiny.benchmark - How to Measure Performance Improvements in R Shiny Apps
The shiny.benchmark package by Appsilon allows you to compare the performance of different versions of R Shiny applications. You can write instructions that will be executed and evaluated on different versions of your app and easily measure the performance differences.
In today’s article, you’ll learn how to install and use the shiny.benchmark package by exploring and tweaking an example Shiny application. So without much ado, let’s dive straight in.
-
Little useless-useful R functions – Mandelbrot set
-
Rubenerd: Your own little standard library
I’m sure every technical person and power user has a folder of scripts they use to automate repetitive tasks, or make their lives easier in specific use cases. I know this isn’t strictly analogous to a “standard library” in a programming language or development environment, but I like to think of it as one we carry around for our lives. Why reinvent the wheel when our personal standard library has a function for us already?
[...]
It’s also a bit fun for some digital archaeology. I can see how my mind has changed over the years just by sorting these scripts by modification date. For all my love of Perl, I’ve written more shell scripts over the last few years.
-
Alphabet’s Intrinsic Acquires Majority of Open Robotics - IEEE Spectrum
Today, Open Robotics, which is the organization that includes the nonprofit Open Source Robotics Foundation (OSRF) as well as the for-profit Open Source Robotics Corporation (OSRC), is announcing that OSRC is being acquired by Intrinsic, a standalone company within Alphabet that’s developing software to make industrial robots intuitive and accessible.