Recommended Agency

text controls: text only | A A A

Sorry, our twitter status is currently unavailable, posted 4 minutes ago

RSS feed icon What is RSS?

blog.

articles tagged with: programming


Displaying all 6 articles

18th Century Mathematician Helps Us Check An Algorithm

18th Century Mathematician Helps Us Check An Algorithm

The other day, I was discussing with one of the developers here at Focus how to approach a problem whereby we’d send off a message to a third party software service, and we wanted to know when they’d processed our message.

The problem was: we didn’t know exactly how long it would take - perhaps it would be a few seconds, perhaps a minute or more - but it seemed unlikely (from our testing) to take more than a few minutes.

We could have checked to see if they were finished every second, but that seemed a little too often - but we did want to know fairly quickly, so we didn’t want to wait minutes before checking.

We decided on a solution of a simple “backing-off” algorithm - we’d check, wait 1 second, check, wait 2 seconds, check, wait 3 seconds, check, and so on.

This means that if the process does take a while, we get gradually more relaxed about checking again as time goes on; after the 30th check, we wait 30 seconds before checking again.

(Significantly more advanced approaches may be used for this kind of algorithm, but this simple approach seemed good enough here.)

However, I thought we should sanity check ourselves - if we allowed, say, 50 of these checks, how long are we waiting at a maximum? A few minutes? An hour? Several hours? More? How can we tell?

Carl Friedrich Gauss

Gauss was an 18th Century mathematician who made a large number of contributions to many fields in maths and science, and demonstrated his skills from an early age.

There is an anecdote, which may or may not be true, but remains a good story, that whilst at primary school, his teacher asked him (perhaps to “keep him quiet” for a while!) to add up all the numbers from 1 to 100.

His teacher, we can assume, thought it would take him quite some time  to add 1 plus 2 (3), plus 3 (6), plus 4 (10), plus 5 (15), plus 6 (21) ... and so on - and of course the additions would get harder as you went onwards.

The teacher was therefore rather surprised when Gauss gave the correct answer - 5,050 - within just a few seconds.

Gauss had realised that, if you imagine the sequence of numbers in a line, the first and last numbers - 1 and 100 - when added, would produce 101. Imagine, then, the next pair inwards - 2 and 99 - they also add up to 101. So does the next pair - 3 and 98 - 4 and 97 - 5 and 96 - and so on.

In effect, you’re adding 50 pairs of numbers, all of which add up to 101.

50 times 101 is 5,050, as a primary school child can indeed tell you. (A theory I’ve tested successfully on my youngest primary school child!)

Back to our algorithm

Our problem is, of course, the same - we’re adding 1 second + 2 seconds + 3 seconds and so on, up to 50.

So, we have 25 pairs of numbers, each adding up to 51.

25 times 51 = 1,275 seconds, which equals just over 21 minutes.

This seems to fit our requirements well - 20 minutes is a fair amount of time to wait - if the third party service isn’t complete by then, it seems reasonable to assume it’s failed, and we can take the appropriate steps to follow-up manually.

Thanks, Carl

Whether or not the anecdote is true, exaggerated or apocryphal, it’s a lovely example of how a little clever thinking can make what seems like a slow manual process (adding 1, plus 2, plus 3, plus 4, plus 5 .. and so on ...) into a fairly straightforward calculation.

If you’d like the team here at This is Focus to see if we can find any clever solutions to your manual business processes, please do get in touch with us!

(Image from Wikipedia, in the public domain.)

Neil Smith
Neil

Created on Tuesday June 18 2019 09:35 AM


Tags: programming


Comments [0]








Annette's a Rails Girl

Annette's a Rails Girl

Heard of Rails? Heard of Girls? What about RailsGirls?!

(Ruby on) Rails is, and I quote Wikipedia: "an open source web application framework written in Ruby". In layman's terms, it's what our clever web developers use to make our websites.

