Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Manage complex Git workspaces with Great Teeming Workspaces

    Somewhat like Python venv, but for languages other than Python, GTWS handles workspaces for multiple versions of multiple projects. You can create, update, enter, and leave workspaces easily, and each project or version combination has (at most) one local origin that syncs to and from the upstream—all other workspaces update from the local origin.

  • Why developers like to code at night

    If you ask most developers when they prefer to work, many will say their most productive hours are at night. This may be especially true for open source contributors who are contributing to projects outside of their day job (though hopefully within healthy limits to avoid burnout).

    Some like to start in the evening and work till the early hours while others get up super early—say, 4 a.m.—to get most of the programming work done before the daily grind kicks in.

    This work habit may make many developers seem like oddballs and misfits. However, there are quite a few reasons why so many programmers prefer to work during the odd hours:

  • Introducing our new Lua cheat sheet

    Not only is Lua simple in design, but it's also consistent in ways that many other languages are not. It has explicit scoping (so it's not dependent on indentation), it interfaces with C through simple wrappers, and it can accept raw C data as a data type. Lua's syntax is direct and predictable, so once you learn a few structures, the rest is largely intuitive.

    For example, the end keyword is used to close a clause, whether that clause is an if statement, a for or while loop, or a function. The table construct is the sole data-structuring mechanism in Lua, and it can be used to represent ordinary arrays, lists, symbol tables, sets, records, graphs, or trees, and it can even mimic object-oriented classes. Broad statements about Lua are plentiful, and they usually apply equally across the language. There aren't exceptions to the syntax: once you learn something, you can use that principle no matter what you're writing in Lua.

    Lua is simple enough to fit on one side of a single-page cheat sheet, but we created a two-page cheat sheet for notes about syntax, data structures, important variables, and a few tricks and tips. Whether you're new to Lua or you've been using it for years, download our Lua cheat sheet and keep it handy. It'll make Lua (or at least writing it) even faster.

  • Excellent Free Tutorials to Learn Ada

    Ada is a structured, statically typed, imperative, wide-spectrum, multi-paradigm, object-oriented high-level, ALGOL-like programming language, extended from Pascal and other languages. The language was developed in the late 1970s and early 1980s. Ada is named after Augusta Ada Byron (often now known as Ada Lovelace), daughter of the poet Lord Byron.

    Ada has built-in language support for explicit concurrency, offering tasks, synchronous message passing, protected objects, and non-determinism. Ada incorporates the benefits of object-oriented languages without incurring the pervasive overheads.

    Other notable features of Ada include: strong typing, inherent reliability, modularity mechanisms (packages), run-time checking, parallel processing, exception handling, the ability to provide abstraction through the package and private type, and generics.

    Ada is particularly strong in areas such as real-time applications, low-level hardware access, and safety-critical software, as it has specialized design features, and high reliability. Most errors are detected at compile time and of those remaining many are detected by runtime constraints. While Ada was originally targeted at embedded and real time systems, the Ada 95 revision added support for object-oriented (including dynamic dispatch), numerical, financial, and systems programming. With its readability, scalability, and being designed for development of very large software systems, Ada is a good choice for open source development.

    Here’s our recommended tutorials to learn Ada. If you’re looking for free Ada programming books, check here.

  • digest 0.6.24: Some more refinements

    Another new version of digest arrived on CRAN (and also on Debian) earlier today.

    digest creates hash digests of arbitrary R objects (using the md5, sha-1, sha-256, sha-512, crc32, xxhash32, xxhash64, murmur32, and spookyhash algorithms) permitting easy comparison of R language objects. It is a fairly widely-used package (currently listed at 889k monthly downloads with 255 direct reverse dependencies and 7340 indirect reverse dependencies) as many tasks may involve caching of objects for which it provides convenient general-purpose hash key generation.

    This release comes a few month after the previous release. It contains a few contributed fixes, some of which prepare for R 4.0.0 in its current development. This includes a testing change to the matrix/array class, and corrects the registration for the PMurHash routine as pointed out by Tomas Kalibera and Kurt Hornik (who also kindly reminded me to finally upload this as I had made the fix already in December). Moreover, Will Landau sped up one operation affecting his popular drake pipeline toolkit. Lastly, Thierry Onkelinx corrected one more aspect related to sha1.

  • Do you CI?

    Continuous integration is often confused with build tooling & automation. CI is not something you have, it’s something you do.

    Continuous integration is about continually integrating. Regularly (several times a day) integrating your changes (in small & safe chunks) with the changes being made by everyone else working on the same system.

    Teams often think they are doing continuous integration, but are using feature branches that live for hours or even days to weeks.

    Code branches that live for much more than an hour are an indication you’re not continually integrating. You’re using branches to maintain some degree of isolation from the work done by the rest of the team.

  • Using Zuul CI with Pagure.io

    I attended Devconf.cz again this year – I’ll try and post a full blog post on that soon. One of the most interesting talks, though, was CI/CD for Fedora packaging with Zuul, where Fabien Boucher and Matthieu Huin introduced the work they’ve done to integrate a specific Zuul instance (part of the Software Factory effort) with the Pagure instance Fedora uses for packages and also with Pagure.io, the general-purpose Pagure instance that many Fedora groups use to host projects, including us in QA.

    They’ve done a lot of work to make it as simple as possible to hook up a project in either Pagure instance to run CI via Zuul, and it looked pretty cool, so I thought I’d try it on one of our projects and see how it compares to other options, like the Jenkins-based Pagure CI.

  • Declarative Systems Take Center Stage

    Declarative systems and languages are different from what we typically think of as computer code. Most computer languages are imperative, not declarative. In imperative systems, code defines a series of steps to be taken which the system then executes. This is the classic programming language paradigm.

    For example, a declarative system may be told to create a virtual machine by declaring the existence of the VM as the expected state of the system.

  • This Week in Rust 325
  • 7 Best Programming Languages for Mobile Apps Development | HokuApps

    Java is probably one of the most popular programming languages out there for mobile app development and is used by a number of mobile app development services. Android OS, which is a widely used operating system, is written in Java; and so, if an app developer is well-versed with Java, then they’ll be able to create all kinds of Android apps.

    Besides Android apps, developers familiar with Java can develop games, embedded space, websites, server apps, and more. Moreover, Java can either be run in a browser window or in a virtual machine that does not require a browser. This is why it’s an extremely flexible programming language in terms of reusing code.

  • Working on these skills can get you high paying jobs
  • ML, data analytics most sought after skills for 2020: Study
  • Tech skills will dominate in 2020

