Technology

The pattern (or one might say the way it is implemented) has several issues:

It (seriously) violates SRP. In a typical implementation of the pattern you will have the following set of methods and properties in every class:
Getting the data from database.
Instantiating a new instance in memory for inserting it into the database.
Saving changes to the database.
Loading related entities.
Validation.
Usually loads of methods (inherited from the base framework class) to deal with all the complexity involved with the above-mentioned methods.
Column related ...

Over the last 10 years I think I’ve heard all the arguments for Database Abstractions Layers (DBAL) and I’ve come to hate them. I’ve twice seen data moved from one database to another (from Oracle to MySQL and from MySql to PostGres) but in all cases I was able to write the import/export script in a day or two, so DBAL was never needed. More so, DBAL means giving up on what makes a database unique, and so you throw ...

Because find(id) is such a common query, the ActiveRecord developers have special-cased it to bypass a lot of the work that would have to be done if you were chaining together conditions or doing more elaborate queries. You can see at line 147 that this simple query is actually cached, and that this cache is checked to see if the query has been executed before.

If not, the query construction begins at line 149, with the chaining of a where clause ...

Here is an a la carte menu of features or properties that are related to these terms; I have heard OO defined to be many different subsets of this list.

Encapsulation – the ability to syntactically hide the implementation of a type. E.g. in C or Pascal you always know whether something is a struct or an array, but in CLU and Java you can hide the difference.

Protection – the inability of the client of a type to detect its implementation. ...

First of all, if you call a random object to ask it a question of any kind, you can get a denial of service in the form of nontermination. This can be mitigated by using an asychronous send or resource limitation, in which case you may get no information about the object.

But it’s worse than this. Even if you ignore DOS and timeout, you
might think you could do challenge/response for authentication = “type check” or brand predication. Let’s ...

I didn’t think you were such an OO partisan. If you are, then you
will probably find my reasons for despising it (other than the above)
to be very touchy-feely, and they are. I think comprehensive OO
(occasional OO is fine) is a very poor metaphor for the world, a poor
tool for problem solving, and an unnatural way to think. Here are
some particulars off the top of my head:

- It accounts poorly for symmetric interaction, such as chemical
reactions ...

Running `a {1+1}` is 4x slower than running `b {1+1}`. I didn’t even know you could yield in a method without an explicit &block parameter. I’ll guess I’ll change my ways then, although I like having the block declared in the method signature so I know ...

Paul Graham says there are 5 reasons why people like object oriented programming, and 3 and half of them are wrong:

I think there are five reasons people like object-oriented programming, and three and a half of them are bad:

Object-oriented programming is exciting if you have a statically-typed language without lexical closures or macros. To some degree, it offers a way around these limitations. (See Greenspun’s Tenth Rule.)

Object-oriented programming is popular in big companies, because it suits the way they ...

I always thought critical applications like banking needed compile time type checking. Clojure is neat and all, but it’s dynamic.

The counter-argument:

They need quality, trustworthy software. Compile time type checking is a tool that can be used to help get there (but how useful it is in getting there depends on how robust the type system is, and Java’s is not particularly robust).

Clear and concise code that is readily understood, avoids visual noise so that the programmer can focus on ...

It seems to keep going, but I find it difficult to accept any explanation of why it keeps going:

It won’t happen overnight, but WP-API will dramatically reduce the amount of active PHP code in WordPress, starting with the admin back-end. It will become a JavaScript app that talks to the WP-API sooner than anyone suspects.

Front-end (read: theme) development will change at a slower pace, because rendering HTML on the server side is still the right thing to do for ...

The pattern should be used when you have distinct and unrelated operations to perform across a structure of objects.

Wait a minute, isn’t that… a function? In a language where functions can take functions, I would simply send in a function, right? Maybe a multimethod. I wouldn’t need an interface for the “visitor”, except maybe the interface of the multimethod, right?

The fact that these metaphors are so tortured is certainly a bad sign: ...

I tend to come across a lot of code written by people who read up on design patterns and than think they should use them all over the place and the result is the actual code gets buried under tons of interfaces, wrappers and layers and pretty hard to read. That’s a wrong approach to design patterns.

Design patterns exist so that you have a repertoire of useful idioms handy when you come across a problem. But you should ...

Given the few items we can hold in working memory simultaneously, it’s no wonder that programming is hard; any interesting programming problem has a multitude of fine-grained parameters and possible alternatives. One way around this limitation is a process known as chunking. Chunking is an encoding strategy where individual elements are grouped into higher-level groups, chunks. While the limit on the number of units still apply, each unit now holds more information.

This is a nice write up of some of the plugins one can use with Leiningen

Cljfmt
At long last, Clojure finally has its own gofmt-like tool, thanks to the ever-industrious @weavejester. Cljfmt both checks (lein cljfmt check) and formats (lein cljfmt fix) your code nicely in adherence to the generally accepted Clojure style rules, and has options for configuration in case you have your own feelings on the subject.

Eastwood
Eastwood is a Clojure linter, invoked with lein eastwood. As a general request, ...

One such strategy is to share knowledge and base our solutions on what has been known to work well in the past. Since few designs are really novel we often find that previous solutions, at least on a conceptual level, apply to our new problem too…

Patterns incorporate both of these strategies. As software developer and author of a technical book on patterns I obviously find value in the pattern format. And as a psychologist I ...

Most software developers are familiar with the OOP motto “everything is an object.” People accustomed to C++ classes often find the Haskell concept of type classes difficult to grasp. Why is it so different?

C++ classes pack functions together with data, which makes it convenient to represent and consume data. Use of interfaces (abstract classes) allow classes to interact by contract, instead of directly manipulating the data in the other class. There exist alternative ways in C++ to accomplish such ...

As one data point on the curve, at any rate, if you were to compete with ITA and chose to write your software in C, they would be able to develop software twenty times faster than you. If you spent a year on a new feature, they’d be able to duplicate it in less than three weeks. Whereas if they spent just three months developing something new, it would be five years before you had it too.

This is true. When I work with another programmer, I suddenly have to focus 100%, and interact with someone too, straining the limits of both my technical abilities and my social skills. I can do this for 30 minutes, but if I had to do it all day, everyday, I would be utterly exhausted.

What about the downsides?
It’s not all peaches and cream of course – pairing all the time does have some downsides.

The width of a Unicode string differs from the number of characters in it. Fortunately, we can use the POSIX standard function wcswidth to calculate the display width of a Unicode string. We can use this function to rebuild our basic formatting functionality.

Suppose that we are interested in estimating the average height among all people. Collecting data for every person in the world is impractical, bordering on impossible. While we can’t obtain a height measurement from everyone in the population, we can still sample some people. The question now becomes, what can we say about the average height of the entire population given a single sample.

The Central Limit Theorem addresses this question exactly. Formally, it states that if we sample from ...

Cocoa is from the 1980s. Qt is from 1991. MFC is from 1992, building upon older technology. AWT is from 1995. Swing is from 1996. GTK+ is from 1997. SWT and wxWidgets just build upon these old toolkits. Windows Forms is maybe the newest, from the early 2000s.

There hasn’t been a widely used UI toolkit created in the past decade, if not longer. The best we’ve seen since then are half-assed UIs built using HTML/CSS/JS, and limited mobile UIs ...

# ———————————————————————————
# Some python module defines a Bar component and states the dependencies
# We will assume that
# – Console denotes an object with a method WriteLine(string)
# – AppTitle denotes a string that represents the current application name
# – CurrentUser denotes a string that represents the current user name
#

The framework of the future should make us think only about the data and only about the markup. Nothing in between. We don’t want to deal with loading HTML strings or passing data to special functions. We want to apply values to variables and get the DOM updated. The popular two-way data binding should not be a feature, but a must-have core functionality.

In fact, AngularJS is close to the desired behavior. It reads the template from the provided page’s ...

Practices are often built without targeting the crucial aspect of collaboration—the human factor.

The secret lies in understanding of good patterns and mindfully applying them (and we’ve elaborated on that a little bit here).

