Chuck Lauer Vose's Thoughts

Concurrency Tracking Part 1 - What is High-Scale Concurrency?

Introduction Back to the first article and the table of contents Ah concurrency, the gift that keeps on giving. You’ve likely read the articles about concurrency vs parallelism, but have you really given much thought to what it looks like at scale? How do the concepts of concurrency and parallelism apply when you have 80 physical machines with 2000 processes between them (spoiler, it doesn’t matter)? Does anything even change or does it act...

Read More

Intro to High-Scale Concurrency Limiting

Introduction This is my third attempt at this series and every time I feel like I’m failing to do it justice. It’s too long, too muddled, too insufficient. This is important to me and I want to do it right. So this time I’m going to take it slow and methodically. I’m going to take the time to explore and explain each of the topics, so that we can all arrive at the end together. But I promise it’s worth it. By using these techniques on our l...

Read More

Concurrency part 1 - What Concurrency Monitoring even means

Introduction In this post I’d like to teach you a little bit about server concurrency tracking. I’m going to assume that you know what concurrency is and the difference between concurrency and parallelism, but I want to talk about “concurrency tracking”, how this applies to backend web servers, and how it applies at scale. This article series is targeted at fairly senior engineers. That’s not to say that you shouldn’t read it if you aren’t a...

Read More

Setting Bulkhead parameters before deploying them to production

Introduction When bulkheads and circuit breakers work together, one struggling external service or database will no longer take out your entire service. This article exists to help you find the right configuration for your bulkhead system of choice before finding out the config is insufficient for production loads. Bulkheads can be implemented in many different ways and at a lot of different levels, so I’ll try to cover the general process ...

Read More

How does `docker build` even work?

