Language Selection

English French German Italian Portuguese Spanish

Programming Programming

Filed under
Development
  • CAPLin framework to build a SocketCAN node application in C

    The SocketCAN functionality, combined with the can-utils programs, enable you to view, interact and analyze the CAN bus traffic on Linux. However, these tools are no match for high-end tools such as Vector CANalyzer and CANoe under Windows. I especially miss CAPL scripts on Linux. For this reason I developed the CAPLin framework. With CAPLin you can quickly build a SocketCAN node application in the C programming language.

  • [Old] Thoughts on how to find remote work in Cameroon

    Remote work is the new norm there has never been a time like this, where as a SE you can make more than a decent living. This isn’t a know-it-all kind of post, I just wanted to write a bit about my experience, but it’s way too long (6 months+) so I will just share what worked and not for me. Before I forget, this is mainly for people like me doing computer science for the sake of doing it. Not because someone forced us or whatever. In short, geeks I guess. If you’re like me the perspective of spam applying and writing corresponding CVs is not very appealing. So, if CS is just a means to an end - not that there’s something wrong with that - but this might rub you off the wrong way (and you guessed right, no, I don’t look forward to enter management to “escape” coding). The job landscape in Cameroon is… saddening. While everywhere else the supply exceeds the demand, here it’s the exact opposite, which inevitably leads to abuse. Also, if you are still a student, this might not be for you directly, you can still read it to be prepared but there are many opportunities for students and I talk a bit about GSoC here. That being said, let’s get started.

  • Emacs is a Lifestyle

    I think that perfectly captures the spirit of Emacs and the nature of its (most devoted) users. I’d even go a bit farther and make the claim that (using) Emacs is essentially a lifestyle (choice).

  • Uninitialized Stack Variables

    Finally, as we observe here once more, writing C leaves us (necessarily) at the whims of the compiler: FreeBSD 13.0-RELEASE happens to use clang, and gcc(1) would have failed in either of our two scenarios. So one question that arises is whether compilers should perhaps auto-initialize stack variables.

    clang has a discussion around this, as does gcc, but there does not seem to be an agreed upon conclusion. Considering the possible security implications, it does seem to me that it would be a Good Thing™ to at least move away from having uninitialized variables by default and instead requiring explicit requests from the programmer (say, by way of an attribute?) that a given stack variable not be initialized. But I honestly don't know what the performance impact of this would be.

    Either way, I'm going to make it a habit to memset(3) my structs going forward...

  • Testing

    I think about tests in terms of defense in depth, value-for-effort and debugging efficiency.

    Debugging efficiency is not something I see discussed often and it's the only place where I disagree slightly with Aleksey's post above. The more that happens between the cause of a bug and the actual test failure, the longer it takes to track down the bug. So I tend to write unit tests for code which is: [...]

  • Writing

    I have a file called 'ideas' where I write down potential projects or thoughts that might be worth writing about. Entries grow over time as I add more thoughts. The entry that eventually became Against SQL existed for over a year. Every time I encountered a new bizaare corner of the SQL I would make a quick note of it.

    Eventually one of the ideas will feel ready and I'll try to write it up in full. This can take anywhere from a few hours to a few weeks depending on what the goal of writing it is and how much research is required. Against SQL took something like 60-80 hours to write because I was trying to make a strong argument about a complicated and contentious subject. Why isn't differential dataflow more popular took maybe an hour or two because I just wanted to hear about other peoples experiences.

  • Property-Based Testing In Go

    Property-based testing can be a bit trickier to learn, and not every problem can be well tested in this manner, but it’s a powerful technique that’s well supported by the go std-lib (testing/quick) and that is under-utilized.

  • [Old] EP. #91: Open Source Security: with Dr. David A. Wheeler

    In episode 91 of The Secure Developer, Guy Podjarny speaks to Dr. David A. Wheeler, an expert in both open source and developing secure software. David is the Director of Open Source Supply Chain Security at the Linux Foundation and teaches a graduate course in developing secure software at George Mason University. Today’s discussion revolves around open source security (or OSS), in which David is an expert, not just from the perspective of consuming open source but also creating and even governing open source. Tuning in, you’ll learn about some of the primary security concerns in open source and the necessity to educate developers about secure software.

  • [Old] Managing Risks and Opportunities in Open Source with Frank Nagle & David A. Wheeler

    We start off on the topic of looking at metrics that are useful for identifying what’s going on in a Software Configuration Management system. David tells us what it is and if there’s a difference between building software and deploying it. Also, figuring out which components you’re going to bring in, to your overall system.

  • Toit open-source language claims to be 30x faster than MicroPython on ESP32 - CNX Software

    Developed by a team of former Google employees, Toit is a complete IoT platform with remote management, firmware updates for fleets of devices with features similar to the one offered by solutions such as balena, Microsoft Azure, or Particle edge-to-cloud platform.

    Toit currently works on ESP32 microcontrollers using lightweight containers, and after seeing existing high-level languages MicroPython and Javascript were not fast enough on low-end microcontrollers platforms, the team at Toit started to develop the Toit language in 2018, and has just made it open-source with the release of the compiler, virtual machine, and standard libraries on Github under an LGPL-2.1 license.

  • XOR Two Strings in Python

    You may have used many logical, arithmetic, and comparison operators within mathematics and programming while working. One of the frequently used logical operators is the XOR operator. It returns exactly the opposite of the result of the OR operator. Within this article, we will be using the XOR operator on two string-type variable values while working in a Python environment. Let’s have some examples in the Ubuntu 20.04 system.

  • Python String to a Dict

    In Python, the conversion of different data types is a common problem and it is very important to do it right. Dictionary is the data type that saves the information/elements in a pair form. It is important to convert the string data type to a dictionary data type during programming. However, before going to the methods of conversion, let me explain the strings and dictionaries.

    A string is a series of elements in Python. It is unchangeable. The elements or items are enclosed in single and double quotation marks. Since Python has no proper character data type. However, any character is also taken as a string in Python.

    In Python, a dictionary is essentially a collection of changeable data items. This collection is present in an unordered form. Dictionaries save the data in which every element is in the form of a pair. The elements inside the brackets are present in the form of pairs and each pair is segregated by the comma. But the elements are isolated by using a colon.

    The main attribute of the dictionary is that it does not accept polymorphism. We can get the data from the dictionary later by referencing the appropriate key name. Let’s discuss the techniques of converting the string to a dictionary.

  • Python String Decode Method

    The Python language is used to store the string in the form of Unicode. Within Unicode, a simple code point is utilized to represent a single character of a Unicode. We have to know two terms: encode and decode. The encoding would convert a simple string to a group of bytes while decoding will convert the group of bytes to a real string once again.

    So, within this article today, we will be decoding a string to an original one with the encode() and decode() function. Be sure to configure the python3 package on your Linux system. Let’s start today’s article by launching the terminal console using the Ctrl+Alt+T.

  • Python Removes Newline From a String

    In Python, the strings are a series of elements. These elements are surrounded by single and double quotation marks. Python has a newline symbol. It is represented by “/n”. It is utilized to track the climax of a line and the appearance of a new line. The newline character is utilized in f-strings. In addition, the print statement prints a newline character to the end.

    Newline character “/n” is a special character. It is helpful to make a new line. When we utilize the newline character (/n), a new line is created spontaneously.

  • Laravel 8.73 Released | Laravel News

    The Laravel team released 8.73 with support for Countable objects in the string pluralizer, allowing closures for determining cache TTL, a lazyByIdDesc() query builder method, and the latest changes in the v8.x branch.

  • Medical Web Development: Top 10 Programming Languages Used in Health Tech
  • What are Container Classes C++?

    A container class as the name suggests is used to contain different values, objects, and variables, etc. in the memory or the external storage. A container class supports other classes present in the programs and it functions to hide the objects/variables used in the memory. It stores many items and all of these items are easily accessible by other members of the program.

    All container classes access the elements of the container efficiently through the iterators. This class is known to hold some similar and mixed objects in the memory. A container can be of a homogeneous or heterogeneous type. If the container holds mixed objects then it is heterogeneous, while in the case of similar items it is known as homogeneous container class.

    We are going to explain this concept on the Linux operating system, so you need to have Ubuntu installed and in the running form on your system. So you must install Virtual Box and after downloading and installation now configure it. Now add the Ubuntu file to it. You can access Ubuntu’s official website, and download the file according to your system requirement and operating system. It will take hours, then after installation, configure it on the virtual machine. In the configuration process, make sure you have created the user because it is essential for any operation on the Ubuntu terminal. Moreover, Ubuntu needs the authentication of the user before doing any installation.

    We have used the 20.04 version of Ubuntu; you may use the latest one. For the implementation, you need to have a text editor and must have access to the Linux terminal, because we will be able to see the output of the source codes on the terminal through the query. The user must have basic knowledge of C++ and object-oriented programming to make use of classes in the program.

  • How to Convert Java to Kotlin and Kotlin to Java

    This article will cover a guide on converting code written in the Kotlin programming language to Java programming language and vice versa. Kotlin is a relatively new programming language being developed by JetBrains and it is fully interoperable with Java programming language. It offers some benefits over Java programming language like a more concise syntax, more built-in helper functions, stricter null type checking, data classes, and so on. Full list of differences between these two languages is available here. Kotlin is now the preferred language for developing Android apps and it has been fully integrated into Android Studio app development software suite.

    You can convert Kotlin to Java and Java to Kotlin using offline tools. Some of them are explained in this article. Do note that depending on the code being converted and the type of tool being used for the conversion purpose, the converted code may not be 100% accurate and you may have to make some manual edits. You should always review converted code before using it in an application.