A starting point for building up effective collaboration is to create resources than can serve as learning and reference materials. One of the ways to do so is to have a style guide (see Github, MailChimp, The Guardian and A ...

I have had 2 good friends of mine, both working as frontenders for many years, tell me that the work is not as fun as it used to be. 10 years ago, or even 5 years ago, working on the frontend meant doing creative worked that intermingled artistic design concerns and some technical cleverness for making the design real. But over the last 3 or 4 years, with the rise of the pure Javascript frontends, being a frontender has increasingly ...

Interesting. How to get different tools to work together, via some common specification? This sounds a bit like a new approach to the problems that the industry failed to solve 10 years ago with the insane WebServices approach.

The best way to view Kythe is as a “hub” for connecting tools for various languages, clients and build systems. By defining language-agnostic protocols and data formats for representing, accessing and querying source code information as data, Kythe allows language analysis and ...

Type annotations in TypeScript are lightweight ways to record the intended contract of the function or variable. In this case, we intend the greeter function to be called with a single string parameter. We can try changing the call greeter to pass an array instead:

When Etsy announces their switch to SCSS to make their styles more maintainable the finding should not be “SASS beats CSS”, but it would be interesting to learn what lead to over 400,000 lines of CSS in over 2000 files for an actually not that complex site in the first place. The article is very interesting and shows some great differences in people dealing with code:

One of the great things about JavaScript is that you can do everything with it: you can do computations, you can create HTML, you can dynamically style elements, you can manipulate images, play and create music, video, and nowadays do all the HTTP work of an app, too. JavaScript is not only the leatherman of the client-side web any longer, it now took over the server, too.

That is also one of the terrible things about JavaScript. Just because you can ...

We are suddenly drowning in a wealth of options when it comes to document stores. 5 years ago the default choice would have been MongoDB. But Riak is amazing, and ElasticSearch is amazing. Honestly, I don’t know how I’ll make a choice between these 3 in the future.

For making dashboards, the ELK stack is a powerful option:

We have followed the evolution of Elasticsearch from a search-specific platform to one whose power can also be leveraged for analytics. The ...

So he went to Cenegenics, a medical start-up that trains physicians to run their own “age management” practices. They updated his diet, put him on a new workout regimen, and started giving him testosterone. Within six months, his body fat was down to nine percent. “That’s pretty hard to maintain—I’m closer to 12 percent now,” he humblebrags. After his personal success, Cenegenics asked if he’d like to take their training course, so he did, and quickly, he found himself ...

Obviously you wouldn’t typically use the word “denormalize” when you are talking about a linked list. “Denormalize” means you are allowing a database table to accumulate redundant data. The best reason to denormalize a database is that it speeds up your software. If you embed all the records you want in one database table, then you can all the info you need with 1 query. It’s like doing a JOIN statement, but instead of doing the JOIN at the time ...

The effects of a variety of oxazolidinones, with different antibacterial potencies, including linezolid, on mitochondrial protein synthesis were determined in intact mitochondria isolated from rat heart and liver and rabbit heart and bone marrow. The results demonstrate that a general feature of the oxazolidinone class of antibiotics is the inhibition of mammalian mitochondrial protein synthesis. Inhibition was similar in mitochondria from all tissues studied. Further, oxazolidinones that were very potent as antibiotics were uniformly potent in inhibiting mitochondrial protein ...

Here, we propose a new strategy for the treatment of early cancerous lesions and advanced metastatic disease, via the selective targeting of cancer stem cells (CSCs), a.k.a., tumor-initiating cells (TICs). We searched for a global phenotypic characteristic that was highly conserved among cancer stem cells, across multiple tumor types, to provide a mutation-independent approach to cancer therapy. This would allow us to target cancer stem cells, effectively treating cancer as a single disease of “stemness”, independently of the tumor tissue ...

We all like simple tools. Complexity kills. It makes our work difficult and gives us much steeper learning curve. Programmers need to know how things work. Otherwise, they feel insecure. If we work with a complex system, then we have a big gap between “I am using it” and “I know how it works”. For example, code like this hides complexity:

var page = Framework.createPage({
‘type’: ‘home’,
‘visible’: true
});

Let’s say that this is a real framework. Behind the scenes, createPage generates a ...

I am astounded that the tech industry thinks this is a problem worth having. Do we really need any more evidence that HTTP and HTML and Javascript have failed and should be replaced with a new protocol?

Unfortunately, this is a generic problem with minifying code in JavaScript. Because JavaScript is untyped, it is easy to introduce errors in minification like this when variable names are counted on not changing. I personally think programming like this is an ...

Basically, dependency injection makes some (usually but not always valid) assumptions about the nature of your objects. If those are wrong, DI may not be the best solution:

First, most basically, DI assumes that tight coupling of object implementations is ALWAYS bad. This is the essence of the Dependency Inversion Principle: “a dependency should never be made upon a concretion; only upon an abstraction”.

This closes the dependent object to change based on a change to the concrete implementation; a class depending ...

If I had to give a single reason to use Clojure, it would be this: immutability is awesome. It protects you from yourself in ways that aren’t immediately obvious at first, but become more apparent over time.

The argument that follows is particularly catered to the world of web development, but remains applicable in other contexts as well.

In short: application state is a source of complexity, and unwarranted complexity is a developer’s worst enemy. This is true on the basic level ...

I had a long conversation today with a very smart engineer. We have different views about things such as types and immutable data. It occurred to me that, in some sense, we both want the same thing: some sort of integrity check for our systems. And yet, we prefer to put these constraints in different places. His preferences:

1.) the dependency injector loads things in an order that ensures correctness

Some imported code could be modifying methods on built-in classes. You can never be sure exactly what will happen when this Ruby code executes.

He’s right about that. “Readable” isn’t the word I’d use though: Ruby isn’t “reason-aboutable.” You can’t be completely sure what it’s going to do without running it. (No wonder Rubyists are such good testers.)

Tom agreed that Ruby could be good at expressing the intent of the programmer. This is a different goal from knowing exactly how it ...

I like this comment very much, as this is something that I remember struggling with:

The examples are fairly easy to follow. Many of the examples use `require` to alias dependent namespaces. I think this is key when presenting Clojure examples. Having to prefix calls to library functions causes them to stand out from uses of core Clojure functions. It also lets readers know from which library each function comes from. I would have liked to see all of the examples ...

I love Clojure. I love immutability. Why? Maybe I lack self-discipline, or maybe my co-workers lack self-discipline (not my current co-workers, who are very talented, but people I’ve worked with in the past). I am tired of dealing with mutable variables in loops, which allow us to many easy mistakes like this:

Stacker can only make things appear so fast. If actions still take 500ms to render, it’s not going to have that ultra snappy feel that Basecamp Next does. To get that sensation, your requests need to take less than 100ms. Once our caches are warm, many of our requests take less than 50ms and some even less than 20ms.

The only way we can get complex pages to take less than 50ms is to make liberal use of caching. We ...

There are two varieties of waiting: parking and blocking. Blocking is the kind of waiting you’re familiar with: a thread stops execution until a task is complete. Usually this happens when you’re performing some kind of I/O. This kind of waiting keeps the thread alive, doing no work, so that if you want your program to continue doing work you have to create a new thread. In the last chapter, you learned how to do this with future.

Although the functional language purists will have other criteria (functions as first class values (python is already fine on this count)) the functional programming ethos is what is of interest to me: the idea of describing data transformations and piping the data through these transformations. Thats the essential, practical take-home message of functional programming and reproducibility. In pursuing these goals, we see the incorporation of some great libraries for R that allow piping and laziness, facilitating the easy composition of ...

Good acceptance criteria (“INVEST” – especially valuable to users, testable)
Layered implementation:
Acceptance criteria (Given/When/Then) – as xUnit tests or with Concordion/FitNesse/…
Test implementation – it’s crucial that they use a (business) domain-specific language (DSL), no direct relation to UI/API, which would make it brittle
Application driver layer – translates the DSL to interactions with the API/UI, extracts and returns results
Take care to keep test implementation efficient and well factored, especially wrt. ...

Some development tools, such as lein-test-refresh, are useful to have across most of your Clojure projects. Rather nicely, Leiningen supports adding global profiles to ~/.lein/profiles.clj. These profiles are available in all your projects.

Well engineered non-trivial systems written in dynamic languages embrace runtime assertions especially near public interfaces. For example here’s a snippet of code from React.js that does exactly that:

There is, of course, one clear layer violation that NAT has to deal with, but that’s not NAT’s
fault either. Some application protocols put an IP address inside the application layer header.
These have to be modified by NAT, so a NAT has to understand the syntax of all of these layer violating applications that it supports. The original application that did this was FTP, going back to the very early ARPANET days. FTP did this because – remember, this was a ...

To start with, consider this quote from Martin Fowler writing about Rake:

This is a somewhat skewed story. I’m not trying to write a tutorial on Rake – I’m going to concentrate on things I find interesting rather than give a complete coverage. I’m not going to assume you know Ruby, Rake, or indeed any other build language. I’ll explain relevant bits of Ruby as I go along. Hopefully if you’ve done any messing with these, or are just interested in ...

Tesser.core looks a lot like the Clojure seq API, and many of its functions have similar names. Their semantics differ, however: Tesser folds do not preserve the order of inputs, and when executed, they run in parallel.

Applying a fold using tesser.core/tesser uses mutiple threads proportional to processor cores. Unlike reducers, we don’t use the Java forkjoin pool, just plain old threads. I’ve seen too many weird performance issues compared to regular threads.

Clojure comes with a set of qualities that shape how programmers can interact with the language and runtime environment. To a large part this is derived from the powerful yet simple ideas and concepts Clojure builds on. Properties such as homoiconicity (your code is nothing special, “just” data) enable several versatile features: Meta-programming based on code transformations (macros). Documentation and other meta-data that becomes part of the actual system. Structural editing and inspection because, well, code is just data!

Surely it is suspicious that this is being so often discussed among Javascripters? Doesn’t that suggest that Javascript is being pushed to do things that it can not do?

JavaScript Modularity Shaming:

Pete Hunt of React fame recently got into an online discussion about the pros and cons of Webpack vs. Browserify. In the discussion he inadvertently coins a hilarious term for a form of rhetoric in some circles of the JavaScript community – “Modularity Shaming”. React itself has been on ...

