Language Selection

English French German Italian Portuguese Spanish

Development

Programming leftovers

Filed under
Development
  • My Favorite Warnings: redefine

    Sooner or later any programmer, writing in any language, will run across something like this Perl warning: Subroutine foo redefined. This is telling you that somehow, somewhere, you tried to create two subroutines with the same name.

  • Dirk Eddelbuettel: dang 0.0.15: Small Correction

    A bug-fix release of the dang package arrived at CRAN a little while ago. The dang package regroups a few functions of mine that had no other home as for example lsos() from a StackOverflow question from 2009 (!!), the overbought/oversold price band plotter from an older blog post, the market monitor from the last release as well the checkCRANStatus() function tweeted about by Tim Taylor.

  • Dirk Eddelbuettel: td 0.0.5 on CRAN: New Reference Accessors

    The td package for accessing the twelvedata API for financial data has been updated on CRAN to version 0.0.5.

    This is version is mostly the work of Kenneth who suggested to add accessors for reference data, and then did just that. So if you already use td, good news as you now have nine or so more functions getting data for you!

  • A simple CSS trick for dark mode

    You're likely already familiar with media queries. They're in widespread use for making websites responsive. The width and height properties contain the viewport's dimensions. You then use CSS to render different layouts at different dimensions.

    The prefers-color-scheme media query works the same way. The user can configure their operating system to use a light or dark theme. Prefers-color-scheme contains that value. The value is either light or dark, though the W3C spec states that it might support future values like sepia. I specify different values of CSS variables for both modes and let the user's OS decide.

  • Print a Halloween greeting with ASCII art on Linux | Opensource.com

    Full-color ASCII art used to be quite popular on DOS, which could leverage the extended ASCII character set and its collection of drawing elements. You can add a little visual interest to your next FreeDOS program by adding ASCII art as a cool “welcome” screen or as a colorful “exit” screen with more information about the program.

    But this style of ASCII art isn’t limited just to FreeDOS applications. You can use the same method in a Linux terminal-mode program. While Linux uses ncurses to control the screen instead of DOS’s conio, the related concepts apply well to Linux programs. This article looks at how to generate colorful ASCII art from a C program.

  • Announcing marked-it v2: Transform your Markdown source into HTML5 output

    marked-it is an open source generator that transforms Markdown source into HTML5 output. Created by IBM, marked-it adds to the basic Markdown markup with extensions that make your content web-ready.

    In marked-it version 2.0, we refactored the code to make it easier for users to code, customize, and contribute their own enhancements to the project.

  • Commercial LTS Qt 5.15.7 Released

    We have released Qt 5.15.7 LTS for commercial license holders today. As a patch release, Qt 5.15.7 does not add any new functionality but provides bug fixes and other improvements.

  • Qt Creator 6 - CMake update

    Qt Creator 6 comes with bug fixes and new features that affect CMake projects.

Programming Leftovers

