Language Selection

English French German Italian Portuguese Spanish

Development

Programming: Rust Turns 4, GCC, Go and Python

Filed under
Development
  • 4 years of Rust

    On May 15th, 2015, Rust was released to the world! After 5 years of open development (and a couple of years of sketching before that), we finally hit the button on making the attempt to create a new systems programming language a serious effort!

    It’s easy to look back on the pre-1.0 times and cherish them for being the wild times of language development and fun research. Features were added and cut, syntax and keywords were tried, and before 1.0, there was a big clean-up that removed a lot of the standard library. For fun, you can check Niko’s blog post on how Rust's object system works, Marijn Haverbeke’s talk on features that never made it close to 1.0 or even the introductory slides about Servo, which present a language looking very different from today.

    Releasing Rust with stability guarantees also meant putting a stop to large visible changes. The face of Rust is still very similar to Rust 1.0. Even with the changes from last year’s 2018 Edition, Rust is still very recognizable as what it was in 2015. That steadiness hides that the time of Rust’s fastest development and growth is now.

  • Three Ways of Storing and Accessing Lots of Images in Python

    Why would you want to know more about different ways of storing and accessing images in Python? If you’re segmenting a handful of images by color or detecting faces one by one using OpenCV, then you don’t need to worry about it. Even if you’re using the Python Imaging Library (PIL) to draw on a few hundred photos, you still don’t need to. Storing images on disk, as .png or .jpg files, is both suitable and appropriate.

    Increasingly, however, the number of images required for a given task is getting larger and larger. Algorithms like convolutional neural networks, also known as convnets or CNNs, can handle enormous datasets of images and even learn from them. If you’re interested, you can read more about how convnets can be used for ranking selfies or for sentiment analysis.

    ImageNet is a well-known public image database put together for training models on tasks like object classification, detection, and segmentation, and it consists of over 14 million images.

    Think about how long it would take to load all of them into memory for training, in batches, perhaps hundreds or thousands of times. Keep reading, and you’ll be convinced that it would take quite awhile—at least long enough to leave your computer and do many other things while you wish you worked at Google or NVIDIA.

  • A Linaro Developer Has Taken Up The Effort Of Converting GCC's SVN To Git

    The lengthy battle of converting the GNU Compiler Collection (GCC) to using a Git workflow from SVN might be getting closer to finally culminating... Linaro developer Maxim Kuvyrkov has jumped on the task of converting the GCC repository from SVN to Git and did so without much fuss.

    Eric S. Raymond has been working for what feels like ages on converting GCC SVN to Git using his "Reposurgeon" tool but given the massive size of the GCC code-base and long development history, it's been a slow process. There were roadblocks in his approach of converting the SVN history to Git that were blamed on high RAM prices and other obstacles. Most recently he was working on porting his tool to Golang but that it would take months to complete.

  • Friendlier tracebacks

    When beginners run programs that generate Python tracebacks, they are almost always confused by what the information shown and have no clue as to what this all means. More experienced programmers can sometimes extract enough information directly from tracebacks to figure out what what wrong, but they will often have to resort to inserting a few print calls and running their program again to truly figure out what went wrong and how to fix it. (A minority of programmers might eschew using print calls and use a debugger instead.)

    In order to make tracebacks more useful for them, some advanced programmers have designed tools to add more information so that simply looking at the enhanced traceback might be sufficient to diagnose properly the problem. These tools include better_exchook, infi.traceback, rich-traceback, stackprinter, as well as the beautiful better-exceptions, and many others including Python's own cgitb module. While there is no doubt that the additional information provided by these tools is useful for advanced programmers, it would likely only add to their confusion if it were used by beginners.

  • The Price of the Hallway Track

    There are many good reasons to not go to every talk possible when attending conferences. However increasingly it became hip to boast with not going to talks at all – encouraging others to follow suit. As a speaker, that rubs me the wrong way and I’ll try to explain why.

    This article started at PyCon US 2019, the biggest Python conference in the world with roughly 3,500 attendees. Over lunch on day one, I’ve noticed tweets encouraging people to not go to talks and instead do the infamous hallway track (= socializing in the hallways) or go to open spaces, and watch the videos later on YouTube. Sometimes even claiming that it doesn’t make any sense to go to talks in the first place.

  • Data Science Dojo Blog: Network Theory and Game of Thrones - A Perfect Combination

    Game of Thrones is arguably one of the biggest pop culture phenomena to hit the public consciousness in the last decade. Since the hype for the final season's arrival has gone down a bit, especially mine after episode three , I thought I could use this time to finally explore a side of Data Science that has always intrigued me - Network Theory, and combine it with a topic I am very invested in - Game of Thrones. Just to be clear I won't be making any claims or predictions about the plot of the show - No Spoilers. I just want to use Game of Thrones as a hopefully relatable context for discussing the analysis techniques.

    At a high level, Network Theory is the study of relationships between objects, more specifically it is a subfield of Graph Theory with extra attributes attached to the nodes and edges. If you're confused by these terms, don't worry I'll explain everything in a bit. For the rest, you might be familiar with graph theory and have not-so-fond memories associated with it, but bear with me for a while. I first learned basic graph theory in my university's algorithms course and, I'll be honest, I found absolutely nothing of interest in the entire topic. Sure, I could find the shortest path between two cities or find the best way to lay down routers in a computer network, but these topics never seemed fun to me. That is until I started exploring data science and learned about network analysis. That really opened my eyes to what the graph theory concepts were capable of. I encourage you to check out this video about exploring opposing factions and their effects on each other using graphs.

  • Go Baby Go

    I’m starting a new job next month and their language of choice is Go. Which means I have a good reason to finally get around to learning it (far too many years after I saw Marga talk about it at DebConf). For that I find I need a project - it’s hard to find the time to just do programming exercises, whereas if I’m working towards something it’s a bit easier. Naturally I decided to do something home automation related. In particular I bought a couple of Xiaomi Mijia Temperature/Humidity sensors a while back which also report via Bluetooth. I had a set of shell scripts polling them every so often to get the details, but it turns out they broadcast the current status every 2 seconds. Passively listening for that is a better method as it reduces power consumption on the device - no need for a 2 way handshake like with a manual poll. So, the project: passively listen for BLE advertisements, make sure they’re from the Xiaomi device and publish them via MQTT every minute.

    One thing that puts me off new languages is when they have a fast moving implementation - telling me I just need to fetch the latest nightly to get all the features I’m looking for is a sure fire way to make me hold off trying something. Go is well beyond that stage, so I grabbed the 1.11 package from Debian buster. That’s only one release behind current, so I felt reasonably confident I was using a good enough variant. For MQTT the obvious choice was the Eclipse Paho MQTT client. Bluetooth was a bit trickier - there were more options than I expected (including one by Paypal), but I settled on go-ble (sadly now in archived mode), primarily because it was the first one where I could easily figure out how to passively scan without needing to hack up any of the library code.

    With all those pieces it was fairly easy to throw together something that does the required steps in about 200 lines of code. That seems comparable to what I think it would have taken in Python, and to a large extent the process felt a lot closer to writing something in Python than in C.

  • Paul Ganssle: Time Zones In The Standard Library
  • Russell Keith-Magee: Python On Other Platforms
  • The 2019 Python Language Summit
  • What's an Engineering Workstation, in Your Opinion?

