Pure silicon for quantum computing

The BBC reports that American physicists have found a way to purify silicon better than ever before.

The good stuff is silicon-28, and physicists in the US have worked out how to produce it with 40 times greater purity than ever before.

Even better, they can do it in the lab instead of relying on samples made ten years ago in a huge, repurposed plutonium plant in St Petersburg.

Leave a comment

Filed under Technology

How to generate tests under GTest

One of the many features provided by GTest is the ability to generate test at runtime. One useful application of this is that you can execute data-driven testing by obtaining a list of test file names, then generating a test for each of them. It’s actually very simple to do this in GTest – they call these value-parameterized tests (see documentation). Here’s a snippet of code to demonstrate how little overhead is involved:

#include <gtest/gtest.h>

using namespace testing;

// placeholder - could be used for test setup/cleanup
class MyTest : public ::testing::TestWithParam<std::string>
{
};

TEST_P( MyTest, IntegrationTest )
{
    std::string test_file_name = GetParam();

    // open file and run the integration test
}

std::vector<std::string> test_file_names();

INSTANTIATE_TEST_CASE_P( MyLibraryName, MyTest, test::ValuesIn( test_file_names() ) );

On one hand, this approach isn’t really in the spirit of unit test – data-driven tests have a habit of quickly escalating to integration tests between libraries. However, such integration tests also have their place in a testing strategy, and this is a neat way to accomplish it with minimal overhead.

1 Comment

Filed under C++, C++ Code, Programming

Restaurant Review: Monty’s Inn, Beaulieu, Hampshire

Monty's Inn, Beaulieu

Monty’s Inn, Beaulieu


Really enjoyed lunch at Monty’s, part of The Montague Arms Hotel, at Beaulieu in the New Forest. This was my first visit, but will definitely be going back. The sea bass served with saffron potatoes and breaded mussels with caramelised shallot puree was beautifully presented. The chocolate mousse with raspberry sorbet and shortbread was delicious. We walked to Monty’s from Buckler’s Hard, a historical maritime visit – also worth a look.
Five Stars

Leave a comment

Filed under Restaurant Review

Development processes at Microsoft

This article provoked a lot of discussion about software development and architecture where I work.

With a few more weeks for managing the transitions between the phases of development, some extra time for last-minute fixes to both the beta and the final build, and a few weeks to recover between versions, the result was a two-year development process in which only about four months would be spent writing new code. Twice as long would be spent fixing that code.

For me, this paragraph sums up where multi-year release cycles are just plain wrong:

In addition to making the Visual Studio team enormously unresponsive, this development approach wasn’t much good for team morale. A feature developed during the first development phase wouldn’t properly get into customer hands for the better part of 18 months. For Windows and Office, with their three-year cycles, the effect is even worse. A developer could be waiting more than two years before the work they did would ever make it to end users. Most developers actually want their software to be used; it’s just not that satisfying to know that you’ve implemented some great new feature that nobody will actually use for years. With Microsoft’s long development cycles, a developer may not even be on the same team—and may not even be at the company—by the time their code makes it to desktops.

Leave a comment

Filed under Programming

Brain-Inspired IBM Chip Puts Traditional Computers To Shame

Article from NBC news on IBM’s new computer chip. Apparently it has 5 billion transistors on a single chip.

Leave a comment

Filed under Technology

Book Review: Hell’s Kitchen, Jeffery Deaver

Hell's Kitchen, Jeffery DeaverIn this book, Deaver introduces yet another new character, John Pellam (that’s along with Lincoln Rhyme and Kathryn Dance who are both sort of investigators). It took a while to get to know John Pellam, unlike the others, to whom Deaver cleverly introduces the reader in each other’s books. He’s not the typical star of a thriller – he works in the movie business, yet this book isn’t set in Hollywood or even on a film set, so the book plodded along until the real plot emerged. Fortunately, Pellam turns out to have experience as a stunt man, just as the action gets tough and he needs to roll with the punches.Three stars

Leave a comment

Filed under Book Review

Book Review: The Redeemer, Jo Nesbo

The Redeemer, Jo NesboThe quality of writing by Jo Nesbo (or possibly the translator?!) hits you as soon as you begin his books – this one is every bit as good as The Redbreast. Whilst some of the Harry Hole books are grisly, this one doesn’t rate too high on the bloodthirsty scale (although one incident with a vacuum cleaner isn’t for the squeamish).Five Stars

Leave a comment

Filed under Book Review

Book Review: The Concrete Blonde, Michael Connelly

The Concrete BlondeThis is another book in the Harry Bosch series from Michael Connelly. There are strong connections to another book in this series, The Dollmaker, so best to read that first. I particularly liked that we followed two story lines, the first being a court case with Harry Bosch unusally appearing as the defendant, the second being a new investigation into a murder. On the personal level, we found out some more about Harry’s relationship with Sylvia – but, strangely, no mention of Harry’s daughter at all (in other books, she lives with him and is quite significant in the story). Four stars

Leave a comment

Filed under Book Review

F# equivalent of C++ ‘Most vexing Parse’

I first read of the C++ “Most Vexing Parse” in the Scott Meyers Effective C++ series. For reference, here’s the code:

double aDouble;
int i(int(aDouble)); // This doesn't do what you think

The commented line actually declares a function i that takes a single integer parameter and returns an integer. Now, today, I saw something similar in F# that made me scratch my head and I think is similar:

let func a b c =
    return a + b + c

let main () =
    let sum = func a b
    // use sum
    0

The symptom was that my function (here, called func) wasn’t being called. Yet stepping through in the debugger, I could break on the line that called it – yet it wouldn’t step into the function! Of course, by missing one of func’s parameters in the function call, I’d actually declared sum to be a new function taking one parameter (or to use functional terminology, I’d curried a and b).

This is hard to spot when the calling code and function declaration are in separate files and when you’ve added a new parameter to the function and it still compiles but doesn’t do what you expected!

Leave a comment

Filed under Programming

Birthday Paradox

Nice write-up of The Birthday Paradox on the BBC today.

It’s puzzling but true that in any group of 23 people there is a 50% chance that two share a birthday.

Some bright spark noticed that, with exactly 23 players in each World Cup 2014 squad, here was a topical example with which to test the theory, by which at least half of the 32 squads are expected to have a shared birthday.

Using the birthdays from Fifa’s official squad lists as of Tuesday 10 June, it turns out there are indeed 16 teams with at least one shared birthday – 50% of the total.

Leave a comment

Filed under Musing