Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • The mmap() copy-on-write trick: reducing memory usage of array copies

    Let’s say you have an array, and you need to make some copies and modify those copies. Usually, memory usage scales with the number of copies: if your original array was 1GB of RAM, each copy will take 1GB of RAM. And that can add up.

    But often, you’re just changing a small part of the array. Ideally, the memory cost would only be the parts of the copies that you changed.

  • Pip Install Specific Version of a Python Package: 2 Steps

    In this Python tutorial, you will learn how to use pip install a specific version of a package. The outline of the post (as also can be seen in the ToC) is as follows. First, you will get a brief introduction with examples on when you might need to install an older version of a package. Second, you will get the general syntax for how to carry out this task. After that, you will get two steps to installing specific versions of Python packages with pip. In this section, you will also learn how to work with a virtual environment. In the next section, we will look at how to specify the version of multiple Python packages by creating a .txt file.

  • Angular 10 and Django 3 Image Files Upload with FormData

    Throughout this tutorial, we'll see how we can implement file and image upload in Django 3, Django REST Framework and Angular 10 with a step by step example.

    Our application will expose an /upload REST API endpoint that accepts POST requests which contain the image file posted with a multipart/form-data content type via FormData.

    For the frontend, we'll be using Angular 10 to create a simple interface that allows the user to select a file or image and upload it to the server via a POST request using HttpClient and FormData.

  • Multiple Image Files Upload with Django 3, Angular 10 and FormData

    In the previous tutorial we have seen how to implement image file uploading in Django 3 and Angular 10. In this tutorial, we'll see how to implement multiple file uploading with FormData and HttpClient.

  • Python: Check if File or Directory is Empty

    Python has a set of built-in library objects and functions to help us with this task. In this tutorial, we'll learn how to check if a file or directory is empty in Python.

  • For Loop vs. List Comprehension

    Many simple “for loops” in Python can be replaced with list comprehensions. You can often hear that list comprehension is “more Pythonic” (almost as if there was a scale for comparing how Pythonic something is, compared to something else

More in Tux Machines

today's leftovers

     
  • Russians Who Pose Election Threat Have Hacked Nuclear Plants and Power Grid
                     
                       

    Officials at San Francisco International Airport discovered Russia’s state [attackers] had breached the online system that airport employees and travelers used to gain access to the airport’s Wi-Fi. The [attackers] injected code into two Wi-Fi portals that stole visitors’ user names, cracked their passwords and infected their laptops.

  •                
  • Psychotherapy centre data breach victims receive extortion emails [iophk: Windows TCO
                     
                       

    ]As well as their personal data, the extortionist told them that records of their discussions with therapists would be published.

                       

    It is not known whether the extortionist is the same individual or group that [cracked] the data in the first place.

                       

    Individual emails were sent on Saturday evening, with [YLE] receiving messages from 8pm onwards. All the victims described receiving the same message.

    The extortionist wrote that recipients must pay 200 euros within 24 hours, or if they don't meet that deadline, 500 euros within 48 hours.

  • Datacamp Review - CodersLegacy

    Datacamp is a very well known online learning platform for programmers. It aims to teach a variety of different languages and topics through the use of videos, text and exercises. In this review we’ll be attempting to cover everything about Datacamp, from it’s format to it’s user complaints to it’s good points. Whether Datacamp is worth the time and money, will be clear to you by the end of this review.

  • Why I wrote 152 extra lines of code just to do the same thing (and why I’d do it again today)

    Who else remembers printing out code on a dot matrix printer? Ah, those were the days… (Image courtesy Arnold Reinhold.)

  • YottaDB Announces Octo 1.0, a YottaDB Plugin for Using SQL to Query Data in YottaDB

    YottaDB, the database for transactional systems where data integrity is paramount, today announced production-grade Octo 1.0, a YottaDB plugin to query YottaDB application data using popular SQL tools. YottaDB excels for transactional systems, where data integrity and application robustness are paramount – applications that effect database state change to provide mission-critical functionality, such as electronic health record systems, core banking systems, library systems, and election systems.

    There is a vast ecosystem of tools using SQL/JDBC for reporting, visualization, analysis, and more. Octo 1.0 makes databases of transactional applications that use YottaDB, accessible to those tools.

  • Introducing Octo

    Octo is a YottaDB plugin for using SQL to query data that is persisted in YottaDB’s key-value tuples (global variables).

    Conforming to YottaDB’s standard for plugins, Octo is installed in the $ydb_dist/plugin sub-directory with no impact on YottaDB or existing applications. In addition to YottaDB itself, Octo requires the YottaDB POSIX plugin. The popularity of SQL has produced a vast ecosystem of tools for reporting, visualization, analysis, and more. Octo opens the door to using these tools with the databases of transactional applications that use YottaDB.

  • About me and my life ...: Fedora 31 : Can be better? part 006.

    I try to use the Selinux MLS with Fedora 31 and I wrote on my last article about Fedora 31 : Can be better? part 005.After relabeling the files and start the environment I get multiple errors and I ask an answer at fedoraproject lists:This is an example of the problem of implementing MLS in Fedora and can be remedied because MLS Selinux is old in implementing Selinux.

  • How To Install HPLIP on Ubuntu 20.04 LTS - idroot

    In this tutorial, we will show you how to install HPLIP on Ubuntu 20.04 LTS. For those of you who didn’t know, HPLIP (HP Linux Imaging and Printing Driver) developed by HP for Printing, scanning, and faxing with HP inkjet and laser-based printers in Linux platforms. 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 through the step by step installation of HP Linux Image and Printing on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian based distribution like Linux Mint.

  • Putting open values into management practice

    Allison has a unique perspective on the practice of managing with open values because she was familiar with working in an open organization before becoming a manager, and therefore needed to learn how to practice the values differently as she transitioned to a manager role at Red Hat. That was “easier said than done,” as she put it during our discussion, because of a manager's responsibilities for helping and coaching individuals on their team, specifically regarding performance and development. Allison manages a team focused on internal communications, where associates have a variety of unique responsibilities and work on different tasks rather than collaborate on a single deliverable. This makes both the sharing of knowledge and the use of knowledge toward an innovative goal of primary importance. Because of that, she feels she is not a "boss"—not someone who directs work— but rather "just another member of the team" who "sets the context in which works take place." She feels she is not a "boss"—not someone who directs work— but rather "just another member of the team" who "sets the context in which works take place."

  • Chrome OS finally has a dark mode, and you can try it right now

    While Windows and macOS users have been enjoying their flavors of dark mode for quite some time now, Chrome OS users have sadly been missing out on the fun. However, thanks to a recent sighting by Android Police on the Chrome OS Canary channel, it looks like Chrome OS users can now join in on the dark mode hype train. We reported back in September that Google has been internally working on proper dark and light themes for Chrome OS. The system-wide feature is still in its early development stages and is not officially ready to come to the Stable channel yet, but if you have a Chromebook and are itching to start using the upcoming feature today, you can do just that by going into the Flags menu on Chrome.

GNU Taler news: RFC 8905 - "The 'payto' URI Scheme for Payments" published

We are happy to announce the publication of RFC 8905 by the IETF. RFC 8905 defines the 'payto' Uniform Resource Identifier (URI) scheme for designating targets for payments. A unified URI scheme for all payment target types allows applications to offer user interactions with URIs that represent payment targets, simplifying the introduction of new payment systems and applications. Read more

It's Time To Admit It: The X.Org Server Is Abandonware

The last major release of the X.Org Server was in May 2018 but don't expect the long-awaited X.Org Server 1.21 to actually be released anytime soon. This should hardly be surprising but a prominent Intel open-source developer has conceded that the X.Org Server is pretty much "abandonware" with Wayland being the future. This comes as X.Org Server development hits a nearly two decade low, the X.Org Server is well off its six month release regiment in not seeing a major release in over two years, and no one is stepping up to manage the 1.21 release. A year ago was a proposal to see new releases driven via continuous integration testing but even that didn't take flight and as we roll into 2021 there isn't any motivation for releasing new versions of the X.Org Server by those capable of doing so. Read more

RISC OS 5.28 now available

Slightly delayed from our original target in Spring, we’re pleased to announce RISC OS 5.28 is now available for all platforms that met or exceeded our stable release criteria. What’s inside? The extra few months has allowed us to pack in a fantastic 366 improvements to the ‘HardDisc4’ image and applications, and a similarly impressive 344 improvements to the main operating system. Enjoy an overhauled Paint, up-to-date network security, system wide clipboard support, all running faster thanks to our community led bounty schemes. Read more