C++ pre-processor and decltype references

I’m experimenting with the Boost PP library and found these links useful: C Preprocessor, difference between std::result_of and decltype and name lookup tricks (the latter has a handy trick for declaring return types in a template to workaround name lookup phase issues). The question on StackOverflow that promted me to look at Boost PP was reflection in C++

Leave a comment

Filed under C++

Contactless payment on buses

We are now able to pay by cards enabled with NFC – but what are the chances of paying multiple fares?

TfL warned Oyster card users in an email that they should take care when swiping their wallet against readers if they own more than one NFC-enabled card. “If you present two cards together, the reader will normally reject them both,” said TfL. “But there is a small possibility of payment being taken from a card which you did not intend to use.”

Leave a comment

Filed under Technology

iPhone tricks

I recently found out that you can zoom in on an iPhone camera by pinching the picture and you can take a screen shot by pressing Square + Power together:

20121217-131129.jpg

Leave a comment

Filed under Technology

Knight Capital takeover rumours

Knight Capital’s fall from grace was well publicised after a software glitch cost them $440 million. Now there’s talk of a takeover.

Leave a comment

Filed under Finance

Vision of touch typing in the future

This alternative keyboard layout would change the amount of travel each finger has to make in order to touch type. The article doesn’t give any figures as to speeds achieved after practice and to be honest I’m not sure you’d gain much over a mini-QWERTY keyboard.

Leave a comment

Filed under Technology

Brett Victor – A Brief Rant on the future of Interaction Design

Brett Victor makes a convincing case that we shouldn’t sell our futures selves short by settling for a limiting future based on “Pictures under Glass”.

Leave a comment

Filed under Technology

Capture-by-Move for lambdas in C++

Marco Arena looks at how to implement move semantics for lambda captures – useful if you wish to capture a large object without using shared_ptr (perhaps to avoid other parties mutating the object outside the lambda).

John Bandela proposed an alternative approach.

All very interesting, but as the comments suggest, it’s best to introduce an extra parameter to the lambda and use std::bind:

function CreateLambda()
{
  std::vector<Huge> hugeObj;
  // ...preparation of hugeObj...

  auto toReturn = std::bind(
    [](std::vector<Huge>& hugeObj)
    { /*..operate on hugeObj..*/ },
    std::move(hugeObj));

  return toReturn;
}

Leave a comment

Filed under C++

Introduction to Modern C++ Techniques

Excellent tutorial on a selection of Modern C++ techniques by Michael Caisse.

Topics include:
Policy Based Design
SFINAE
Tag Dispatching
Traits
Curious Recurring Template Pattern

This is a two part video series:

and with slides.

Leave a comment

Filed under C++, Video

Why concurrent programming is tough

Raymond Chen relates a story where the debugger obscures the very information that provoked the bug.

Be aware that the value in the crash dump is the value that existed in memory a split second after the crash occurred. During that split second, other things may have happened.

Leave a comment

Filed under Programming

The story of BBC News Online

Really enjoyed reading the history of BBC News Online, which apparently started as a skunkworks project and succeeded largely because of the passion and technical brilliance of a small group of people.

Leave a comment

Filed under Technology