Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Pros and Cons of Building Your Own IoT Platform

    “Should I build my own IoT platform? Is it worth it to do it myself? The answer is, of course, it depends.

    You’ve got an idea for an awesome IoT project, and you’re ready to get started making it into a reality. But there’s a lot of options to choose from. Should you build your project from the ground up? Should you hire an IoT company to build it for you? Or should you take a middle path, using others’ work as a foundation on which to build?

  • Parallel Programming: December 2020 Update - Paul E. McKenney's Journal — LiveJournal

    This release of Is Parallel Programming Hard, And, If So, What Can You Do About It? features numerous improvements...

  • Learn Lua by writing a "guess the number" game | Opensource.com

    If you're a fan of scripting languages like Bash, Python, or Ruby, you might find Lua interesting. Lua is a dynamically typed, lightweight, efficient, and embeddable scripting language with an API to interface with C. It runs by interpreting bytecode with a register-based virtual machine, and it can be used for everything from procedural programming to functional programming to data-driven programming. It can even be used for object-oriented programming through the clever use of arrays, or tables, used to mimic classes.

    A great way to get a feel for a language is by writing a simple application you're already familiar with. Recently, some Opensource.com correspondents have demonstrated how to use their favorite languages to create a number-guessing game. Lua is one of my favorites, so here's my Lua version of the guessing game.

  • Out of Control

    This leads us to ponder — and not for either the first or the last time in the history of computer science — the distinction between code and data. We stumble across this question even in the simplest cases. How would you describe the refactoring transformations above? Many would describe them in terms of separating the data from the code. Does that mean, then, that numerals.py contains data but not code? It’s a valid Python module that initialises a variable to a list of string–integer pairs. Sounds like code. Nothing says an essential qualification for something to be considered code is the presence of control flow.
    We use the word code freely, referring both to anything written in a programming language and, more specifically, to code (sic) whose primary concern is algorithm and operation rather than data structure and definition. Natural language is messy like that, filled with ambiguity, synecdoche and context dependency.
    If we want to be more rigorous, we could say that we have separated the code into code that abstracts operation and code that abstracts data. In other words, we are saying that Programs = Code and, given that Algorithms + Data Structures = Programs, therefore Algorithms + Data Structures = Code. This can be convenient and clear way to frame our thinking and describe what we have done. We also need to recognise, however, that it is just that: it is a thinking tool, a way of looking at things and reasoning about them rather than necessarily a comment on the intrinsic nature of those things; it is a tool for description, a way of rendering abstract concepts more concretely into conversation.
    If we confuse a point of view for the nature of things we will end up with a dichotomy that feels like Cartesian dualism. Just as Descartes claimed there were two distinct kinds of substance, physical and mental, we could end up claiming there are two distinct kinds of code — code that is data and code that is operation.
    When we look to hardware, compilers or the foundations of computer science, such as Turing machines, we will not find clear support or a strict boundary for such separation. The indistinction runs deep. Although we have code and data segments in a process address, these enforce negotiable matters of convention and protection (e.g., the code or text segment is often read-only). Both code and data segments contain data, but the data in the code segment is intended to be understood through a filter of predefined expectations and an instruction set. On the other hand, it is also possible to treat data in the data segment as something to execute.

  • Perl weekly challenge 093

    Using a similar approach than James Curtis-Smith , the solution looks at points with equal slope to see if they are in a straight line. Being less literate in Raku, using classes help me to organize coding ideas.

    This exercise gives me the opportunity to work with the type BagHash. The highest value of the slopes stored in a BagHash gives the number of points in a straight line. Happily, the first example in Raku documentation is for a Class Point, an example reused in this solution.

  • I'm Making Headway Now

    Last January there was a post on reddit which claimed that my module JSON::Parse was not only failing some of the JSON Test Suite tests, but also crashing on one of them. Anyway I should have got around to doing something about it sooner, but here are my conclusions.

    First of all there was a crash on one of the files, which went something like this: [{"":[{"":[{"", repeated about 100,000 times. Investigating it using a LInode, I found that after 80,000 open brackets the stack was overflowing, causing the crash to occur. If I added a printf in the midst of my code the printf would cause the stack overflow, so it wasn't actually due to my code but just because the stack size seems to be quite small on Linux.

    There are various things one could do to tackle this, but it does seem a bit unlikely that anyone would want to have that many open brackets, so what I did as a strategy was to add a "max_depth" of parsing after which it would stop. I thought 10,000 open { and [ would be enough for anyone, and it would satisfy the people who want to run the JSON Test Suite tests, but I also added an option for the user to alter the max depth and get the max depth as well.

  • Jean-François Fortin Tam: Blogging about Python desktop apps improvements on Planet Python

    Hi, fellow pythonistas! Before I start publishing future Python-related posts to this aggregator, I would like to shortly introduce myself and the reason for this blog’s presence on the planet.

    [...]

    Here I blog mainly about new releases and improvements in my Python software apps (which means GTG lately, but I also have a couple of pythonic utility apps I’ve been meaning to publish sometime soon), and sometimes write about performance optimization in software applications in general, or how a particular bug was solved. As such, my blog posts tend to be “applied Python” type of content rather than theoretical tutorial-style blog posts.

  • 10 examples of using Python in 2020 | Opensource.com

    Each year, Opensource.com publishes various articles about Python to pique new users' interest and help long-time Pythonistas expand their skills. The following are Opensource.com's top 10 articles about Python in 2020.

  • MySQL Primary and Foreign Keys – Linux Hint

    MySQL is an RDBMS (Relational Database Management System) which is owned by the Oracle Corporation and inherited from the standard SQL. It allows access and manipulation of Databases. Whoever knows the word ‘Database’ must have knowledge of Primary and Foreign keys. There is no concept of a relational database without the existence and idea of the concepts of Primary Keys and Foreign Keys. So in this article, we are going to learn about the importance and correct use of Primary and Foreign keys in MySQL.

    The primary key can be any field or column of a table, which should be a unique and non-null value for each record or a row.

    The Foreign key is a field that contains the primary key of some other table to establish a connection between each other.

    Let’s have a look at the syntax and different examples to create primary and foreign keys in MySQL.

  • MySQL Outer Join – Linux Hint

    MySQL provides a lot of commands, which are needed while managing a database. For example, we often need to get some data from different tables based on some condition. MySQL then provides different types of joins to get the desired results. Let’s learn LEFT JOIN AND RIGHT JOIN of MySQL.
    There is no such statement as FULL OUTER JOIN in SQL, but we can use a simple JOIN to get the same results or by simply using a SELECT statement over two different tables.

    Otherwise, MySQL provides LEFT JOIN and RIGHT JOIN to get the records or rows from the right or left table, respectively. Let’s try a couple of different examples to get the desired results using appropriate joins.

More in Tux Machines

Announcing the election for the next TDF Board of Directors

On October 18, we officially announced the upcoming election for the next Board of Directors of The Document Foundation, the non-profit entity behind LibreOffice. As per § 7 II of our statutes (binding German version and non-binding English translartion) the Board’s term lasts two years. The current Board started its duty on February 18, 2020. Therefore, the old Board remains in charge until the end of February 17, 2022, so the new Board will be in charge the day after that, which is February 18, 2022. That upcoming term will then (regularly) end on February 17, 2024, so the next election of the Board of Directors will take place before. As per § 6 III, only members of the Board of Trustees of The Document Foundation, as well as current members of any of its bodies, are eligible to be elected into the Board of Directors, and the election is prepared and supervised by the Membership Committee (§ 7 II). Read more

VirtualBox 6.1.28 Released with Initial Support for Linux 5.14 and 5.15 Kernels

VirtualBox 6.1.28 is here about three months after VirtualBox 6.1.26 to introduce initial guest and host support for the Linux 5.14 and 5.15 kernel series. This means that you can now use VirtualBox on GNU/Linux systems powered by Linux kernels 5.14 or 5.15, as well as to run distributions powered by Linux 5.14 or 5.15 kernels inside virtual machines. In addition, this release introduces initial support for the upcoming Red Hat Enterprise Linux 8.5 operating system, improves the detection of kernel modules in Linux hosts to prevent unnecessary rebuilds, fixes a display corruption on Linux Mint systems, and adds bindings support for Python 3.9. Read more

More Mozilla Spying and Management Shuffle

  • William Lachance: Learning about Psychological Safety at the Recurse Center

    Some context: I’m currently working as a software engineer at Mozilla, building out our data pipeline and analysis tooling. I’ve been at my current position for more than 10 years (my “anniversary” actually passed while I was out). I started out as a senior engineer in 2011, and was promoted to staff engineer in 2016. In tech-land, this is a really long tenure at a company. I felt like it was time to take a break from my day-to-day, explore some new ideas and concepts, and hopefully expose myself to a broader group of people in my field. My original thinking was that I would mostly be spending this time building out an interactive computation environment I’ve been working on called Irydium. And I did quite a bit of that. However, I think the main thing I took away from this experience was some insight on what makes a remote environment for knowledge work really “click”. In particular, what makes somewhere feel psychologically safe, and how this feeling allows us to innovate and do our best work. While the Recurse Center obviously has different goals than an organization that builds and delivers consumer software, I do think there are some things that it does that could be applied to Mozilla (and, likely, many other tech workplaces).

  • [Older] Firefox Now Sends Your Address Bar Keystrokes to Mozilla

    Firefox now sends more data than you might think to Mozilla. To power Firefox Suggest, Firefox sends the keystrokes you type into your address bar, your location information, and more to Mozilla’s servers. Here’s exactly what Firefox is sharing and how to control it.

  • Support.Mozilla.Org: What’s up with SUMO – October 2021

    As we enter October, I hope you’re all pumped up to welcome the last quarter of the year and, basically, wrapping up projects that we have for the remainder of the year. With that spirit, let’s start by welcoming the following folks into our community. [...] Thanks for Jefferson Scher for straightening the Firefox Suggest confusion on Reddit. That definitely help people to understand the feature better.

  • Welcome Imo Udom, Mozilla’s new Senior Vice President, Innovation Ecosystems

    I am delighted to share that Imo Udom has joined Mozilla as Senior Vice President, Innovation Ecosystems. Imo brings a unique combination of strategy, technical and product expertise and an entrepreneurial spirit to Mozilla and our work to design, develop and deliver new products and services.

Security Leftovers

  • Security updates for Tuesday

    Security updates have been issued by Debian (redmine and strongswan), Fedora (containerd, fail2ban, grafana, moby-engine, and thunderbird), openSUSE (curl, firefox, glibc, kernel, libqt5-qtsvg, rpm, ssh-audit, systemd, and webkit2gtk3), Red Hat (389-ds:1.4, curl, kernel, kernel-rt, redis:5, and systemd), SUSE (util-linux), and Ubuntu (ardour, linux-azure, linux-azure-5.11, and strongswan).

  • Best Open Source Security Tools | eSecurityPlanet

    Over the past quarter of a century, the open source movement has gone from strength to strength. But that success and the openness inherent in the community have led to a major challenge – security. The more software that is developed, the greater the likelihood there is for vulnerabilities. To make matters worse, the open source world prides itself on openness and transparency. Therefore, any security vulnerabilities are disclosed publicly. In this age of organized gangs of cybercriminals, that is like placing an ad asking for an attack. This has given rise to a large number of open source security tools. They take care of all aspects of the management of security in open source components, examine dependencies, fix bugs in code, and lower risk.

  • Credit card PINs can be guessed even when covering the ATM pad

    Researchers have proven it’s possible to train a special-purpose deep-learning algorithm that can guess 4-digit card PINs 41% of the time, even if the victim is covering the pad with their hands. The attack requires the setting up of a replica of the target ATM because training the algorithm for the specific dimensions and key spacing of the different PIN pads is crucially important.

  • Using Machine Learning to Guess PINs from Video - Schneier on Security

    This works even if the person is covering the pad with their hands.

  • Google Developing "SiliFuzz" For Fuzzing CPUs To Uncover Electrical Defects - Phoronix

    With OSS-Fuzz for continuous fuzzing of open-source projects and along with working on the various sanitizers for compilers, Google has been doing a lot for proactively uncovering software defects in key open-source projects. Now though a group of their engineers have been working on SiliFuzz for software aiming to discover new CPU defects.