Posts
Expected Utility and Agile
Selling Agile When convincing others to adopt agile practices, I have often found it useful to discuss those practices in terms of risk reduction. For example, we can talk about continuous integration in terms of reducing the “schedule risk” that results from performing all the integration at the end.
Unfortunately, selling agile in this way has a major disadvantage, which is that people tend to associate reduced risk with reduced cost, even though that is not really a valid association.
Posts
ANTLR 4 with Python 2 Detailed Example
Zone: Integration
TLDR: ANTLR 4 introduced a handy listener-based API, but sometimes it’s better not to use it.
In a previous post I showed a very simple example using ANTLR 4 with Python 2. While this example gave the basic framework necessary, it didn’t delve very deeply into ANTLR’s API. In this article, I’ll give a little more detail.
Grammar To get started, we need a grammar that is more complex than the basic “Hello” grammar.
Posts
Using ANTLR 4 with Python
ANTLR (Another Tool for Language Recognition) is an established tool for writing parsers. It is written in Java, but generates code in a variety of languages, including Python.
There seemed to be a dearth of examples out there using ANTLR 4 with Python, and having used ANTLR only with Java, I was interested to explore how difficult it would be to use. You can see the results in a GitHub repository.
Posts
User Interface Joys and Follies
Zone: Web Dev
TLDR: How can a tool with a great concept and a great user interface ultimately fail in its promise? By taking the wrong path in just a couple big ways.
Markdown All the Things In my effort to convert all my documents to Markdown, I have been looking for a tool that would allow the use of Markdown for larger technical documents (the kind of thing traditionally done in Microsoft Word).
Posts
Publishing JSON Schema Documentaton with Docson
For systems that have JSON data that’s published as part of an API, there are tools such as Swagger / OpenAPI and RAML that can be used to define REST endpoints and the data types for requests and responses. However, for cases where JSON data isn’t part of a REST API, such as documents in MongoDB, files on a disk, or messages, JSON Schema provides a way to specify what the JSON will look like in a way that covers all the possibilities better than making example documents.
Posts
iPhone and DVD: Encryption versus Security
The Internet has been transfixed by the story of San Berdardino, Cupertino, and Quantico in the FBI’s attempt to access data from a terrorist’s smart phone. I won’t take a position, other than to point out that this is why the lawyers say, “Hard Cases Make Bad Law”. Instead, I’m interested in the discussion about what the idea of back doors to access an encrypted device really tells us about security.
Posts
Algorithms: The Assignment Problem
One of the interesting things about studying optimization is that the techniques show up in a lot of different areas. The “assignment problem” is one that can be solved using simple techniques, at least for small problem sizes, and is easy to see how it could be applied to the real world.
Assignment Problem Pretend for a moment that you are writing software for a famous ride sharing application. In a crowded environment, you might have multiple prospective customers that are requesting service at the same time, and nearby you have multiple drivers that can take them where they need to go.
Posts
Docker and User Namespaces by Trial and Error
Included in the recent release of Docker 1.10 is a feature destined to become more important with future releases: support for user namespaces. At the moment, it’s not enabled in a fresh install, and it still feels a little bleeding edge compared to more established Docker features, but it does work and is worth getting to know.
I spent a little time getting familiar; by no means enough to claim expertise, but enough to make it work.
Posts
About Transactions
Zone: Integration
TLDR: Transactions are important but can be complex and confusing when getting started. This article provides an introduction to the terms and thinking behind transactions.
Transactions Are Important The famous “pennies for everyone” scheme in the movie Office Space was based on transferring fractions of a cent to an account with every transaction a bank performs. So obviously transactions are important, at least to the plot of that movie.
Posts
Fully Dynamic Classes with ASM
Zone: Java
TLDR: ASM is a Java bytecode manipulation library. Mocking frameworks and runtime code generators use it to dynamically generate Java classes. Here is an introduction to how it works.
In two previous articles, I discussed Java’s built in dynamic proxy support and using CGLib to proxy concrete classes. In both cases, we provided some regular Java code, then dynamically generated classes that would wire up that Java code to any arbitrary interface or class.
Posts
Writing for the Web in Markdown with Strapdown
Zone: Web Dev
TLDR: Writing in Markdown is more enjoyable than writing in HTML, and Markdown files are easier to version control and backup than content in a CMS.
As a Zone Leader here at DZone, I try to contribute as many interesting articles as time permits. So I spend a lot of time writing with a Web page as my target.
By the way, there are a lot of fun parts to being a Zone Leader, including getting to know the great people at DZone and in the Zone Leader Program.
Posts
String Builders and Smart Compilers
TLDR: We’ve all been trained to stay away from string concatenation. The Java compiler stays away from it, too, even when the source code doesn’t. /TLDR
Concatenation, Oh No A friend of mine discovered “something” in a Java file recently; it looked about like this:
String s1; // etc. about 20 String combined = s1 + s2 + ... + s20; For a long time, this has been seen as a bad practice, because of the nature of strings in the Java programming language.
Posts
Puppet or Ansible: How to Choose?
TLDR: When choosing between Puppet and Ansible, understanding the design choices can get us past wondering which is better, so we can make an informed decision. /TLDR
For people who are new to DevOps, it can be difficult to understand how tools are intended to be used. The basic examples in the documentation are intentionally simplified to show the tool, but that makes it more difficult to envision real-world usage. Since I’ve spent a lot of time recently using multiple tools, I thought it would be worth writing a little about my experiences.
Posts
Beyond Beginning Git: Exclude and Interactive Add
This article is the second of a series describing tips and tricks on the way to mastery. The first article described how Git uses the index to track changes ready for commit and what it means when we need to back out changes before commit. This time, I want to describe a couple different things I’ve found useful: negative exclusions and interactive add.
Negative Exclusion In Git, we use a .
Posts
Inside an Algorithm: Dijkstra's
One of the most famous algorithms in computer science is Dijkstra’s algorithm for finding the shortest path through a graph to one node or to all other nodes. This article walks through an example implementation to describe the algorithm in detail.