Programming Leftovers
-
Dyn async traits, part 8: the soul of Rust
In the last few months, Tyler Mandry and I have been circulating a “User’s Guide from the Future” that describes our current proposed design for async functions in traits. In this blog post, I want to deep dive on one aspect of that proposal: how to handle dynamic dispatch. My goal here is to explore the space a bit and also to address one particularly tricky topic: how explicit do we have to be about the possibility of allocation? This is a tricky topic, and one that gets at that core question: what is the soul of Rust?
-
Redis DECR
The string type is the most fundamental data type that Redis offers. Redis strings are capable of storing texts, serialized JSON objects, images, audio, and even numerical values. In this guide, we will focus on the numerical values and the manipulation of integers. Redis doesn’t support the separate integer data types to hold the numerical data. If a Redis key contains a string that can be represented as an integer, Redis can interpret the number values as base-10 64-bit signed integers.
-
Redis EXPIRE Hash Key
Redis hashes are a special kind of data type which is a lot more similar to the JSON object, Java HashMap, or a Python dictionary. Furthermore, it is a collection of field-value pairs that can be used to model domain objects. Redis hash data structure is extremely memory efficient where each hash key can store up to four billion field-value pairs. Most importantly, the fundamental hash operations like HSET, HGET, HMGET, etc. operate on constant time complexity.
-
For Loop C++
In C++, loop statements repeat a certain piece of code or statement. They are mostly used to shorten code by performing the same function more than once and to cut down on redundancy. For loops, while loops and do-while loops are only a few of the loop types supported by C++. Each has a unique syntax, benefits, and application. When we wish to run a block of code repeatedly, we utilize the programming control structure known as the loop. Typically, it keeps running and stops when a certain criterion is met. You will discover a crucial idea in this post, namely C++ For Loop.
-
Atan C++
Math, statistics, and computer programming languages work hand-in-hand. Formula used in stats or math sometimes need to be implemented in computer programming languages. These functions and formula work the same in all subjects. The only difference is the implementation. This article is designed to teach how to implement atan() function in the c++ programming language.
-
C++ Modulus
In many programming languages, we often use an operator named “modulus” with the symbol representation as “%”. This modulus operator is used to find the remainder when the two numerical integers or numbers are divided by each other. This operator takes the two operands: dividend and divisor. What is left after their division is done is the remainder, X % Y = R; where X and Y are dividend and divisors respectively and R is the remainder. We use this remainder as a piece of information if we want to know whether or not the two dividing numbers are factors of each or not. We also use the remainder to let us know if the number is even or odd.
-
C++ Tuple
Working with any programming language requires using tuples, lists, arrays, and etc. The arrays, lists, and tuples offer the same services with slight differences. A tuple is an object that holds an order list of items. It is just like an array and a list, however, they both are mutable, but the tuple is immutable. An immutable object cannot undergo any changes during execution. The list and array can easily be modified, sliced, or indexed since they are mutable. But a tuple cannot be modified, sliced, or changed since it is an immutable object. Moreover, the list and array can only store one type of data, but a tuple can have data of multiple types. In this guide, we will discuss the main function of a tuple and how it can be used in a c++ program.
-
C++ Mutex Lock
C ++ is known to be one of the fastest programming languages with good performance, high precision, and an adequate memory management system. This programming language also supports the concurrent execution of multiple threads with the sharing of multiple resources between them. In multithreading, the thread is only to perform the read operation that makes no issues since the thread does not get affected by what the other threads are doing at that time. But if these threads had to share the resources between them, one thread can modify the data at that time which makes the issue. To deal with this problem, we have the C++ “Mutex” which prevents the access of multiple resources towards our code/object by providing the synchronization which states that the access to the object/code can be provided to only one thread at one time, so that multiple of threads would not be able to access that object simultaneously.
-
Stol() Function in C++
C++ is one of the most popular and oldest programming languages used for the development of high-performance applications. It is used among highly expert programmers and novice developers. It is mainly used in game development and is an ideal option for developing operating systems. When writing code in the C++ language, you may come across converting data from one type to another. In this article, you will learn to convert a string into a long integer. It is quite difficult to convert a string into any other format. However, the C++ programming language provides a quick and efficient way to convert strings into integers.
-
Pandas Vlookup
“Pandas” is a great language to perform the analysis of data because of its great ecosystem of data-centric Python packages. That makes the analysis and the import of both factors easier. The “vlookup” stands for the “vertical lookup”. It is used to merge the two different tables in the DataFrame where there should be some common attributes between them (the two tables). As an output, we will get a single table that consists of the data from both the common tables. This is similar to the one lookup function used in “excel”. We will implement all of the possible methods in which the Pandas vlookup is used. For the execution of the codes, we will use the “Spyder” which is a software that is written in “Python” in a friendly language.
-
Pandas Check Version
“Pandas” is an open-source “Python” library. It is utilized for the evaluation of data. The version is deployed each year. Sometimes, earlier, the changes and updates occur continuously. At times, it is kind of important to know the version that we use in the installed Pandas library. For example, if we install it a year ago, it won’t be of the same version as when we installed it. It would have been updated once for sure and maybe twice the possibility is there. So, how will we recognize the exact version that is currently used?
For this, Pandas come up with a function that makes it easier for anyone to use it for the knowledge of the version used. It works for Linux, Windows users, and mac users as well. We will discuss all of the possible ways in which we can perform the check of the “Pandas version”. For the implementation of the code, we will use the “Spyder” software since it is a Python language based friendly software to perform the code.
-
How to install GoLand 2022 on a Chromebook
Today we are looking at how to install GoLand 2022 on a Chromebook. Please follow the video/audio guide as a tutorial where we explain the process step by step and use the commands below.
-
Using Mock is easy | FrostyX.cz
There are a lot of articles and documentation pages explaining how to use Mock but I am hesitant to share them with new Fedora packagers because they make the tool look much scarier than it actually is. Using Mock is easy!
-
PHP Data Types - Pi My Life Up
In this guide, we will touch on the different data types that you can use in the PHP programming language.
-
API as a package: Structure
At Jumping Rivers we were recently tasked with taking a prototype application built in {shiny} to a public facing production environment for a public sector organisation. During the scoping exercise it was determined that a more appropriate solution to fit the requirements was to build the application with a {plumber} API providing the interface to the Bayesian network model and other application tools written in R.
When building applications in {shiny} we have for some time been using the “app as a package” approach which has been popularised by tools like {golem} and {leprechaun}, in large part due to the convenience that comes with leveraging the testing and dependency structure that our R developers are comfortable with in authoring packages, and the ease with which one can install and run an application in a new environment as a result. For this project we looked to take some of these ideas to a {plumber} application. This blog post discusses some of the thoughts and resultant structure that came as a result of that process.
-
The broken bridge between biologists and statisticians | Multi-environment split-plot experiments
Have you made a split-plot field experiment? Have you repeated such an experiment in two (or more) years/locations? Have you run into troubles, because the reviewer told you that your ANOVA model was invalid?
-
R Markdown Lesser-Known Tips - Tricks #4: Looks Better, Works Better - RStudio
The R Markdown file format combines R programming and the markdown language to create dynamic, reproducible documents. Authors use R Markdown for reports, slide shows, blogs, books — even Shiny apps! Since users can do so much with R Markdown, it’s important to create high-quality documents that take advantage of available features.
-
Amend 3.6 Released
-
A Review of Games Written in R on CRAN | Dr. Rick Tankard
R is primarily designed for statistical computing and graphics, and that’s where I’ve spent most of my time in R. This includes developing an R package, exSTRa, for my PhD. R isn’t an ideal language for video games, without native support for reactive programming. Though where there’s computing, there are games.
-
Saturn Elephant - The 'Reorient' transformation
If you follow my youtube channel then you have certainly seen the “ball” of twenty Hopf tori. Sometimes I call it the “Hopf flower”. How is it done?
Well, firstly, I take twenty points on a ball: the twenty vertices of the compound of five tetrahedra. Then, I construct one Hopf torus, and for each of the twenty points I reorient it towards this point and I translate it to this point. This post is about the transformation used to reorient.
-
GraphQL Trades Complexity
GraphQL decouples the frontend team's data needs from the teams managing the API and data layers.
GraphQL was first deployed for Facebook's native mobile applications. Clients and backends had rapidly diverging data needs. Mobile clients were different than web clients. Some APIs didn't even exist (e.g., hydrated serverside and sent as HTML). iOS applications might rarely (or never) be updated.
-
GSoC 2022 Final Report: Improving the Calendar Application
A Calendar application is a must have application for any operating system and is beneficial for end users as well as developers. Having a feature-rich Calendar might not sound like a big deal, but it can drastically impact your performance at work and personal life.
-
[GSoC 2022] Ham: Final Report
Hello everyone. Thank you for having me the past few months; it’s been a busy, fun ride. This is the final report for Ham, a replacement to the Jam build system.
I’d like to thank Stephan Aßmus for taking the time to mentor me, and the rest of the Haiku community for being responsive and receptive to Ham’s development.
[...]
This project is a continuation of Ingo Weinhold’s original Ham project, which paused development in 2013. Over the course of the GSoC period, I completed the evaluation portion of Ham, which converts a Jam build system into a series of commands to run.
-
PCIe CXL investigation
I’ve been asked to look in to PCIe+CXL with an eye to supporting some subset of it in our future internal Linux Kernel. These are my notes.
There is a cxl_test module the Linux tree under tools/testing/cxl/.
There is a cxl command line tool. On Ubuntu and CentOS you install it via the ndctl package. This is short for libnvdimm, or Nonvoltile Memory. I think it is needed for CXL Kernel tests, but it is interesting in its own right, too.
-
GSoC 2022 with GNOME: Final Report - DEV Community
This post marks the ending of my GSoC'22 journey with GNOME. I worked on the database migration and managing user model for the GNOME Health Application. Let's take a deep dive into the project.
[...]
Health is a Health and Fitness Tracking application. It helps the user to track and visualize their health indicators better. That means a user can track down their activities and weight progressions. The project is created and maintained by Rasmus Thomsen, who is also the mentor of my GSoC project.