Programming Languages

posted 09/23/11 by Ian Westcott

Here are some recent posts from our employees about Programming Languages:

Adding Custom Javascript and HTML to Textile Blog Posts

Here at The Barbarian Group, we use Textile for our blog to help make publishing fast and easy. But occasionally there are blog posts in which you want to have more control over the markup or you want to embed more sophisticated web objects than simple text and images. After struggling with several tough posts, I’ve spent some time learning how to work around these limitations. In this post, I’m demonstrating how to embed custom javascript code into a Textile blog post.
What happens if you simply add javascript to your post?

It won’t work, because any time Textile encounters a less than (<) or greater than (>) sign, it treats it as an html tag and acts accordingly. Fortunately, you can encapsulate your markup within <notextile></notextile> tags, and your code will remain entirely unadulterated by Textile.
To demonstrate this, below is an example of a simple bit of code that toggles the visibility of text sections using javascript.
Working Demo


Section 0 Heading
Section 1 Heading

(click to read more)

The GE Show: Episode 7 - Visions of Health

Healthcare is a complex topic. The science is bleeding-edge and constantly evolving, and the concepts are often very abstract. With those challenges in mind, we approached Episode 7 of The GE Show with ambitious goals – to explain the way 3D medical images are produced, to demonstrate the future of personalized cancer care, and to show how aggregate data visualization is changing the way we think about individual medical cases.
(Not familiar with The GE Show? It’s a episodic series we make with GE, showcasing their technology, people, and problem-solving in inventive ways.)

Principles of interaction design: #6 Don't be a dick

I recently spent the weekend with some friends whose teenage daughter has lost all but a shred of her vision. It is very likely that eventually she will be totally blind. I was amazed to see how well she adapts to a sighted world but still couldn’t help but reflect on the designs I create and wonder whether she can experience them fully.
Around the time of the last internet boom, bubble and burst the discussions I remember weren’t about web standards, but web accessibility. Flash was extremely popular but because it was a plugin that didn’t expose it’s code structure to the browser, screen readers for the blind couldn’t make any sense of it. As far as they were concerned a Flash object was no different than a single static image.
Today I am shocked to find that many of the younger designers I talk to aren’t aware that the ‘alt’ tag assigned to images in HTML was created so that screen readers could describe the image to vision impaired users. It seems to be thought of as another place to add marketing. A branded opportunity for when the mouse hovers an image.
Now in the wake of CSS3, HTML5, and closer browser alignment to standards the notion of ‘responsive web design’ seems to be the discussion of choice. I’ve even blogged about it. Responsive design is a great thing as it brings accessibility issues to the forefront. Specifically the accessibility of smaller screens, but combined with the latest coding practices the environment for visually or auditory impaired users is now at it’s greatest.
As interaction designers, coders, and creatives we need to be aware of everyone who may want to use our designs. We need to consider smaller screens, the elderly who rely on hearing devices, and a blind teenager who one day wants to be a writer and ask ourselves, is this design good enough for them? Am I being a dick?
Don’t be a dick.

A Gotcha: Authlogic's allow_http_basic_auth (and configuration methods ending with =)

So, if you have ever implemented simple authentication into your Rails application, you’ve probably used or considered using Authlogic, a very popular Rails gem.
If you have experienced frustration with configuring Authlogic::Session::Base, in particular using the allow_http_basic_auth= method to disable allowing your users to log in w/ basic authentication credentials, here’s a little bit of help.

Rando: a random sequence generator for Machinist, Factory Girl, and other mocking frameworks

A bit of a history:
I’m a big fan of Machinist. But I wasn’t a huge fan of one of the changes that came with Machinist 2: the removal of Sham.
Simply put, satisfying uniqueness constraints by simply inputting random numbers into a field value doesn’t always cut it. Sometimes you need
a unique ip address, a unique first name (with no numeric characters), or a unique latitude/longitude (which is not necessarily easy to generate
simply by using a serial number).

The GE Show: Episode 6 - Future Flight

Episode 6 of The GE Show has just taken flight, and we’re awfully proud. (Don’t know about The GE Show? It’s a episodic series we make with GE, showcasing their technology, people, and problem-solving in inventive ways.) This time we’ve returned to the fertile skies of the aviation world, exploring the problems and potential of the future of flight.
The GE Show Episode 6: Future Flight

Secure cross-domain communication with hash functions

Sometimes, you have to post to remote servers and you don’t want jerks posting invalid data. Here’s a recipe I’ve used that works pretty well and isn’t that hard to drop into existing code.

Setting the swf Base Directory in HTML

Have you ever completed a flash project and started testing it online only to realize that the swf is looking for assets either in a different directory than the one you specified? Or that the folder that you have all your media stored is not in a relative directory like it was when working on it locally? There’s an easy solution that can be implemented without messing with any actionscript code.