Saturday, March 2, 2013

How to switch from Google+ Photos back to Picasa Web Albums

Looking for how to find the secret link to a photo inside Google+ photos? This is what I found:

The Google+ view of the Photos did not allow me to find the secret link to a given photo within an album. The other interface which I believe is called Picasa Web Albums does.

Here is how to get back to the original Picasa Web Albums interface that has that feature:  Use this special link to display the Picasa Web Albums interface, not the Google+ interface:

https://picasaweb.google.com/lh/myphotos?noredirect=1

Here is I stumbled upon it:

  1. Login to your Google Account.
  2. Go to http://support.google.com/picasa/answer/157000?hl=en&ref_topic=1689652 
  3. Scroll down until you see "Picasa Web Albums".
  4. Notice it says "Looking for a simple way to get photos from your camera and computer on the web? Google's Picasa Web Albums provides 1GB of free storage that makes sharing your photos a snap. Visit http://picasaweb.google.com."
  5. Click on http://picasaweb.google.com.
  6. Wait for a little bit. At the top of the page that is loaded you will see a message that disappears after a few seconds/minute: "Click here to go back to Picasa Web Albums".  A screenshot is shown below.
  7. That link goes to https://picasaweb.google.com/lh/myphotos?noredirect=1.


Saturday, January 26, 2013

RaiiCaps with GCC: error: cannot declare ‘::main’ to be a template

The idea of the raiicap class is described at RaiiCap pattern: Injected Singleton alternative for C++. However, the version of GCC I am using is affected by a bug ([Bug c++/24449] Unable to declare friend main() from class template) that prevents using the raiicap idea directly without code modifications.

Below is an attempt at a workaround:

When MAIN_IS_THE_FRIEND is defined above, we fail the compile on GCC (version 4.6.3) with:

/usr/bin/g++ -g -fPIC -Wall -Werror -Wsynth -Wno-comment -Wreturn-type test.cpp -c -o test.o
test.cpp:13:41: error: cannot declare ‘::main’ to be a template
make: *** [test.o] Error 1

But if we undefine MAIN_IS_THE_FRIEND then the compile succeeds.

This may or may not prevent malicious intent: In practice, these classes will likely be defined in header files, which can be included in other translation units, and exploited. For instance, it might still be possible for someone to define their own file static version of mainSurrogate in their own translation unit, and use it in that other translation unit to instantiate instances of Resource. However, this may just be enough to keep the majority of developers within the bounds of the original intent.