Awesome quote stolen from “The Embedded Muse”

While I try to keep this blog to (more or less) original content I write, I liked this quote from the Embedded Muse so much that I had to steal it:

Norm Augustine, retired chairman and CEO of Lockheed Martin, wrote a book called Augustine’s Laws that documents observations he made as a government contractor. One of those was that by the year 2054 the entire US defense budget would buy just one aircraft, due to their spiraling costs. In the May 9-22, 2016 issue of Aviation Week and Space Technology (often called Aviation Leak and Secret Technology due to their outing of many programs) he wrote this revealing statement:

“Another law from the 1960s used historical data, fearlessly extrapolated, to show than an ever-increasing fraction of an aircraft’s weight was being devoured by electronics and in 2015 would leave no room for pilots. Thus, we have today’s dilemma wherein pilots must remain in Nevada while their aircraft burn holes in the sky all around the planet. The Wright Brother surely are doing barrel rolls in their graves.

“Of course, some observers have questioned how, as these laws seem to imply, it would be possible to endlessly add cost to an aircraft when nothing more can be added to an aircraft’s weight, not even a pilot. To do this would require a colorless, odorless, weightless substance whose cost – like entropy – would continue to increase forever. Fortunately, the industry’s engineers were up to the task: the elusive substance is software.”


Buguntu family album

This is a very cool family album: http://blog.nizarus.org/2010/04/ubuntu-the-family-album

Can’t wait to upgrade to 10.04, my current install (9.10) is working like crap.


Ubuntu Day

Spanish only: GNU/Linux, Guía de Supervivencia – Versión Ubuntu Day

Released under WTFPL if you care to know. Source code to be available soon too.


CM WTF

Seen on a cablemodem’s configuration page:

<form action="http:/loginData.htm" method="GET">
Long version: The other day, while stranded on a CLI (using ssh) I did a wget $IP, to see a modem’s status web page. I’d have thought an electronic device (which, obviously, is much more difficult to upgrade than a software product, and that’s difficult enough as it is) is a little bit better tested than that. I should have known better by now. comcast_cablemodem

“Good Linux users don’t talk about Microsoft”

I don’t usually post links, I’d rather write something myself, but check out this quote:

You don’t see me calling Linux users tux turds, penguin poopers or GUI-challenged, do you?

http://www.pcmech.com/article/good-linux-users-dont-talk-about-microsoft/

Enjoy


Tech Support

Two comics this month, but I’m sure it’s worth it:

This advice would have saved me a couple years of life. Normal post tomorrow.


Something to add to your news reader




C++: Magic member callbacks

Short post about C++ this time – though calling it a request would be more appropiate. I’m trying to create some kind of magic callback to do this:

class Caller {
	Callback c;
	public:
	Caller(Callback c) : c(c) {}
	void doit(){ c(this); }
};

Shouldn’t be too difficult, right? There are some hidden complexities, of course, mostly regarding the callback parameter type, but the idea is simple, keep the caller dependant only in the callback, not in the callee.

Templates are not a valid solution as the callee may have more than one callback (i.e. expect more than a single object to finish and call the callback) so the whole idea of this is having the callback “bind” to a member method when created, doesn’t matter which one.

I have a solution, tough I’m not too happy about it for now. I’ll post it next week, unless someone comes up with a better idea (you know how to submit it if you do, right?).

cpp

self.uptime = 725328000

Today it’s been 725328000 seconds of uptime since I was promoted from Release Candidate to V1.0. Still waiting for security updates though. new-super-mario-bros

Vim tips: Using macros

vim_editor Clik-click tap, clik-click tap, clik-click tap. A team mate is performing some kind of repetitive operation with text and it’s becoming more and more annoying. Good news, there’s a way to keep your mental sanity and help this guy to be more productive: replace him with a sed/awk script teach him how to use Vim macros!

Vim macros can repeat for you a sequence of commands. Press qq to start recording, then q again to stop. Use @q to execute a macro. Let’s try it:

This – random garbage
is – random garbage
a – random garbage
sample – random garbage
text – random garbage

So, how would you get rid of the random garbage? Move the cursor to the beggining of the first line, press qq to start recording then f- to move the cursor to the dash and d$ to delete the rest of the line. Now move the cursor to the begging of the next line (0j) and press q to stop recording. Now press 4@q to repeat the macro for times and check the results; you should have something like this:

This
is
a
sample
text

Neat, huh? You can also store any number of macros using a different letter after the q to start recording, for example qn to record and @n to execute. Also, use @@ to execute once again the last executed macro (from any buffer).

There are some more things you can do with macros (like editing before executing one) but the best source for that is the manual.