Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • with Statement – Linux Hint

    The Python with statement is a very advanced feature that helps to implement the context management protocol. When the programmer starts coding, they are basically using the try/except/finally to maintain the resources. But there is another way to do this automatically, called the ‘with’ statement.
    So, in this article, we will discuss how we can use the ‘with‘ statement.

    We can understand this with a very simple example.

    Whenever we code something to read or write a file, the first thing which we have to do is to open the file, and then we perform the read or write operations on that and, at last, we close the file so that all the resources will not be busy. So it means that we have to release the resource after we complete our work.

  • Assembly of Python External C++ procedure returning the value of string type

    Writing C++ procedure below we get a final answer as C++ string , then via sequence of operations which convert string to the pointer (say c) to "const char" and finally return required value via pointer to PyObject provided by PyUnicode_FromString(c) to Python Runtime module.

  • How to split string in C++ – Linux Hint

    Working with string data is an essential part of any programming language. Sometimes we need to split the string data for programming purposes. The split() function exists in many programming languages to divide the string into multiple parts. There is no built-in split() function in C++ for splitting string but many multiple ways exist in C++ to do the same task, such as using getline() function, strtok() function, using find() and erase() functions, etc. The uses of these functions to split strings in C++ have been explained in this tutorial.

  • Do while in c – Linux Hint

    Loops in C are divided into two parts. One is the loop body, and the other is the control statement. Each loop is unique in its way. Do while loop is alike to a while loop in some aspects. In this loop, firstly, all the statements inside the body are executed. In case the condition is true, then the loop is again executed until the condition becomes false. In this guide, we will shed some light on the examples of do-while loops.

  • C++ class constructors – Linux Hint

    Constructors are like functions. These are used to initialize the values and the objects of the class. These constructors are initiated when the object of a class is created. Constructor directly does not return any value. To get the value of the constructor, we need to describe a separate function as the constructor doesn’t have any return type. Constructor differs from the simple function in different ways. A constructor is created when the object is generated. It is defined in the public segment of the class.

    In this article, we will deliberate on all these types of constructors with examples.

  • Comparing Strings in Java – Linux Hint

    It is easier to understand the comparison of characters before learning the comparison of string literals. A comparison of strings is given below this introduction. With Java, characters are represented in the computer by integers (whole numbers). Comparing characters means comparing their corresponding numbers.

    With Java, uppercase A to uppercase Z are the integers from 65 to 90. A is 65, B is 66, C is 67, until Z, which is 90. Lowercase ‘a’ to lowercase ‘z’ are the integers from 97 to 122. ‘a’ is 97, ‘b’ is 98, ‘c’ is 99, until ‘z,’ which is 122. Decimal digits are the integers, 48 to 57. That is, ‘0’ is 48, ‘1’ is 49, ‘2’ is 50, until 9, which is 57.

    So, in this new order, digits come first before uppercase letters, which come next before lowercase letters. Before the digits, there is the bell, which is a sounding and not a printable character. Its number is 7. There is the tab character of the keyboard, whose number is 9. There is the newline character (pressing the Enter key), whose number is 10. There is the space character (pressing the space-bar key), whose number is 32. There is the exclamation character, whose number is 33. There is the forward-slash character, whose number is 47. ‘(’ has the number, 40 and ‘)’ has the number, 41.

  • How to use HashMap in Java – Linux Hint

    The column on the left has the keys, and the column on the right has the corresponding values. Note that the fruits, kivi, and avocado have the same color, green. Also, the fruits, grapes, and figs have the same color, purple. At the end of the list, three locations are waiting for their own colors. These locations have no corresponding fruits; in other words, these three locations have no corresponding keys.

More in Tux Machines

Linux 5.16 To Bring Initial DisplayPort 2.0 Support For AMD Radeon Driver (AMDGPU)

A batch of feature updates was submitted today for DRM-Next of early feature work slated to come to the next version of the Linux kernel. AMDGPU driver feature work continues accumulating for what will become Linux 5.16 and debut as stable around the start of the new year. Most notable with today's pull request is initial enablement in this open-source AMD Radeon kernel graphics driver around DisplayPort 2.0. Since August we've been reporting on AMDGPU patches for DisplayPort 2.0, particularly around the Ultra High Bit Rate 10 (UHBR 10) support. Read more

4MLinux 37.1 released.

