January 12th, 2009, by mlambie
I like to have wider images in Cacti, the system we use to monitor our servers.
Specifically, I like to have images that are 750px wide instead of the default 500px. It can be cumbersome to change the templates individually, so the following SQL can be executed against your Cacti database and they’ll all be changed at once:
UPDATE graph_templates_graph SET width = 750 WHERE ID > 0;
I’ve found that some templates can’t jam all their information into a 500px wide image, so this SQL fixes that. It’s annoying having to reverse-engineer the database every time I add a new device template but now I have this post to refer back to.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: cacti, mysql, SQL
Posted in Tips and Tricks | No Comments »
January 12th, 2009, by tony
Ajax is a fairly broad technology with so many different client side and server side approaches that it’s hard to provide generic best practice rules. This however is one.
Requests via ajax tend to be handled asynchronously these days, communicating with the server whilst keeping the user interface active and responsive. This approach provides a potential problem though as it is possible to make a request and not worry about results, presuming what was sent just worked.
Better practice is to always respond from the server and at least have some form of simple logging at the client side so you can be certain communication is working as expected. It is simple for the server to respond with JSON in the form of:
{success:1}
This provides several pieces of information. Firstly the server action completed and was not met with an error such as error 500 (server error) or error 404 (page not found). Also if we toggle the “success” value with true or false, depending on the success of the request, we know that the process we requested was successful or failed. In one small line we rule out several potential points of failure.
Note that most major JavaScript libraries provide a simple means of handling success and failure so this is not hard to implement. In the case of Prototype you need only look at the “onError” and “onSuccess” attributes when defining the initial Ajax request.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: AJAX
Posted in Code, Inside TFG, Tips and Tricks | No Comments »
January 9th, 2009, by aaron
There are five developers here at The Frontier Group and four of us have partners. That’s nine people, between them there are eight Apple laptops of various vintages. Five of them are our own Macbook Pros. If you were to say that we are impressed with Apple products and enjoy using them daily then I’d say you are dead right!
Apple have recently released their new 17″ Macbook Pro and have given it an embedded, non-removable battery pack. On initial impression this seems to be quite a limitation. In reality given that they are touting 8 hours of battery life and 1000 recharges the battery could quite legitimately last 2-3 years of even the most heavy use.
Their video detailing why they went with an embedded battery and how the battery pack is manufactured is pretty interesting. It explains how the batteries are manufactured and where they saved space and weight as well as the improvements they made to increase the lifespan of the battery pack.
My assumption is that the battery is replaceable, it’s just that you’ll need to take it to a service centre to have it done. They don’t seem to mention this on the website though so I may be wrong.
If the battery is truly and completely irreplaceable then I think their claims of environmental friendliness and so on would be debunked. I guess we’ll hear about it in a couple of years time.
All in all though I’m pretty excited about the new Macbook Pro and after having seen one in the flesh at work I’m keen to see one in my own hands some time this year or next.
UPDATE : According to Gizmodo the battery is replaceable after all for US$179. To me that seems like an entirely reasonable price if the battery life lives up to the claims.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Apple, Batteries, Mac, Macbook
Posted in Product Reviews | 1 Comment »
January 8th, 2009, by aaron
Debugging most things that include a jQuery chain can be annoying at best and virtually impossible at worst. Now there is a jQuery Firebug Plugin that helps when debugging Javascript that uses jQuery and it seems to do it very well! The plugin allows you to call debug(), assert(), log() or any other Firebug 1.2 call at any point in your chain. Fantastic!.
There are examples in the article of how to use jQuery.Firebug() so I suggest taking a peak.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Firebug, jQuery
Posted in Websites or Tools | No Comments »
January 7th, 2009, by aaron
I thought that I understood Ruby a little bit, but after reading Robert Sosinski’s article on Blocks, Procs and Lamdas in Ruby I felt a little humbled. To take such a small part of a language and express such detail and give some very useful examples really impressed me. The similarities between some of the ways I do things using Javascript and his examples really surprised me too.
I’d recommend giving it a good read to really understand how things work with these constructs and it may even give you a few new ideas on how to approach some problems you’ve encountered along the way.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Rails, ruby, Ruby on Rails
Posted in Ruby on Rails, Websites or Tools | No Comments »
Follow Us