Language Selection

English French German Italian Portuguese Spanish


Programming Leftovers (Mostly Python Links)

Filed under
  • Create the third level for this pygame project

    In this article we are going to create the third level for our pygame project after we have created the previous two levels, the reason I create the third game level in this chapter is because this level is different from the second level which is only using the same enemy class to generate different type of enemy ship. In this chapter we are going to create a new enemy class which will act...

  • Python Pandas Groupby Tutorial
  • Everything you need to know about tree data structures

    When you first learn to code, it’s common to learn arrays as the “main data structure.”

  • Introducing Zato public API services

    Most users start to interact with Zato via its web-based admin console. This works very well and is a great way to get started with the platform.

    In terms of automation, the next natural step is to employ enmasse which lets one move data across environments using YAML import/export files.

    The third way is to use the API services - anything that can be done in web-admin or enmasse is also available via dedicated API services. Indeed, both web-admin and enmasse are clients of the same services that users can put to work in their own integration needs.

    The public API is built around a REST endpoint that accepts and produces JSON. Moreover, a purpose-built Python client can access all the services whereas an OpenAPI-based specification lets one generate clients in any language or framework that supports this popular format.

  • 6 steps to optimize software delivery with value stream mapping

    Do your efforts to improve software development fall short due to confusion and too much debate? Does your organization have a clear picture of what is achievable, and are you sure you’re moving in the right direction? Can you determine how much business value you've delivered so far? Are the bottlenecks in your process known? Do you know how to optimize your current process?

    If you are looking for a tool that will help you answer these questions, consider integrating value stream mapping and lean concepts into the way you deliver software.

  • Delete duplicate file with python program

On Linus' Return to Kernel Development

Filed under

On October 23, 2018, Linus Torvalds came out of his self-imposed isolation, pulling a lot of patches from the git trees of various developers. It was his first appearance on the Linux Kernel Mailing List since September 16, 2018, when he announced he would take a break from kernel development to address his sometimes harsh behavior toward developers. On the 23rd, he announced his return, which I cover here after summarizing some of his pull activities.

For most of his pulls, he just replied with an email that said, "pulled". But in one of them, he noticed that Ingo Molnar had some issues with his email, in particular that Ingo's mail client used the iso-8859-1 character set instead of the more usual UTF-8. Linus said, "using iso-8859-1 instead of utf-8 in this day and age is just all kinds of odd. It looks like it was all fine, but if Mutt has an option to just send as utf-8, I encourage everybody to just use that and try to just have utf-8 everywhere. We've had too many silly issues when people mix locales etc and some point in the chain gets it wrong."

Read more

Python Coding Leftovers

Filed under
  • Python 101: Episode #36 – Creating Modules and Packages

    In this screencast, we will learn the basics of how to create our own module or package.

  • PyCoder’s Weekly: Issue #345 (Dec. 4, 2018)
  • Python Education Summit - in its 7th year in 2019

    Teachers, educators, and Pythonistas: come and share your projects, experiences, and tools of the trade in teaching coding and Python to your students. The Annual Python Education Summit is held at PyCon 2019, taking place on Thursday, May 2nd. Our call for proposals is open until January 3rd AoE, and we want to hear from you!

  • Using Pip in a Conda Environment

    Unfortunately, issues can arise when conda and pip are used together to create an environment, especially when the tools are used back-to-back multiple times, establishing a state that can be hard to reproduce. Most of these issues stem from that fact that conda, like other package managers, has limited abilities to control packages it did not install. Running conda after pip has the potential to overwrite and potentially break packages installed via pip. Similarly, pip may upgrade or remove a package which a conda-installed package requires. In some cases these breakages are cosmetic, where a few files are present that should have been removed, but in other cases the environment may evolve into an unusable state.

  • Type erasure and reification

    In this post I'd like to discuss the concepts of type erasure and reification in programming languages. I don't intend to dive very deeply into the specific rules of any particular language; rather, the post is going to present several simple examples in multiple languages, hoping to provide enough intuition and background for a more serious study, if necessary. As you'll see, the actual concepts are very simple and familiar. Deeper details of specific languages pertain more to the idiosyncrasies of those languages' semantics and implementations.

    Important note: in C++ there is a programming pattern called type erasure, which is quite distinct from what I'm trying to describe here [1]. I'll be using C++ examples here, but that's to demonstrate how the original concepts apply in C++. The programming pattern will be covered in a separate post.

Programming Leftovers

