Language Selection

English French German Italian Portuguese Spanish

Development

Screencasts and Shows: ArcoLinux 19.12 Run Through, TechSNAP and Python Bytes

Filed under
Development
GNU
Linux

Programming Leftovers

Filed under
Development
  • Fedora 32 Will Feature Bleeding-Edge Compilers Again With LLVM 10 + GCC 10

    Fedora Linux is on track to deliver another bleeding-edge compiler toolchain stack with Fedora 32 due out this spring. 

    Fedora's spring releases have tended to always introduce new GNU Compiler Collection (GCC) releases that are generally out a few weeks before the April~May Fedora releases. Thanks to Red Hat employing several GCC developers that collaborate with Fedora, they tend to stick to ensuring Fedora ships new GCC releases quite quickly while managing minimal bugs -- in part due to tracking GCC development snapshots well before launch to begin the package rebuilds. 

  • What makes Python a great language?

    I know I’m far from the only person who has opined about this topic, but figured I’d take my turn.

    A while ago I hinted on Twitter that I have Thoughts(tm) about the future of Python, and while this is not going to be that post, this is going to be important background for when I do share those thoughts.

    If you came expecting a well researched article full of citations to peer-reviewed literature, you came to the wrong place. Similarly if you were hoping for unbiased and objective analysis. I’m not even going to link to external sources for definitions. This is literally just me on a soap box, and you can take it or leave it.

    I’m also deliberately not talking about CPython the runtime, pip the package manager, venv the %PATH% manipulator, or PyPI the ecosystem. This post is about the Python language.

    My hope is that you will get some ideas for thinking about why some programming languages feel better than others, even if you don’t agree that Python feels better than most.

  • Python String Replace

    In this article, we will talk about how to replace a substring inside a string in Python, using the replace() method. .replace() Method In Python, strings are represented as immutable str objects. The str class comes with many methods that allow you to manipulate strings. The .replace() method takes the following syntax: str.replace(old, new[, maxreplace]) str - The string you are working with. old – The substring you want to replace.

Python Programming, Rust and Puppet Enterprise 3

Filed under
Development
  • Circuit Python at PyConf Hyderabad

    Coding in/with hardware has become my biggest stress buster for me ever since I have been introduced to it in PyCon Pune 2017 by John. Coding with hardware provides a real-life interaction with the code you write. It flourishes creativity. I can do all of this while I learn something new. Now I look for auctions to offer me a chance to code in/with Hardware. It gives the chance to escape the muggle world.

  • New in testmon 1.0.0

    Significant portions of testmon have been rewritten for v 1.0.1. Although the UI is mostly the same, there are some significant differences.

  • Determining affected tests

    Automatically determining affected tests sounds too good to be true. Python developers rightfully have a suspecting attitude towards any tool which tries to be too clever about their source code. Code completion and symbol searching doesn't need to be 100% reliable but messing with the test suite execution? This page explains what testmon tries and what it does not try to achieve.

    [...]

    After running the test with coverage analysis and parsing the source code, testmon determines which blocks does test_s.py::test_add depend on. In our example it's Block 1,2 and 4. (and not Block 3). testmon doesn't store the whole code of the block but just a checksum of it. Block 3 can be changed to anything. As long as the Block 1,2 and 4 stay the same, the execution path for test_s.py::test_add and it's outcome will stay the same.

  • How to set-up and use py.test in Pycharm

    I've been using Vim and terminal as a weapon of choice for years. I've had a good time with it, however, more and more people ask me why I'm using this setup. And honestly, I don't know the answer.

    I'm aware that things can be done more efficiently and an IDE can help with a lot of things. I guess that my weak spot is the unit tests and testing my code in general. I'm not running my tests when on the coding spree, I'm breaking lots of stuff, and only when I think I'm finished, I'll do the fixing and make everything running green again.

    Well, I would like to change that. And I'm also curious about trying out new ways of doing things. The obvious choice for programming in Python is the PyCharm. It's a nice IDE, supports many features that I like and most importantly, it can help with the testing. PyCharm can easily integrate with popular test frameworks and run the tests for me.

  • This Week in Rust 316
  • Continuous Delivery for Puppet Enterprise 3.0 is now available

    I am very excited to announce the immediate availability of Continuous Delivery for Puppet Enterprise 3.0! Over the last year, we’ve taken to heart the challenges and recommendations our customers have shared with us on how we can make Continuous Delivery for Puppet Enterprise better. Our intent is to be truly customer-obsessed, meet our customers where they are, and help them get to where they want to be. This release focuses on our customers’ needs by providing more context into the impact of a proposed Puppet change by offering Hiera support for Impact Analysis, a simplified approach to defining pipelines as code, and the ability to easily compose custom deployment processes (currently in beta!). Let’s dive in!

Programming: PHP, C++, Python and More

Filed under
Development
  • Excellent Free Tutorials to Learn PHP

    PHP has been at the helm of the web for many years. It’s an extremely popular, interpreted scripting language that is ideally suited for web development in part because it has an approachable syntax and supports different operating systems. This language powers millions of web sites on the net and is extremely well supported by its user community.

    PHP is also used as a general-purpose programming language. PHP code can be executed with a command-line interface (CLI) and to implement standalone graphical applications. CLI PHP programs often automate common tasks such as testing, deployment, and application administration. The language offers a very complete set of object-oriented programming features as well as support for functional programming. The latest TIOBE Index (August 2019 at time of writing) ranks PHP in 8th place, behind Java, C, C++, C#, Python, Visual Basic .NET, and JavaScript.

    The language is released under a non-copyleft free software license / open source license. The latest stable version adds lots of new features.

  • Intel's MKL-DNN/DNNL 2.0 Beta 3 Release Adds SYCL + Data Parallel C++ Compiler

    Intel's MKL-DNN Deep Neural Network Library (DNNL) that is open-source and catering to deep learning applications like Tensorflow, PyTorch, DeepLearning4J, and others is nearing its version 2.0 release. With DNNL 2.0 is now support for Data Parallel C++ as Intel's new language as part of their oneAPI initiative.

    MKL-DNN/DNNL 2.0 Beta 3 was released on Wednesday and to my knowledge is their first public test release of the forthcoming 2.0. Notable with DNNL 2.0 is supporting SYCL API extensions and interoperability now with SYCL code, the single-source C++-based programming language backed by The Khronos Group and a crucial to Intel's new oneAPI initiative.

  • Watch this machine made out of Lego sort other Lego using AI

    Dubbed the “Universal Lego Sorting Machine” by its creator, Daniel West, it’s a pretty neat contraption that’s far more useful than any of the Lego science projects I used to make. The machine is apparently able to use AI to sort Lego into one of 18 different buckets at a rate of “about one brick every two seconds.” West says he trained the neural network that sorts the bricks using 3D images of Lego parts, and he says the network can learn to recognize any piece as long as there’s a 3D image to train on.

  • Reactive programming, a new way of thinking

    Get to know Reactive Programming and Grace Jansen, co-author of a new O'Reilly report that introduces Reactive and Reactive Architecture.

    [...]

    At Devoxx Belgium, Grace gave a number of talks, including one about Reactive programming and the pitfalls, entitled “Reacting to the future of application architecture.” In the talk, she uses an analogy from biology, namely how bees live and function together. “I compare the behavior of bees with how we would like applications to function and meet the requirements and expectations of users.”

  • Future-proof monolithic applications with modular design

    DevNation tech talks are hosted by the Red Hat technologists who create our products. These sessions include real solutions and code and sample projects to help you get started. In this talk, you’ll learn about future-proofing applications from Eric Murphy and Ales Nosek, Architects with Red Hat Consulting.

    When building an MVP software application, you may immediately jump to a microservices architecture because it’s the new norm for building cloud-native applications. You may also be skeptical about starting off with a monolith because of the perception of such applications as relics of the past.

  • Merge Sort in Python

    Merge Sort is one of the most famous sorting algorithms. If you're studying Computer Science, Merge Sort, alongside Quick Sort is likely the first efficient, general-purpose sorting algorithm you have heard of. It is also a classic example of a divide-and-conquer category of algorithms.

  • Updates on Unoon in December 2019

    This Saturday evening, I sat with Unoon project after a few weeks, I was continuously running it, but, did not resume the development effort. This time Bhavin also joined me. Together, we fixed a location of the whitelist files issue, and unoon now also has a database (using SQLite), which stores all the historical process and connection information. In the future, we will provide some way to query this information.

  • Summarising, Aggregating, and Grouping data in Python Pandas

    In this post, I will talk about summarizing techniques that can be used to compile and understand the data. I will use Python library Pandas to summarize, group and aggregate the data in different ways.

    I will be using college.csv data which has details about university admissions.

Programming Leftovers