Introduction Today I received this question and it was a stumper for me. After a bunch of research, I wanted to write something up in case I needed to send this again later. So yesterday we moved all of the non global npm installs from Dockerfile.test to the test_suites command section of the grandcentral.yml. Why was having all of those npm installs in Dockerfile.test not resulting in the container having node_modules( not in root, serve...

Read More

Testing rack middleware in a request spec

Introduction This may be a controversial thing, but I found it to be useful and difficult to research so I’m going to post about it. For the record, it’s probably ill-advised to test the effects of a middleware since presumably the middleware itself has bountiful tests (or maybe you should send in a PR!), but we wanted to TDD this and make sure that the middleware was really getting applied the way we thought it was. Crux of the story: We ha...

Read More

Rails attr_accessible gotcha

If you're like me you inherit a lot of projects which have very different styles. Today I ran into a project that had never used attr_accessible and I found a total gotcha: * If there are no attr_accessible attributes on a model it's open, any attribute can be written with .update_attributes() or a similar mass-assignment function. * If there is even one attr_accessible the model is closed except for those attributes defined to be attr_access...

Read More

Playing Drupal the card game the Drupal way

Now that NodeOne is running out of Drupal the Card Game I feel like it's time to introduce my version of the game rules which I believe are actually significantly more Drupaly than the main rules. If you don't already know the rules check out this video: Now, in the main rules you compete to complete modules and sites, which is all well and good right, but we don't develop modules in the dark at all, we all know what's going on with other ...

Read More

What's in a framework, experiences from Rails and Drupal

I've now been working professionally in Drupal for a year and have learned a lot about it; I have some patches into contrib but I've not really done much with core other than some simpletests I was too shy to commit at Drupalcon and some comments trying to help people out on d.o. Prior to my stint as Drupal programmer I was a hardcore Ruby on Rails developer for about 4 years. Over the last two years in particular I've learned a lot about fram...

Read More

Nesting Views like a Mecha-Eagle

As you have probably figured out, I love views. I love teasing out little features that are completely buried and obscure. Nesting Views is one of my favorite new travesties; not sure if it's ready for Drupal for Evil, but it's certainly not kosher. If birds can nest, why can't I? image by Benjamin Verdonck, reported by apartmenttherapy.com Ah nesting season, time to buckle down, collect bits of straw, and raise little Views babies that wi...

Read More

Making your clients love Drupal's menu system as much as I love candy

NOTE: Apologies for the gap, I said I would post on Monday but well, I decided to get married instead. So there. You might be saying to yourself, "So Chuck, D7UX is all well and good right, but I'm running D6 right now. How can your wisdom possibly enhance my life and vitality?" Well, you're in luck friend, for my limited stints into D7 have left me craving more of that optimized UX goodness and blogging is a side-effect of learning for me. T...

Read More

Do your clients send you presents? If not, maybe we can figure it out together, lets talk about D7UX.

Do your clients love you with such a furious passion that it borders on problematic? Do you find new customers calling you and saying things like, “I must have your services! My friend has been bugging me all week to call you. Seriously, I just want him to stop camping out on my lawn. It’s scaring the children.” I found this on my desk the other day and I found myself filled with a sense of joy and satisfaction. I have to admit though, it was...

Read More

Drupal snippets #1 (Views exposed filters, F5 tweaks)

Cross-posted at the Metaltoad Blog While I'm certain that I could never work up to the standards of Peter Cooper his "Interesting Ruby Tidbits That Don't Need Separate Posts" series was a great help to me when I was a ruby developer. You can see the original here: IRTTDNSP #1. I've not found similar for the Drupal community but I believe a lot of the things I do during the week are interesting but not at all worthy of a complete post of their...

Read More

Drupal benchmark results using AB and the simple things we did to get here

Cross posted at the "Metal Toad Blog":http://metaltoad.com/blog/drupal-benchmark-results-using-ab-and-simple-things-we-did-get-here I was trolling around the Internet today looking for benchmarks and I actually had a little trouble finding something current. Dries has one comparing D6 on PHP4 vs D6 on PHP5 but that was clearly ages ago. I also realize that this is going to be out of style in about 12 minutes, will probably be fraught with con...

Read More

Using git-svn to manage standard and non-standard branches

Cross posted at the "Metal Toad Blog":http://metaltoad.com/blog/using-git-svn-manage-standard-and-non-standard-branches When Webchick announced that Drupal was moving to Git at Drupalcon 2010, our office erupted in pleasure at the news. Lots of great Drupalists are already using Git and there's even an unofficial Github branch of Drupal for your branching and stashing pleasure Github mirror. However, Metal Toad Media has been an SVN shop for ...

Read More

How to reconnect a bluetooth mouse/keyboard in OS X or Windows 7

Cross-posted on "the metaltoad blog":http://metaltoad.com/blog/how-reconnect-bluetooth-mousekeyboard-os-x-or-windows-7 Okay, as mundane as it sounds there are a lot of articles around the internet that are fundamentally misunderstanding the simplicity of this request: how do I reconnect my bluetooth device after it's been disconnected from being in my laptop bag or whatever. There is no reconnect option in Windows 7 and the reconnect option ...

Read More

RequiredSequence v0.4

During my last mini flash project I created a project designed to help me with async calls in AS3. I hope that it helps you too. You can find the project on "my github account":http://github.com/vosechu/required_sequence. h2. Intro Required Sequence is a tiny AS3 library that mandates that certain bits of code run before other bits of code. I've heard that Senocular has an "excellent version of this":http://www.senocular.com/flash/actionscri...

Read More

Getting started on displaying videos with the Brightcove iPhone SDK

Cross posted on the "Metal Toad Blog":http://metaltoad.com/blog/getting-started-displaying-videos-brightcove-iphone-sdk There's a lot of good to be said about the Brightcove iPhone SDK, it's easy, it seems to work really well, but there's also a ton of gotchas and the docs are a little conflicting and/or out of date. The OnePlanet app is also out of date. This post is my attempt to rectify some of these things. There are three things needed ...

Read More

Clearing the state of a actionscript 3 app (aka, globals are eeevil)

Cross posted on the "Metal Toad Blog":http://metaltoad.com/blog/clearing-state-actionscript-3-app-aka-globals-are-eeevil Imagination time: Imagine for a moment that you have an app, it has one button and one little window. When you click the button it changes the text within the window to something else. Now, when you get into flash development it seems like the easiest and clearest way to do this is to wipe out the contents in the window, bu...

Read More

The Value of 10% Time in Improving Your Life and Productivity

Cross posted on the "Metal Toad Blog":http://metaltoad.com/blog/value-10-time-improving-your-life-and-productivity Convincing Yourself Convincing yourself of the value in 10% time is critical and is sometimes the most overlooked step in the process. Most people look at 10% time as nothing time; time you can't bill for must surely be worth nothing financially right? And worse you might think, not only are you not billing but you're robbing yo...

Read More

Facebook API Terminology

Cross posted on the "Metal Toad Blog":http://metaltoad.com/blog/facebook-api-terminology The toad just finished a small project involving the Facebook API and by far the most confusing aspect of the project was the terminology regarding the many, many different API's and what each one actually does. I thought this merited a write-up and I hope you find it helpful. FBML, Frames and the Canvas "I'm interested in making a Facebook app that wil...

Read More

Recursively load nodes from a rich data model

Cross posted on the “Metal Toad Blog”:http://metaltoad.com/blog/recursively-load-nodes-rich-data-model If you’ve ever worked with a rich data model in drupal you know it can be a pain to load up all the children and parents of a node within the templating engine. One method that could save you a lot of time is to load the data recursively in node_load and save your poor front-end guy some wrist pain (or yourself if you’re that guy!) Edit: Pl...

Read More

Multiple Dynamic Tabs in Brightcove 3

Cross-posted at company blog: http://metaltoad.com/blog/multiple-dynamic-tabs-brightcove-3 This week I had the wonderful opportunity to work on an interesting problem that as far as I can tell hasn't been documented. The call came out that we needed to generate a couple dynamic tabs on the top of our player for smart playlists. Now, we already have one dynamic playlist so I thought it was going to be a fairly simple logical step up to three b...

Read More

An Unexpected Occurence With Git: How Git Saved The Day Today

Cross-posted from the "Company Blog":http://metaltoad.com/blog/unexpected-occurence-git-how-it-made-our-life-easier-time In my experiences in the past working with external contractors is often a pain, especially the final merge where you try to incorporate all their code. I've always been a huge proponent of Subversion for SCM but today I saw an example where Git knocked the socks off of Subversion. Time came and code needed to be merged in...

Read More

Fun with stakeout.rb

Cross-posted to the company blog at: "Fun with stakeout.rb":http://metaltoad.com/blog/fun-stakeoutrb Having only left Rubyville a couple weeks ago there are still a lot of Ruby-based utilities that I still find incredibly handy. One such utility that I've recently fallen hopelessly in love with is stakeout.rb from: http://pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFi... Stakeout monitors your filestructure waiting for cha...

Read More

Converting from Brightcove 2 and loading arbitrary videos

Cross-posted to: "Company blog version":http://metaltoad.com/blog/converting-brightcove-2-and-loading-arbitrary-videos Over the last two weeks I've been working on a project to convert one of our client's websites to Brightcove 3 players. As I am quite new to drupal but not to PHP you can imagine that many of the problems I had were unrelated to brightcove itself but there were a few aspects that I thought were worth documenting for those who...

Read More

Integrating Rails and Rack

Posted for those confused about Rack. Rails doesn't need Rack right now to integrate with the current webservers so you don't need to learn about Rack right now. Rack is for frameworks that aren't Rails but still want to take advantage of the excellent web servers that have come into being lately (read: Phusion Passenger) I hope you don't have to troll around the Internet as long as I did just to find this answer :)