Programming: Rust, C++, GitLab, PHP and Python

Filed under
Development
  • This Week in Rust 286
  • 2 tips to make your C++ projects compile 3 times faster

    In this article, I will demonstrate how to speed up your compilation times by distributing compilation load using a distcc server container. Specifically, I’ll show how to set up and use containers running a distcc server to distribute the compilation load over a heterogeneous cluster of nodes (development laptop, old desktop PC, and a Mac). To improve the speed of recompilation, I will use ccache.

  • 8 Secrets Of GitLab’s Remote Work Culture

    At the GitLab Contribute event, Sid Sijbrandij, CEO and co-founder of GitLab shared some open secrets that make GitLab a successful ‘all remote’ company. What’s unique about GitLab is that being true to its Open Source roots, the company wants to share these ‘secrets’ with the rest of the world. It wants other companies to learn and benefit from the work it has done.

  • PHP in 2019

    Today I want to look at the bright side: let's focus on the things that have changed and ways to write clean and maintainable PHP code. I want to ask you to set aside any prejudice for just a few minutes. Afterwards you're free to think exactly the same about PHP as you did before. Though chances are you will be surprised by some of the improvements made to PHP in the last few years.

  • Unauthenticated Remote Code Execution on djangoci.com

    Yesterday the Django Security and Operations teams were made aware of a remote code execution vulnerability in the Django Software Foundation's Jenkins infrastructure, used to run tests on the Django code base for GitHub pull requests and release branches. In this blog post, the teams want to outline the course of events.

  • Git magic: split repository into two
  • 12 Most Popular Python Interview Questions You Must Prepare For
  • Pycon India 2019 is coming!

    They are currently accepting proposals for talks and workshops. For more details, check out the official Pycon India 2019 website.

today's howtos and programming

Filed under
Development
HowTos

Erlang OTP 22.0 is released

Filed under
Development

OTP 22 has just been released. It has been a long process with three release candidates before the final release. We decided this year to try to get one month more testing of the major release and I think that the extra time has paid off. We’ve received many bug reports from the community about large and small bugs that our internal tests did not find.

This blog post will describe some highlights of what is released in OTP 22 and in OTP 21 maintenance patches.

Read more

today's howtos and programming

Filed under
Development
HowTos

react-content-marker Released – Marking Content with React