Filed under
Development
  • A static-analysis framework for GCC

    One of the features of the Clang/LLVM compiler that has been rather lacking for GCC may finally be getting filled in. In a mid-November post to the gcc-patches mailing list, David Malcolm described a new static-analysis framework for GCC that he wrote. It could be the starting point for a whole range of code analysis for the compiler.

    According to the lengthy cover letter for the patch series, the analysis runs as an interprocedural analysis (IPA) pass on the GIMPLE static single assignment (SSA) intermediate representation. State machines are used to represent the code parsed and the analysis looks for places where bad state transitions occur. Those state transitions represent constructs where warnings can be emitted to alert the user to potential problems in the code.

    There are two separate checkers that are included with the patch set: malloc() pointer tracking and checking for problems in using the FILE * API from stdio. There are also some other proof-of-concept state machines included: one to track sensitive data, such as passwords, that might be leaked into log files and another to follow potentially tainted input data that is being used for array indexes and the like.

    The malloc() state machine is found in sm-malloc.cc, which is added by this patch, looks for typical problems that can occur with pointers returned from malloc(): double free, null dereference, passing a non-heap pointer to free(), and so on. Similarly, one of the patches adds sm-file.c for the FILE * checking. It looks for double calls to fclose() and for the failure to close a file.

  • RUST howto getting started – hello world

    if one is viewing this site using Firefox or Gecko-Engine… one is running RUST already.

    At the beginning – one was big fan of Java – Java was/still is all the rage – theoretically write once – run anywhere linux, osx and (thanks to Google) on mobile and even on the closed source OS who’s name shall not be mentioned, nobody knows what the Java Virtual Machine does besides running bytecode, Java on slow ARM CPUs is kind of a burden.

  • Async Interview #2: cramertj, part 3

    This blog post is continuing my conversation with cramertj. This will be the last post.

    In the first post, I covered what we said about Fuchsia, interoperability, and the organization of the futures crate.

    In the second post, I covered cramertj’s take on the Stream, AsyncRead, and AsyncWrite traits. We also discussed the idea of attached streams and the importance of GATs for modeling those.

  • Python 3.7.6rc1 and 3.6.10rc1 are now available for testing

    Python 3.7.6rc1 and 3.6.10rc1 are now available. 3.7.6rc1 is the release preview of the next maintenance release of Python 3.7;  3.6.10rc1 is the release preview of the next security-fix release of Python 3.6. Assuming no critical problems are found prior to 2019-12-18, no code changes are planned between these release candidates and the final releases. These release candidates are intended to give you the opportunity to test the new security and bug fixes in 3.7.6 and security fixes in 3.6.10. While we strive to not introduce any incompatibilities in new maintenance and security releases, we encourage you to test your projects and report issues found to bugs.python.org as soon as possible. Please keep in mind that these are preview releases and, thus, their use is not recommended for production environments.

  • Print all git repos from a user (only curl and grep)
  • Linux Fu: Debugging Bash Scripts

    A recent post about debugging constructs surprised me. There were quite a few comments about how you didn’t need a debugger, as long as you had printf. For that matter, we’ve all debugged systems where you had nothing but an LED to flash or otherwise turn on to communicate with the user. However, it is hard to deny that a debugger can help with complex code.

    To say you only need printf would be like saying you only need machine language. Technically accurate — you can do anything in machine language. But it sure makes things easier to have an assembler or some language to help you work out your problem. If you write a simple bash script, you can use the equivalent to printf — maybe that’s the echo command, although there is usually a printf command on a typical system, if you want to use it. However, there are other things you can do with bash including a pretty cool debugger if you know how to find it.

    I assume you already know how to use echo and printf, but let’s dig into how to use trace execution line by line without the need for echo statements on every other line. Along the way, you’ll learn how to get started with the bash debugger.

Heroku Review apps available for Treeherder

Filed under
Development
Moz/FF

In bug 1566207 I added support for Heroku Review Apps (link to official docs). This feature allows creating a full Treeherder deployment (backend, frontend and data ingestion pipeline) for a pull request. This gives Treeherder engineers the ability to have their own deployment without having to compete over the Treeherder prototype app (a shared deployment). This is important as the number of engineers and contributors increases.

Once created you get a complete Heroku environment with add-ons and workers configured and the deployment for it.

Looking back, there are few new features that came out of the work, however, Heroku Review apps are not used as widely as I would have hoped for.

Read more

News From Python Programmers

