Programming Leftovers


-
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.
-

- Login or register to post comments
Printer-friendly version- 2748 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
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.
|
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.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago