Membrane SoftwareTechnology development studio
<< Top of blog
Book icon The Membrane blog: Posts about programming
Thursday, July 20 2017 22:09 GMT
Posted by: Membrane Estimated read time: 9m Tags: programming valgrind

A typical software application is built from a code base containing thousands of lines, and a complex application easily reaches into the millions as its developers add ever more functionality. However, each line of code in a project is a place where somebody could have made a mistake, and even a single coding mistake among millions of lines can bring everything crashing down if it falls in a critical area. Many programmers become reliant on simple visual inspection and peer review to find lines of code that might contain mistakes, an approach that proves utterly unworkable when scaling to a code base of significant size, not to mention the fact that imperfect human eyes miss things all the time when examining code bases of any size. It's inevitable, then, that we'll need to use tools of some sort to analyze our code base. Ideally, these tools would be rolled into an automated build that processes all code after each change is committed, thereby giving us a system of continuous integration. On a team with multiple developers, such a system is invaluable; if any individual commits a change found to cause errors, we can easily revert the code its previous and known good state.

Today, we'll take a look at valgrind, a tool that comes in very handy as part of an automated build for C/C++ code. In applications built from these languages, the memory leak is one of the most common types of bugs as well as one of the most pernicious, often causing the user's system to slow to a crawl before an inexorable process crash hits. With valgrind's help we can flush out such leaks, along with several other types of issues related to memory management. Furthermore, by incorporating valgrind into a project as a build step, we can detect critical bugs as soon as they are coded, hopefully preventing their propagation to production sources and keeping them out of the hands of users.

This article refers to sample source files, which are available for cloning in the valgrind-testapp project on GitHub.

Wednesday, June 14 2017 18:01 GMT
Posted by: Membrane Estimated read time: 15m Tags: docker sysadmin programming

Call it a fact of life: computer systems fail, sometimes catastrophically. One afternoon not too long ago, a web server of mine became the latest in a long line of systems throughout history to do just that. It was midway through just another day of programming in the office when I noticed this server go completely offline without a warning or apparent cause. Contacting the data center support staff, we soon discovered that the server had been accidentally wiped and reinstalled in what I can only assume was a bad click or fat finger type of error. This server had been running several web sites, including and the forums we use for blog comments, but due to this mishap it was now rendered dead in the water, a purposeless brick.

Back in the old days, fixing our dead server would mean carefully reinstalling and reconfiguring the many software packages involved with a set of web sites, including: nginx, apache, PHP, MongoDB, and others, not to mention any custom software on the sites that we hope runs exactly the same way when transported into a shiny new system environment (hint: sometimes it doesn't). Dealing with all of this mess takes time and effort, which is not exactly ideal when there's other work to be done. In this case we were prepared, however, and reduced an afternoon's worth of work to just a few commands. Today, we'll see how that was possible thanks to Docker, a containerization layer providing an efficient and reliable paradigm for deployment of software applications. We'll also look at examples of a working project on GitHub that could be used by anyone to run a web server on any host able to start a Docker container.

Tuesday, May 23 2017 22:20 GMT
Posted by: Membrane Estimated read time: 9m Tags: programming membrane control
As more people join the world of modern, high-speed Internet, we've seen the rise of video as the preferred medium for communicating information. Indeed, according to some reports, video will comprise a staggering 82% of internet traffic by 2020. Use of video in place of text certainly has its advantanges, not least of all the ability to capture nonverbal queues helpful for human interaction. However, video also comes with a rather heavy downside in its sheer bulk and general lack of convenient ways to work with it. Managing thousands of text files is a snap for a personal computer and its operator, and the whole file set can be transmitted across the Internet in moments. On the other hand, managing thousands of video files, each of which might have its own quality, encoding standard, and format, quickly becomes a tangled and time-consuming mess. At Membrane Software, we seek better lives through computing, and today we'll look at development screenshots from a software system designed to help those like us: video enthusiasts who crave a convenient archive and retrieval system.
Tuesday, May 09 2017 01:08 GMT
Posted by: Membrane Estimated read time: 5m Tags: programming raspberry pi
In a previous post, we discussed the concept of electronic devices that act as appliances, with the word "appliance" used to describe our requirement that the device should do its job effectively while maximizing user convenience. Under that guideline, a perfect appliance is one that always does what its user expects and never causes surprises. A simple device such as a toaster has few expectations and rarely finds a way to violate them, but a general purpose machine such as our old friend, the Raspberry Pi, has many possible functions and is therefore more likely to do the unexpected. Luckily for us, however, it's possible to get a Raspberry Pi closer to appliance-like behavior through software. If we take control over the methods by which such a device is able to receive commands, we can, through careful programming, ensure that those commands are always handled in a manner that best reflects the user's intent. Today, we'll look at the first step in programming the Raspberry Pi, which is the same first step we see in any programming project: build and install our target hardware to prepare an environment for development.
Wednesday, April 19 2017 15:14 GMT
Posted by: Membrane Estimated read time: 9m Tags: programming websites
As webmasters of the Membrane Software site, it's our duty to deliver so-called "responsive" content: a page arranged in the best way possible for each user's individual device. These days, we can expect more than half of our web requests to come not from old-fashioned desktop PCs, but rather from new-fangled mobile devices. On these devices, we aim to load the page at a text size large enough to be immediately readable, and with a layout that makes most effective use of limited screen space without requiring the user to zoom. But there are still a lot of those desktops out there and our site needs to look good on them, not to mention larger mobile devices like tablets. How do we program a system to appropriately present a single set of content for such a wide range of screen sizes? Today, we'll explore ways to fulfill this unquestionably essential need for our modern web.
Tuesday, March 28 2017 01:12 GMT
Posted by: Membrane Estimated read time: 8m Tags: programming raspberry pi
The word appliance might conjure images of washing, blending, or garbage disposing gizmos, but in the area of computing we can use the concept to describe a device with the best quality of any appliance in your kitchen: it has one job to do, and does it perfectly every time with the absolute minimum help from you. At Membrane HQ, we have dozens of computing devices performing a wide array of tasks, and treat as many of them as possible like appliances. Raspberry Pi boards, in particular, are extremely useful for this type of work because they're easily programmable and can connect to other devices via Ethernet, module boards, or custom soldering. Armed with a board that can be programmed with arbitrary logic and then put in control of an arbitrary slave device, it's possible to create an appliance for absolutely any task if we put our minds to it. And what with Raspberry Pi boards being so inexpensive, we gain even more desirable appliance-like attributes: we can easily replace one that breaks, and we can get more of them if we have too much work for only one to handle.
Wednesday, January 25 2017 18:27 GMT
Posted by: Membrane Estimated read time: 3m Tags: games programming
Hello, dear reader, and welcome to Membrane Software. As the name of the blog implies, we'll be discussing topics centered around software, and more generally, technology. It's a broad topic for sure, one that can and does fill hundreds of blogs. Two topics in particular are of interest at Membrane Software: video games and programming. If you're someone who's into either or both of those things, I hope you'll find these posts entertaining and informative. And if you're someone who is a maker of software and technology as we are, I hope we can trade some of that good old know-how as we focus on analyzing the creative process.
<< Top of blog