backing up pics from iphone to Mac

Perhaps there are tons of post out there about how to achieve this. This for my personal convenience about how to backup images. There are various ways:

  1. iTunes backup
  2. using iPhoto
  3. using Image Capture Program

I don’t prefer iTunes for this- somehow i don’t feel i am in control with that backup, don’t want to pay for iPhoto so using Image Capture Program is the only option for me.

Steps:

  1. Cmd + Space Bar — Image Capture
  2. Select the iPhone in Image Capture application
  3. Select pictures and videos that you want to move
  4. you may want to delete the images from iPhone as part of moving to Mac

That’s it.

Sharing Options:

curious case of 20GB address space reservation

Recently I have been tracking a case where some code from a third party library was fiddling up with address space of my application. Address space was very important back in Win32 days you had only 2GB (3GB for large address aware applications), but with x64 Windows 7 allows you to reference up to 8TB (that’s right 8192GB). Well, no one needs that much address space as of today- but a lot of times it is the first thing you look at when your application is running out of memory.

Such thing happened with me: due to some bug in a very thick algorithm, while loop never terminated and kept on allocating memory internally. It allocated so much memory that Windows started having problems with Low Memory Condition and finally had to quit the application. As for investigation I noticed that application reported it’s address space was ~82GB while Task Manager reported it’s Working Set to be ~48GB- what was puzzling was my application during the run had reserved ~34 GB address space for nothing.

Continue reading

Sharing Options:

origin of endian

While reading about Endian-ness with microprocessor I became curious about how this term came into existence. The terms Big-Endian and Little-Endian come from Part I, Chapter 4, of Jonathan Swift’s Gulliver’s Travels. Here is some background what Big and Little mean in here:

The novel further describes an intra-Lilliputian quarrel over the practice of breaking eggs. Traditionally, Lilliputians broke boiled eggs on the larger end; a few generations ago, an Emperor of Lilliput, the Present Emperor’s great-grandfather, had decreed that all eggs be broken on the smaller end after he cut himself breaking the egg on the larger end. The differences between Big-Endians (those who broke their eggs at the larger end) and Little-Endians had given rise to “six rebellions… wherein one Emperor lost his life, and another his crown”. The Lilliputian religion says an egg should be broken on the convenient end, which is now interpreted by the Lilliputians as the smaller end. The Big-Endians gained favour in Blefuscu..

Related articles

Sharing Options:

boost with XCode

Sometime ago I was trying to port one of my experiments on Mac OS X. The application relies on boost library, so there was need to get started with boost on Mac. And I wanted to use XCode all the way along. Coming from Windows meant browsing thru XCode build settings to figure out what goes where. Visual Studio Property Pages and XCode Settings don’t match really well, from UI point of view.

XCode puts the compiler application somewhere in deep guts of \Developer directory, so copying the boost libraries was not really an option. Mac OS X being UNIX underneath meant I had a global include/lib/bin directory where I can put boost libraries once built. What follows next is visual summary of building and installing boost on Mac OS X.

It starts with boot-strapping boost build engine:

Continue reading

Sharing Options:

C++ Template Metaprogramming Part 2 of n

Series:
1. C++ Template Metaprogramming
2. C++ Template Metaprogramming Part 2 of n

This is second in series and I would like to expand on thinking recursively in this part, before than introducing other concepts. For this post lets create a template metaprogram to check if given number is prime or not.

This a standard iterative implementation of checking whether the number is prime:

bool isPrime(int number)
{
    if(number < 3)
        throw std::invalid_argument("numbers less than 3 cannot be primes");

    //  any even number cannot be a prime
    bool result = number % 2 != 0;

    for(int divisor = 2; result && divisor < number/2; ++divisor)
    {
        result = number % divisor != 0;
    }

    return result;
}

All highlighted lines have one or more terminating conditions for computation. Line 4 checks for valid input, 7 filters out all even numbers. Line 9 ensures we terminate if have tried a lot of divisors (number/2 is the last thing we want to try) and 11 checks whether number is a multiple of divisor.

Given this it is implement a recursive equivalent with said terminating conditions:

bool isPrime_rimpl(int number, int divisor)
{
    return  number == divisor ? true :
            number % divisor == 0 ? false : isPrime_rimpl(number, ++divisor);
}

bool isPrime_r(int number)
{
    if(number < 3)
        throw std::invalid_argument("numbers less than 3 cannot be primes");

    return isPrime_rimpl(number, 2);
}

Continue reading

Sharing Options: