Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development

  • Python String Manipulation Handbook

    String manipulation is one of those activities in programming that we, as programmers, do all the time.

    In many programming languages, you have to do a lot of the heavy lifting by yourself.

    In Python, on the other hand, you have several built-in functions in the standard library to help you manipulate strings in many different ways.

    In this article I will show you how to work with strings specifically along with some nice tricks.

  • Web Scraping in Python – How to Scrape an eCommerce Website Using Beautiful Soup and Pandas

    In this post we are going to scrape an ecommerce website. We'll get into each individual product page and retrieve our information from there. This is the website we are going to scrape – it's an online shop that sells whisky.

    Do remember to check out the robots.txt file before scraping any website. You have to keep in mind that you can unnecessarily bring a website down and can harm their services. So, please do not flood their servers with scraping requests.

    You can learn more about effective web scraping techniques here before starting to scrape any website.

  • Django vs. SQLAlchemy Comparison

    As more and more technology is developed and improved over time, the number of users accessing the internet grows even more, and as a result of that, the amount of data that businesses and organizations have to deal with is growing exponentially. For a company to be successful, it needs to have tools and infrastructure that can deal with these large sets of data easily. This is exactly where the database comes into the picture which is mainly designed for the storage and collection of data. Moreover, its organized form allows users to easily manage and access the dataset. Database themselves require a management system that allows them to store and provide access to the data. Mostly, the language SQL is used to perform operations in a database, however, as your application grows and becomes more complex, it becomes extremely difficult to have an idea as to what exactly each operation is doing.

    An alternative to this that was developed was the ORM (Object Relational Mapping) frameworks that actually create a bridge in connecting the database and the programming language that you prefer using in creating your application. With Python being one of the most popular programming languages this year, we shall, therefore, take a look at and compare the pros and cons of two of its most popular and widely used ORMs, Django and SQLAlchemy, in this article.

  • Subject Verb Object notation; declarative Perl without the framework

    If you’ve read Curtis “Ovid” Poe’s articles on the declarative framework for Tau Station Link and Link, you are undoubtedly aware of many of the benefits this style of programming can bring. It decouples the “what” from the “how”, encourages discrete functions and prevents the OO trap of “god objects”. The result is software that is easy to test, robust and very flexible. Inserting steps, reording steps etc… are done much easier and more clearly than trying to figure this out in 300 lines of imperative code with four to six level deep if-else chains with for loops mixed in for good fun. However, the framework is tightly coupled to the game in spots and has a few other issues that make it not ready for general use.

  • Understanding Mach Try

    There is a lot of confusion around mach try. People frequently ask “How do I get task X in mach try fuzzy?” or “How can I avoid getting backed out?”. This post is not so much a tip, rather an explanation around how mach try works and its relationship to the CI system (taskgraph). Armed with this knowledge, I hope you’ll be able to use mach try a little more effectively.

  • Qt Desktop Days Returns!

    KDAB is bringing you another Qt Desktop Days this May! So, if you missed the first one that was held last September, or if you would like to attend a second, please join us May 19th-20th. That’s a little less than two months away!

    Qt Desktop Days is primarily a technical event and we want our content to be as relevant and interesting as possible to our audience. The target audience is developers programming with Qt, building software for desktop systems.

  • Using Qt datatypes in Standard Library unordered containers

    In this post, we’ll continue our discussion regarding hashing functions, tackling a specific problem, namely, how to use a Qt datatype as a key of a Standard Library unordered associative container.

    The Standard Library unordered associative containers (std::unordered_map, std::unordered_set, and so on), as well as other third party implementations (like the excellent robin-map), require, by default, a specialization of std::hash to be available for the key type we want to use.

  • How to Beat Coder's Block – Five Tips to Help You Stay Productive

    As programmers, we all share a certain number of universal experiences.

    One is an enduring hatred of semicolons, brackets, and parentheses (who hasn't wasted hours looking for the one of these they misplaced or omitted?).

    And another is learning to use compile-time for a convenient break when we don't feel like getting anything done (I won't tell if you don't).

    But the most universal programming experience of them all is what is now known as coder's block. That's when you end up unable to produce any usable code for no discernible reason.

  • Generics in Go Explained with Code Examples

    Generics were proposed a few years ago for Go, and they have finally been accepted into the language earlier this year. And they're scheduled to be officially released at the end of this year.

    How will Generics really affect Go? Will it change how we code?

    To really answer these questions, we will need to take a look at how generics work. Conveniently, the devs have provided us with a web compiler where we can experiment with generics ourselves.

  • Create Pixel Effects with JavaScript and HTML Canvas

    You can use JavaScript to create some amazing pixel effects.

    We've just published a course that will teach you how to use JavaScript to create really cool effects with images and text. You will learn multiple different particle effects with vanilla JavaScript and HTML canvas.

    This course was developed by Frank Dvorak. Frank loves to demonstrate his creative coding experiments on his own YouTube channel, and now he is sharing some of his coolest experiments with the freeCodeCamp community.

  • Live previews with Rails and Stimulus 2

    Who wouldn’t want a live preview for writing their great content? If you happen to be running Rails with Hotwire, it’s surprisingly easy with a small Stimulus controller.

    The core idea of our preview is that it’s rendered entirely on the backend. This is useful since we can reuse the logic both for presentation as well as actual changes. Whatever happens with the content can come from a single Ruby method. We’ll start with a small controller and a preview method:

  • Twenty Years of Geek Girl-ing

    I recently read a number of articles talking about what women in tech face daily. The one trending on medium currently was written by a developer with three years in the industry.

    Her experience is absolutely valid of course, but it only tells part of the picture. We’re missing the experience of the greybeards. In tech, the greybeards are the developers who came before you — the ones you go to for advice and wisdom. We’ve been around and have seen all sorts of things. We’re usually willing to share wisdom in exchange for coffee, chocolate, or whiskey.

    Yes, women can be greybeards too. Really. Doesn’t require actual facial hair.

  • Static energy: Crystal language hits v1.0 milestone, ARM and Windows support still needs polishing

    The first major release of the Crystal programming language happened this week as the project hit version 1.0. The much anticipated language has been created with the aims of offering the speed of C/C++ but with a programmer-friendly syntax as readable and easy to understand as Ruby.

    Crystal has been under development for around a decade and is described as a general-purpose, object-oriented programming language. It is a compiled language with static type-checking and a syntax heavily influenced by the Ruby language.

  • Made in Thailand CorgiDude RISC-V AI board aims to teach machine learning

    There’s a relatively small but active maker community in Thailand, and we’ve covered or even reviewed some made in Thailand boards including ESP8266 and ESP32 boards, a 3G Raspberry Pi HAT, and KidBright education platform among others.

    MakerAsia has developed CorgiDude, a board based on the version of Sipeed M1 RISC-V AI module with built-in WiFi, and part as a kit with a camera and a display used to teach machine learning and artificial intelligence with MicroPython or C/C++ programming.

  • How to Create A New React.Js Application

    React is an open-source JavaScript library for creating web frontend and UI components. It is developed and maintained by the Facebook and a large community of developers. This is also useful for creating mobile applications.

    We will use yarn package manager to create a reactjs application and make production build. Pm2 to run and monitor react application.

    This tutorial will help you to create a new React.js Application on a developer system. Also help you to run reactjs application and make a production build.

  • How to Add Video Calling to a React Native App

    Video calling has become an essential day to day activity during the COVID-19 pandemic. By using features such as chat apps, audio calling, and video calling, we have been able to stay connected with our friends and family.

  • Eclipse Foundation Launches Adoptium Working Group | TFiR: Interviews, News & Analysis by Swapnil Bhartiya

    The Eclipse Foundation has announced the formal establishment of the Adoptium Working Group in collaboration with the AdoptOpenJDK Technical Steering Committee.

    With this announcement, the Eclipse Foundation is bringing its vendor-neutral governance framework in support of the Eclipse Adoptium top-level project, which is based on the work previously done under the AdoptOpenJDK organization.

  • Red Hat joins the Eclipse Adoptium Working Group

    Red Hat is proud to be a founding strategic member of the Adoptium Working Group as AdoptOpenJDK transitions to its new home at the Eclipse Foundation.

    It started as a simple mission. In 2017 the AdoptOpenJDK project began delivering high-quality, open source Java binaries based on OpenJDK technology. After several years and impressive success, AdoptOpenJDK is joining the Eclipse Foundation as Eclipse Adoptium, and Red Hat is proud to be part of this effort.

  • Stephen Michael Kellat: Taking Stock In Late March 2021

    Apparently there are people talking about self-hosting their git repositories. There are multiple variations on this as seen elsewhere. There remains the option of using Gitea as well. No, I am not thinking of abandoning my git repos on Launchpad at this time.

  • Forecast - A simple Bash script for the weather service Yr.no

    Some time ago, my rather old (zsh!) script for checking the current weather from the weather service Yr.no broke, after some looking around I found a new alternative called Forecast.

    The script is written in Bash, and it’s pretty straightforward. It requires bash, curl and xsltproc.

  • How to Use until Loop in Your Shell Scripts

    In bash for, while, and until are three loop constructs. While each loop differs syntactically and functionally their purpose is to iterate over a block of code when a certain expression is evaluated.

    Until loop is used to execute a block of code until the expression is evaluated to be false. This is exactly the opposite of a while loop. While loop runs the code block while the expression is true and until loop does the opposite.

    [...]

    You can use a break and continue statements inside while loop. The break statement will exit out of the loop and will pass the control to the next statement while the continue statement will skip the current iteration and start the next iteration in the loop.

    I am using the same infinite loop example. Here when the count is equal to five continue statement will jump over to the next iteration skipping the rest of the loop body. Similarly, the loop breaks when the count is equal to or greater than 10.

  • 1.51.0 pre-release testing

    The 1.51.0 pre-release is ready for testing. The release is scheduled for this Thursday, March 25th. Release notes can be found here.

  • Niko Matsakis: Async Vision Doc Writing Sessions
  • String to Char Array Java Tutorial

    In this article, we’ll look at how to convert a string to an array of characters in Java. I'll also briefly explain to you what strings, characters, and arrays are.

  • How to Use Supercharged Sorts in JavaScript

    And the answer is, of course, sure. Absolutely. The way Array.filter() works in JavaScript, it's chainable. That means, when the first .filter() function returns, it can be fed straight into a second .filter(), and to as many filters as you like.

    But if we want to sort by more than one property, that seems a little trickier. After all, if we sort by one property, then sort by a second, we've lost the first.

    How about if we use something like .reduce() instead? We could use that to reduce the array to an object whose properties are the first sort values, then set each of those properties to an array of items containing those values, and sort them!

  •   

  • 3 new Java tools to try in 2021 | Opensource.com

    Despite the popularity of Python, Go, and Node.js for implementing artificial intelligence and machine learning applications and serverless functions on Kubernetes, Java technologies still play a key role in developing enterprise applications. According to Developer Economics, in Q3 2020, there were 8 million enterprise Java developers worldwide.

    Although the programming language has been around for more than 25 years, there are always new trends, tools, and frameworks in the Java world that can empower your applications and your career.

    The vast majority of Java frameworks are designed for long-running processes with dynamic behaviors for running mutable application servers such as physical servers and virtual machines. Things have changed since Kubernetes containers were unleashed in 2014. The biggest issue with using Java applications on Kubernetes is with optimizing application performance by decreasing memory footprints, speeding start and response times, and reducing file sizes.

More in Tux Machines

digiKam 7.7.0 is released

After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. Read more

Dilution and Misuse of the "Linux" Brand

Samsung, Red Hat to Work on Linux Drivers for Future Tech

The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. Read more

today's howtos

  • How to install go1.19beta on Ubuntu 22.04 – NextGenTips

    In this tutorial, we are going to explore how to install go on Ubuntu 22.04 Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions. Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection. In this guide, we are going to learn how to install golang 1.19beta on Ubuntu 22.04. Go 1.19beta1 is not yet released. There is so much work in progress with all the documentation.

  • molecule test: failed to connect to bus in systemd container - openQA bites

    Ansible Molecule is a project to help you test your ansible roles. I’m using molecule for automatically testing the ansible roles of geekoops.

  • How To Install MongoDB on AlmaLinux 9 - idroot

    In this tutorial, we will show you how to install MongoDB on AlmaLinux 9. For those of you who didn’t know, MongoDB is a high-performance, highly scalable document-oriented NoSQL database. Unlike in SQL databases where data is stored in rows and columns inside tables, in MongoDB, data is structured in JSON-like format inside records which are referred to as documents. The open-source attribute of MongoDB as a database software makes it an ideal candidate for almost any database-related project. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MongoDB NoSQL database on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.

  • An introduction (and how-to) to Plugin Loader for the Steam Deck. - Invidious
  • Self-host a Ghost Blog With Traefik

    Ghost is a very popular open-source content management system. Started as an alternative to WordPress and it went on to become an alternative to Substack by focusing on membership and newsletter. The creators of Ghost offer managed Pro hosting but it may not fit everyone's budget. Alternatively, you can self-host it on your own cloud servers. On Linux handbook, we already have a guide on deploying Ghost with Docker in a reverse proxy setup. Instead of Ngnix reverse proxy, you can also use another software called Traefik with Docker. It is a popular open-source cloud-native application proxy, API Gateway, Edge-router, and more. I use Traefik to secure my websites using an SSL certificate obtained from Let's Encrypt. Once deployed, Traefik can automatically manage your certificates and their renewals. In this tutorial, I'll share the necessary steps for deploying a Ghost blog with Docker and Traefik.