More in Tux Machines

Ubuntu 21.04 (Hirsute Hippo) Reached End of Life, Upgrade to Ubuntu 21.10 Now

Dubbed by Canonical as the “Hirsute Hippo,” Ubuntu 21.04 was released nine months ago, on April 22nd, 2021. It was the first Ubuntu release to use the next-generation Wayland display server by default for its Ubuntu Desktop flavor, which uses a modified version of the GNOME desktop environment. Ubuntu 21.04 didn’t make the plunge into the GNOME 40 desktop environment series due to its redesigned Activities Overview, but it did ship with support for GNOME 40 apps while being built on top of the older GNOME 3.38 desktop environment series. Read more

today's leftovers

  • Supplino is a variable benchtop power supply that you can build yourself | Arduino Blog

    Working with electronics requires access to stable power in a variety of voltages. Some components require 3.3V and others require 5V. Still others need 9V or 12V — there are many possibilities. You could keep a variety of wall warts on hand, but a variable benchtop power supply is a more convenient option. Supplino is one choice and this guide from Giovanni Bernardo and Paolo Loberto will walk you through how to build one. Supplino can accept anything from 4 to 40 volts and can output anything from 1.25 to 36 volts, with a maximum of 5A. An XH-M401 module with an XL4016E1 DC-DC buck converter handles the voltage regulation. Technically, you could use that alone to power your components. But the addition of an Arduino Nano board (or Nano Every) makes the experience far friendlier. It monitors the power supply output and drives a 1.8″ 128×160 TFT LCD screen, which displays the present voltage, amperage, and wattage.

  • Relocating Fedora's RPM database [LWN.net]

    The deadlines for various kinds of Fedora 36 change proposals have mostly passed at this point, which led to something of a flurry of postings to the distribution's devel mailing list over the last month. One of those, for a seemingly fairly innocuous relocation of the RPM database from /var to /usr, came in right at the buzzer for system-wide changes on December 29. There were, of course, other things going on around that time, holidays, vacations, and so forth, so the discussion was relatively muted until recently. Proponents have a number of reasons why they would like to see the move, but there is resistance, as well, that is due, at least in part, to the longstanding "tradition" of the location for the database.

  • CPU Isolation – A practical example – by SUSE Labs (part 5)
  • How to install Mantis bug tracker on Debian 11?

    Hello friends. In this post, you will learn how to install Mantis Bug Tracker on Debian 11.

