We’re flirting with the idea of creating tour guides for our apps. Here's an example how it could look like for our Campaign Reporting app. Take it right away or pick it up at some other point when you have time.
You forget things, right? Everyone does. The viewable-active-visible-durational-collegial-clustered-megaflips. ..per second? Huh.. How’s that important, again?
We do try to avoid confusing and un-actionable metrics, but we also release new apps all the time. This’d be a good way of getting quickly (re-)acquainted.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Learning to Build Distributed Systems the Hard Way
Here's the slides and a link to the video from Theo's presentation at DeNormalised London. The awesome people at SkillsMatter also recorded the talk and have put the [video online](http://skillsmatter.com/podcast/nosql/learning-to-build-distributed-systems-the-hard-way).
The combined JRubyConf EU and Eurucamp conference is over and we're home again in rainy Sweden. We had a blast, the location at lake Müggelsee was awesome, the weather amazing, and the conference was great. Read on to find the slides from our presentations.
Gotcha! Ruby things that will come back to bite you, by David
Gotcha! Ruby things that will come back to bite you. from David Tollmyr
Concurrency and Distributed Systems using JRuby, by Theo
Idempotency as the Holy Grail of Scaling, by Srdan
ExchangeWire: Carl Nelvig, VP R&D, Burt - Media Versus Creatives: Should There Really Be A Dilemna In Display?
A follow-up to the previous post on the complexity of media and creative parameters in display advertising has been published at the ExchangeWire website today. It is a highly relevant topic if we wish to raise the value of display advertising in order to monetize it better and make it deliver better results for branding purposes. We strongly beleive that the future of display advertising is bright and our concepts and products are developed to make a significant contribution to it.
You can read the whole post here.
It will be very interesting to hear the panel discussions on the current state of display in the Nordics, since it seems to be quite a controversial topics especially when it comes to RTB.
Not the least to take part of the Fireside chat on The Future of Display in The Nordic Region, featuring our very own CEO Gustav von Sydow.
JavaScript and alike are very proud about their first class citizen methods/functions - but what are they? Does Ruby have them? If so, in what form? These are a few of the questions I will try to answer in this post.
If you ever traverse through some Rails projects you will most likely come across the use of Module#alias_method_chain. It basically places a function as a proxy in between the original call and the actual method call. It makes it easy to define some Aspect oriented programming which makes it easy to add logging and performance measuring to a method call.
Enter Tivoli.
What better than a DSL to explain the functionality.
https://gist.github.com/2647673#file_tivoli.rb
There are a few gems already providing this functionality and much more for Ruby http://aquarium.rubyforge.org/ and a few more https://www.google.com/search?btnG=1&pws=0&q=gem+aspect+oriented.
My core thoughts on Tivoli are: It should be dead simple, not pollute any object and provide a way of doing AOP in an adhoc manner. (Meaning existing code should not be concerned that we are logging or measuring performance).
About this time a year ago I started my deep dive into JavaScript, a language that I had no previous intimate knowledge about. I knew only the parts i had previously needed to get around jQuery and all was good. Throughout the past year of studying the language I came around to find the elegance and horrible extremities of it.
Let me guide you through the thoughts that led me to Tivoli.
Disclaimer: We are about to tread into meta programming, please choose cautiously what you would use in your production code.
Methods in Ruby are quite different from the functions we see in JavaScript.
To recap: In JavaScript functions are like any other object. They can be passed around, assigned attributes and so on. This is one of the core features of JavaScript and we should be quite happy that such an old (17 years) dynamic language lets us create highly dynamic code with functions as first class citizens.
In Ruby we clearly distinct methods from blocks, which are the two tools we as developers have to mix in a dynamic control flow. Methods are always defined on a class, even though this might be the eigenclass or the global main object. Methods can only be called in context with an object and a class. In contrast to JavaScript, where it is possible to pass null through a #call or #apply call. Blocks, namely procs and lambdas, on the other hand can be passed around in the same way as JavaScript functions and are often passed in a method through the normal block syntax, but also as normal parameters with the flip side of missing out on nicer syntax.
https://gist.github.com/2647673#file_blocks.rb
In JavaScript the only way to imitate Ruby blocks would be by passing in the function as an argument which reminds us of the above syntax. Maybe changing the minimal way of defining a function could make the below more appealing but for now i find myself not using anonymous functions/procs/lambdas and instead naming them for cleaner syntax.
A word on syntax:
In JavaScript we have to use parentheses when calling a function which feels nice and cosy like any "c-like" language. This has the benefit of letting us treat references to the function without any arguments or parenthesis as a reference and not as a call which in turn brings us the lazy feature of passing functions around in JavaScript and evaluating them when we choose in the context we see fit.
In Ruby, things are quite different for methods but similar for procs/lambdas. Ruby methods are in fact called when referred without parentheses and arguments which makes for nice short and clean syntax and compensates by using blocks when functionality needs to be passed around.
I think the design choices in Ruby are quite solid and bring the nice flexibility that we come to expect when expressing ourselves in Ruby. I encourage reuse of blocks in this manner as it is often a feature people tend to overlook as a way of DRYing up their code.
Even the block syntax feels clumsy at times for simple cases. Which got us the Symbol#to_proc and encourages some to work outside of the simple cases.
The short syntax that you see above unfortunately only captures the cases when the methods are in fact defined on the object.
So given a class method in this example JSON#parse we could create a proc that proxies the call and reuse it.
But would it not be cleaner to actually pass JSON#parse much like we would have done in javascript? Turns out we can - with #method.
Reading the docs on the Method Class confirms that a Ruby method is defined in the context of a object, meaning that there is a #reciever and an #owner method on a Method.
This got me thinking... There's got to be a way of reusing a method's definition for multiple class and at the same time satisfying my needy DRY addiction while removing the overhead of having a separate block for proxying every call.
We define a method #twice on Numeric
https://gist.github.com/2647673#file_twice.rb
Now lets say we want to reuse this method. How do we get around so that a method is bound to a reciever?
We want a piece of functionality that we could pass around like any other object just as in JavaScript. One could always call 1.method(:twice) but that would return an object that is bound to 1.
Enter at Method#unbind
“Dissociates method from its current receiver. The resulting UnboundMethod can subsequently be bound to a new object of the same class (see UnboundMethod).”.
UnboundMethod says
“Unbound methods can only be called after they are bound to an object. That object must be be a kind_of? the method’s original class.”
Ok, but what if I don’t have an instance of the class that I am copying the method from? Module#instance_method provides what we need. Please note that it does not in fact return a Method as one would expect at a first glance but an UnboundMethod since it would actually not be bound to an object.
Let’s try to bind the Numeric#twice that we defined above to String
This turns out to be a limitation in Ruby, at least MRI. Since Ruby is slightly evil, not letting us jailbreak twice, let’s bring in the heavy artillery ourselves: evil-ruby. Unfortunately this does not work with the latest MRI (1.9.3) atm, but highlights what lengths one would need to go, to achieve a solution to our problem. This makes me think that this is probably not a good idea out of a design or performance perspective.
Ok, but what CAN we do?
If we start off defining our functionality in a proc, it turns out to be quite simple to share it among classes.
But when you come to think about it, you could have an abstraction layer on top of this piece of functionality which included defining multiple methods that should be included and Voila! You have reinvented Module.
I have hopefully teased you enough to have a look at the implementation:
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
This time a fellow Burtling is traveling down to Verona to pass on some awesome engineering knowledge! jsDay -- a conference fully dedicated to JavaScript will take place next week in Verona, Italy. It's described as "the most needed conference", since JavaScript is the most used programming language on Earth.
In his own words (that we regulars non-developers might not quite understand)…
"Tools like Express and NoSQL-databases have made it easy to write web applications using Node.js. But what if we don’t need to serve HTML? What if we don’t need to do templating, CSS and pretty animations? What if we only want to provide an HTTP-interface to our data?
This talk will be about tips and tricks for building RESTful web services using Node.js. It’ll discuss challenges, pitfalls and shortcuts. It will deal with authentication, declarative ways to describe your data structures and validation.
If you’re serious about building a backend able to serve any kind of application or provide a public API for your users, and doing it without pain, this is a talk for you."
If you're in Verona next week get in touch with Jakob via @jakobmattsson or stay tuned for the video of the talk and slides on the jsDay website.
Just got a friendly email reminder from Stefan pointing out we have a lot of jobs announcements left on the blog that have already been taken.
BUT we'd like to point out we're always happy to meet amazing talents that find what we do interesting. So, you find some of previous openings challenging our just love what we do and see yourselves as a potential member of the Burt Team?
Drop us an email at [email protected] or come by our office if in Gothenburg or Stockholm.
The three golden rules for successful advertising formats
It seems as if all really successful, large scale advertising formats have three things in common. These rules apply to everything from the beautiful pages of *Vogue Magazine* to the relevant sponsored links at *Google.com*:
1. The format is a native, natural part of the experience
2. The format is simple enough for anyone to understand
3. The format is consistent across properties and over time
Not only are display ads placed out of the way, one single site can easily offer 20 different basic products (not counting options for rich media, targeting etc) and none of these products can be easily compared with one another or with other properties.
Not only does this make the online media consumer experience borderline horrific, it's also one of the main reasons online media properties are making pennies on the dollar compared to other channels.
It doesn't have to be that way.
We can make online advertising a natural part of every user experience, more zen, less chaos and create consistency across campaigns and properties. It's well possible for great media companies to have advertising revenues per reader on par, even beyond traditional media.
What's interesting is that we need nothing more than just getting our act together. Content, consumers, infrastructure. It's already there. As some smart people rightly point out, there are no silver bullets, and tweaked targeting, automated overhead or yet another performance metric will have little or no impact in the greater scheme of things.
However, the rules still apply.
Before going into how, I figured I'll explain each rule more in detail over the next week or two. After all, we've got it wrong for the last 15 years, so what's another couple of days?