Programming Leftovers
-
Merge modula-2 front end onto gcc.
This commit merges the devel/modula2 into master. The libraries reside in libgm2, the compiler in gcc/m2 and the testsuite in gcc/testsuite/gm2.
-
ephemeral success -- wingolog
Good evening, patient hackers :) Today finishes off my series on implementing ephemerons in a garbage collector.
Last time, we had a working solution for ephemerons, but it involved recursively visiting any pending ephemerons from within the copy routine—the bit of a semi-space collector that is called when traversing the object graph and we see an object that we hadn't seen yet. This recursive visit could itself recurse, and so we could overflow the control stack.
The solution, of course, is "don't do that": instead of visiting recursively, enqueue the ephemeron for visiting later. Iterate, don't recurse. But here we run into a funny problem: how do we add an ephemeron to a queue or worklist? It's such a pedestrian question ("just... enqueue it?") but I think it illustrates some of the particular concerns of garbage collection hacking.
-
Embedded Device Requirements for Digital Advertising [Ed: Qt helps companies make very annoying applications that embed ads inside the GUI, distracting the user from what he or she actually wanted to do; imagine GUIs that refuse to let you change settings or press "Next" until you have watched all the ads]
The concept of digital advertising across different types of hardware has become increasingly popular as of late, and the opportunities for ad placements in novel locations is continuously growing. However, there are certain minimum requirements which must be taken into consideration to ensure optimal performance across this multitude of devices.
-
Qt Creator 9.0.1 released
We are happy to announce the release of Qt Creator 9.0.1!
-
Dirk Eddelbuettel: spdl 0.0.3 on CRAN: Adding File Logger
A second update to the still-new package spdl is now om CRAN, and in Debian. The key focus of spdl is a offering the same interface from both R and C++ for logging by relying on spdlog via my RcppSpdlog package.
This release add support for a simple filesetup() initialiser to direct logging output to a file. For now the console logger and the file logger are exclusive, if there is interest we could borrow a page from upstream and combine them.
-
Frederik Braun : DOM Clobbering
When thinking of HTML-related security bugs, people often think of script injection attacks, which is also known as Cross-Site Scripting (XSS). If an attacker is able to submit, modify or store content on your web page, they might include evil JavaScript code to modify the page or steal user information like cookies. Most developers out there protect their websites against XSS by disallowing or controlling script execution.
-
Inet_Ntop() Function in C
Socket functions use data structures in their input arguments that contain client and server-specific information. The most important information in them is undoubtedly the IP addresses. There are several types of structures that are used by socket functions to store these addresses such as sockaddr, addrinfo, or in_addr, etc.
IP addresses are not encoded which means that each of the numbers in their fields is represented by its binary equivalent. This means that in certain cases, it is necessary to convert the IP addresses to strings or the strings to IP addresses in order to work with them.
In this Linux Hints article, you will learn how to convert the IP addresses to strings using the inet_ntop() function.
-
Getaddrinfo() Function in C Language
To open a socket client-server, we need some important information about the server that we want to connect to such as the domain address, the address family it uses, etc.
This connection process requires the use of several functions, and the call to each of these has a specific order that must be strictly followed. Many of these functions are used to retrieve the data from the server that you want to connect to. Their results are some of the input arguments for the subsequent function.
These arguments are descriptors and data structures that contain the client and server-specific information about some of the layers that make up a network connection.
-
Radix Sort (C++)
A radix or base is a representation of a number that shows how many digits are required to represent a positional number. For example, to represent the binary number, the radix value is 2 (we represent the binary either with 0 or 1). To represent the decimal number, the radix value is 10 (we represent the decimal number with numbers 0 to 9).
-
Return Array From Function C++
Arrays store the data of the same type in a consecutive memory location. Functions break the bigger problems into smaller chunks to make it easier for programmers to code. Another advantage of using the function is that it makes the code look presentable and clean. Sometimes, we need a function that returns an array so that we can utilize that array in other functions. Then, comes the concept of the array return function in C++. It is the function that returns the array to another function. In this Linux Hint tutorial we will show you with examples how to return arrays from functions that you write in the C++ language.
-
Using Floating Data Types in PostgreSQL
Float data type falls under the numeric data type category. It supports floating point numbers., numeric, and real numbers. Floating data types can be confusing. But this guide will shed light on understanding the three main floating data types and how to represent them in PostgreSQL using different examples.
-
PostgreSQL Temporary Tables
PostgreSQL has reliable database features for handling different transactions. For instance, its temporary table saves data per given session. A temporary table exists for a given session and closing the given session or trying to query the same temporary table in another session will return an error.
This post will guide you in understanding how temporary tables work. We will create a temporary table, then try to access it from another session.
-
PostgreSQL Grant All Privileges on Schema to User
Databases are crucial, and it’s the work of the administrator to control what different roles the users can do within a given database. As part of authorization, the administrator can define user entities within the database and grant or revoke various privileges to the roles.
That way, you attain control over who can access a database and what privileges they have if they can access the database. For instance, you can revoke the database modification or grant all privileges on the schema to a user or users in a given table. This guide details how to use PostgreSQL to grant a user all privileges on the schema to a user.
-
Fiber examples and Windows support
I know there are a few things I’d like to still add and change the APIs, but I guess now it’s at the point where it’s time to start building things with it. I’m likely to target pieces of Builder which have a lot of complex async callback chains. Those are likely to benefit the most from fibers.
-
Day 16: Santa CL::AWS (part 2) - Raku Advent Calendar
… in Part 1 of this winter drama, we left Mrs CL::AWS in a pickle.
The story so far: the elves needed to rebuild their eChristmas website on AWS EC2 – Mrs CL::AWS had quickly whipped up a minimal raku script to use the AWS CLI with a basic procedural coding approach and shell execution of the required commands.
BUT was this code just too procedural? was it too hard to maintain? would the elves be able to pick it up, to grok it and to extend it come next year after their hibernation under the polar ice? Was raku the right choice?
-
Perl Weekly Challenge 195: Special Integers and Most Frequent Even
-
Day 15: Junction transformers - Raku Advent Calendar
This carries 'any' as a type of operation and 0..9 as a list of eigenstates internally. In a smartmatch context, this can match any object that can smartmatch against any of its digit eigenstates. While the list of these is not exposed, there is a means of traversing its contents.