More in Tux Machines

Best Wallpaper Slideshow Apps for Linux

Many Linux users love to customize and personalize their desktop environment. Linux offers plenty of choices to customize almost every part of the desktop including automatic switching of desktop background at periodic intervals. This article will list some wallpaper slideshow apps that can find and apply desktop backgrounds automatically based on your interests. Read more

today's howtos

Programming Leftovers

  • Hover a mouse over a link - just don't trust the results

    This appears to be a link to a good website. When the mouse hovers over this link, it will appear that it goes to www.somegoodplace.com. Click it. I dare you :-)

    The link really goes to guce.advertising.com. JavaScript is used to dynamically change the link just as it is clicked. Pretty cool, eh?

  • Goodbye Joyent

    But as any software veteran knows, projects often don’t survive the whims of management. No one is fired for picking Linux (these days), but they might be for picking something else. I already experienced this once before, as a core developer of the Riak database. We were rigorous, paying homage to the theoretics of distributed systems, but with a focus on bringing that theory to the masses. So much so that our last CEO said we had to stop doing so much “computer science”. He meant it as an insult, but we wore it as a badge of honor. But hey, MongoDB had a sweet API and BJSON, who cares if it lost your data occasionally [1]. I understand that people like to stick with what is popular. I respect that decision — it is theirs to make. But I’ll never be a part of that crowd. I want to use software that speaks to me, software that solves the problems I have, software guided by similar values to my own. For me, no project does this more than SmartOS and the illumos kernel. It is my Shawshank Redemption in a sea of MCU.

  • Continuous integration with GDB Buildbot

    Continuous integration is a hot topic these days, and the GNU Project Debugger is keeping up with the trend. Who better to serve as a role model for tracking and exterminating bugs than a debugger? The GDB Buildbot started as a pet project back in 2014 but is now an integral part of the development process. It provides an infrastructure to test new commits pushed to the official repository, as well as a service (which we call try builds) for developers to submit their proposed changes. In this article, I share the story of our Buildbot instance, where we are right now in terms of functionality, and the plans (and challenges) for the future. [...] Back in 2014, the GDB project did not have a continuous integration tool. Developers kindly provided testsuite results and reported regressions in the code, often using their own machines. However, these developers had limited resources and could not test various architectures simultaneously. Compilation failures were often not caught in systems that are not widely used. Ultimately, this issue caused delays and annoyances during the release process (or in the worst cases) after GDB was released. In an attempt to mitigate this problem, the GDB Buildbot was set up. Only GNU/Linux running on Intel/AMD 32 and 64-bit was supported at the beginning, but the community quickly started to contribute toward support other machines and architectures. The initial setup compiled and tested the code using common configure flags, but developers still needed to consult the web page in order to know the results. Over time, the instance has been improved and new features were added, including email notifications whenever a commit introduced a compilation failure, and email notifications to the gdb-testers mailing list containing the results of each testsuite run. Perhaps one of the most useful features was the try build system.

  • Automating unit tests in test-driven development

    DevOps is a software engineering discipline focused on minimizing the lead time to achieve a desired business impact. While business stakeholders and sponsors have ideas on how to optimize business operations, those ideas need to be validated in the field. This means business automation (i.e., software products) must be placed in front of end users and paying customers. Only then will the business confirm whether the initial idea for improvement was fruitful or not. Software engineering is a budding discipline, and it can get difficult to ship products that are defect-free. For that reason, DevOps resorts to maximizing automation. Any repeatable chore, such as testing implemented changes to the source code, should be automated by DevOps engineers. This article looks at how to automate unit tests. These tests are focused on what I like to call "programming in the small." Much more important test automation (the so-called "programming in the large") must use a different discipline—integration testing. But that's a topic for another article.

  • Create web user interfaces with Qt WebAssembly instead of JavaScript

    When I first heard about WebAssembly and the possibility of creating web user interfaces with Qt, just like I would in ordinary C++, I decided to take a deeper look at the technology. My open source project Pythonic is completely Python-based (PyQt), and I use C++ at work; therefore, this minimal, straightforward WebAssembly tutorial uses Python on the backend and C++ Qt WebAssembly for the frontend. It is aimed at programmers who, like me, are not familiar with web development.

  • GCC 8.4 Status Report (2020-02-17)
    Status
    ======
    
    
    
    
    It has been almost a year since GCC 8.3 has been released and GCC 8.4
    release should have been released already, so we should concentrate on
    getting it out soon.  Unfortunately we have two P1s, one of them is
    waiting for reporter's input, so we might as well just ignore it unless
    the input is provided, but the other, C++ FE one, looks something that
    should be fixed.  If we get rid of the P1s, I'd like to create
    8.4-rc1 on Wednesday, Feb 26th and release 8.4 the week afterwards.
    If you have any queued backports, please commit them to 8 branch
    (and 9 branch too, we'd like to release 9.3 soon too).
    
    
    
    
    
    
    
    
    Quality Data
    ============
    
    
    
    
    Priority          #   Change from last report
    --------        ---   -----------------------
    P1                2   +   2
    P2              284   +  75
    P3               38   +   4
    P4              151   -  11
    P5               22   -   2
    --------        ---   -----------------------
    Total P1-P3     324   +  81
    Total           497   +  68
    
    
    
    
    
    
    
    
    Previous Report
    ===============
    
    
    
    
    https://gcc.gnu.org/ml/gcc/2019-02/msg00122.html
    
  • GCC 8.4 + GCC 9.3 Compilers Coming Soon

    GCC 8.4 is already past due for release while Red Hat's Jakub Jelinek is trying to get its release organized in the coming weeks along with GCC 9.3. It's been nearly one year since GCC 8.3 and thus many fixes in tow for GCC 8.4. But two "P1" regressions of the highest priority are left to be addressed or demoted before the 8.4 release can happen. Jakub is hoping to create a release candidate of GCC 8.4 on 26 February and to then officially release the GCC 8.4 stable compiler the first week of March. A similar GCC 9.3 release is also expected soon for those on this current GCC 9 stable series. 

Python Programming

  • Refactoring and asking for forgiveness

    Recently, I had a great interaction with one of my coworkers that I think is worth sharing, with the hope you may learn a bit about refactoring and python. My colleague came to me to help him think through a problem that surfaced with a change to a project. The code in question sends a file to a remote storage service.

  • A Guide to the Newer Python String Format Techniques

    In the previous tutorial in this introductory series, you learned how to format string data using the string modulo operator. The string modulo operator is useful, and it’s good for you to be familiar with it because you’re likely to encounter it in older Python code. However, there are two newer ways that you can use Python to format strings that are arguably more preferable.

  • Python 101 2nd Edition Kickstarter is Live!

    I am excited to announce that my newest book, Python 101, 2nd Edition is launching on Kickstarter today!

  • February PyLadies Pune workshop

    It was the time for “learning Python with harware” in February, 2020 with PyLadies in Pune. Coding in Python becomes fun when one can see the changes it makes in the hardware. Selecting a place for work is always a difficult task as any organizer. College Of Engineering Pune (COEP) has always been supportive of PyLadies Pune. When I approached Abhijit for the venue he readily agreed. My sincere gratitude to him, Women Engineers Group and the FOSSMeet Pune team enough for that. Once I reached the venue it was already a full house and still people were coming in. We had more than 55 students of 1st to 3rd year, attending the workshop. The first year students already knew Python. Around 12-14 people were writing Python for the first time. The workshop started with the very basics of the language on the terminal. [...] We started with blinking the first LED of the board. When the students lit their first LED the smile and light in their eyes were precious :). Following that we spend some time with the simple codes. We tried our hands on different modules of Circuit Python. We took the help from the tutorial provided in Adafruit website. The students were enjoying and indulged into creativity. So I decided to give them problem statements instead of showing them code. I was happy to see how fast they were solving it and experimenting with different patterns, colours.

  • PyDev of the Week: Martin Fitzpatrick

    This week we welcome Martin Fitzpatrick (@mfitzp) as our PyDev of the Week! Martin is the author of “Create Simple GUI Applications with Python and Qt 5” and the creator of the LearnPyQt website. You can also check out his personal site or see what he’s up to by visiting his Github profile. Let’s spend some time getting to know Martin better!