Filed under
Development
  • A viable solution for Python concurrency

    Concerns over the performance of programs written in Python are often overstated — for some use cases, at least. But there is no getting around the problem imposed by the infamous global interpreter lock (GIL), which severely limits the concurrency of multi-threaded Python code. Various efforts to remove the GIL have been made over the years, but none have come anywhere near the point where they would be considered for inclusion into the CPython interpreter. Now, though, Sam Gross has entered the arena with a proof-of-concept implementation that may solve the problem for real.
    The concurrency restrictions in the CPython interpreter are driven by its garbage-collection approach, which uses reference counts on objects to determine when they are no longer in use. These counts are busy; many types of access to a Python object require a reference-count increment and (eventually) decrement. In a multi-threaded program, reference-count operations must be performed in a thread-safe manner; the alternative is to risk corrupted counts on objects. Given the frequency of these operations, corruption in multi-threaded programs would be just a matter of time, and perhaps not much time at that. To avoid such problems, the GIL only allows one thread to be running in the interpreter (i.e. to actually be running Python code) at a time; that takes away almost all of the advantage of using threads in any sort of compute-intensive code.

  • Niko Matsakis: Rustc Reading Club

    Ever wanted to understand how rustc works? Me too! Doc Jones and I have been talking and we had an idea we wanted to try. Inspired by the very cool Code Reading Club, we are launching an experimental Rustc Reading Club. Doc Jones posted an announcement on her blog, so go take a look!

    The way this club works is pretty simple: every other week, we’ll get together for 90 minutes and read some part of rustc (or some project related to rustc), and talk about it. Our goal is to walk away with a high-level understanding of how that code works. For more complex parts of the code, we may wind up spending multiple sessions on the same code.

  • This Week In Rust: This Week in Rust 414
  • Vercel boss Guillermo Rauch on Next.js 12 • The Register
  • Qt Creator 6 Beta2 released

    We are happy to announce the release of Qt Creator 6 Beta2!

  • Qt Creator and clangd: An Introduction

    As I hinted at recently, we have spent the last couple of months implementing a new clangd-based back-end of our C/C++ code model. With the second beta of Qt Creator 6 having been released, I feel we can now in good conscience ask you to enable this feature and take it for a test drive.

  • GTK4: Toolbars in Sidebar

    GTK4 port of Libreoffice now supports the "widebutton" Toolbar MenuButtons that show a preview of the selected color.

  • New training couse: Real-Time Linux with PREEMPT_RT - Bootlin's blog

    In the field of embedded systems, a number of applications need real-time guarantees, and the Linux ecosystem has been offering for a long time a number of solutions to address those needs, either by improving the Linux kernel itself using the PREEMPT_RT approach, or by using a co-kernel approach such as the one offered by Xenomai. Bootlin training’s portfolio already has an initial coverage of these topics in our Embedded Linux system development course.

  • OpenUK Open Technology for Sustainability and OpenUK Awards 2021

    This week sees COP26, the UN conference which is probably the last chance for humanity to mitigate the worse effects of the climate emergency.

    At Akademy earlier this year KDE had a talk about Towards Sustainable Computing. Open tech can make a difference.

    OpenUK will be hosting a venue on 11 November with a day of events about sustainability with technology emphasising why open tech is the most effective way to do that.

  • Adaptive Transparency is Broken: Let's Fix It! - Kockatoo Tube

Programming Leftovers

Filed under
Development
  • Steinar H. Gunderson: Speed

    My OS: One core can run 10 million random I/O operations per second and minify JSON at 6 GB/sec.

    Also my OS: Firing up a new terminal gives a one-second delay where the shell reads its 24 MB history file, and getting ten new emails makes my mail reader reflow all threads ten times, giving jank of several seconds.

  • Better Perl: Four list processing best practices with map, grep, and more

    First, some cred­it is due: these are all restate­ments of sev­er­al Perl::Critic poli­cies which in turn cod­i­fy stan­dards described in Damian Conway’s Perl Best Practices (2005). I’ve repeat­ed­ly rec­om­mend­ed the lat­ter as a start­ing point for higher-​quality Perl devel­op­ment. Over the years these prac­tices con­tin­ue to be re-​evaluated (includ­ing by the author him­self) and var­i­ous authors release new pol­i­cy mod­ules, but perlcritic remains a great tool for ensur­ing you (and your team or oth­er con­trib­u­tors) main­tain a con­sis­tent high stan­dard in your code.

    With that said, on to the recommendations!

  • Perl Weekly Challenge 136: Two Friendly and Fibonacci Sequence
  • Project Wakefield Is OpenJDK's Effort To Improve Java On Wayland - Phoronix

    Project Wakefield formally got off the ground in September with its focus to provide native Wayland support. Given Linux distributions continue moving away from X.Org Server based sessions by default in favor of Wayland, OpenJDK developers are working to get their Wayland desktop support in order. Initially they are working to provide good support for JDK running on Wayland within the X11 compatibility mode while the ultimate goal is to offer complete and native Wayland client support. OpenJDK developers have acknowledged this will "take years to fully complete and deliver" their native Wayland support.

Raspberry Pi and Qt Programming

Filed under
Development

Pyston's Plans

Filed under
Development
  • Alternative Python Implementation "Pyston" Plans For Greater Performance, 64-bit ARM

    Pyston as the alternative Python implementation open-sourced originally by Dropbox is forming ambitious plans for a bright future.

    While Dropbox continued developing Pyston publicly from 2014 to 2017, they stopped supporting it with having moved their performance-sensitive code to other languages. But the original developers then restarted work on it and released Pyston 2.0 in 2020.

    Pyston 2.0 was made closed-source along with the follow-on 2.1 release but then Pyston 2.2 this year returned it to being open-source. Then in August it was announced the Pyston developers joined Anaconda to continue their work on this high performance Python implementation.

  • Pyston roadmap

    We’ve spent some time recently thinking about the future of Pyston, our faster implementation of Python, and wanted to share what’s on our mind. For updates please check out our wiki.