Server: MongoDB vs. DynamoDB, Mirantis, and More

  • MongoDB vs. DynamoDB: What you need to know

    NoSQL databases have become more popular because of the need for more flexible backend solutions. These databases run applications that require a more flexible data structure than traditional structured databases can provide. Robust feature-rich NoSQL database platforms famous for NoSQL databases include MongoDB and DynamoDB. This article guide will compare these two databases to help you choose the right one for your project.

  • Mirantis brings secure registries to Kubernetes distros | ZDNet

    Mirantis Secure Registry, formerly Docker Trusted Registry, provides an enterprise-grade container registry solution. You can use this as a foundation to build a secure software supply chain. It does this by providing you with access to a container image registry that has enhanced levels of security beyond that of public registries. This, in turn, gives you more control over this critical part of their software supply chain. The comprehensive, built-in security enables users to verify and trust the automated operations and integration with Continuous Integration/Continuous Delivery (CI/CD) pipelines to speed up application testing and delivery. You can use MSR alongside your other apps in any standard Kubernetes 1.20 and above distribution, via standard Helm techniques. While the new MSR is no longer integrated with Mirantis Kubernetes Engine (MKE) as it was earlier, it still runs as well as ever on MKE as it does with any other supported Kubernetes distribution.

  • How North Dakota Is More Like Windows than UNIX

    If your official name is YATES, you can't (and presumably needn't) file a petition to change it to Yates. "Petitioners have offered no authority or reasoned argument that there is any legal significance to the capitalization of their names."

  • The Success of ‘Open-hearted’ Partnerships in the Cloud | SUSE Communities

    The future is open — and it’s better together. At SUSE, we pride ourselves on our partnerships, and sometimes what we can achieve together surpasses even our greatest hopes. That’s what our award-winning, cloud-based, high-performance computing (HPC) partnership with UberCloud, Dassault Systèmes, and Google Cloud achieved, by enabling 3DT Holdings researchers to create an affordable, real-time heart surgery simulator for physicians to use when it matters most. This is an ongoing relationship with the Living Heart Project that we think is just the beginning of what this ground-breaking research can achieve — and the lives it can save.