Girls are... well, insert your own answer here.............. (try wonderful, clever etc). But for me as a Girl, I didn't know much about Rails, or Ruby - and in fairness, I don't need to - but I was starting to want to.

Over the three years I've been here at Focus, I've seen and heard lot of code-y, tech-y stuff, like 'Gems', 'Frameworks', 'Scaffolds' and the like. I see black screens with white text on that looks like something out of the Matrix, and I am DEAD impressed. So when I heard about the latest Rails Girls event in Bristol, I signed myself up to find out more.

So a couple of Saturdays ago I headed over to At-Bristol (where loads of cool stuff was going on with kids flying drones and all sorts!), and got stuck in to a really informative, interesting and empowering day. The guys running the sessions all had different experiences with Ruby and Rails. We learnt some basic information, terminologies and the like, did some tutorials, had a yummy lunch, and then onto the highlight - building our own web application. With the assistance of several experienced helpers, I managed to set myself up a server and make myself an 'ideas application'. I made CSS styling changes, created new 'ideas' (headlines with text), I even made buttons that facilitated an image upload.

Back at work on the Monday after the event I proudly showed off my work. I think the developers sniggered into their sleeves a bit :-) but everyone was interested in what I'd done and how I'd done it.

Moreover, I now feel better informed; when talking to our developers and also hearing them talk, and seeing what's happening on their screen when I ask for changes to a website. I know what a Gem is, and what it means to create a new scaffold. And it helps talking to clients about their website work, I can better picture what might be involved with what sounds like a simple change...

So huge thanks to @RailsGirlsBriz - I enjoyed the day and learned lots of new stuff. And the fact they run these events for free I think is marvellous. Can I go to the next one?

Annette Ryske
Annette

Created on Wednesday December 10 2014 09:43 AM


Tags: website open-source web-development bristol rubyonrails ruby rails programming


Comments [0]








Focus are hiring....

These are busy times in the Focus studio, so we're after two new people to join the team - an experienced web developer and an account manager! Both roles are full time and based at our Bristol office....

Web Developer

We're looking for a web developer to work in our central Bristol office. Preferably we're after someone with experience of the Ruby on Rails framework but we're also happy to hear from applicants with strong skills in other MVC frameworks and PHP programmers looking to get into Rails and we're happy to provide training.

You'll be working throughout the project lifecycle - meeting clients to confirm requirements, writing specifications, coding (front and back-end), testing and some minimal sys admin work.

Back-end, we're focussed on Ruby on Rails, which we use for all our sites - there will definitely be front-end XHTML / CSS work too. We mainly use Macs for development, but are flexible if you're a Linux or Windows die-hard.

You'd need either some Ruby on Rails or strong skills in another MVC framework. Commercial experience is a plus, but we'd also like to talk to you if you've been doing Rails in your spare time and are looking for your first commercial Rails gig. Your XHTML and CSS is expected to be solid, and you'll hopefully have good Javascript chops too - we use jQuery, so that would be ideal. You should know your way around a database (ideally MySQL), have some experience of version control, and be comfortable working from the command line.

Salary for this role between £25k and £30k dependent on experience.

To apply please send a CV and covering email to:
devjob@thisisfocus.co.uk

If you have a relevant blog, or code samples, they would also support your application.


Account Manager

We're looking to recruit an experienced Account Manager to help provide proactive services to our wide range of clients.

Key responsibilities of the role include:

 - creating effective and innovative solutions and digital strategy for our range of clients.
 - provide a day to day point of contact for multiple accounts, responding to work requests and scheduling work within the studio.
 - developing relationships with key individuals to generate work and revenue.
 - using Google Analytics to track web site goals and objectives.
 - search strategy including optimisation and PPC campaigns.
 - assisting with marketing and new business sales.

A full job specification is available. 

Ideally we're looking for someone with experience in a similar agency environment, with excellent communication and organisation skills and a flexible approach to manage multiple accounts.