Programming Leftovers

Filed under
Development
  • Run your own CI pipeline with GStreamer's new monorepo

    Recently, the GStreamer project merged all its git repositories into a single, unified repository, often called monorepo. You can read more about this change here.

    One benefit is it greatly simplifies maintaining custom, project specific, GStreamer patches. Previously, projects that needed to develop, or backport, some patches had to go through multiple steps to complete the task. Projects had to fork various git repositories (e.g. gst-plugins-good, gst-plugins-bad, etc), each repository would then have a new branch with the extra commits, and often, gst-build was used to pull all of these repositories together (and gst-build itself had to be patched beforehand to download forked repositories). Thankfully, all that will be a thing of the past.

  • GitOps: Best practices for the real world

    There is a common misunderstanding about how GitOps should be applied in real-world environments. Developers equate Infrastructure as Code (IaC) with GitOps in concept or believe that GitOps can only work with container-based applications — which is not true. In this blog, you will learn what GitOps is and how to apply its principles to real-world development and operations.

  • 5 Open Source tools for Documenting your React Component - DEV Community

    Documenting our code is of course not the easiest part of the development process and at times developers even avoid it saying that it's really boring. In this article, we will take an overview of 5 tools whose purpose is to help us in documenting our React Components with bare minimum efforts thus, which have made documenting our React Components a piece of cake.

  • Meson version bumped to 0.59.2

    Meson is a source package build system. EasyOS has version 0.53.0, however, I wanted to compile the latest 'pipewire' package and it requires meson version 0.54.0 or later.

    So, have recompiled meson in OpenEmbedded, now version 0.59.2.

  • Reviving Net::Pcap

    ... in which I look at how existing patches floating on the internet can be integrated into Net::Pcap to make it compile again.

    Net::Pcap is dear to me, as I have a module implementing an HTTP sniffer using its network capture. So I like it when the module compiles without too much manual work.

  • Smart Flower Pot Build Is All About That Base | Hackaday

    This attractive beginner build is a Python-powered project that runs on a PyPortal Titano and has a speaker that anthropomorphizes the thing so it can berate you politely ask for water in English. But the real magic of this build is in the enclosure itself.

  • Best Plugins for PyCharm

    Plugins are add-ons that enable you to optimize your applications. For instance, if you want to live-stream a soccer match on a website, you may need to install a plugin because your browser doesn’t come with preinstalled streaming tools.

    You might want to think of plugins as an integral part of your computing and web browsing, making sure each activity you do is running smoothly, even if it is just about viewing a document or surfing a blog.

  • Duplicate records differing only in unique identifiers

    There's a big data table with lots of fields and lots of records. Each record has one or more unique identifier field entries. How to check for records that are exactly the same, apart from those unique identifiers?

    I've been tinkering with this problem for years, and you can read my last, fairly clumsy effort in this BASHing data blog post from 2020. Here I present a much-improved solution, which has also gone into A Data Cleaner's Cookbook as an update.

    In 2020, the fastest and most reliable method I used to extract these partial duplicates was with an AWK array and two passes through the table. In the first pass, an array "a" is built with the non-unique-identifier field entries as index string and the tally of each different entry as the value string. In the second pass through the table, AWK looks for records where the value string for the same index string is greater than one, and by default prints the record.

  • Excellent Free Tutorials to Learn Bash - LinuxLinks

    Bash (acronym for the ‘Bourne-Again-SHell’) is the GNU Project’s shell and programming language. It’s an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). Bash has become a de facto standard for shell scripting. It runs on almost all versions of Unix and a few other operating systems including Windows platforms.

    A Unix shell is both a command interpreter and a programming language. As a command interpreter, the shell provides the user interface to various utilities. The programming language features of Bash allow these utilities to be combined. Files containing commands can be developed, and become commands themselves. A shell script is therefore a quick way of prototyping a complex application. Shell scripting follows the classic Unix philosophy of breaking complex projects into simpler subtasks, of chaining together components and utilities.

    Like all Unix shells, Bash supports filename globbing (wildcard matching), piping, here documents, command substitution, variables and control structures for condition-testing and iteration. The keywords, syntax and other basic features of the language were all copied from sh.

    Here’s our recommended free tutorials to learn Bash.

  • Classic 80s Text-To-Speech On Classic 80s Hardware | Hackaday

    Those of us who were around in the late 70s and into the 80s might remember the Speak & Spell, a children’s toy with a remarkable text-to-speech synthesizer. While it sounds dated by today’s standards, it was revolutionary for the time and was riding a wave of text-to-speech functionality that was starting to arrive to various computers of the era. While a lot of them used dedicated hardware to perform the speech synthesis, some computers were powerful enough to do this in software, but others were not quite able. The VIC-20 was one of the latter, but thanks to an ESP8266 it has been retroactively given this function.

    This project comes to us from [Jan Derogee], a connoisseur of this retrocomputer, and builds on the work by [Earle F. Philhower] who ported the retro speech synthesis software known as SAM from assembly to C which made it possible to run on the ESP8266. Audio playback is handled on the I2S port, but some work needed to be done to get this to work smoothly since this port also handles the communication with the VIC-20. Once this was sorted out, a patch was made to be able to hear the computer’s audio as well as the speech synthesizer’s. Finally, a serial command interface was designed by [Jan] which allows for control of the module.