Filed under
Development
Moz/FF

Last year, in a React side-project, I had to replace some content in a string with HTML markup. That is not a trivial thing to do with React, as you can't just put HTML as string in your content, unless you want to use dangerouslySetInnerHtml — which I don't. So, I hacked a little code to smartly split my string into an array of sub-strings and DOM elements.

More recently, while working on Translate.Next — the rewrite of Pontoon's translate page to React — I stumbled upon the same problem. After looking around the Web for a tool that would solve it, and coming up short handed, I decided to write my own and make it a library.

Read more

Programming: PyLint, C2x, Librem 5, Portable Document Format (PDF) in Python

Filed under
Development
  • Writing Cleaner Python Code With PyLint

    PyLint is a well-known static analysis tool for Python 2 and 3. It has a number of useful features, like checking your code for compliance with the PEP 8 Python style guide. It makes sure that your code follows the code style guide and it can also automatically identify common bugs and errors in your Python code.

    In this video series you’ll see how to install and set up the PyLint code linter tool. You’ll learn why you should use code linters like PyLint, Flake8, PyFlakes, or other static analysis tools—and how they can help you write cleaner and more Pythonic code.

    You can get this setup up and running in a few minutes and it’ll quickly help you write better and cleaner Python code.

  • LLVM Clang 9.0 Picks Up Initial C2x Language Mode

    Merged today to the mainline Clang compiler front-end is the initial C2x language mode support as what will eventually be the successor to the C18 programming language.

    C2x is still quite a ways out from release and its changes still under determination. At this stage the C2x language support for LLVM Clang is just enabling support by default for the [[attribute]] (double square brackets attribute; similar to C++) support.

  • Librem 5 App Design Tutorial – Part II

    Hello and welcome to the second of my series of blog posts on how to design your own, brand new app for the Librem 5.

    In my last post we went over the philosophy and process, goals and relevant art of building a read-it-later app; today we’ll be discussing sketches and mockups – specifically in what concerns navigation, article and article list screens, and desktops.

  • Working with PDFs in Python: Adding Images and Watermarks

    Today, a world without the Portable Document Format (PDF) seems to be unthinkable. It has become one of the most commonly used data formats ever. Up to PDF version 1.4, displaying a PDF document in an according PDF viewer works fine. Unfortunately, the features from the newer PDF revisions, such as forms, are tricky to implement, and still require further work to be fully functional in the tools. Using various Python libraries you can create your own application in an comparable easy way.

    This article is part two of a little series on PDFs with Python. In part one we already gave you an introduction into reading PDF documents using Python, and started with a summary of the various Python libraries. An introduction followed that showed how to manipulate existing PDFs, and how to read and extract the content - both the text and images. Furthermore, we showed you how to split documents into its single pages.

    In this article you will learn how add images to your PDF in the form of watermarks, stamps, and barcodes. For example this is quite helpful in order to stamp or mark documents that are intended to be read by a specific audience, only, or have a draft quality, or to simply add a barcode for identification purposes.

Announcing Rust 1.34.2

Filed under
Development
Moz/FF

The Rust team has published a new point release of Rust, 1.34.2. Rust is a programming language that is empowering everyone to build reliable and efficient software.

Read more

GCC 9 vs. Clang 8 C/C++ Compiler Performance On AMD Threadripper, Intel Core i9

Filed under
Development
Graphics/Benchmarks

Since the release of the GCC 9 stable compiler suite earlier this month we have begun firing up a number of compiler benchmarks for this annual feature update to the GNU Compiler Collection. For your viewing pleasure today is looking at the performance of GCC 8 against GCC 9 compared to LLVM Clang 8 as the latest release of this friendly open-source compiler competition. This GCC 8 vs. GCC 9 vs. Clang 8 C/C++ compiler benchmarking was done on an Intel Core i9 7980XE and AMD Ryzen Threadripper 2990WX high-end desktop/workstation systems.

Read more

Syndicate content

More in Tux Machines

Android Leftovers

Stable kernels 5.1.10, 4.19.51, and 4.14.126

  • Linux 5.1.10
    I'm announcing the release of the 5.1.10 kernel. All users of the 5.1 kernel series must upgrade. The updated 5.1.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.1.y and can be browsed at the normal kernel.org git web browser: https://git.kernel.org/?p=linux/kernel/git/stable/linux-s...
  • Linux 4.19.51
  • Linux 4.14.126

Android Leftovers

My personal journey from MIT to GPL

As I got started writing open source software, I generally preferred the MIT license. I actually made fun of the “copyleft” GPL licenses, on the grounds that they are less free. I still hold this opinion today: the GPL license is less free than the MIT license - but today, I believe this in a good way.

[...]

I don’t plan on relicensing my historical projects, but my new projects have used the GPL family of licenses for a while now. I think you should seriously consider it as well.

Read more