Language Selection

English French German Italian Portuguese Spanish

Development

Programming/Development: Perl, Python/Django and Bash

Filed under
Development
  • Springtime in Switzerland

    During the same week I’ll also be giving a half-day seminar on Raku, which has been generously sponsored by EPFL and so will cost nothing to attend. It’s suitable for anyone who would like a quick but comprehensive overview of this remarkable new programming language.

    Besides making the Raku seminar entirely free, SIB/UNIL/EPFL have done an amazing job
    keeping the prices of the other classes extremely competitive...especially if you can claim a plausible association to any academic institution, either as a student or staff member.

    If you’re looking for some training that’s economical, practical, and just plain fun,
    in a location that’s central, civilised, and simply breathtaking, then this week
    in Switzerland might fit just the bill.

  • PyCoder’s Weekly: Issue #404 (Jan. 21, 2020)
  • Basic Data Types in Python

    In this step-by-step course, you’ll dig into the basic data types that are built into Python.

  • Python 3.7.5 : Django security issues - part 002.
  • Python 3.7.5 : Use Django Formsets.

    Django Formsets manage the complexity of multiple copies of a form in a view. 
    This simplifies the task of creating a formset for a form that handles multiple instances of a model.

  • Hunting gremlins

    In the UTF-8 files I audit, the only invisible characters I expect to see... er... not see... are whitespace (hexadecimal 20), horizontal tab (09) and newline (linefeed; 0a). All others I call "gremlins". They include carriage return (0d), no-break space (c2 a0), soft hyphen (c2 ad) and another 62 control characters.

    Gremlins are a nuisance. One gremlin causes a shell to hang. Less evil gremlins lurk inside apparently OK strings and cause the strings to be processed weirdly. In the file "demo1", two of the strings contain no-break spaces (in different places), two contain soft hyphens (in different places) and three have no gremlins. 

  • A more expressive Bash prompt

    Bash provides some interesting built-in specifiers for the prompt strings PS1. 

Programming: Git, Python and PHP

Filed under
Development
  • Git Update Improves DevOps with Partial Cloning Feature

    On Jan. 13, Git 2.25 was released, bringing to one of the most commonly used developer tools new capabilities that will help improve performance and overall developer productivity.

  • Solving Python Error- KeyError: 'key_name'

    As per Python 3 official documentation a key error is raised when a mapping (dictionary) key is not found in the set of existing keys.

  • Python's Execution Time Is Close To C++ And Go Language: Study

    Python is the most preferred programming language for Machine Learning and Artificial Intelligence, but it is also the least preferred for being slow to solve certain problems that involve loops.

    To challenge this fact, researchers at EPFL Computer Vision Laboratory published a report in which they presented the competitiveness of Python against C++ and Go by solving the popular N-queens puzzle.

  • PHP in 2020

    It's no secret among web developers and programmers in general: PHP doesn't have the best reputation. Despite still being one of the most used languages to build web applications; over the years PHP has managed to get itself a reputation of messy codebases, inexperienced developers, insecure code, an inconsistent core library, and what not.

    While many of the arguments against PHP still stand today, there's also a bright side: you can write clean and maintainable, fast and reliable applications in PHP.

    In this post, I want to look at this bright side of PHP development. I want to show you that, despite its many shortcomings, PHP is a worthwhile language to learn. I want you to know that the PHP 5 era is coming to an end. That, if you want to, you can write modern and clean PHP code, and leave behind much of the mess it was 10 years ago.

Programming Leftovers