Read More

Pagination, Sets, Checkboxes

When I was at RailsConf2008 I learned a lot about life and Rails but there were some nagging problems that lingered after me for a long time. At one point in the talks there was a discussion of how to make listing pages have checkboxes and how to handle this data. The problem is complicated by pagination and filtering so it's actually a really good problem to talk about. The proposed solution was to send back a structure that looked somethin...

Read More

RBridge 0.2

RBridge has undergone a lot of bug fixes and I think it's worthy of a 0.2 release at long last. 1 major enhancement * Actually runs headless via the rulang command. 3 minor enhancements * Uses optparse for clearer command-line options. * Option to specify port, compile directory, mnesia directory, sname, and location of server file. * Some error checking, and debug output added. Checks to see if server is already running on specified port....

Read More

RBridge-0.1.2 Announcement

Just wanted to poke my head in and let people know that a new version of rbridge has been released. New to this revision is a few little tweaks and bug fixes but the main point is that you can install the gem and just type 'rulang' from anywhere to start the erlang server. This enabled us to build a little test suite which should improve quality. Also, the end of quarter summary has been posted per our class requirements: "Review":http://www....

Read More

Concurrent code in Ruby 1.8.6 through inlining

*Slight typo in the code fixed: 2008-01-08* Toshiyuki and I have released a new gem called rbridge which allows us to execute functional, side-effect free, concurrent code directly in Ruby regardless of the version by using Erlang as a processor. This includes using the Mnesia distributed database and ETS/DETS. To try it out please follow these steps: 1. Download Erlang for your os. Windows has binaries and OS X can be configured with `./co...

Read More

rbridge 0.1 Released

h2. FEATURES: Allows use of Erlang code within Ruby h2. Changes: v0.1 / 2008-01-04 (vosechu) 1 major enhancement * Allows many-lined Erlang commands when using the Erlang class for direct access. 3 minor enhancements * Revised error checking to allow custom resolution * stop_server/0 now shuts down any servers running in an erl shell * created tests to run with RSpec and autotest (erl server must be running on port 99...

Read More

Complex commands with Rulang

Rulang was giving me a lot of trouble with regards to multi-line commands and complex commands in general. After hacking on it for a while I've developed a patch that will allow ruby code such as the following: require 'rulang' @mnesia = RulangBridge::Erlang.new("localhost", 9900) def find @mnesia.eval(<<-EOF QH = qlc:q([X || X <- mnesia:table(shop)]), F = fun() -> qlc:eval(QH) end, {atomic, Val} = mnesia:transacti...

Read More

Mnesia to ruby bridge evaluation

Owing to the complexities of building a Rails adapter for Mnesia I've been looking into using a Ruby to Erlang bridge and have looked at the various projects that seem to be available and want to share my comments on how each is stacking up so far. h2. Rebar "Rebar":http://rubyisawesome.com/2007/4/30/calling-erlang-from-ruby-teaser was announced on 2007-04-20 and has since never surfaced to the public as far as his blog and Google are concer...

Read More

Mnesia + Ruby Announcement

My goal this year is to release a Ruby port of the Mnesia distributed database and hopefully start the process of moving to a true slice architecture. The port is an interesting project but I think the importance of the slice architecture is paramount. For the last couple of years we've been working on the n-tier model with ruby. It's well established and it has been working nicely for us. But the web server industry is starting to move more ...

Read More

find_or_create by params (extension to dynamic attribute based finders)

Rails has a dynamic method where you can do find_or_create_by_attr_name(attr) but it the method names get incredibly long very quickly. So SJS wrote "this article":http://sami.samhuri.net/2007/4/11/activerecord-base-find_or_create-and-find_or_initialize in which he tries to remedy the situation. His solution was pretty elegant but it still only worked for fields that were already defined in the database; if you often redefine setter methods it...

Read More

Long Bets

"Sam Ruby":http://intertwingly.net occasionally does an article about his long bets and I really respect his ability to predict the future. "This time":http://intertwingly.net/blog/2007/08/12/Long-Bets I feel that he was focusing too close and forgot the long part of the 'long bet'. REST is already important, and there are further developments in edge rails that make it even more important (active resource). MySQL is already a pain for scaling...

Read More

Inheritance without STI: method_missing routing

Every once in a while I find myself in the situation where I need to override a model or create an inheritance without using single table inheritance (STI). The method_missing call can help us to create an intelligent router that will route calls to the parent class or the child while maintaining an extremely small code footprint. Here's an example of what I'm talking about. We needed a landing page that would be dynamic for each user that w...

Read More

Nginx http_perl_module

Errors you might get at this step: Can't locate nginx.pm in @INC Can't locate loadable object for module nginx in @INC This is how I installed the http_perl_module for Nginx. I'm not sure why these things are the way they are, I'm following a mailing list that was written in russian. :) Installing from ~/src/nginx-0.6.5 Installing to /opt/local/nginx (if this isn't owned by you use append sudo to the last step) cd ~/src/nginx-0.6.5 ./config...

Read More

Rendering partials with a 302 breaks ie6

If you can spot what's wrong with this code you get a cookie. Apparently rendering with a 302 breaks ie6 entirely. Just deleting the 302 makes it okay. render :partial => 'admin/restricted', :layout => 'admin', :status => "302" and return false Whether it makes sense or not is not the question. I'm pretty confident that it doesn't make sense after thinking about it for a while. But why would it make ie6 connections die while firefox...

Read More

Arrow keys in vi and iTerm

Arrow keys doing funny things when you use vi in iTerm 0.9.5? It's because we're too used to messing with things. Set your Default bookmark's keyboard type back to Global. "When the terminal type of your sessions is set to one of those "xterm" types, iTerm handles the arrow keys, the home key, and the end key in a special way." says the FAQ while not actually addressing the solution. But who can complain? Global works well now! Hooray!

Read More

Testing rails without fixtures

At "On & On Creative":http://www.create-on.com we have a lot of sites on a common rails backend. It's incredibly flexible so we can offer a lot of support to customers but because there are so many customers with different needs testing has become a huge pain. Not only does it let us run tests custom to each client, it provides a way to import the data to the test db really easily and it's way faster than loading the fixtures each time you sta...

Read More

RailsMachine / Slingshot image loader slowdown

h2. Background / Analysis Recently a fellow asked me to help him diagnose a slowdown in his rails stack at the Ruby Brigade meeting in Seattle. After going through the normal procedures of checking mysql indexes, talking about caching, and checking the code for bizarreness I still couldn't find anything really out of the ordinary. Finally we turned to "Firebug":http://getfirebug.com and found that the images were taking an eternity to downl...

Read More

Rmagick OS X Verdana

If you're getting errors about Verdana not being found, specifically: "unable to read font `/Library/Fonts/Verdana' (Magick::ImageMagickError)" try: sudo apt-get install applesystemfonts cp /sw/lib/X11/fonts/applettf/Verdana.ttf /Library/Fonts/ sudo gem install rmagick