Filed under
  • Removing Duplicate PATH Entries, Part II: the Rise of Perl

    With apologies to Arnold and the Terminator franchise for the title, let's look one more time at removing duplicates from the PATH variable. This take on doing it was prompted by a comment from a reader named Shaun on the previous post that asked "if you're willing to use a non-bash solution (AWK) to solve the problem, why not use Perl?" Shaun was kind enough to provide a Perl version of the code, which was good, since I'd have been hard-pressed to come up with one. It's a short piece of code, shorter than the AWK version, so it seemed like it ought to be fairly easy to pick it apart. In the end, I'm not sure I'd call it easy, but it was interesting, and I thought other non-Perl programmers might find it interesting too.

  • converts all pngs in a folder to webp, quality can be choosed as a argument
  • This Week In Servo 120
  • Tower of Hanoi program in Higher-Order Perl book, ported to Python

    I was reading the book Higher Order Perl (Wikipedia entry). It is by Mark Jason Dominus, a well-known figure in the Perl community. I've only read a bit of it so far, but it already looks very good. There are also many reviews of it, all of which say that it is a good book, including one by Damian Conway, another well-known Perl figure.

    Early in the book, in chapter 1 - Recursion and Callbacks, there is a nice example program showing how to solve the Tower of Hanoi problem. I had come across the problem earlier, but had not seen a Perl solution before. It's not really any different from the same kind of solution written in other languages, except for some points related to Perl's syntax and semantics, such as the use of local (Perl's my) vs. global variables, specifically with regard to a recursive function, which is what Mark uses for Hanoi.

  • 55: When 100% test coverage just isn't enough - Mahmoud Hashemi

    What happens when 100% test code coverage just isn't enough.
    In this episode, we talk with Mahmoud Hashemi about glom, a very cool project in itself, but a project that needs more coverage than 100%.
    This problem affects lots of projects that use higher level programming constructs, like domain specific languages (DSLs), sub languages mini languages, compilers, and db query languages.

  • Create the custom made thread class for the python application project
  • Seaborn Library for Data Visualization in Python: Part 1

    In the previous article, we looked at how Python's Matplotlib library can be used for data visualization. In this article we will look at Seaborn which is another extremely useful library for data visualization in Python. The Seaborn library is built on top of Matplotlib and offers many advanced data visualization capabilities.

    Though, the Seaborn library can be used to draw a variety of charts such as matrix plots, grid plots, regression plots etc., in this article we will see how the Seaborn library can be used to draw distributional and categorial plots. In the next part of the article, we will see how to draw regression plots, matrix plots, and grid plots.

  • Create enemy missiles within the Enemy object

    In this article we are going to edit a few game’s classes that we have created earlier, our main objective here is to detach the enemy missiles from the enemy missile manager, which means instead of putting all the enemy missiles under a single missile list inside the enemy missile manager as we have done previously, we are going to create a separate missile list and a separate missile pool...

  • Django TemplateView Example — URLs, GET and as_view

    Django Templates are used to create HTML interfaces that get rendered with a Django view.

  • Write drunk, test automated: documentation quality assurance - Sven Strack

    Before you start testing your documentation, you’ll need some insight. Start with getting an overview of your documentation. Who is committing to it? Which parts are there? Which parts of the documentation are updated most often? Are the committers native speakers yes/no? Which part of the documentation has the most bug reports. So: gather statistics.

    Also: try to figure out who reads your documentation. Where do they come from? What are the search terms they use to find your documentation in google? You can use these statistics to focus your development effort.

    Important: planning. If your documentation in English, plan beforehand if you want it to be in UK or US English. Define style guides. If you have automatic checks, define standards beforehand: do you want a check to fail on line length yes/no? Spelling errors? Etc. How long is the test allowed to take?

Programming Leftovers

Filed under
  • Python Software Foundation: November 2018 board meeting summary

    On November 12th and 13th, ten of the thirteen PSF board members convened in Chicago, IL. Those who could not make it to the in-person meeting, joined via phone conferencing when possible.

    In attendance were Naomi Ceder, Jacqueline Kazil, Thomas Wouters, Van Lindberg, Ewa Jodlowska, Lorena Mesa, Eric Holscher, Anna Ossowski, Christopher Neugebauer, and Jeff Triplett. Kushal Das and Marlene Mhangami connected remotely.

  • How Kotlin’s coroutines improve code readability
  • LLVM / Clang 8.0 Likely To Be Released Around Early March

    Ongoing LLVM release manager Hans Wennborg has laid out plans for releasing LLVM 8.0 and related sub-projects like Clang 8.0 in early March.

    Under a proposal drafted on Monday and so far okay by other upstream developers, the LLVM 8.0.0 release would ship in the early days of March.

  • Deploying Swift

    Well, no, that’s not true. I basically never actually want to deploy Swift as such. What I generally want to do is to debug some bit of production service deployment machinery that relies on Swift for getting build artifacts into the right place, or maybe the parts of the Launchpad librarian (our blob storage service) that use Swift. I could find an existing private or public cloud that offers the right API and test with that, but sometimes I need to test with particular versions, and in any case I have a terribly slow internet connection and shuffling large build artifacts back and forward over the relevant bit of wet string makes it painfully slow to test things.

  • Django bugfix releases: 2.1.4 and 1.11.17

    Today we've issued the 2.1.4 and 1.11.17 bugfix releases.

    The release package and checksums are available from our downloads page, as well as from the Python Package Index. The PGP key ID used for this release is Carlton Gibson: E17DF5C82B4F9D00.

  • Python Data Visualization 2018: Moving Toward Convergence

    In my previous post, I provided an overview of the myriad Python data visualization tools currently available, how they relate to each other, and their many differences. In this post we’ll take a look at an important theme that emerged from SciPy 2018: convergence, i.e., Python libraries becoming more similar in capability as they mature over time and share ideas and approaches. These trends of convergence have started to erase some of what were previous clear distinctions between each library. This is great for users, though it does make it more difficult to make blanket recommendations. As in the first post, we’ll generally separate the SciVis projects (typically 3D plotting situated in real-world space) from InfoVis projects (typically 2D plotting situated on the page or screen surface with arbitrary coordinate axes).

  • Fundamental C - Dependent v Independent & Undefined Behavior

    Lots has been written about undefined behavior in C, but not much about the reasons why it exists.

today's howtos and programming leftovers

Filed under

Programming/Development Leftovers

Filed under
  • nginx and lua to evaluate CDN behaviour

    I guess in the past everyone used CGIs to achieve something similar, it just seemed like a nice detour to use the nginx Lua module instead. Don't expect to read something magic. I'm currently looking into different CDN providers and how they behave regarding cache-control header, and what additional header they sent by default and when you activate certain feature. So I setup two locations inside the nginx configuration using a content_by_lua_block {} for testing purpose.

  • Keeping Up With The Python Community For Fun And Profit with Dan Bader

    Keeping up with the work being done in the Python community can be a full time job, which is why Dan Bader has made it his! In this episode he discusses how he went from working as a software engineer, to offering training, to now managing both the Real Python and PyCoders properties. He also explains his strategies for tracking and curating the content that he produces and discovers, how he thinks about building products, and what he has learned in the process of running his businesses.

  • New Android SDK/NDK Rebuilds

    As described in a previous post, Google is still click-wrapping all Android developer binaries with a non-free EULA.

  • CSS Grid Layout Tutorial—Styling a Django Template
  • 3 aging IT specialties that just won't retire

    That system runs what? IT leaders face a quandary as Boomers vanish, but the need for COBOL, mainframe, and legacy storage skills does not

  • PyDev of the Week: Erika Fille Legara

    This week we welcome Erika Fille Legara (@eflegara) as our PyDev of the Week. Erika is a professor and program director at the Asian Institute of Management. She has spoken at PyCon Philippines. You can check out her website to see what else she has been up to or watch her talk below:

  • Tryton News: Newsletter December 2018
  • Processing.js 2008-2018

    It was nothing short of epic. I had followed the development of Processing since I was an undergrad. I remember stumbling into the aesthetics + computation group website at MIT in my first year, and becoming aware of the work of Ben Fry, John Maeda, Casey Reas and others. I was smitten. As a student studying both humanities and CS, I didn't know anyone else who loved computers and art, and here was an entire lab devoted to it. For many years thereafter, I followed along from afar, always amazed at the work people there were doing.

    Then, in the fall of 2009, as part of my work with Mozilla, Chris Blizzard approached me about helping Al MacDonald (f1lt3r) to work on getting Processing.js to 1.0, and adding the missing 3D API via WebGL. In the lead-up to Firefox 3.7, Mozilla was interested in getting more canvas based tech on the web, and in finding performance and other bugs in canvas and WebGL. Processing.js, they thought, would help to bring a community of artists, designers, educators, and other visual coders to the web.

Python Leftovers

Filed under

Programming: PHP, Django, Python and More

Filed under
  • PHP Tutorial For Beginners

    If you are new in PHP then this tutorials will help you to learn PHP from the beginning.

  • JJ's Mostly Adequate Summary of the Django Meetup: When *Not* To Use the ORM & Goodbye REST: Building GraphQL APIs with Django

    The Django meetup was at Prezi. They have a great space. They are big Django users.

  • Virtual Environments in Python 3

    Like most people, I hate installing unnecessary packages on my workstation. After you are done with them, uninstalling them is never enough. Packages leave behind tonnes of folders and files. They require many other (obscure) packages also left behind in the wake of things. Slowly but surely these things build up in your workstation and while they may not hog up any significant portion of your disk space, they can cause other issues.

  • Episode #188: Async for the Pythonic web with Sanic

    What do most web servers do most of the time? They wait. They wait on external systems while processing a request.

    Think about a standard web request to an ecommerce site where you are logged in. You send it a session cookie and a URL. It pulls a bunch of items from a database, a Redis cache, and an external API.

    Virtually all this time is spent waiting. That is exactly what asyncio is built for. But to take advantage of it in Python web frameworks, the framework itself has to support async methods.

  • On degrees

    Lately there’s been a recurring discussion on various social-media outlets about the relevance of academic degrees to a career in programming.

Syndicate content

More in Tux Machines

today's leftovers

OSS Leftovers

  • #RecruitmentFocus: Open source skills in high demand
    The unemployment rate in South Africa rose to 27.5% in the third quarter of 2018, while the demand for skills remains high - leaving an industry conundrum that is yet to be solved. According to SUSE, partnerships that focus on upskilling graduates and providing real-work skills, as well as placement opportunities - could be exactly what the industry in looking for.
  • Stable: not moving vs. not breaking
    There are two terms that brings a heavy controversy in the Open Source world: support and stable. Both of them have their roots in the “old days” of Open Source, where its commercial impact was low and very few companies made business with it. You probably have read a lot about maintenance vs support. This controversy is older. I first heard of it in the context of Linux based distributions. Commercial distribution had to put effort in differentiating among the two because in Open SOurce they were used indistictly but not in business. But this post is about the adjectivet stable…
  • Cameron Kaiser: A thank you to Ginn Chen, whom Larry Ellison screwed
    Periodically I refresh my machines by dusting them off and plugging them in and running them for a while to keep the disks spinnin' and the caps chargin'. Today was the day to refurbish my Sun Ultra-3, the only laptop Sun ever "made" (they actually rebadged the SPARCle and later the crotchburner 1.2GHz Tadpole Viper, which is the one I have). Since its last refresh the IDPROM had died, as they do when they run out of battery, resetting the MAC address to zeroes and erasing the license for the 802.11b which I never used anyway. But, after fixing the clock to prevent GNOME from puking on the abnormal date, it booted and I figured I'd update Firefox since it still had 38.4 on it. Ginn Chen, first at Sun and later at Oracle, regularly issued builds of Firefox which ran very nicely on SPARC Solaris 10. Near as I can determine, Oracle has never offered a build of any Firefox post-Rust even to the paying customers they're bleeding dry, but I figured I should be able to find the last ESR of 52 and install that. (Amusingly this relic can run a Firefox in some respects more current than TenFourFox, which is an evolved and patched Firefox 45.)
  • Protecting the world’s oceans with open data science
    For environmental scientists, researching a single ecosystem or organism can be a daunting task. The amount of data and literature to comb through (or create) is often overwhelming. So how, then, can environmental scientists approach studying the health of the world’s oceans? What ocean health means is a big question in itself—oceans span millions of square miles, are home to countless species, and border hundreds of countries and territories, each of which has its own unique marine policies and practices. But no matter how daunting this task may seem, it’s a necessary and vital one. So in 2012, the National Center for Ecological Analysis and Synthesis (NCEAS) and Conservation International publicly launched the Ocean Health Index (OHI), an ambitious initiative to measure the benefits that oceans provide to people, including clean water, coastal protections, and biodiversity. The idea was to create an annual assessment to document major oceanic changes and trends, and in turn, use those findings to craft better marine policy around the world.

Openwashing Leftovers

The Last Independent Mobile OS

The year was 2010 and the future of mobile computing was looking bright. The iPhone was barely three years old, Google’s Android had yet to swallow the smartphone market whole, and half a dozen alternative mobile operating systems—many of which were devoutly open source—were preparing for launch. Eight years on, you probably haven’t even heard of most of these alternative mobile operating systems, much less use them. Today, Android and iOS dominate the global smartphone market and account for 99.9 percent of mobile operating systems. Even Microsoft and Blackberry, longtime players in the mobile space with massive revenue streams, have all but left the space. Then there’s Jolla, the small Finnish tech company behind Sailfish OS, which it bills as the “last independent alternative mobile operating system.” Jolla has had to walk itself back from the edge of destruction several times over the course of its seven year existence, and each time it has emerged battered, but more determined than ever to carve out a spot in the world for a truly independent, open source mobile operating system. After years of failed product launches, lackluster user growth, and supply chain fiascoes, it’s only been in the last few months that things finally seem to be turning to Jolla’s favor. Over the past two years the company has rode the wave of anti-Google sentiment outside the US and inked deals with large foreign companies that want to turn Sailfish into a household name. Despite the recent success, Jolla is far from being a major player in the mobile market. And yet it also still exists, which is more than can be said of every other would-be alternative mobile OS company. Read more