Filed under
Development
  • Server-side Swift's slow support story sours some: Apple lang tailored for mobile CPUs, lacking in Linux world

    The Swift programming language has suffered some setbacks in its quest for ubiquity since Apple released it under an open-source license in 2015.

    In December, IBM said it had reevaluated its priorities and decided to back away from server-side Swift development. Then last week, Vapor Cloud, a server-side Swift hosting biz, and a related service called Vapor Red, announced plans to shut down in February.

  • Excellent Free Tutorials to Learn Scala

    Scala is a modern, object-functional, multi-paradigm, Java-based programming and scripting language that’s released under the Apache License 2.0. It blends functional and object-oriented programming models. Scala introduces several innovative language constructs. It improves on Java’s support for object-oriented programming by traits, which are stackable and cannot have constructor parameters. It also offers closures, a feature that dynamic languages like Python and Ruby have adopted.

    Scala is particularly useful for building cloud-based/deliverable Software as a Service (SaaS) online applications, and is also proficient to develop traditional, imperative code.

    The language helps programmers write tighter code. It uses a number of techniques to cut down on unnecessary syntax, which helps to make code succinct. Typically, code sizes are reduced by an order of 2 or 3 compared to an equivalent Java application.

  • 13 of the best React JavaScript frameworks

    React.js and React Native are popular open source platforms for developing user interfaces (UIs); both rank well for desirability and use in StackOverflow's 2019 Developer Survey. React.js was developed by Facebook in 2011 as a JavaScript library to address the need for cross-platform, dynamic, and high-performing UIs, while React Native, which Facebook released in 2015, is used for building native applications using JavaScript.

    The following are 13 of the best React JavaScript frameworks; all are open source—the first 11 (like React) are licensed under the MIT license and the latter two are licensed under Apache 2.0.

  • Espacio de Datos: fulldome installation

    Espacio de Datos is a site-specific, immersive audiovisual installation, consisting of a fulldome projection and a spatialized audio track that I created in collaboration with sound artist Mene Savasta for the +CODE 2018 festival in Buenos Aires, Argentina. It was originally comissioned by Cristian Reynaga and Merlina Rañi, organizers of the festival. Espacio de Datos was also shown at the 2018 edition of the Domo Lleno festival in Bogotá, Colombia, the 9th International Festival of Science Visualization in Tokyo, Japan, in February 2019, and finally at the Elektra Festival XX in Montréal, Canada, in June 2019. This blog post goes in more depth into the background for this project, and the process we followed to create its images and sounds.

    [...]

    The sound palette was informed by the thematic field of the data, which contained anonymized clinical information of patients affected by Lassa fever, a virual hemorrhagic fever endemic in West Africa. The tragedy of a deadly disease, reduced to indices and values that are then visualized in a cosmic and minimalistic vision. Mene considered these aspects to construct a noisy and glitchy while simultaneously clean palette, where the tragic element is manifested in the dynamic range, such as contrasts and accumulation.

  •      

  • 2020.03 Trait::Traced

           

             

    Ben Davies has published a module that may well change ad-hoc debugging in Raku: Trait::Traced. It introduces the is traced trait that can currently be attached to any type (class), or to any subroutine or method. So, to find out anything that is happening while executing code in your class Foo, simply do use Trait::Traced and change class Foo { to class Foo is traced {. Yours truly feels this could become a core module rather sooner than later!

  •       

Programming Leftovers

Filed under
Development
  • The Titler Revamp – The QML MLT Producer is testing ready

    The last time I blogged about the Titler, I promised that the next update would be when we have some sort of a backend ready – and I’m happy to announce now that now we have some sort of a backend ready!

  • The Meson Manual is now available for purchase

    Some of you might remember that last year I ran a crowdfunding campaign to create a full written user manual for Meson. That failed fairly spectacularly, mostly due to the difficulty of getting any sort of visibility for these kinds of projects (i.e. on the Internet, everything drowns).

  • anytime 0.3.7

    A fresh minor release of the anytime package is arriving on CRAN right now. This is the eighteenth release, and it comes roughly five months after the previous showing the relative feature-stability we have now.

    anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.

    This release brings a clever new option, thanks to Stephen Froehlich. If you know your input has (lots) of duplicates you can now say so and anytime() (and the other entry points for times and dates, UTC or not) will only parse the unique entries leading to potentially rather large speed gains (as in Stephen’s case where he often has more than 95% of the data as duplicates). We also tweaked the test setup some more, but as we are still unable to replicate what is happening with the Fedora test boxen at CRAN due to the non-reproducible setup so this remains a bit of guess work. Lastly, I am making use of a new Rcpp #define to speed up compilation a little bit too.

  • Merging Of Flang/F18 Fortran Compiler Support Into LLVM Has Been Delayed

    The modern F18/Flang Fortran front-end to LLVM had been set to land in the LLVM mono repository last Monday that could have made it included as part of the LLVM 10.0 branch set for that day. The LLVM 10.0 branching happened as planned but the landing of this Fortran support did not.

    Landing of the Flang front-end was delayed to allow for last minute changes to happen. Their revised target for merging was 20 January.

  • Connect your Raspberry Pi 4 to an iPad Pro

    Have you ever considered attaching your Raspberry Pi 4 to an Apple iPad Pro? How would you do it, and why would you want to? Here’s YouTuber Tech Craft to explain why Raspberry Pi 4 is their favourite iPad Pro accessory, and why you may want to consider using yours in the same way.

Programming Leftovers

Filed under
Development
  • The Titler Revamp – The QML MLT Producer is testing ready

    The last time I blogged about the Titler, I promised that the next update would be when we have some sort of a backend ready – and I’m happy to announce now that now we have some sort of a backend ready!

  • The Meson Manual is now available for purchase

    Some of you might remember that last year I ran a crowdfunding campaign to create a full written user manual for Meson. That failed fairly spectacularly, mostly due to the difficulty of getting any sort of visibility for these kinds of projects (i.e. on the Internet, everything drowns).

  • anytime 0.3.7

    A fresh minor release of the anytime package is arriving on CRAN right now. This is the eighteenth release, and it comes roughly five months after the previous showing the relative feature-stability we have now.

    anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.

    This release brings a clever new option, thanks to Stephen Froehlich. If you know your input has (lots) of duplicates you can now say so and anytime() (and the other entry points for times and dates, UTC or not) will only parse the unique entries leading to potentially rather large speed gains (as in Stephen’s case where he often has more than 95% of the data as duplicates). We also tweaked the test setup some more, but as we are still unable to replicate what is happening with the Fedora test boxen at CRAN due to the non-reproducible setup so this remains a bit of guess work. Lastly, I am making use of a new Rcpp #define to speed up compilation a little bit too.

  • Merging Of Flang/F18 Fortran Compiler Support Into LLVM Has Been Delayed

    The modern F18/Flang Fortran front-end to LLVM had been set to land in the LLVM mono repository last Monday that could have made it included as part of the LLVM 10.0 branch set for that day. The LLVM 10.0 branching happened as planned but the landing of this Fortran support did not.

    Landing of the Flang front-end was delayed to allow for last minute changes to happen. Their revised target for merging was 20 January.

Python Programming Leftovers

Filed under
Development
  • Improving python code performance by using lru_cache decorator

    Here is the program to generate the Fibonacci series up to the number provided as a command-line argument.

  • Wing Python IDE 7.2 - January 20, 2020

    Wing 7.2 adds auto-formatting with Black and YAPF, expanded support for virtualenv, support for Anaconda environments, easier debugging of modules launched with python -m, simplified manually configured remote debugging, and other improvements.

  • Python Meeting Düsseldorf - 2020-01-22

    The following text is in German, since we're announcing a regional user group meeting in Düsseldorf, Germany.

  • Having some fun with Python

    If it’s not clear after the inevitable Swedish-chef-muppet impression has run through your mind, this string-formatting operation will replace the contents of port with a string containing two copies of whatever was in port, separated by a colon. So if port was "foo", now it will be "foo:foo".

  • Using SciPy for Optimization

    When you want to do scientific work in Python, the first library you can turn to is SciPy. As you’ll see in this tutorial, SciPy is not just a library, but a whole ecosystem of libraries that work together to help you accomplish complicated scientific tasks quickly and reliably.

2019 was the “Year of C”

Filed under
Development

The TIOBE Programming Community has released an index indicating the popularity of programming languages in which it recognised C as the programming language of the year 2019.

OK, it was not at the top - Java is still King - but was a number two above Python – which is a little surprising.

C is considered the red-headed stepchild of programming these days and most people consider Python emerged as the most productive and popular language in recent times and, apparently, the language had a good year due to the Internet of Things.

C is really good with small devices that are performance-critical with limited resources. It is a feature-rich programming language, including direct access to machine level hardware APIs. There are lots of C compilers, deterministic resource use and dynamic memory allocation.

Read more

Programming: JIT Compilers and DocKnot 3.03

Filed under
Development
  • MIR: A lightweight JIT compiler project

    For the past three years, I’ve been participating in adding just-in-time compilation (JIT) to CRuby. Now, CRuby has the method-based just-in-time compiler (MJIT), which improves performance for non-input/output-bound programs.

    The most popular approach to implementing a JIT is to use LLVM or GCC JIT interfaces, like ORC or LibGCCJIT. GCC and LLVM developers spend huge effort to implement the optimizations reliably, effectively, and to work on a lot of targets. Using LLVM or GCC to implement JIT, we can just utilize these optimizations for free. Using the existing compilers was the only way to get JIT for CRuby in the short time before the Ruby 3.0 release, which has the goal of improving CRuby performance by three times.

    So, CRuby MJIT utilizes GCC or LLVM, but what is unique about this JIT?

    MJIT does not use existing compiler JIT interfaces. Instead, it uses C as an interface language without losing compilation speed. Practically the same compilation speed as with the existing JIT interfaces is achieved by using precompiled headers and a memory filesystem.

  • Red Hat Developer's MIR Is A Lightweight JIT Compiler

    Not to be confused with Ubuntu's Mir display stack or Rustlang's MIR, the new MIR effort by Red Hat developer Vladimir Makarov is a new project focused on providing a lightweight JIT compiler.

    MIR in this context is the Medium Internal Representation (Rustlang's is the Mid-Level Internal Representation) and is striving to be a lighter-weight JIT compiler than the JIT interfaces offered by GCC or LLVM.

    Initially, MIR is aiming to suit the just-in-time needs of CRuby and/or MRuby and from there expand out. This IR is strongly-typed, based on the concept of modules, and you can get to MIR through LLVM IR as one of the options.

  • DocKnot 3.03

    DocKnot is the software that I use to generate package documentation and web pages, and increasingly to generate release tarballs.

    The main change in this release is to use IO::Uncompress::Gunzip and IO::Compress::Xz to generate a missing xz tarball when needed, instead of forking external programs (which causes all sorts of portability issues). Thanks to Slaven Rezić for the testing and report.

    This release adds two new badges to README.md files: a version badge for CPAN packages pushed to GitHub, and a Debian version badge for packages with a corresponding Debian package.

Contributing to KDE is easier than you think – Localization and SVN

Filed under
Development
KDE

This is a series of blog posts explaining different ways to contribute to KDE in an easy-to-digest manner. This series is supposed to run parallel to my keyboard shortcuts analysis so that there can be content being published (hopefully) every week.

The purpose of this series originated from how I feel about asking users to contribute back to KDE. I firmly believe that showing users how contributing is easier than they think is more effective than simply calling them out and directing them to the correct resources; especially if, like me, said user suffers from anxiety or does not believe they are up to the task, in spite of their desire to help back.

This time I’ll be explaining how the localization workflow looks like for contributing to KDE; this should also immediately enable you to translate your favorite third-party Plasma widgets (if the project supports it), and generally allow you to translate any PO file with your preferred localization software. I will also explain a bit about CAT tools in general and how professional translation is done since it’s my field of expertise, but that will serve only as optional reading for those interested.

Don’t get scared with how lengthy this blog post is: by the end of this text, you should be perfectly fine to start working with localization, that’s the point. The localization process is quite straightforward, I simply put a lot of explanations in-between so you don’t have many (or better yet, any!) doubts about how stuff works.

This article should be timely in that a new Plasma version, 5.18, will be released in about two weeks. Contributions to the stable branch would be quite appreciated in the following days!

Read more

Syndicate content

More in Tux Machines