Filed under
Development
  • Data Engineer Interview Questions With Python

    Going to interviews can be a time-consuming and tiring process, and technical interviews can be even more stressful! This tutorial is aimed to prepare you for some common questions you’ll encounter during your data engineer interview. You’ll learn how to answer questions about databases, Python, and SQL.

  • 8 AI Predictions for 2020: Business Leaders & Researchers Weigh In

    The first industrial revolution was powered by coal, the second by oil and gas, and the third by nuclear power. The fourth — AI — is fueled by an abundance of data and breakthroughs in compute power. While this abundance has allowed us to make significant progress in recent years, there is still much to be done for AI to be the positive life-changing force that many hope it will be. We asked thought leaders at the forefront of AI and machine learning technology to contribute some insight into what they think will transpire in 2020. Their predictions center around hardware, the human impact of AI, the public’s understanding of AI, and its limitations.

  • The easiest way to deploy Django application

    Heroku is a cloud application platform, it facilitate the deployement of a web application.

    They support several programming languages, include Python.

  • Encoding and Decoding Base64 Strings in Python

    Have you ever received a PDF or an image file from someone via email, only to see strange characters when you open it? This can happen if your email server was only designed to handle text data. Files with binary data, bytes that represent non-text information like images, can be easily corrupted when being transferred and processed to text-only systems.

    Base64 encoding allows us to convert bytes containing binary or text data to ASCII characters. By encoding our data, we improve the chances of it being processed correctly by various systems.

    In this tutorial, we would learn how Base64 encoding and decoding works, and how it can be used. We will then use Python to Base64 encode and decode both text and binary data.

Audiocasts/Shows: Talk Python to Me, Art With Free Software and mintCast on Linux Mint

Filed under
Development
GNU
Linux
  • Talk Python to Me: Episode #242: Your education will be live-streamed

    Online education has certainly gone mainstream. Developers and companies have finally gotten comfortable taking online courses. Sometimes these are recorded, self-paced courses like we have at Talk Python Training. Other times, they are more like live events in webcast format.

    In this episode, you'll meet two guys who are taking the interactivity of online learning up a notch. Brian Clark and Cecil Philip run a weekly event on Twitch where they are live-streaming an interactive Python course. They take questions from 100's of students and dig into the diversions more mainstream online learning simply cannot.

  • [Krita artist] Production report: episode 31

    Slowly but surely and in the background of the book-publishing project I've been working on a future episode of Pepper&Carrot. Here is a report about that with many screenshots:

  • mintCast 323.5 – Traveling Networker Problem

    In our Innards section, we talk more about Linux Mint and Clem’s comments.

Programming: Vim, Qt Shader and Python

Filed under
Development
  • Vim Text Editor for Beginners Part 1 - Introduction

    In my newly refreshed Vim series, you'll learn all the things you'll need to know in order to use this text editor in your daily workflow. In this first video, we'll get Vim installed take an initial look.

  • Vim Text Editor for Beginners Part 2 - Combining Files

    In my newly refreshed Vim series, you'll learn all the things you'll need to know in order to use this text editor in your daily workflow.

  • Qt Shader Tools Looks To Become Official Qt6 Module

    The currently-experimental Qt Shader Tools allows for graphics/compute shader conditioning and used by the in-development Qt graphics abstraction layer for supporting Vulkan / Metal / Direct3D / OpenGL APIs.

    Qt Shader Tools offers various shader features in preparing them for consumption by different graphics APIs. Qt Shader Tools is currently used ahead of time for QtGUI with Qt 5.14+. But for Qt 6.0, Qt Shader Tools is going through the appropriate steps for becoming a formal Qt 6 module for compiling and translating shaders between interfaces.

  • Python Positional-only parameters

    I have downloaded Python 3.8 and start to play around with those latest python functions. In this article, we will look at the Positional-only parameter syntax which is a function parameter syntax / to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments which means after the / syntax we may specify a value for each parameter within that function.

  • For Loop in Python Explained With Practical Examples

    If you are just getting started to learn Python, you must be in search of something to explore for loop in Python.

    Of course, our list of free python resources should help you learn about it quickly.

    In either case, we shall help you learn more about the ‘for‘ loop in python using a couple of important examples.

Programming: Rust, Haskell, Qt and Python