GitHub stale bot considered harmful

Filed under
Development
Microsoft

One of GitHub’s “recommended” marketplace features is the “stale” bot. The purpose of this bot is to automatically close GitHub issues after a period of inactivity, 60 days by default. You have probably encountered it yourself in the course of your work.

This is a terrible, horrible, no good, very bad idea.

Read more

Raspberry Pi and Arduino Leftovers

Filed under
Development
Hardware
  • Fast Indoor Robot Watches Ceiling Lights, Instead of the Road

    To pull this off, [Andy] uses a camera with a fisheye lens aimed up towards the ceiling, and the video is processed on a Raspberry Pi 3.

  • Tackle The Monkey: Raspberry Pi Gets Round Screen | Hackaday

    You could argue that the project to add a round screen to a Raspberry Pi from [YamS1] isn’t strictly necessary. After all, you could use a square display with a mask around it, giving up some screen real estate for aesthetics. However, you’d still have a square shape around the screen and there’s something eye-catching about a small round screen for a watch, an indicator, or — as in this project — a talking head.

    The inspiration for the project was a quote from a Google quote about teaching a monkey to recite Shakespeare. A 3D printed monkey with a video head would be hard to do well with a rectangular screen, you have to admit. Possible with a little artistry, we are sure, but the round head effect is hard to beat. Honestly, it looks more like an ape to us, but we aren’t primate experts and we think most people would get the idea.

  • Move! makes burning calories a bit more fun | Arduino Blog

    Gamifying exercise allows people to become more motivated and participate more often in physical activities while also being distracted by doing something fun at the same time. This inspired a team of students from the Handong Global University in Pohang, South Korea to come up with a system, dubbed “Move!,” that uses a microcontroller to detect various gestures and perform certain actions in mobile games accordingly.

    They started by collecting many different gesture samples from a Nano 33 BLE Sense, which is worn by a person on their wrist. This data was then used to train a TensorFlow Lite model that classifies the gesture and sends it via Bluetooth to the host phone running the app. Currently, the team’s mobile app contains three games that a player can choose from.

New bash programming articles