This is a minor (point) release in the 4MLinux STABLE channel, which comes with the Linux kernel 5.10.63. The 4MLinux Server now includes Apache 2.4.49, MariaDB 10.6.4, and PHP 7.4.23 (see this post for more details). Read more

Audiocasts/Shows: Linux in the Ham Shack, GNOME, Goto, Ubuntu MATE 21.10 Beta, and Destination Linux

  • LHS Episode #431: SDR++ Deep Dive

    Hello and welcome to Episode 431 of Linux in the Ham Shack. In this episode, the hosts take an in-depth look at the SDR++ client program for SDR receivers and transceivers. Topics include where to find the software, it's origins, code base and license and more. Further discussion includes installing from the package repos or building the software, running the code, configuring the basic features as well as navigating the interface and controlling your SDR. We hope you enjoy this content and tune in for the next episodes as well. Have a great week.

  • A Better Menu For The GNOME Desktop - Invidious

    Fly-Pie is a GNOME extension that let's you create your own custom menus. You can use it to launch applications, simulate hotkeys, open URLs and much more. The coolest feature, in my opinion, is how easy it is to navigate the menus either by clicking or by simply dragging the mouse.

  • Alias & Navigate Anywhere On Linux With Goto - Invidious

    Managing your navigation aliases under Linux can be a bit of a hassle and today we're looking at a tool called goto that aims to simplify that process, by separating those out from the rest of your shell aliases and providing some useful extra functionality like tab completion

  • Ubuntu MATE 21.10 Beta Run Through - Invidious

    In this video, we are looking at Ubuntu MATE 21.10 Beta. Enjoy!

  • Ubuntu MATE 21.10 Beta

    Today we are looking at Ubuntu MATE 21.10 Beta. It comes with Linux Kernel 5.13, MATE Desktop 1.26, and uses about 900MB of ram when idling. Enjoy!

  • Destination Linux 245: What Linux Needs For Desktop Domination

    This week’s episode of Destination Linux, we’re going to discuss what’s needed to take Linux desktop over the finish line. Then we’re going to pay our respects to Sir Clive Sinclair with a very special Treasure Hunt. Plus we’ve also got our famous tips, tricks and software picks. All of this and so much more this week on Destination Linux. So whether you’re brand new to Linux and open source or a guru of sudo. This is the podcast for you.

today's howtos

  • How to install Friday Night Funkin' - QT Mod on a Chromebook

    Today we are looking at how to install Friday Night Funkin' - QT Mod on a Chromebook. Please follow the video/audio guide as a tutorial where we explain the process step by step and use the commands below.

  • Linux 101: What does "sourcing a file" mean in Linux? - TechRepublic

    Sourcing a file in Linux is a very important concept, but it might not be one you'll use early on in your Linux career. Even so, I'm going to try to explain this challenging concept in a way you can understand it. Sourcing a file makes it possible for an executable to "source" information from a script as though the script had printed its output to the terminal. It's not an easy concept to grasp, so I'm going to show you by way of an example.

  • 3 Ways to install Slack in Ubuntu 20.04 LTS (Focal Fossa) - Linux Shout

    Slack is a group collaboration tool designed for teams that work in different locations. Primarily used for communication in teams, as the service can be perfectly integrated into the workflow. Users can link Slack with many other services, for example with cloud services such as Dropbox or with social networks. So Slack becomes the focal point of the action. At its core, Slack is instant messaging software. In addition to direct messaging, Slack enables communication “channels” that can be organized by project, customer, team, or any other way your company deems appropriate for separate conversations. Channels are structured according to the concept of a chat room: All channel participants can take part in the conversation and the messages appear in real-time.

  • Install Ruby on CentOS/RHEL 8 with 3 different methods - Unixcop

    Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Ruby is seen as a flexible language, since it allows its users to freely alter its parts. Essential parts of Ruby can be removed or redefined, at will. Existing parts can added upon. Ruby tries not to restrict the coder. Ruby can_be used in diverse applications such as data analysis and prototyping. In this installation guide, you will learn how to install Ruby on CentOS 8 and RHEL 8 Linux.

  • How to Check Which Desktop Environment You’re Using on Linux

    As you might know, Linux-based operating systems are heavily focused on the command line for performing operations. A minimal distro like Arch Linux will present you with a dark terminal post-installation. What makes Linux distros interactive and user-friendly often goes unnoticed—the desktop environment. Most beginner Linux users are unaware of desktop environments and don't even know which one they're using. Here's how you can check which desktop environment is currently installed on your Linux system.