Filed under
Development
  • Sonja Heinze: What this blog is about

    In order to ask for an Outreachy grant for a certain open-source project, applicants first have to contribute to that project for about a month. When choosing a project, I didn’t know any Rust. But the fact that Fractal is written in Rust was an important point in favor due to curiosity. But I also expected to have a hard time at the beginning. Fortunately, that wasn’t really the case. For those who haven’t used Rust, let me give two of the reasons why:

    If you just start coding, the compiler takes you by the hand giving you advice like “You have done X. You can’t do that because of Y. Did you maybe mean to do Z?”. I took those pieces of advice as an opportunity to dig into the rules I had violated. That’s definitely a possible way to get a first grip on Rust.

    Nevertheless, there are pretty good sources to learn the basics, for example, the Rust Book. Well, to be precise, there’s at least one (sorry, I’m a mathematician, can’t help it, I’ve only started reading that one so far). It’s not short, but it’s very fast to read and easy to understand. In my opinion, the only exception being the topics on lifetimes. But lifetimes can still be understood by other means.

  • Joey Hess: announcing the filepath-bytestring haskell library

    filepath-bytestring is a drop-in replacement for the standard haskell filepath library, that operates on RawFilePath rather than FilePath.

  • Parsing XML with Qt: Updates for Qt 6

    This module provides implementations for two different models for reading and writing XML files: Document Object Model (DOM) and Simple API for XML (SAX). With DOM model the full XML file is loaded in memory and represented as a tree, this allows easy access and manipulation of its nodes. DOM is typically used in applications where you don't care that much about memory. SAX, on the other hand, is an event based XML parser and doesn't load the whole XML document into memory. Instead it generates events for tokens while parsing, and it's up to the user to handle those events. The application has to implement the handler interfaces (fully, or partially by using QXmlDefaultHandler). A lot of people find this inconvenient as it forces them to structure their code around this model.

    Another problem is that the current implementation of SAX (and as a consequence DOM, since it's implemented using SAX) is not fully compliant with the XML standard. Considering these downsides, Qt does not recommend using SAX anymore, and the decision has been made to deprecate those classes starting from Qt 5.15.

  • pathlib and paths with arbitrary bytes

    The pathlib module was added to the standard library in Python 3.4, and is one of the many nice improvements that Python 3 has gained over the past decade. In three weeks, Python 3.5 will be the oldest version of Python that still receive security patches. This means that the presence of pathlib can soon be taken for granted on all Python installations, and the quest towards replacing os.path can begin for real.

    In this post I’ll have a look at how pathlib can be used to handle file names with arbitrary bytes, as this is valid on most file systems.

  • PyCoder’s Weekly: Issue #398 (Dec. 10, 2019)
  • Variables in Python

    If you want to write code that is more complex, then your program will need data that can change as program execution proceeds.

  • Creating an email service for my son’s childhood memories with Python

    This was very flexible as it allowed me to keep anything else I wanted in this document – and it was portable (to anyone who have access to some way of reading Word documents) – and accessible to non-technical people such as my son’s grandparents.

    After a while though, I wondered if I’d made the right decision: shouldn’t I have put it into some other format that could be accessed programmatically? After all, if I kept doing this for his entire childhood then I’d have a lot of interesting data in there…

    Well, it turns out that a Word table isn’t too awful a format to store this sort of data in – and you can access it fairly easily from Python.

    Once I realised this, I worked out what I wanted to create: a service that would email me every morning listing the things I’d put as diary entries for that day in previous years. I was modelling this very much on the Timehop app that does a similar thing with photographs, tweets and so on, so I called it julian_timehop.

  • Executing Shell Commands with Python

    Repetitive tasks are ripe for automation. It is common for developers and system administrators to automate routine tasks like health checks and file backups with shell scripts. However, as those tasks become more complex, shell scripts may become harder to maintain.

    Fortunately, we can use Python instead of shell scripts for automation. Python provides methods to run shell commands, giving us the same functionality of those shells scripts. Learning how to run shell commands in Python opens the door for us to automate computer tasks in a structured and scalable way.

    In this article, we will look at the various ways to execute shell commands in Python, and the ideal situation to use each method.

Syndicate content

More in Tux Machines

Type Titlesort icon Author Replies Last Post
Story 1+ Year Running Arch Linux on a Lenovo Yoga 2 Roy Schestowitz 07/04/2015 - 9:38am
Story Lunar Linux 1.7.0 (i686 & x86_64) ISO’s released Rianne Schestowitz 12/10/2014 - 5:03am
Story Most Popular Desktop Video Player: VLC Roy Schestowitz 22/01/2014 - 5:31pm
Story 'One frickin' user interface for Linux' Roy Schestowitz 29/12/2014 - 5:12pm
Story A Dell 4K laptop with Linux: Tough construction and built for developers. Roy Schestowitz 27/03/2015 - 8:29am
Story Android (Linux) is creating more jobs than iPhone Roy Schestowitz 15/04/2014 - 7:53pm
Story Cinnamon PPA will no longer be maintained for Ubuntu users Roy Schestowitz 27/05/2014 - 7:44am
Story CyanogenMod support arrives for Amazon Kindle Fire HD Roy Schestowitz 23/04/2014 - 10:54am
Story Dell launches Android-based Venue tablets at Computex 2014 Rianne Schestowitz 03/06/2014 - 5:33pm
Story Elementary OS Freya Beta 1 Available For Developers And Testers Rianne Schestowitz 11/09/2014 - 4:33am