Locating a bad expression in Emacs and Clojure I work frequently in Emacs and Clojure. Emacs has two extensions that let you do interactive development: tools.nrepl and swank-clojure . I sometimes make the mistake of modifying many functions in a module before I attempt executing or compiling the entire file again and am met with an error like: Can't have more than 1 variadic overload [Thrown…
Fixing A Broken Sudoers File on an Amazon s EC2 I was working on getting our CI server set up and wanted to grant Jenkins the ability to run a command as root. Pretty standard stuff really. I ran sudo visudo and discovered that it had dropped me into Nano . Being an editor snob , this was unacceptible. I immediately quit out of the weak little thing. The next few moments were where I made my fatal…
Narcissism, or don t try this at home I m a frequent reader of Hacker News and when I saw the post about HackerRank and challenge to be invited into the beta if you were on the leader board I had a hard time resisting. I played a few games manually to make sure I understood the game. Since you can take only 1-5 candies, and to win you must force your opponent to leave you with less than 6, then at…
Look Ma, No Threads! Java s NIO , node.js, Netty, Tornado, Twisted, Perl s POE they all have in common one thing: non-blocking IO. Node.js is based on V8. V8 is a JavaScript implementation. It comes form a place (the Browser) where blocking is anathema. It s just not permitted. You can t block the browser. Node.js community follows this to its core: thou shall not block. Ever. It permeates its…
Cucumber, Gherkin and Multi-line arguments Gherkin is the language of the Cucumber testing tool uses for describing feature tests. Writing a test today at $ WORK , we needed to use a multi-line string and had some trouble finding an example in Google I am using Cucumber to test my Twilio based IVR and SMS applications. You can find an example as part of my Twilio in Ten Minutes repo , one of which…
Simple Process Coordination with Tellmewhen I subscribe to the Unix is my IDE philosophy, mixing and matching the gnu tools , Leiningen , and lots of other tools. I frequently go to bash , Ruby and Rake in order to tie or glue many of those tools together in ad-hoc combinations to get tasks done or create small automations. I often want is to be notified when a task completes, or to trigger an…
An Interactive Voice Response System in 10 Minutes In this post I m going to walk you through deploying a telephony application. If you ve ever called an automated system, listened to a menu and then pressed 1 to continue then you ve interacted with a telephony application. By following this guide you ll deploy an application that you can call from your own phone that will read a random quote to…
Upcoming Talk: Large Data and Clojure I ll be giving my Large Data and Clojure: the middle ground between RAM and EC2 talk at Philly Lambda on November 22nd. The RSVP Link is here . This will be an updated verison of the talk I gave at Barcamp Philly 2010 .
Sampling a Sequence with Clojure We needed to sample a data set that had around 392 million entries in it. The first thing we thought of was using the database. The second thing we thought of was by creating an array of the record IDs (or line numbers), shuffling the array and then selecting those records that matched (via the line number or record id). SQL SQL Databases do support selecting…
Clojure and Large Result Sets I ve been working with the very useful clojure.contrib.sql package. One wrinkle I ve encountered, in an otherwise lazy language, is that the SQL connections typically are not lazy. By default they load the entire result set at once even if the java.sql.ResultSet is lazily accessed. This isn t an issue with clojure.contrib.sql inasmuch as it is with how the JDBC…
How We Deploy Our Clojure Services We re using Clojure as a core development technology at my company. We have a basic web service implemented in Clojure running inside Jetty . I m not using a full J2EE container, I just wanted a fairly simple strategy for running the Jetty based service. We re already using Chef for provisioning our servers, for installing base dependencies, so that s what I…
Automating Capistrano Password Prompts with Expect I just started using Capistrano for deploying my Rails applications (like Snapclean.me "). I also just started using capistrano_rsync_with_remote_cache to help push releases out faster than the :copy deploy strategy. I m very happy with how much faster it is than the a :copy , but I m impatient and having to provide the password more than once per…
New Clojure Libraries: Bloom Filter and LFSR I created two new clojure libraries as part of my continued study of all things computing related. I was introduced to the Bloom Filter through Hacker News and to the Linear Feedback Shift Register [ LFSR ] through Toby DiPasquale . It turns out that each of these will have practical application for me in the near future. They are the kind of thing I…
How We Run Cucumber Cucumber is a wonderful behavior driven development tool by Aslak Hellesøy . There is a getting started guide in the wiki at github that describes how to get it set up and running. We ve written a wrapper around Cucumber to help make it easier to run along with our application and to make it less intrusive when it runs the browser (at least under Linux). Server Execution Most…
Creating Standalone Java Applications with Leiningen Leiningen is a simpler build tool for Clojure . Previously I covered a few basic aspects including how to run the HEAD version of Leiningen. Leiningen can also build a standalone jars in the same way the maven assembly plug-in does. There are a few steps you need to follow, I ll walk you through them here. This example is available in my sandbox…
Leiningen Leiningen is a simpler build tool for Clojure . It is easier to get started with than Maven (though you can do it , as more than one post shows ), as well as ant . Leiningen is, as maven is, rooted in convention over configuration to reduce the complexity of its build configuration. Leiningen expects your Clojure source code to be in <project>/src and your tests to be in <project>/test .…
From the Agony of JUnit to the Ecstasy of RSpec In the past I have had a love hate relationship with unit testing and testing tools in general. I have had a long, healthy, even dreamy relationship with test driven development though. Aahh how it improves design and prevents issues from reaching users! I am often unhappy with the amount of effort it takes to write tests using some of the tools and…
Influential Books I started with a new team in the middle of this year and as I get to know the other members of the team and share our skills and experiences, the books that each of us has found influential has come up. This has given me the opportunity to reflect a bit on which ones I still find worthy of suggesting that others read. Over my career, and as my family has grown, I have become…
Connecting SLIME to a remote Clojure Repl SLIME is a powerful extension for Emacs that transforms Emacs into an IDE for Lisp. It sets up Emacs so that it can connect to and interact with a Lisp running as a separate process even on a separate server. This configuration allows you to connect to a running application with Emacs, allowing you to inspect the state of and debug a running application.…
Safer Bash Scripting I was pairing with a colleague today writing a moderately sized shell script , during the session some of the best practices I try to follow came up. There are some best practices I try to follow when programming, be it in shell or any other language. We took a little time to talk about two of the habits I picked up which encouraged me to share them here. The first has two…
Departure I recently moved on from a company I was with for eight years (my longest time at any one company). My experience at HMS was absolutely without equal. I was given better opportunities than I could have reasonably asked for. I grew both professionally and personally, and both of my children were born while I was with HMS . I was presented with what I believe to be an unique situation and…
Array Type Hints in Clojure How to encode type hints for Java array types came up recently in conversation with a friend and I found it difficult to Google for so I decided to write it up here. This is because Java doesn t have what you d normally think of as a class name for its typed arrays, but first a brief explanation of type hints Clojure Type Hints Clojure allows you to use type…
Creating Executable Jars For Your Clojure Application It is possible to create stand alone executable Jar files for your Clojure programs. In this post I walk you through the issues you need to keep in mind and the steps you need to take to create the jar. You can download the example code this post walks through in its entirety from my GitHub account (under examples/exec-jar). I used ant to build…
Visualizing AMQP Broker Behavior with Clojure and Incanter I m working with our system architect ( Mark Mehalik ) evaluating AMQP as a messaging implementation for a new project. One of the things want to prove out is how the brokers behave under a widely varying number messages, message sizes, numbers of producers, consumers, queues and in differing clustering configurations. Since AMQP is a…
Trixx Gets a Build I just implemented an ant build for Trixx . Trixx now builds, pulls down its dependencies jar, and contains and builds the required version of RabbitMQ . To build using ant (you will need to have Erlang already installed): kyleburton@indigo64 ~/personal/projects/$ git clone git@github.com:kyleburton/trixx.git kyleburton@indigo64 ~/personal/projects/$ cd trixx kyleburton@indigo64…
Experience knows a Name Reading Your Language Features Are My Libraries , a thought occurred to me. Not about language features, but about people. I see new developers latch onto the new languages and the features that they support (Java has garbage collection; Ruby lets you extend classes and makes DSLs easy; C# has list comprehensions; and so on). I see new developers lead themselves down the…
Exploring Quartz from Clojure From the Quartz website: Quartz is a job scheduling system that can be integrated with, or used along side virtually any other software system. The term job scheduler seems to conjure different ideas for different people in short, a job scheduler is a system that is responsible for executing (or notifying) other software components when a pre-determined (scheduled)…
Introduction to Git talk at PLUG West Tonight at 7pm I m giving my Introduction to Git talk tonight at the West chapter of the Philadelphia Linux Users Group . I m bringing some minor give-aways, usb drives and post-it note pads, in case that is enticing :). Intro To Git View more presentations from kyleburton . Kyle Burton, 17 May 2009 Wayne PA
Extending Jekyll After using Jekyll to build my personal website, I was having some issues with my stylesheet not being reloaded by Firefox . Frameworks like Ruby on Rails provide an HTML helper that add a short querystring which is simply the last modification time of the file being linked to. This interacts nicely with the browse s cache since it can cache the stylesheet and when you change it,…
Getting Started With Jekyll I took at look at Toby Di Pasquale s website tonight and it inspired me to get around to sprucing up my own site. Toby used Jekyll , a site generation and maintenance. Jekyll allows you to maintain your site using liquid (a text based templating tool), Yaml (for configuration) and Markdown (a simplified wiki-ish style markup language). Jekyll is a bit different from…
Introduction to Git talk at PLUG North Tonight at 7pm I m giving my Introduction to Git talk tonight at the north chapter of the Philadelphia Linux Users Group . I m bringing some minor give-aways, usb drives and post-it note pads, in case that is enticing :). Intro To Git View more presentations from kyleburton . Kyle Burton, 11 May 2009 Wayne PA
Introduction to Git talk at PLUG Central Tonight at 7pm I m giving my Introduction to Git talk tonight at PLUG Central the main chapter of the Philadelphia Linux Users Group . I m bringing some minor give-aways, usb drives and post-it note pads, in case that is enticing :). Intro To Git View more presentations from kyleburton . Kyle Burton, 06 May 2009 Wayne PA
List Comprehensions in Clojure This is a basic example of the list comprehension support in Clojure , the same feature supported by Erlang , Haskell and Common Lisp (via a libraries like incf-cl ). ;; generate the positions of a chess board: (for [file "ABCDEFGH" rank (range 1 9)] (format "%c%d" file rank)) ;; Evaluate and put the result into the buffer: C-u 8 C-x C-e ;; ("A1" "A2" "A3" "A4" "A5"…
Cloud Con East 2008 Overall Chariot Solutions Computing Among The Clouds was a great conference. Cloud computing is not well defined and mostly correlates to the movement of applications, services and compute resources (machines, storage, queuing services) into hosted data centers and billed based on usage. It brings with it concepts of dynamic provisioning and relinquishing of resources. So, how…
Common Lisp destructuring-bind Destructuring bind examples in Common Lisp: ;; This is a typical usage, for pulling apart a list (destructuring-bind (first second) '(1 2) (format t "~%~%;;; => first:~a second:~a~&" first second)) ;;; > first:1 second:2 ;; You can also pull apart improper lists: (destructuring-bind (first . second) '(1 . 2) (format t "~%~%;;; => first:~a second:~a~&" first second))…
Introduction to Lisp talk at PLUG North Tonight at 7pm I m giving my Introduction to Lisp talk tonight at the north chapter of the Philadelphia Linux Users Group . Introduction To Lisp View more presentations from kyleburton . Kyle Burton, 11 Aug 2008 Wayne PA
A Survey of Fuzzy String Matching Algorithms at PLUG Central Tonight at 7pm I m giving my Survey of Fuzzy String Matching Algorithms talk tonight at the central chapter of the Philadelphia Linux Users Group . Fuzzy String Matching View more presentations from kyleburton . Kyle Burton, 06 Aug 2008 Wayne PA
OSCon Day 1 Morning Andrew and I arrived for OScon 2008 registration and took advantage of the continental breakfast before heading up to the Intro to Python. O Reilly had the registration process pretty streamlined. They had a long bank of laptops which you needed only enter your registration code, or your email address (if you registered on the OSCon conference web site). Register, then walk up…
A Survey of Fuzzy String Matching Algorithms at Philly Lambda I m giving my Survey of Fuzzy String Matching Algorithms talk tonight at Philly Lambda hosted by Algorithmics , See you at 7. Fuzzy String Matching View more presentations from kyleburton . Kyle Burton, 25 Jun 2008 Wayne PA
Idempotency or Singleton Memoization in Perl This is an example of a factory for creating a function who s body will only fire once, returning the first computed result each time it is invoked thereafter. sub makeDoOnce { my($sub) = @_; my $alreadyDone = undef; my @result = undef; my $exception = undef; return sub { die $exception if $exception; if ($alreadyDone) {return wantarray ? @result :…
Basic Data Analysis at the Unix shell I often prefer the shell and Unix utilities to having to wait to load data into a relational database or MS Access. There are plenty of cases when an RDBMS is a better choice especially when what you re doing requires joins. At the shell it s often possible to not even have to transform the encoding of the files before analyzing them. I have developed a couple…
SRFI -26 s cut macro I m working on an introduction to lisp presentation for Plug West . I m trying to think through examples of macros which are a good demonstration of what they re for. Towards that end I picked Scheme s srfi-26 s cut macro, which allows for specialization of argument, and try to extend it in a couple of ways. Below is the example code, including a simplified cut, a recursive…