For more details or to apply please send a CV and covering email to:
hello@thisisfocus.co.uk

If you have a relevant blog that would also support your application. 

Salary for this role between £25k and £30k dependent on experience.


For both roles - strictly no agencies

 

Neil Smith
Neil

Created on Friday June 17 2011 09:37 AM


Tags: web-development ruby programming


Comments [0]








Ruby & rails: Just like peas and carrots

Ruby & rails: Just like peas and carrots

We often get asked what language we use to build our sites, and as first point of contact with the client, I chirpily rattle off the reply: 'Ruby on Rails!' It sounds nice, comes with gems and I'm pretty proud of myself (as a non-tecchie) for even knowing that much!

But what does it mean? Why do we use Ruby over any other more widely used programming language? I realised I wasn't entirely sure, so set myself the task of finding out.

Rails is the framework that grew out of the development of the popular project management tool Basecamp 

Open source, it enables people to use it and deploy 'commits' to it (contribute to its growth) and is increasing in popularity all the time. Some sites you may have used that are built in Ruby on Rails (apart from ours!) are:

  

 

So why do we use it? One reason, really: It's so much less complicated than some other programming languages.

Ruby on Rails is designed to use less code than other programming methods, meaning less repetition, quicker development times and less margin for error. 

Its two main principles, Convention over Configuration and Don't Repeat Yourself, mean that it's more intuitive for programmers and enables them to programe more quickly and with A LOT less code. In short, we think it's better than anything else out there.

Drop us a line if you would like to know more!

 

 




Ruby & rails: Just like peas and carrots

Ruby & rails: Just like peas and carrots

We often get asked what language we use to build our sites, and as first point of contact with the client, I chirpily rattle off the reply: 'Ruby on Rails!' It sounds nice, comes with gems and I'm pretty proud of myself (as a non-tecchie) for even knowing that much!

But what does it mean? Why do we use Ruby over any other more widely used programming language? I realised I wasn't entirely sure, so set myself the task of finding out.

Rails is the framework that grew out of the development of the popular project management tool Basecamp 

Open source, it enables people to use it and deploy 'commits' to it (contribute to its growth) and is increasing in popularity all the time. Some sites you may have used that are built in Ruby on Rails (apart from ours!) are:

  

 

So why do we use it? One reason, really: It's so much less complicated than some other programming languages.

Ruby on Rails is designed to use less code than other programming methods, meaning less repetition, quicker development times and less margin for error. 

Its two main principles, Convention over Configuration and Don't Repeat Yourself, mean that it's more intuitive for programmers and enables them to programe more quickly and with A LOT less code. In short, we think it's better than anything else out there.

Drop us a line if you would like to know more!

 

 




Ruby & rails: Just like peas and carrots

Ruby & rails: Just like peas and carrots

We often get asked what language we use to build our sites, and as first point of contact with the client, I chirpily rattle off the reply: 'Ruby on Rails!' It sounds nice, comes with gems and I'm pretty proud of myself (as a non-tecchie) for even knowing that much!

But what does it mean? Why do we use Ruby over any other more widely used programming language? I realised I wasn't entirely sure, so set myself the task of finding out.

Rails is the framework that grew out of the development of the popular project management tool Basecamp 

Open source, it enables people to use it and deploy 'commits' to it (contribute to its growth) and is increasing in popularity all the time. Some sites you may have used that are built in Ruby on Rails (apart from ours!) are:

  

 

So why do we use it? One reason, really: It's so much less complicated than some other programming languages.

Ruby on Rails is designed to use less code than other programming methods, meaning less repetition, quicker development times and less margin for error. 

Its two main principles, Convention over Configuration and Don't Repeat Yourself, mean that it's more intuitive for programmers and enables them to programe more quickly and with A LOT less code. In short, we think it's better than anything else out there.

Drop us a line if you would like to know more!