Technology

rdio.com: Intro and Pricing

I’ve used Rdio for the past half-year and thought I’d explain how it works. I also had Spotify for a similar amount of time before switching to Rdio. They are very similar; I liked Rdio more.

You rent music from Rdio for about $10/month (I’m paying $18 for my wife and me plus another $5 for my son). We each get unlimited music and downloads. We each have separate accounts. Really! You can download thousands of songs to your iPhone, iTouch, or other smart phones. Obviously, you can only download limited by storage capacity. I do that for music I listen to regularly so it keeps working while I’m on the subway. If music is not already stored on my device it is streamed so you can always listen to more music.
When you stop paying you lose access to the music.
You can download an app for you Mac — for some reason I tend to prefer desktop apps. Probably some outdated notion that desktop apps are more capable then a web based interface — not so true given the number of people that use web based interfaces.

Screenshot 5 16 13 11 22 PM

The web interface is pretty similar to the app. It’s nice because you can use it without installing any software so it’s much easier to use a work.

Screenshot 5 19 13 9 26 PM

Technology

Passing extra arguments to output operator

I usually implement the output operator for a class, operator<<().
I find it useful for debugging and regression testing purposes.
Occasionally when defining a class hierarchy with polymorphism in mind
I’ll instead define a virtual print() method.

Base  base;
std::cout << "base = " << base << std::endl;

Here’s the typical implementation:

class Base {
// ...
public:
    /// print Base with flags indicating hw much extra to include
    virtual void print (std::ostream &out, int flags);
};
std::ostream &
operator<< (std::ostream &out, const Base &base)
{
    base.print (out, 0);
}

So everything is great except… I now want to pass that extra
argument. I could write the following ugly code:

std::cout << "base = ";
base.print (std::cout, 1);
std::cout << std::endl;

Instead, I’m going to follow the example from <iomanip> and define a struct
that saves the arguments and then define an output operator for that
struct. The following code makes it so you can write the above as:

std::cout << "base = " << printstream (base, 1) << std::endl;

Here is the implementation of that. This expects the class to implement a method print() that takes a std::ostream and a second argument. It’s pretty easy to extend this to a print() that takes a third argument.

#ifndef INCLUDED_PRINTSTREAM_H
#define INCLUDED_PRINTSTREAM_H
#include 
namespace printstream_impl {
template
struct PrintStream1
{
    const ObjectType &  m_object;
    const Arg1Type &    m_arg1;
    PrintStream1 (const ObjectType &object, const Arg1Type &arg1)
        : m_object (object),
          m_arg1 (arg1)
    {
    }
    std::ostream &print (std::ostream &out) const
    {
        m_object.print (out, m_arg1);
        return out;
    }
};
template
std::ostream &operator<<(std::ostream &out, const PrintStream1 &ps)
{
    ps.print (out);
    return out;
}
} // End namespace printstream
template
printstream_impl::PrintStream1
printstream (const ObjectType &object,
             const Arg1Type &arg1)
{
    return printstream_impl::PrintStream1 (object, arg1);
}
#endif /*  INCLUDED_PRINTSTREAM_H */
News

Investing my money

Here’s some reinforcement from The Big Picture about why I have trouble putting money in the stock market:
Recall what Charles Ellis said when he was overseeing the $15-billion endowment fund at Yale University:

Watch a pro football game, and it’s obvious the guys on the field are far faster, stronger and more willing to bear and inflict pain than you are. Surely you would say, ‘I don’t want to play against those guys!’
Well, 90% of stock market volume is done by institutions, and half of that is done by the world’s 50 largest investment firms, deeply committed, vastly well prepared – the smartest sons of bitches in the world working their tails off all day long. You know what? I don’t want to play against those guys either.

NYC

Does it make sense to buy a house?

Here’s a great interactive graphic from Trulia.com that shows the ratio of renting to buying. The ratio is how many years of paying before you paid full price for an equivalent house. This data is comparing the median list price with that of a two bedroom apartment.

For example, in NYC renting is so much better that you’d pay rent for 39 years before you’d paid the amount the house costs. A good estimate is the rent-to-price ratio should be about 17:1.
The size of the circle shows how much the rent is (e.g. bigger circle means more rent). The color indicates the ratio (e.g. red means better to rent; green means better to own).

Grab 001 1

News · Technology

Iranian Hackers Suspected in Recent Security Breach

Looks like Iranian Hackers Suspected in Recent Security Breach are either trying to get back for Stuxnet and more on Stuxnet. More likely it was for a man-in-the-middle attack to install viruses or trojan horse by posing as the actual company and uploading a compromised version of the software. The compromised software could make it easier to monitor social networking sites, etc.

Comodo, a digital certificate authority and security software maker, said on Wednesday that it unwittingly issued fraudulent digital certificates for Web sites operated by Google, Yahoo, Microsoft, Skype and Mozilla. Digital certificates are used to vouch for the authenticity of a site owner and facilitate encrypted communications between sites and their users. Comodo revoked all of the certificates immediately upon discovery of the incident and notified the site owners, the major browser makers and relevant government authorities, it said.

Politics

Corporate Taxes: Maybe not so high

So you think US corporate taxes are too high? It’s holding back the economy? Here is what poor General Electric has had to pay.

Grab 0011

What’s that right most graph? “Effective Tax Rate”: aren’t those numbers negative? What, US taxpayers paid them money? They most have declared heavy losses. What, they made billions of dollars every year for the past seven years except for 1 year!
Corporate welfare at it’s best!