Language Selection

English French German Italian Portuguese Spanish

Development

Python Programming

Filed under
Development
  • Using IF ELSE condition in Django template

    IF tag evaluates the variable and variable is considered True if it exists and is not empty (if that variable is any iterable) and is not a False boolean value. Which means we can use a boolean variable, a list or a set with IF tag.

  • Ensemble/Voting Classification in Python with Scikit-Learn

    Ensemble classification models can be powerful machine learning tools capable of achieving excellent performance and generalizing well to new, unseen datasets.

    The value of an ensemble classifier is that, in joining together the predictions of multiple classifiers, it can correct for errors made by any individual classifier, leading to better accuracy overall. Let's take a look at the different ensemble classification methods and see how these classifiers can be implemented in Scikit-Learn.

  • PyCharm 2019.3.2

    We’ve been taking some time to polish PyCharm further, so be sure to update to the newest version! You can get it from within PyCharm (Help | Check for Updates), using JetBrains Toolbox, or by downloading the new version from our website.

  • EuroPython 2020: Pre-launch Website Ready

    In the last couple of weeks we have put together a pre-launch site for EuroPython 2020, which has all the information around the event, as we currently know and can share with you.

Programming Leftovers

Filed under
Development
  • Operator pattern: REST API for Kubernetes and Red Hat OpenShift

    In this article, we will see a similar pattern when writing the REST API in any known framework vs. writing an Operator using Kubernetes’ client libraries. The idea behind this article is not to explain how to write a REST API, but instead to explain the internals of Kubernetes by working with an analogy.

  • Rust framework dev says ‘I’m done with Open Source’…has second thoughts

    The main developer behind a Rust actor framework pulled the code behind the project in apparent protest against an “unsafe sh*tstorm” against him last week.

    And while the coder in question now appears to have nominated new leadership to continue the project, the apparent “ragequit” has prompted questions about the dynamics within the open source community.

    [...]

    “You could notice after each unsafe shitstorm, I started to spend less and less time with the community,” he continued. “You felt betrayed after you put so much effort and then to hear all this sh*t comments, even if you understand that that is usual internet behavior. Anyway, removing issue was a stupid idea. But I was pissed off with last two personal comments, especially while sitting and thinking how to solve the problem. I am sorry for doing that.” [SIC]

  • How to Write and Run a C Program in Linux

    Linux is becoming programming heaven for developers, being an open-source and free operating system. Turbo C compiler is already an old approach to compile programs so let us programmers move to Linux for a new programming environment. In this article,

  • TechWiser’s giant Raspberry Pi AirPod speaker (and more)

    YouTube is a haven for awesome Raspberry Pi projects, and we often spend time scanning through the platform’s wares for hidden gems. One such hidden gem is this video from TechWiser, in which they showcase some of their favourite Raspberry Pi projects:

  • A quick-and-dirty guide on how to install packages for Python

    When people start learning Python, they often will come across a package they want to try and it will usually start with "just pip install it!" The problem with that advice is it's a very simplistic view of how to manage packages and can actually lead to problems down the road. And while there is a tutorial on installing packages at packaging.python.org, it might be a bit intimidating for some if they are just looking to quickly get up and going.

    If you just want to start poking at Python and want to avoid the pitfalls to installing packages globally, it only takes 3 steps to do the right thing.

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.

Syndicate content

More in Tux Machines

Type Title Author Replies Last Postsort icon
Story Solus 4.1 Fortitude Released Roy Schestowitz 26/01/2020 - 4:50am
Story Android Leftovers Rianne Schestowitz 26/01/2020 - 1:23am
Story Today in Techrights Roy Schestowitz 25/01/2020 - 8:21pm
Story Android Leftovers Rianne Schestowitz 25/01/2020 - 6:52pm
Story today's leftovers Roy Schestowitz 25/01/2020 - 5:37pm
Story Security Leftovers: BlueTooth, Spectre/Meltdown and Huawei Disputes Roy Schestowitz 25/01/2020 - 4:43pm
Story today's howtos Roy Schestowitz 25/01/2020 - 4:22pm
Story Devices/Embedded With GNU/Linux Roy Schestowitz 25/01/2020 - 4:20pm
Story Easy Librem 5 App Development: Flashlight Roy Schestowitz 25/01/2020 - 3:52pm
Story LibreOffice Writer Articles and Improvements Roy Schestowitz 25/01/2020 - 3:50pm