Read More

RMagick on RHEL4

Holy shit, an easy thing in RHEL4. Assuming you already have rubygems and ruby: sudo up2date ImageMagick ImageMagick-devel sudo gem install rmagick

Read More

Recursive children

One of the things sorely missing from Rails (and with good reason) is a function to find all the children in a tree. Below is my attempt at it, you can drop it in any model that acts_as_tree and call all_children to get a flattened list of all children, grandchildren, etc. def all_children all_children = [] all_children << list_children(self) return all_children.flatten end private def list_children(branch) all...

Read More

Sending messages to all users

One of the biggest fears of all system admins and developers is publishing work to a live server and having it break everything. Naturally we all go to great lengths to make sure this doesn't happen but even the most well-tested code in the simplest environment still breaks sometimes. In addition to these fatalities is the less intrusive but equally damning maintenance that sometimes just has to happen in the middle of the day whether there's...

Read More

Cascading page attributes

h2. Intro and Concept One of the first things I tried to do in Rails was to figure out how to make a nice, generic website that anyone could update. After about sixteen iterations I've finally stumbled on one that I think will finally work. As of now it's only partially complete. I'm really only using this method to generate the titles and meta information but each time I have to make a change to the website I find more and more information ...

Read More

Using Rails to Create a Static Site

h2. Overview A customer of ours has a splendidly restrictive environment which I have the pleasure to work within. Not only is there no Rails, there's no PHP and presumably no database to hook into even if there were dynamic languages. This is probably complete crap but it led to an interesting problem solving situation regardless. What do you do with a client that wants hundreds of pages to be redesigned when you don't have access to handy ...

Read More

Hiring developers

h2. Background After a lot of thought and "an enlightening article by Joel Spolsky":http://www.joelonsoftware.com/articles/DevelopmentAbstraction.html , I've come to the following conclusion: Hiring new developers is almost never the answer to the problem of having too many programming projects. We have that problem right now. Demand is very high and Tynan no longer has much time to code due to business requirements. So we have at least four...

Read More