Programming Leftovers

  • An outdated Python for openSUSE Leap [LWN.net]

    Enterprise distributions are famous for maintaining the same versions of software throughout their, normally five-year-plus, support windows. But many of the projects those distributions are based on have far shorter support periods; part of what the enterprise distributions sell is patching over those mismatches. But openSUSE Leap is not exactly an enterprise distribution, so some users are chafing under the restrictions that come from Leap being based on SUSE Enterprise Linux (SLE). In particular, shipping Python 3.6, which reached its end of life at the end of 2021, is seen as problematic for the upcoming Leap 15.4 release. [...] OpenSUSE and SLE have generally been aligned over the years. In 2020, Leap and SLE grew even closer together. The build system and repositories between the two were shared starting with Leap 15.2, which corresponded to the second "service pack" (SP) of SLE (i.e. SLE 15-SP2). In 2021, with Leap 15.3 and SLE 15-SP3, the two distributions effectively merged, such that all of the base packages were shared between the two. To a first approximation, Leap is an openSUSE-branded version of SLE, much like what CentOS used to be for Red Hat Enterprise Linux.

  • Make Your Python CLI Tools Pop With Rich | Hackaday

    It seems as though more and more of the simple command-line tools and small scripts that used to be bash or small c programs are slowly turning into python programs. Of course, we will just have to wait and see if this ultimately turns out to be a good idea. But in the meantime, next time you’re revamping or writing a new tool, why not spice it up with Rich?

  • An outdated Python for openSUSE Leap [LWN.net]

    Enterprise distributions are famous for maintaining the same versions of software throughout their, normally five-year-plus, support windows. But many of the projects those distributions are based on have far shorter support periods; part of what the enterprise distributions sell is patching over those mismatches. But openSUSE Leap is not exactly an enterprise distribution, so some users are chafing under the restrictions that come from Leap being based on SUSE Enterprise Linux (SLE). In particular, shipping Python 3.6, which reached its end of life at the end of 2021, is seen as problematic for the upcoming Leap 15.4 release. [...] OpenSUSE and SLE have generally been aligned over the years. In 2020, Leap and SLE grew even closer together. The build system and repositories between the two were shared starting with Leap 15.2, which corresponded to the second "service pack" (SP) of SLE (i.e. SLE 15-SP2). In 2021, with Leap 15.3 and SLE 15-SP3, the two distributions effectively merged, such that all of the base packages were shared between the two. To a first approximation, Leap is an openSUSE-branded version of SLE, much like what CentOS used to be for Red Hat Enterprise Linux.

  • Make Your Python CLI Tools Pop With Rich | Hackaday

    It seems as though more and more of the simple command-line tools and small scripts that used to be bash or small c programs are slowly turning into python programs. Of course, we will just have to wait and see if this ultimately turns out to be a good idea. But in the meantime, next time you’re revamping or writing a new tool, why not spice it up with Rich?