Dependency injection is a good idea a lot of the time. You don’t need a class to inject dependencies into, either. Every time you pass something to a free function as a parameter, instead of having the function call another function to get the information, you’re basically doing the same thing: inversion of control. Python also lets you treat modules similarly to classes in a lot of ways (certainly more ...

A canon of Python popular culture is “TIOOWTDI” (“there is only one way to do it”, a slighting, tongue-in-cheek reference to Perl’s “TIMTOWTDI”, which is an acronym for “there is more than one way to do it”).

Pyramid is, for better or worse, a “TIMTOWTDI” system. For example, it includes more than one way to resolve a URL to a view callable: via url dispatch or traversal. Multiple methods of configuration exist: imperative configuration, configuration decoration, and ZCML (optionally via ...

Instead of using Compojure, my simple API servers used the underlying route matcher utility, clout. This was partly because my application needed one or two simple routes and so the additional power and complexity of Compojure was unnecessary. By using clout directly, the surface area ...

Once upon time, there was a webshop portal with hundreds of partner webshops displayed on the front page. Potential users wanted to find out if their favorite webshops or a particular type of goods were available, existing users wanted to find a shop quickly. Therefore it was decided to implement search. But how to do that?

I find it remarkable that each computer language has such a strongly unique culture. I notice that in Python-land it is common to profile the heroes of Python-land. There is no other language community that does anything like this:

This week we welcome Dr. Margherita DI LEO as our PyDev of the Week. She is our first PyLady in this series! Let’s spend some time getting to know her!

fwrite, together with the rest of the C standard library, is implemented in glibc*, which is one of the core components of the Linux operating system.

fwrite is essentially a wrapper for the write library call.

write will load the system call ID (which is 1 for write) and arguments into the processor registers, and then cause the processor to switch to kernel level. The way this is done depends on the processor ...

The school principal is standing in front of fresh students, who need to go to their respective classrooms. Only the students don’t know which classroom yet. How can we get each student to their assigned classroom?

…When pushed too far, analogies break down. And we have pushed this one way too far. The reasons why it is better for the principal to just tell students where to go are rather specific:

The MetaData object contains all of the schema constructs we’ve associated with it. It supports a few methods of accessing these table objects, such as the sorted_tables accessor which returns a list of each Table object in order of foreign key dependency (that is, each table is preceded by all tables which it references):

Regarding the conversation on Hacker News, I strongly agree with “the entire stack is more less broken”. Back in 1989 Sir Tim Berners-Lee put a lot of careful thought into the design of a protocol for sharing documents using IP/TCP. However, when Ajax and Web 2.0 got going circa 2004, the emphasis was on offering software over TCP, and for that the HTTP protocol was poorly suited. Rather than carefully rethink the entire stack, and ideally come up with a ...

I spent some hours trying to convert a Sqlite database to Postgres, and in the end, I failed. Or rather, I decided that it was no longer worth the time. I thought this would cost me 30 minutes, but hours went by and I was unable to make progress. For those using Ruby On Rails there is a good article about how to do it. I was not using any framework. Some of the problems that I ran into: ...

There’s nothing inherently wrong with making tradeoffs like C++ did. And since C++ we’ve seen many instances of these sorts of tradeoffs in the software world. Scala is another recent example–a powerful functional language which makes compromises to retain easy interoperability with Java. What I want to deconstruct is the culture that has come along to rationalize these sorts tradeoffs without the need for serious justification. That is, we do not merely calculate in earnest to what extent tradeoffs are ...

All modern and advanced compilers convert source code through
various stages and representation into an internal data-flow
representation, usually a variant of SSA. The compiler backend
converts that back to an imperative representation, i.e. machine
code. That entails many complicated transforms e.g. register
allocation, instruction selection, instruction scheduling and so
on. Lots of heuristics are used to tame their NP-complete nature.
That implies missing some optimization opportunities, of course.

OTOH a modern CPU uses super-scalar and out-of-order execution. So
the first thing it has to do, is to perform ...

The stuff about quality is interesting. The rest is a misguided rant that gets all of its historical facts wrong. Unix fractured in the 90s? Good lord! It was fractured a long time before that.

One of Brooks’s many excellent points is that quality happens only if somebody has the responsibility for it, and that “somebody” can be no more than one single person—with an exception for a dynamic duo. I am surprised that Brooks does not cite Unix as ...

Wait, is that it? No CreateManagerWithExtraLargeName() method call? No manual credential sending? Well, no. requests was designed to be an HTTP high level API, supporting all HTTP methods, SSL encryption, proxies, redirection, caching, etc.

Now we’re almost there! But what use is that dictionary of routes if there’s no way to access the view functions inside of it? Lets add a method serve(path), which gives us the result of running a function for a given route if it exists or raises an exception if the route has not been registered yet.

You might notice that these three observations I’ve made all sound a bit negative. You might conclude that I think this is an antipattern to be avoided. If so, feel free to give yourself a pat on the back at this point.

But if this is an antipattern, is there a pattern to use instead? I think so. I’ll try to explain it.

The general idea behind the pattern I’m going to suggest comes in two parts. The first part is ...

When I use Base.metadata.create_all(engine) it correctly issues a CREATE TABLE with the schema name on the front like so “CREATE TABLE my_schema.roads (” but Postgresql rightly complains that the schema doesn’t exist.

Am I missing a step to get SqlAlchemy to issue the CREATE SCHEMA my_schema or do I have to call this ...

Turned out I was working against a mirror that was no longer being updated. I had read instructions telling me to set a particular URL for a mirror in my .zshrc file, but the mirror was out of date to whatever was downloaded was wrong.

In the example above, it’s disturbing that simple and intuitively harmless changes introduced such drastic errors. Experientially, it’s kind of like executing print 2 + 2 and seeing 5. What was it about that logging API that turned us into such bad programmers?

The specification of a typical callback-based API is simple: pass in any function and it will get called when the relevant event happens. Unfortunately, this simple specification doesn’t reflect reality. You can’t just call any function ...

When I wrote How ignorant am I, and how do I formally specify that in my code? I said:

For decades, computer programmers have argued with each other over the issue of strict data-type enforcement, versus dynamic data-type unenforcement. And after 16 years of computer programming, I have come down firmly in the middle: I like optional typing.

Clojure allows me to work dynamically, but to type hint when I want to, so I can get the performance benefits of type ...

I “write” a Call Option when I sell someone the right, but not the obligation, to buy in the future an agreed quantity of something at an price that is fixed now. So, for a payment now, I agree to sell you 10,000 chocolate santas[1] at 56 pence each, at any time up to 10th December. You’re prepared to pay the premium because you want to know that you’ll have santas in your stores at a price you can ...

I am very impressed with the new JSON features in Postgres 9.4. So can Postgres completely replace MongoDB? There are some grouping and aggregate functions that MongoDB has that Postgres does not have. More so, at the Mongo shell I have access to the entire Javascript language, whereas Postgres only gives me SQL plus some cool extensions. I recently found out about “WITH” statements in Postgres. From the point of view of SQL, this is the coolest thing ever. From ...

For starters, as you might expect from the difference in Ruby vs. Python cultures, SQLAlchemy is more explicit than ActiveRecord. SQLAlchemy has what is called a “declarative” mode where you define your class and your table all at once (within a class that inherits from SQLAlchemy’s declarative_base class). But you can also explicitly create, edit, and inspect an explicit metadata object which defines the table. Then you can define a Python class for your object – and then use SQLAlchemy’s ...

It is well known that Clojure has a culture best summarized as “Clojure developers prefer to assemble their own stack from small, composable libraries.”

I have been working with Python lately. I am surprised by that it also has a culture of using small libraries. There have been 2 attempts at monolithic frameworks in Python: Zope and Django (maybe Pylons, though it is done as separate libraries, sort of like Symfony2 in PHP). But for the most part, Python goes for ...

Each new design and technology choice never completely replaced the one that went before. The application has archaeological layers revealing it’s history and the different technological fashions taken up successively by Laurence, Bruce, Ina and Gordy. If you look along the Version 4 line, you can see that there are four different ways of doing the same thing scattered throughout the code base.

Each successive lead developer acted in good faith. They genuinely wanted to improve the application ...

As much as I would like it to be ‘good enough’, Postgres’ full text search lacks the feature set to be a reasonable solution to most search use cases.
Background: I wrote a product search engine for a company called iTrackr using Postgres full text search, and later wrote the product search for milo.com using Solr. I also designed a simple (but very effective) algorithm to boost search rankings based on historical user click data, by generalizing click data ...

I’ve looked into it a bit deeper and it does seem that it’s MySQL causing these heavy pulsing writes. When a table has an entry added or updated, does it have to re-write the entire table to disk or could it append/modify existing data? We are using MyISAM tables. We are also using SELECT queries with ORDER BY and TEXT fields, which of course require ...

This article is called “Java For Everything” and it makes a good case for re-using the same language over and over again, but it does not make any case for Java.

This makes clear of using the language that you know best:

And finally, I went to write a simple program that put up a web interface. I considered using Python, but this would have required me to figure out how to serve pages from its library. I had already ...

After a long time of maintaining my own configuration I took the decision a few years ago to outsource it to people who really care about this stuff. I started with the Emacs Prelude (http://batsov.com/prelude/) which introduced me to some great tools. I recently switched to Vim bindings (evil-mode) and a week ago switched to Spacemacs (https://github.com/syl20bnr/spacemacs) which integrates better with evil-mode . So far I’m really liking the Spacemacs approach.
tl;dr: Just use one of the ...

I am not clear why this is better than running a VM but this is an interesting attempt to fix the problem of setting up complex systems on machine:

nixd is an automation framework to build your application environment for development and production. It sits between build tools and configuration management engines, and lets you write simple shell scripts with hooks that will reliably get you from pristine source to running code in one command, and make every attempt to ...

I think what he is suggesting is more interesting: a single, unified way of speaking to all protocols (MySql, MongoDB, Redis, Kafka, etc). When he says “protocol” I think he means “byte format”. He points out that each app generally has its own method of ...

Personally, I am pleased to see Slingshot improve this, as it is has long been a source of confusion. Paul Stadig writes a long comment that is critical of this change, but I disagree with his assumptions, especially here:

“It is confusing to have a class selector that selects against the wrapped object instead of the wrapper.” In other words (catch RuntimeException e …) selects against the wrapper object that is thrown whereas (catch Object o …) selects against ...

This seems to be a universal pattern, where an open source project has both a Github account and a Google Groups mailist, but is the mailist really needed? Why not just use the tools offered by Github (issues, the wiki, etc). I like that Monger introduced a Feature Request label on Github:

Continuing reading the manual page, the very first note under the NOTES section is this:

The effects of signal() in a multithreaded process are unspecified.

This is called Unspecified Behavior. What it means is that standard does not say anything as for how the function should behave in a multi-threaded environment. Therefore, it may exhibit a different behavior on different systems including different versions of the same system, at discretion of ...

This post on Github sums it up very well. For almost every situation where, in an object oriented language, I would reach for interfaces and classes, in Clojure I tend to just use multi-methods.

The key issue is polymorphism. All of us want to work in a language that gives us powerful forms of polymorphism. All of the major languages offer us some types of polymorphism, but let us ask, which gives us the most powerful and flexible forms? ...

Interesting debate. So where should Flask enforce safety for the handling of JSON?

dghubble commented 18 hours ago

My understanding is that the previous behavior (always converting the args to a dict) was sufficient to always prevent a top level json list, but blocked the legitimate use case of jsonify’ing an object for which one has written a custom JSONEncoder. This PR seems to enable that ability, while still protecting against top level json lists.

It is interesting to note that this article about decorators in Python does not use the “word” closure, even though that would be the obvious way of talking about these, were we discussing a language like Javascript, where discussion of closures has been central to the culture since Doug Crockford first discussed them back in 2001.

Only in the comments does someone ask about closures:

So, decorators are an application of closures, i.e. closures applied to functions? Could you explain the ...

I like Python more than PHP, but the mutable parts of Python are as ugly as PHP. This function is an exampe:

def transform_words(content, targets, transform):
"""Return a string based on *content* but with each occurrence
of words in *targets* replaced with
the result of applying *transform* to it."""
result = ''
for word in content.split():
if word ...

Python started off as a clean procedural language, with some immutable objects that would have allowed it to evolve into a beautiful functional language, but instead, with version 3, it veered in the direction of classic object oriented programming. I disappointed by this and so I have some interest in the various disappointments expressed by others:

By far my biggest problem with the language is the stupid slot system. I do not mean the __slots__ but the internal type slots for ...

This is a good overview of the file watchers in Clojure. I had no idea there were so many:

Typically file watchers are implemented using either one of two patterns:

verb based – (add-watch directory callback options)

noun based – (start (watcher callback options))

The difference is very subtle and really centers around the verb start. If the verb start does not exist, we can treat the file-watch as an action on the file object. However if it does exist, we can treat ...

I need to build some dashboards for a business. I am impressed with Riak but I would have to find some way to build the dashboard. In theory, the ELK stack gives an almost instant dashboard. I am not at all interested in Logstash, but the rest of this sounds interesting:

We’ve built a data analysis and dashboarding infrastructure for one of our clients over the past few weeks. They collect about 10 million data points a day. Yes, that’s ...

A very clever trick from Unicorn, which can probably be used everywhere:

And then there’s the ready_pipe Unicorn uses, which is actually quite an amazing trick. See, if you want to daemonize a process under Unix, you need to call fork(2) two times (and do some other things) so the process is completely detached from the controlling terminal and the shell thinks is the process is done and gives you a new prompt.

If all you were doing was renaming a single file, or changing access permissions on all files in a directory, you’d hardly need a flexible shell, as dired or even Finder is sufficient for those tasks. A shell comes in handy when selecting a subset of files based on a pattern, and EShell really shines here, because of its filters.

The Tracy-Widom distribution is an asymmetrical statistical bump, steeper on the left side than the right. Suitably scaled, its summit sits at a telltale value: √2N, the square root of twice the number of variables in the systems that give rise to it and the exact transition point between stability and instability that May calculated for his model ecosystem.

The transition point corresponded to a property of his matrix model called the “largest eigenvalue”: the greatest in a series of ...

sysctl is similar ulimit: It allows to configure kernel parameters at runtime. If you wish to keep settings persistent across reboots you should edit /etc/sysctl.conf – be aware that wrong settings may break things in unforeseen ways.

A lot of the existing CLI making libraries delegate to OptionParser for actually parsing the option string, while OptionParser is nice it doesn’t allow things like specifying the same option multiple times (e.g. like CURL -H parameter) which I like and use quite often. Trollop handles this case nicely, so a Trollop-based CLI tool is superior.

Also a lot of the other CLI libraries in an attempt to be extra terse and DRY make their syntax a little ...

Part of the Ruby philosophy is to rely on Unix as much as possible. That is, in theory, what makes Unicorn so great. Here is an example of how simple it can be to build a server:

At the heart of everything that has to do with networking under Unix are sockets. You want to read a website? You need to open a socket first. Send something to the logserver? Open a socket. Wait for incoming connections? Open a socket. ...

Similar to TCP and UDP, SCTP provides some features of both. It is message-oriented, and provides a reliable sequenced delivery of messages. SCTP supports multi-homing, i.e., multiple IPs on both sides of the connection. So it is called an association instead of a connection, as a connection involves communication between two IPs, while an association refers to communication between two systems that may have multiple IPs.

A pure key/value store is completely agnostic toward the data stored within it. Any key can be associated with values of any conceivable type, from short strings to large JSON objects to video files. Riak began as a pure key/value store, but over time it has become more and more aware of the data stored in it through features like secondary indexes and Search.

Like dotted version vectors, vector clocks are a means of tracking a events in distributed systems. Unlike normal clocks, vector clocks have no sense of chronological time, i.e. they don’t care if something happened at 6 pm today or back in 1972. They care only about sequences of events. More specifically, they keep track of who—i.e. which actor in the system—has modified an object and how many times they’ve done so.

What is Riak good for? I get that we developers often denormalize a database to gain speed. I am not sure I totally get this, but I think this talk from developers at Yammer is about denormalizing data to a standard format, so that you can also get a simplicity and speed when you display it. In this graph they have “notifications” on the left, and then they start dividing it by status and by specific properties, which is strange, ...

When you have to do self-joins, but you don’t know how many to do, to build a hierarchical tree out of data in the database:

In this approach each record stores the whole path to the root. In our previous example, lets assume that KING is a root node. Then, the record with ename = ‘SCOTT’ is connected to the root via the path SCOTT->JONES->KING. Modern databases allow representing a list of nodes as a single value, but since materialized path ...

I note this mostly in surprise, as I realize how many efforts there are now ongoing to modernize health systems all over the world:

Kenya was the first country in Sub-Saharan Africa to deploy a completely online national HIS in September 2011. All districts and selected health facilities are connecting to the DHIS 2 national server using Mobile Internet (dongles/usb modems) on their computers. Kenya allows self-registration of personal user accounts.

I said this before, but it is an interesting trend: the last 20 years has seen the growth of a great many data silos in every industry, both governmental and private-sector, and now there seems to be great value in seeking integration. I noticed this during the summer, when I was working at LaunchOpen: they were integrating private sector databases such as Moodle and Blackboard, with those databases maintained by the Department Of Education. Now I notice the same thing ...

Since we don’t know the number of levels between the two, we can’t tell how many times to selfjoin emp, so that the task can’t be solved in traditional SQL.

Which is from here:

Relational databases are universally conceived of as an advance over their predecessors network and hierarchical models. Superior in every querying respect, they turned out to be surprisingly incomplete when modeling transitive dependencies. Almost every couple of months a question about how to ...

Interesting idea, though strange that this has not caught on decades ago:

Today’s computers don’t have enough contextual knowledge to make me a sandwich but there are lots of domains where this approach excels. The classic example is SQL databases. Rather than specifying exact data-structures and operations, the user specifies a high-level schema and sends descriptions of queries. It is the responsibility of the database to choose storage types, manage concurrent changes and generate query plans. It makes these decisions based ...

I already linked to this, but it really is interesting. I don’t think this is possible in Ruby or PHP or script languages in general, but you can do crazy things in Python:

Above we did an in-place modification of a value in a numpy array. This is easy, because a numpy array is simply a data buffer. But might we be able to do the same thing for a list? This gets a bit more tricky, because lists store ...

Python has a GIL, right? Not quite – PyPy STM is a python implementation without a GIL, so it can scale CPU-bound work to several cores. PyPy STM is developed by Armin Rigo and Remi Meier, and supported by community donations. You can read more about it in the docs.

Although PyPy STM is still a work in progress, in many cases it can already run CPU-bound code faster than regular PyPy, when using multiple cores. Here we will see how ...

At first, we used the Hadoop S3 client, which we had used in some lightweight use cases before. Unfortunately, it ended up coping poorly. Each server had a sustained throughput of about 10 megabytes of compressed data per second, and every so often S3 would hiccup and stop accepting data for a few minutes. When this happened, Hadoop’s client would simply buffer the data in-memory until all the memory was exhausted, at which point the process ...

A related question is: why is Perl so fast?
Quite a few years ago I wrote a little Runge-Kutta solver in Perl for some simulation work. It seemed like a good idea at the time. The equations of motion had to be integrated over a very long time, and it could take hours for a single run (still much faster than the Monte Carlo it was being used to do a sanity-check on). I re-wrote everything in C++, and picked up ...

No. You do not need to learn how to program a computer. The question is stupid. And yet the debate goes on, endlessly. I recall this debate was going strong when I was a child. Here is the New York Times in 1984:

”SHOULD I learn to program?” and ”Do I have to learn to program?” are two variants of the question probably most asked by people testing the waters of computer ownership. The answer usually boils down to an ...

I am thinking of creating a new protocol on top of TCP. I’ve been thinking that, with all the good libraries out there, I would not have to do much work. But then I read this, and it gives me pause: maybe TCP is tougher than I thought:

Zero windows are another frequent source of grief, to such lengths that at multiple mobile operators the technical staff have quizzed us extensively on our use of zero windows. I don’t quite ...

Sophia Shao: As a recent graduate of Carnegie Mellon University’s Electrical & Computer Engineering department, Sophia is currently tackling a massive application migration from MRI to Rubinius. She’s also been improving Rubinius every day. Hit her up for tips about debugging machine code.

Jesse Cooke: As co-founder of Watsi, a venture to fund healthcare for people around the world, Jesse was part of YCombinator’s first ever non-profit. Jesse has been contributing in any way he ...

Back in 1958 Lisp invented the idea of an everything-is-mutable language. Therefore, Lisp is not necessarily functional, since a mutable language is typically not functional. (Although it is possible to adopt a functional style in a mutable language, such as Javascript.) A functional language should be one where, given a set of inputs, one always gets the same output, in a deterministic fashion.

A record (aka “struct” in C) is a pre-defined collection of values where each is accessed by a unique name. Depending on the nature of the data, records may be a superior alternative to dictionaries and instances of custom classes.

PyRecord allows you to use records in Python v2.7 to v3.x and PyPy v2, and can be thought of as an improved namedtuple.

In Python terms, a record is an instance of any class for which you define some attributes but no ...

The idea was to have a single client for the connection to the Twitter Streaming API and the persistence of the received Tweets in ElasticSearch, plus multiple machines to serve WebSocket connections to the client. For the communication between the processes, I picked Redis Pub/Sub because its model of communication appears to suit the requirements really well. As cute as the drawing may be, I prefer code (plus drawing), so I took the previous monolith ...

This next step may or may not live in the same JVM – I haven’t decided yet. So the idea is to aggregate data on the server side and only deliver the aggregated data structures back to the client side. For example, this could be a few hundred aggregates over increments of five minutes each. These increments can easily be made addressable (and cacheable): let’s say it is 1:17pm. Then, we have a last and incomplete increment from 1:15pm ...

What comes to mind immediately when regurgitating the requirements above is Storm and the Lambda Architecture. First I thought, great, such a search could be realized as a bolt in Storm. But then I realized, and please correct me if I’m wrong, that topologies are fixed once they are running. This limits the flexibility to add and tear down additional live searches. I am afraid that keeping a few stand-by bolts to assign to queries dynamically would not ...

The scope of a variable is the part of the program where the variable can be legally referenced. If your system has variables, it has some concept of scoping.

Angular has a DSL that is entangled with the HTML and used primarily to express the data-bindings between the UI and application code. This has variables, and thus a concept of scopes. Let’s take a look at it. Consider for example ng-model:

I’ve been using bash for about 14 years, first on Linux, and the later on Mac OSX. I have heard good things about zsh. The idea of seeing my git branch listed in my terminal, at all times, will save me from many mistakes (I have often committed code on the wrong branch). This article finally convinced me to switch to zsh on my Mac:

I only just discovered logcheck, but now I want to use it on all of my servers:

How Logcheck Protects Your Server
It turns out that Logcheck is a pretty simple tool. All it does is periodically check the log files you specify. It filters out the uninteresting parts and emails you what is left. It is smart enough to avoid mailing you the same information multiple times by keeping a “bookmark” for each log file. This way it can only ...

Scroll half-way down through this conversation among Storm committers, and you learn interesting things about the trade-offs between CPU and network bandwidth:

@Gvain,

There are two parts in your question,
In your test, why throughput drops when worker number increase after reaching a value(8 in your test case)?

For this one, it is because your CPU reach limit for worker# = 8 (CPU usage: 89%), In this case, adding more workers will just adding more threads and context switch, hurting performance. While for ...

I use asserts a great deal in Clojure. They partly take the place of unit tests. Apparently they are mostly unused in the world of Python, although some of the reasons listed here would be general to any language:

Several reasons come to mind…

It is not a primary function

Many programmers, lets not get bogged down by the rationale, disrespect anything which is not a direct participant in the program’s penultimate functionality. The assert statement is intended for debugging and testing, ...

Second, it was clear that reliable data loads would require deep support from the data pipeline. If we captured all the structure we needed, we could make Hadoop data loads fully automatic, so that no manual effort was expanded adding new data sources or handling schema changes—data would just magically appear in HDFS and Hive tables would automatically be generated for new data sources with the appropriate columns.

I’ve been trying to figure out how much I need to do manually when working with Apache Storm. This part seems important:

What is Storm’s reliability API?

There’s two things you have to do as a user to benefit from Storm’s reliability capabilities. First, you need to tell Storm whenever you’re creating a new link in the tree of tuples. Second, you need to tell Storm when you have finished processing an individual tuple. By doing both these things, Storm can detect ...

After many years programming in Ruby, PHP, Clojure, etc, I am only now getting into Python. One thing that strikes me is the extent to which each eco-system emphasizes different things. In theory, all of these languages are Turing-complete, and so you could do anything in any of these languages, but the reality is different: each community regards some issues as important, and other issues as not important, and so you end with tooling for different tasks, in each of ...

By controlling every detail of the project, I could ensure the project remained at a very high quality. Since I knew the project from top to bottom, I could anticipate all the ways any given change would affect the project as a whole. And since I had a vision of where the project should go, I could prevent any changes from going in that conflicted with that vision (or modify them to be consistent). I could ensure the project always ...

Andrew Montalenti has a long post voicing his view of data-type enforcement in Python. He seems to lean against strictness (I will quote him at length below). I am mostly ignorant about Python and I would not want to match my knowledge of Python against his, but I have seen this debate occur in other languages, so I’m going to write about my own experience adding types to dynamic languages.

Once upon a time, not that long ago, there was a clear division between “programmers” and “sysadmins”. Programmers wrote software and sysadmins made sure all the machines were running. But, as Marc Andreessen said, “software is eating the world.” Sysadmin work has become increasingly automated, and therefore sysadmins (at least the good ones) are increasingly forced to become programmers (or they become irrelevant). The job designation “devops” was invented to refer to the new kind of sysadmin, who has to ...

A detailed look at Java memory management in Minecraft 1.8 blames the performance problems on so called “best practices”:

Minecraft 1.8 has so many performance problems that I just don’t know where to start with.

Maybe the biggest and the ugliest problem is the memory allocation. Currently the game allocates (and throws away immediately) 50 MB/sec when standing still and up to 200 MB/sec when moving. That is just crazy.

Michael Jordan: I wouldn’t want to put labels on people and say that all computer scientists work one way, or all neuroscientists work another way. But it’s true that with neuroscience, it’s going to require decades or even hundreds of years to understand the deep principles. There is progress at the very lowest levels of neuroscience. But for issues of higher cognition—how we perceive, how we remember, how we act—we have no idea how neurons are storing information, how they ...

Why do I equate it with religion? Because religion allows you to do anything, and always be right. Need to feed the hungry? Sure. Need to NOT feed the hungry? Sure. Support gays? Sure. Not support gays? Sure. Invade Jerusalem? Sure. Defend against invaders? Sure. Forgive people? Sure. Not forgive people? Sure.

This has always been my observation with “frameworks”, “patterns”, “best practices” and especially, “testing”. You can write a few hundred tests that do nothing, ...

Kdb+ is a testament to the rewards available from finding the right abstractions. K programs routinely outperform hand-coded C. This is of course, impossible, as The Hitchhiker’s Guide to the Galaxy likes to say. K programs are interpreted into C. For every K program there is a C program with exactly the same performance. So how do K programs beat hand-coded C? As Whitney explained at the Royal Society in 2004, ...

Since computer programming is based on math, you would think that one could conceptualize a program just as one might conceptualize a math proof, working out everything in advance. But in fact, trial and error are necessary:

Any experienced engineer who tackles even a moderately complex coding problem and decides beforehand to think through that problem with a machine checked specification (say with Lamports TLA) will very likely discover that

Managing Cabal dependency hell. Most of our application development is in Haskell, and we’ve found we prefer specifying a Docker image than working with Cabal sandboxes. This is equally a gain on other programming platforms. You can replace virtualenv for Python and rvm for Ruby with Docker containers.

I agree that the use of Docker is being driven by the use of languages like Python and Ruby, but maybe the existence of Docker suggests ...

Axilmar’s Blog has a very strange post. I can not know if English is their native language, and I am sympathetic that some ideas get lost in translation. Still, they seem to have misread most of the article. On Hacker News they were asked how they extracted points from the article, and they wrote:

I just read it, skipping the non-essential parts, after quickly scanning them. I might have missed one or two points, but it doesn’t really matter.

Person A is thus protected from the harmful effects of new information. New information is dangerous, as it might cause someone to change their mind. New information can be rendered safe simply by declaring it to be invalid. Person A believes ...

Once I figured out this algorithm, I knew I was onto something big. It massively simplified the design of the system by avoiding all the aforementioned problems, along with making things way more performant. (Amusingly, the day I figured out the algorithm I had a date with a girl I’d met recently. But I was so excited by what I’d just discovered that I was completely distracted the whole time. Needless to say, I did not do well ...

9. The whole language always available. There is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, read or run code while compiling, and read or compile code at runtime.

Every function in Haskell officially only takes one parameter. So how is it possible that we defined and used several functions that take more than one parameter so far? Well, it’s a clever trick! All the functions that accepted several parameters so far have been curried functions. What does that mean? You’ll understand it best on an example. Let’s take our good friend, the max function. It looks like it takes ...

We’ve been using RabbitMQ for messaging for a long time. Some messages are purely reactive: An object was changed, so some other subscribing application needs to react by updating its data structures to reflect the change. This is an event.
Other messages represent jobs. Jobs are tasks that are queued up for processing. Processing photos, for example, is a classic job.
Jobs don’t fall that well into the RabbitMQ/AMQP framework because it’s designed for messaging and is, despite support for things ...

” We do not control the environment executing our JavaScript code, interpreting our HTML, or applying our CSS. Our users control the device (and, thereby, its processor speed, RAM, etc.). Our users choose the operating system. Our users pick the browser and which version they use.”

The original idea of a “browser” was something that was as agnostic as possible about its environment, but somehow managed to deliver a nearly universal experience. The traditional idea of a “browser” does not ...

After being quite puzzled for a while as to why this was happening finally I found the answer in Java 7 api docs for Process.

Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, or even deadlock.

I used Clojure to build a RESTful API. I was successful in so far as that went, but now I face the issue that every once in a while, the program pauses, for a painfully long time — sometimes 30 seconds, which causes some requests to the API to timeout. We are still in testing, so there is no real load on the app, just the frontenders, writing Javascript and making Ajax calls to the service.

We’re going to use Stuart Sierra’s excellent component project to manage the lifecycle of our service which, for the moment, will simply store a random number on initialisation and serve that back in response to any request. Getting Jetty to start on a random, operating system assigned, port is simply a matter of passing zero as the desired port number. If we then communicate this port number in some way ...

I thought I linked to this before but now I can not find evidence of the earlier link:

The State Machines of core.async

It seems this idea has been around for decades but only during the last 2 years did the idea go mainstream. Python and Clojure and Javascript have all added libraries that allow async programming. All of these libraries use state machines to hide the reality of “callback hell”.

The reduce function is the base transformation; any other transformation can be expressed in terms of it (map, filter, etc).

All of the programming languages seem to be adding all of the same features. Over the last 2 years, suddenly people woke up and realized they could escape “callback hell” by using finite state machines to enable a pleasant API for async programming, core.async being a good Clojure example.

What are the alternatives? One — which took over much of macro — is to do intertemporal equilibrium all the way, with consumers making lifetime consumption plans, prices set with the future rationally expected, and so on. That’s DSGE — and I think Glasner and I agree that this hasn’t worked out too well. In fact, economists who never learned temporary-equiibrium-style modeling have had a strong tendency to reinvent pre-Keynesian fallacies (cough-Say’s ...

This is a great summary of all of the arguments against Object Oriented Programming:

Equality

Let’s look at intensional equality as provided by object identity. Apparently this is not what we want at all times, otherwise we wouldn’t see this pattern called ValueObject 3. A type like Javas String is a well-known example of a successful ValueObject implementation. The price for this freedom of choice is a rule that the == operator is almost useless and we must use equals because ...

JavaScript makes inheritance a pain in the ass to implement, so why is it so popular among frameworks? Part of the problem is that JavaScript has always looked like a flimsy lightweight scripting language next to Java and its strongly typed kin; keen to prove that they are using a real language for big people, JavaScript developers have rushed to adopt an OO feature that was never very good in the first place. Strongly ...

All of the pain caused by inheritance can be traced back to the fact that inheritance forces ‘is-a’ rather than ‘has-a’ relationships. If class R2Unit extends Droid, then a R2Unit is-a Droid. If class Jedi contains an instance variable of type Lightsabre, then a Jedi has-a Lightsabre.

The other kind of inheritance

By the way, my gripe is with concrete inheritance – one class deriving from another and inheriting behavior from the parent class. I have no problem with interface inheritance, where ...

I am curious why such a famous text editor is in such terrible shape, and so far behind industry best practices when it comes to stuff like package management. This seems like a good argument:

Code from the Dark Age of Emacs is kept in blog posts, hosted on EmacsWiki, stuck in some obscure directory on university domains, lost to the ether that is personal websites with expired hosting… Tracking down updated versions is nigh impossible, because they’re often ...

Giving a precise answer involves examining the complete Java program – depending on the context in which this snippet executes, the transformed snippet may or may not be equivalent to the original. For example, if there are no writes to volatileF (and so regV is always 0 and so is regNV) in the Java program then the transform is trivially safe. However, it is more interesting to be able to make local judgments when JIT compiling a single method. Specifically, ...

I have become interested in the Shen language. While reading the “history” page, I notice that illness and death play a large role, and also rejection of new ideas by audiences which misunderstand the speaker:

The appearance of Qi was swiftly followed by a serious illness that laid me up for 2006 and most of 2007. Following a partial recovery in 2008, a factorising version of the Qi compiler was introduced which made Qi competitive with the fastest hand-compiled Lisp ...

I am thinking this might be a new business model for me to work toward:

As a reader, I seek an algorithm which weeds out some repetition. For instance I sometimes see a Vox.com article in my feed from three different sources — it would suffice to see it once, along with a color shading indicating that some other people in my feed were tweeting the same thing. I also would like blocks on tweets about the ...

I have never played the Sims game. I did play Sim City back in the 1990s. I was first introduced to the game in 1994 and lost a weekend discovering all I could about it. In my life I have probably played the game 100 times?

The Sims has a strong culture around it, which is something that only a handful of games have achieved. This whole bit was funny and interesting:

Last night I was a table full of programmers and devops. One of the devops said “I’ve been thinking that I’d like to convert to programming.” Another devops said “You will be bored.” Everyone nodded in agreement. I was surprised by this. Is this some known conventional wisdom? I get the adrenaline rush of having to fix the servers when they have crashed and you are offline and the siren is going, but is that more interesting, over the long ...

For decades, computer programmers have argued with each other over the issue of strict data-type enforcement, versus dynamic data-type unenforcement. And after 16 years of computer programming, I have come down firmly in the middle: I like optional typing.

In computer programming, the static type advocates wear a perpetual sneer, claiming that many problems in programming would be solved if only we adopted their approach. And yet, many languages are statically typed, and software written with those languages continue to ...

I really wish I understood this article. I need to commit to spending some serious time studying statistics, so I can catch up with the modern boom in data analysis. Because 90% of this article is over my head. But from what I can glean, it is very informative:

You’ll noticed that I glossed over something here: the prior, P(Ftrue). The prior allows inclusion of other information into the computation, which becomes very useful in cases where multiple measurement strategies are ...

One of the parts of the announcement of transducers was that clojure’s core functions (map, filter, take, etc) that normally operate on sequences will gain a new arity that returns a transducer when called with a single argument that’s a function. The new code for the 1-arity map looks much like what we already wrote (ignore the other arities for now).

The average of effort estimates from different sources is likely to be more accurate than most individual effort estimates. A key assumption for accuracy improvement is that the estimates are independent, which is true if their sources differ in expertise, background, and estimation process. A Delphi-like estimation process, such as “Planning Poker,” where software developers show their independently derived estimates (their “poker” cards) at the same time, seems to be particularly useful in ...

ribol provides a conditional restart system. It can be thought of as an issue resolution system or try++/catch++. We use the term issues to differentiate them from exceptions. The difference is purely semantic: issues are managed whilst exceptions are caught. They all refer to abnormal program flow.

Restart systems are somewhat analogous to a management structure. A low level function will do work until it encounter an ...

This is often the first way developers think to share data across an application: simply throw it in a def in a namespace and allow any function that needs it to reference it from there.

….It has the advantage of being simple to implement. The disadvantages are numerous and Dependency Injection was originally developed to overcome the shortcoming of globally shared data. Among other things, putting the context in a globally shared data structure will ...

Why are there so many goddamn package managers? They sprawl across both operating systems (apt, yum, pacman, Homebrew) as well as for programming languages (Bundler, Cabal, Composer, CPAN, CRAN, CTAN, EasyInstall, Go Get, Maven, npm, NuGet, OPAM, PEAR, pip, RubyGems, etc etc etc). “It is a truth universally acknowledged that a programming language must be in want of a package manager.” What is the fatal attraction of package management that makes programming language after programming language jump off this cliff? ...

“They [the statistical profession] lost the PR war because they never fought it.”

I assume this is a USA development. In Europe the computer departments have tended to be outgrowths of the math departments.

Recently a number of new terms have arisen, such as data science, Big Data, and analytics, and the popularity of the term machine learning has grown rapidly. To many of us, though, this is just “old wine in new ...

The situation with packages and dependency hell today is horrendous, particularly if you work in a highly dynamic environment like web development.
I want to illustrate this with a detailed example of something I did just the other day, when I set up the structure for a new single page web application. Bear with me, this is leading up to the point at the end of this post.
To build the front-end, I wanted ...

The last point is huge: I can use Nix to manage my software on both my Linux and OS X machines! I’ll explain how I do that in a future post.

The whole thing sounds interesting:

The main differentiator of NixOS is its package manager, Nix, which stores packages in isolation on a read-only file system. It then makes them available to you by adjusting your environment variables (e.g. your PATH). This way, it can achieve ...

Check out this screenshot. Do you see where it says “Build/Failing”? The red icon? This simply does not happen with other open source projects that I use. No other community thinks it is normal to push broken code to master. What is wrong with Emacs packages? Is their an attitude that we hackers should be such amazing hackers that we can fix the broken code in every project that we use?

This does a lot to explain the difference between folks drawn to PHP and folks drawn to Lisp. Do you want a utility language that allows you to get basic work done, or do you want a language that you can understand? I wrote PHP for years, but in the end, I was frustrated by much of the magic in it, especially in the PHP object oriented stuff. I like Clojure because I can understand the underpinnings of the language ...

Representational Value Transfer (REVAT)
What we need is a RESTful way to disambiguate state and value, so that we can reason about resource URLs. I propose that we use use existing REST semantics for indicating state and adopt a new conventional standard for indicating values:

GET http://api.example.com/values/5690ba7f-f308-4c32-b67c-56f654bbfd83

I said above that Lisp flat­tery is easy to find. The prob­lem with Lisp flat­tery is that it makes sense only to ex­pe­ri­enced Lisp pro­gram­mers. To oth­ers—es­pe­cially those who are try­ing to de­cide whether to learn and use a Lisp—it just comes across as un­sub­stan­ti­ated hoodoo.

For ex­am­ple, in his es­say How to Be­come a Hacker, Eric Ray­mond says “Lisp is worth learn­ing for … the pro­found en­light­en­ment ex­pe­ri­ence you will have when you fi­nally get it. That ex­pe­ri­ence will ...

“There is an important asymmetry between an architecture of small apps and an architecture of The Monolithic CMS. If you have small apps, and decide you want to move to a monolithic CMS, then you must do The Big Rewrite: the exhausting effort of reproducing all of your funtionality so that it is handled by your one, all-consuming CMS. But when you move from the monolithic CMS to an ...

REST is a vast improvement over complex things like SOAP and CORBA, but I think we still have a way to go before we’ve reached simple. REST is an acronym for REpresentational State Transfer, and I think the “state” part of that acronym gives rise to a lot of incidental complexity as systems grow.

You can think of state as a combination of value and time, and in the RESTful case, the time dimension is almost always “now”. The trouble ...

ACME Co. buys, sells, and processes things. Unfortunately, their circa-2003 web interface is not a shining example of UI/UX design. Befuddled by all the modal screens, managers regularly put bad data into the system.

In fact, manager Steve just accidentally created an inventory record showing that ACME now has 999 Tribbles. This is ridiculous, since everyone knows that the CEO refuses to deal in Tribbles, citing “a bad experience”. In a rather excited voice, ...

OpenSIS tells me that a password is “invalid” because another user is already using it. This is in the admin view, so I guess the assumption is that the admin can know if a password is being used more than once, but this still strikes me a security violation. See the bottom of the screenshot:

Blog Bio The Technician No Imperfections Noted The Jeff and Casey Show Jeff and Casey TimeCasey Muratori
Seattle, WA The Worst API Ever Made A call-by-call look at context switch logging with the Event Tracing for Windows API.This article is part of a series where a new short-form tech article is posted every Wednesday. You can always check the contents page for the latest installment, or follow me on Twitter for updates. You can also RSS ...

Somewhat off-topic, but it is amazing to think about the complexity of the server setup that is implied by this:

First, let me start by explaining why we decided to port away from Puppet: We had a complex puppet code base that has around 10,000 lines of actual Puppet code. This code was originally spaghetti-code oriented and in the past year or so was being converted to a new pattern that used Hiera and Puppet modules split up into services ...

Interesting to note that the beautifully elegant core.async is secretly the same as the “callback hell” of Javascript — except that core.async automates it all for you, which is a huge difference.

core.async is a Clojure library implementing communication sequential processes, an approach that allows code to be structured as producers and consumers of messages passed through channels. CSPs are an approach to dealing with concurrent activity in a program, and exists as a strong alternative to the kind of ...

I’ve been on both sides of this debate, but mostly I write SQL, mostly because the limits of ORMs tend to be immediate and stifling.

ORMs map nicely when you are indeed modifying objects, but somethings don’t map well that way. So don’t map them that way! What we need is a low level abstraction layer alongside the ORM.
The main problem with raw SQL is that what you really want is a genuine programming language. You almost want programmatic access to ...

I’ve only recently discovered multimethods, but now I’ve come round to the idea that one should never use (cond) in Clojure. Rather, any time you have a complicated nexted (ifs) or a big (cond) it should all be replaced by multimethods:

A Clojure multimethods is a combination of a dispatch function and one or more methods, each defining its own dispatch value. The dispatching function is called first, and returns a dispatch value. This value is then matched to the correct ...

If you want concurrency, then use a language that was designed from the beginning to support concurrency. PHP will never be that language. I’ve said this before, and jerf on Hacker News also says it well:

Adding pervasive threading is a different story. Adding threading to a mutable-state dynamic scripting language has a long and sordid history… even when it is nominally successful (as in Python) it is still not very useful, and at times it has been simply a failure ...

It’s an interesting idea, a sort of uberjar idea, in the sense that you bundle all dependencies as one app. You can bundle up all the pieces of a web app and make it a desktop app by including the webserver. Indeed, I do exactly that every time I run “lein uberjar” on one of my Clojure apps (when I embed the Jetty server with my app):

Node is a lightweight JavaScript runtime based on the Google Chrome V8 engine. ...

Assume that your favorite color is red. Now imagine a balloon that is your favorite color. Paint a canvas the same color as the balloon.
As English goes, that’s a fairly clear program with a fairly well-defined result. When I follow those instructions, at least, I will always produce a red canvas (assuming that I have a canvas and some red paint, but a potential lack of art supplies is not the ...

It is impressive how much the Clojure eco-system is catching up with Ruby On Rails. The middleware available for Ring is now very extensive. I just discovered Rate limiting middleware for Clojure Ring. Seeing as I just built an API with Liberator, this middleware could be very useful.

This looks like a good article on simple and practical configs for Emacs. I hope to get a new Mac soon, and then re-install Emacs, and then re-configure it based on all I know now. My initial setup of Emacs was confusing since I was overwhelmed by the complexity of Emacs, and I was in a hurry to get stuff done.

I am not working with Javascript, so part of me wants to ignore it, but, to be honest, the things now happening in the land of Javascript are amazing. Consider Racer:

Racer is a realtime model synchronization engine for Node.js. By leveraging ShareJS, multiple users can interact with the same data in realtime via Operational Transformation, a sophisticated conflict resolution algorithm that works in realtime and with offline clients. ShareJS also supports PubSub across multiple servers for horizontal scaling. Clients can ...

TJ Holowaychuk built out some of the most important nmp modules for NodeJS, but now he is leaving for Go.

Go versus Node

If you’re doing distributed work then you’ll find Go’s expressive concurrency primitives very helpful. We could achieve similar things in Node with generators, but in my opinion generators will only ever get us half way there. Without separate stacks error handling & reporting will be mediocre at best. I also don’t want to wait 3 years for the ...

More than most projects, it seems like Node.js has seen a lot of churn in its leadership.

January 2012:

Citing a desire to work on research projects after three years of focused work, Node.js creator and project leader Ryan Dahl sent out a message today that he will be “ceding my position as gatekeeper to Isaac Schlueter”. He stated:

I am still an employee at Joyent and will advise from the sidelines but I won’t be involved in the day-to-day bug fixes. ...

A while loop that is always true will continue to run until terminated, but it’s not really the cleanest way to obtain the result as it doesn’t allow for a clean shutdown. We can use a scheduled thread pool that will start and execute the desired command in a similar fashion as the while loop, but with a much greater level of control. Create a file in the src directory called scheduler.clj and enter the following code:

The biggest problem I’ve encountered over the years looking at Java code is that it always seems to be the product of someone who fancies themselves as an architect. They must, because so often I find I’m reading code that looks more like a plan for something that solves a problem, rather than something that actually solves a problem. It’s not a subtle distinction. There are deep layers of abstraction and mountains of ...

The amount that programmers need to know is growing, so experienced programmers end up facing situations like the one described here by Tim Bray:

Where I’m stuck · I have a tab open to a page in the Gra­dle doc­s: Chap­ter 50. Depen­den­cy Man­age­ment. It has 63 header-delimited sec­tions or­ga­nized in­to 10 top-level sub­sec­tion­s, and it’s chap­ter 50 of 65 (plus five ap­pen­dices). ¶
Short sto­ry: I’m get­ting an in­com­pre­hen­si­ble Groovy er­ror try­ing to do some­thing that should be sim­ple, and fol­low­ing ...

What’s next? Oh, pretty-printing. Yeah, I pretty-print my JSON to go over the wire. It’s nice for debugging. I mean, who wants to curl one long, 1000-character line of JSON? Put some whitespace, please! How to do that?

(cheshire.core/generate-string mp {:pretty true})
That’s right, it’s basically built in, but you have to specify it. But, oh man, that’s long. I don’t want to type that, especially because my lazy fingers are going to not do it one time, then I’m going ...

If the expression passed to is an S-expr, and the first element of the is recognized as a function. Then is prints that first symbol directly, then evaluates all the arguments to the function and prints the results. For instance:

I find this very surprising. My first serious exposure to the JVM was via Clojure, which has the awesome Leinengen build tool, which has an uberjar option. Therefore I thought uberjar was common on the JVM. But no. Now that I am working with Java, I find that it is rare for anyone to put jars inside of jars:

You can add jars to the jar’s classpath, but they must be co-located, not contained in the main jar.

Interesting to read an old post from 2008 in which Liz Douglas stretch Buildr to the point that it becomes almost a continuous integration tool:

A few months ago the idea of myself writing such words (“Things I like about Buildr“) seemed very unlikely and I dare say that my project buddies may be surprised at the statement. Buildr, for those unfamiliar, is a build tool for Java applications that is written in Ruby. It’s key benefit is its concise ...

This time, the variable jjtree is a file task that reads a JJTree source file from the src/main/jjtree directory, and generates additional source files in the target/generated/jjtree directory. The second line creates another file task that takes those source files, runs JavaCC on them, and ...

I have only two small Clojure projects, and other than writing tools on which nothing major depends, these projects will probably be the only ones in my current position. The rest will be done in Web languages and Perl. So, I enjoy a chance to enhance the Clojure projects.

I do not know why, and am not aware of any conscious prejudice, but writing Clojure code encourages me to create small functions, and external Clojure projects, like ...

I believe it’s just as easy, for basic operations, to use CURL as you are likely to be in a terminal window anyway at such an early stage in development. For this reason, I thought I’d cover using CURL for the 4 basic RESTful methods (GET, POST, PUT and DELETE).

The following assumes you already have an application with a RESTful endpoint of ‘users’:

I did look at both Laravel, Sympfony2 and Codeigniter for this REST Api. They all had some elements I liked and some I disliked. My main concern was how to do the authentication because I had a rather complex algorithm where my users can log in with the apps’ access_token or access_tokens served by Google or Facebook. I also perfer being in complete control of my framework and the frameworks mentioned above had ...

Once you’ve taken the backup of a MongoDB database using mongodump, you can restore it using mongorestore command. In case of an disaster where you lost your mongoDB database, you can use this command to restore the database. Or, you can just use this command to restore the database on a different server for testing purpose.

Why? Because the first one is greedy and will almost always match too much.

This is a nice example:

Most people new to regular expressions will attempt to use . They will be surprised when they test it on a string like This is a first test. You might expect the regex to match and when continuing after that match, .

But it does not. The regex will match first. Obviously not what we ...

This is a very good take on “worse is better”. This also bears on the micro-services debate. Simple implementation allowed Unix to become the world’s favorite operating system. Is there redundant code in a Unix distro? Sure, you’ve got a lot of utilities that all have code for reading files. But if, instead of a bunch of small utilities, you tried to build the one ultimate tool that does everything (the monolithic framework) you would never get anything like the ...

Though they aren’t a particularly new idea, Microservices seem to have exploded in popularity this year, with articles, conference tracks, and Twitter streams waxing lyrical about the benefits of building software systems in this style.

I previously wrote about my preference for an architecture of small apps. But it is worth noting, this approach has its downside:

Where a monolithic application might have been deployed to a small application server cluster, you now have tens of separate services ...

Since I said so many bad things about Unicorn, it is only fair that I also link to this piece that makes Unicorn sound good:

Unicorn was faster than Passenger or Thin with /borat and had the second highest transaction rate for the same. It had the shortest duration of both longest and shortest transaction with /borat as well. It was one of only two that actually finished the /pi test, and did so faster than Thin. Unicorn had the highest ...

As you’ve seen, a greedy quantifier will try to match as much as it possibly can and only give back matched characters as needed. Every time the engine greedily consumes one more character (or repeated token in general), it has to remember that it made that choice. It will therefore persist its current state and store it so it can come back to it later in a process we call backtracking. When ...

I have previously said negative things about Joe Watkin’s attempts to facillitate using objects and multiple threads in PHP.

However, here is an approach to Futures in PHP that does seem easy and interesting to me:

Managing Multiple Futures

Commonly, you may have many similar tasks you wish to parallelize: instead of compressing one file, you want to compress several files. You can use the FutureIterator class to manage multiple futures, via the convenience function Futures().

At first I talked to a guy named Tom. I assumed he was the leader of the tech team, so I talked about my wide experience. He seemed confused by my recent experience with Ruby. He asked if I was a serious PHP programmer? I said a few negative things about PHP, since most corporations are now pulling away from it. PHP is going out of fashion (as you can see in this ...

On the one hand, I am very impressed with this article: Eventual Consistency in Real-time Web Apps. On the other hand, how can anyone keep up with what is best practice in the land of Javascript, when every week seems to bring a new framework or methodology?

Having said that, I’ll point out that there is no way to ensure a 1-to-1 match between one’s backend model and one’s front-end model, so all one can do is pick one to ...

I already linked to this, but I will link again because, seriously, this is one of the best setup tutorials I’ve seen:

One of the greatest strengths of PHP-FPM is its ability to scale its worker processes up and down as load on the server increases. PHP-FPM can have several “pools” of PHP handlers: one for each different Web application, with different numbers of worker processes and different rules about when to add more processes or kill idle processes.

Something like Docker is probably the future. Clearly, virtual machines is becoming a popular way to manage dependencies. However, Docker still has problems:

Misconception: If I use Docker then I don’t need a configuration management (CM) tool!

This is partially true. You may not need the configuration management as much for your servers with Docker, but you absolutely need an orchestration tool in order to provision, deploy, and manage your servers with Docker running on them.

Kind of pathetic that the world’s best text editor only got package-support in 2012:

GNU Emacs 24 (released in June 2012) introduced official support for packages, that is, a way of installing extensions from a remote repository. This was a huge step forward for Emacs, as it not only allowed users to easily find and install extensions, but it also made it possible for extensions to build upon other extensions without having to tell the user “great you want to install ...

I only just learned about Flood. In the past I used ab, which is a severely limited tool, in that it only sends HEAD requests. What I have often wanted is a tool that was as simple as ab, but which could send parameters, make a GET request, and give me more feedback than CURL. The XML config for flood suggests it is nowhere as easy to use as ab, but it still looks fairly simple and it looks like ...

Perhaps the most significant change to PHP performance I have experienced since I first wrote this article is my use of Squid, a web accelerator that is able to take over the management of all static http files from Apache. You may be surprised to find that the overhead of using Apache to serve both dynamic PHP and static images, javascript, css, html is extremely high. From my experience, 40-50% of our Apache CPU utilisation is in ...

I was just looking at this article, PHP with PHP-FPM, and it brought back memories of Timeout.com. All of the developers who worked at Timeout eventually had to set up the company CMS, and this was something of a hazing process, in that every developer later remembered the experience with dread. The CMS was a massive Symfony project — without question, the largest PHP code base I have encountered in 14 years of working with PHP. I’ll give you a ...

I’ve sorted the execution time of each call in order to determine which calls are the most expensive. The call to the Default_Model_Platform model’s hot() method ranks up towards the top, and because I know this data changes only every few hours, now I can safely cache it and thereby eliminate this expensive database query (which is indeed a fairly large JOIN operation). After implementing caching I again profile the page and indeed have eliminated that ...

Missing from the list is “Ask yourself if PHP is the correct language for what you are trying to do.” I think of this especially in regard to the 6th tip, about memory caching. If you start using something like MemCache, then you ...

The static scope of a class entry can be considered thread local, in a way. Complex members (objects and resources) are nullified when creating new threads, but simple members (arrays/strings/numbers/mixture of any of the above) are copied, so in the static scope can be class::$config which contains connection info to whatever and class::$connection can be the connection itself, ...

Almost every language shows a long-term downhill trend. With the exception of Java and (recently) CSS, all of these languages have been decreasing. This was a bit of a puzzler and made me wonder more about the fragmentation of languages over time, which I’ll explore later in this post as well as future posts. My initial guess is that users of languages below the top 12 are growing in share to counterbalance the decreases here. It’s also possible that ...

I have gotten in the habit of doing 2 things:
1.) I used :pre and :post conditions as you are doing here
2.) I also use dire so when the :pre or :post conditions fail and an Assert exception is thrown, I can capture the arguments and the return value and write a meaningful error message:

treated exceptions as exceptions
was general enough to leverage `clj-http` exception
gave informative error messages in the right place
A quick side note on exceptions vs happy paths everywhere. Some will say a bad response isn’t an exception, but is something to be expected. I agree. This is something that should be handled at the app level though, and not the library level – if I get a 401 as an end user I expect to ...

WhatsApp was recently bought by Facebook, for $19 billion. This is the first time a startup had a big success, using Erlang as the basis for all of its technology.

The most stable commercial computing device in history is a telephone switch developed at Ericson and built with Erlang. It can handle millions of simultaneous connections, it has 1.7 million lines of code, and it averages 1 hour of downtime every 20 years.

download and install Vagrant – I use version 1.2.7 You can check that with:

vagrant -v

You should see:

Vagrant version 1.2.7

create a folder for your Rails application and go to it

mkdir rorapp
cd rorapp

initialize your Vagrant machine

vagrant init precise32 http://files.vagrantup.com/precise32.box

This is your virtual machine (server) that will hold and run your Rails application.
If you check now, Vagrant created a config file in your rorapp folder, called Vagrantfile. You’ll change that a little on next step.
make ...

showed you don’t need to prove a program of interesting size. You can
defend millions of lines of buggy code with a “software firewall” made
of formally verified code. Verify the right thousand lines of code
that the rest needs to use to talk to anything else, and you have very
strong security properties for the rest of the code. seL4 and CompCert
are clearly also quite useful programs.

I find it surprising that this is still accepted as best practice in the Ruby community:

But it’s not all bad news. The Ruby core developers are aware of the problem, and there are some changes (3GenGC, oldgen space estimation) being tested which may bring relief. But right now, for users of Ruby 2.1, this is a very real problem that could easily affect you in production.
What did we do? We used a combination of Unicorn::OobGC and unicorn-worker-killer to help tame ...

Before you can run vagrant, you’ll need to download and install a few things:

The Vagrant tool – This is the actual vagrant tool itself. It manages virtual machines
Virtualbox – Virtualbox is the virtual machine where your code will run
If you have an app that already has a Vagrantfile in it, it’s very easy to get started. At the command line change into the folder with the ...