Filed under
Development
  • How to use bash aliases

    Most of the users like to use shortcuts for running commands. There are many commands in Ubuntu that we need to execute regularly. It will be very helpful for us if we can run those common commands by typing shortcut commands. Using bash aliases, Ubuntu users can easily create shortcut commands of the large commands those are used frequently. Bash aliases not only make the task easier but also save the time of the users. The user can declare alias temporary or permanently. The temporary aliases can be used as long as the session of the user exists. If the user wants to use shortcut commands every time the session starts, then he or she has to create permanent alias by using ~/.bashrc and ~/.bash_profile files. This tutorial shows how you can create and use bash aliases in Ubuntu by using some examples.

  • Bash Arithmetic Operation

    Using bash aliases, Ubuntu users can easily create shortcut commands of the large commands those are used frequently. Bash aliases not only make the task easier but also save the time of the users. The user can declare alias temporary or permanently. How to use bash aliases is explained in this article.

  • How to use arrays in Bash

    When you want to use multiple data using a single variable in any programming language, you have to use array variables. The list of data can be assigned and used using an array variable. Bash is a weakly typed language that does not require defining any data type for declaring the variable. Array declaration in bash is a little bit different from other standard programming languages. Two types of the array can be declared in bash. Numeric array and associative array. If the index of an array is numeric, then it is called a numeric array, and if the index of an array is a string, it is called an associative array. How you can declare a numeric array, associative array, and iterate elements of the array using for loop are described with examples in this tutorial.

  • Bash Head and Tail Command

    Many types of commands are available in bash to show the content of a file. Most commonly used commands are ‘cat’, ‘more’, ‘less’, ‘head’ and ‘tail‘ commands. To read the entire file, ‘cat’, ‘more’, and ‘less‘ commands are used. But when the specific part of the file is required to read then ‘head‘ and ‘tail‘ commands are used to do that task.

    ‘head‘ command is used to read the file from the beginning and the ‘tail‘ command is used to read the file from the ending. How you can use ‘head‘ and ‘tail‘ commands with different options to read the particular portion of a file is shown in this tutorial.

    You can use any existing file or create any new file to test the functions of ‘head‘ and ‘tail‘ commands. Create two text files named products.txt and employee.txt with the following content to show the use of ‘head‘ and ‘tail‘ commands.

  • Bash Range

    You can iterate the sequence of numbers in bash in two ways. One is by using the seq command, and another is by specifying the range in for loop. In the seq command, the sequence starts from one, the number increments by one in each step, and print each number in each line up to the upper limit by default. If the number starts from the upper limit, then it decrements by one in each step. Normally, all numbers are interpreted as a floating-point, but if the sequence starts from an integer, the decimal integers will print. If the seq command can execute successfully, then it returns 0; otherwise, it returns any non-zero number. You can also iterate the sequence of numbers using for loop with range. Both seq command and for loop with range are shown in this tutorial by using examples.

  • Bash Script User Input

    In the seq command, the sequence starts from one, the number increments by one in each step, and print each number in each line up to the upper limit by default. If the seq command can execute successfully, then it returns 0; otherwise, it returns any non-zero number. Two ways to generate the sequence of numbers are shown with examples in this article.

  • BASH while loop examples

    Three types of loops are used in bash programming. While loop is one of them. Like other loops, a while loop is used to do repetitive tasks. This article shows how you can use a while loop in a bash script by using different examples.

Programming Leftovers

Filed under
Development
  • Josef Strzibny: Preloading Rails applications in production

    When it’s time to take your application online, there are several decisions to make. Today I would like to talk about application preloading and explain why I prefer preloading applications in production.

    But first things first. What’s is preloading anyway?

    Preloading the application is a process of loading up all application files and dependencies to virtual memory. If it would be a game, this might be a difference between loading just first two levels of the game versus loading the game as a whole. What’s not loaded at first will be loaded later from the disk when required.

    The opposite of preloading is lazy loading. Lazy loading saves us some memory at first and as a side product makes the boot process faster which might be a decent optimization for large applications.

  • GCC 12 Merges Initial Support For RISC-V's Bitmanip Extensions - Phoronix

    Following the recent RISC-V Bitmanip work in Binutils, the GCC 12 compiler has now landed preliminary support for the RISC-V ISA's bit manipulation extension.

    RISC-V's Bitmanip is a collection of several component extensions intended to help cater the open-source processor ISA for better efficiency that can result in code size reduction, better performance, and reduced energy consumption.

  • Nibble Stew: A call for more downstream testing of Meson

    As Meson gets more and more popular, the number of regressions also grows. This is an unvoidable fact of life. To minimize this effort we publish release candidates before the actual releases. Unfortunately not many people use these so many issues are not found until after the release (as happened with 0.60.0).

    For this reason we'd like to ask more people to test these rcs on their systems. It's fairly straightforward.

    [...]

    If you have some different setup that has a full CI run (hopefully something smaller than a full Debian archive rebuild) then doing that with the rc version would be the best test.

  • Use Rust for embedded development

    Over the past several years, Rust has gained a passionate following among programmers. Tech trends come and go, so it can be difficult to separate excitement just because something is new versus excitement over the merits of a technology, but I think Rust is a truly well-designed language. It aims to help developers build reliable and efficient software, and it was designed for that purpose from the ground up. There are key features you'll hear about Rust, and in this article, I demonstrate that many of these features are exactly why Rust also happens to be great for embedded systems.

    [...]

    Using Rust for your embedded development gives you all the features of Rust without the need to sacrifice flexibility or stability.

Syndicate content