It’s the week of the underdog as Wall Street snubbed Apple and pounded Netflix but smiled on struggling AOL as the company swung to a profit last quarter on a massive sale of patents.The Netco, which owns the Huffington Post and has been trying to reinvent its business ever since the Time Warner days, earned $970 million in the second quarter vs. an $11 million loss the year before. Advertising sales rose 6%. AOL shares closed up 7.2% Wednesday at $29.48. In contrast, Netflix shares plunged 25% the day after it spooked investors with talk of higher costs and uncertain sub growth. And juggernaut Apple closed down 4.3% after its earnings report late Tuesday afternoon. AOL said total revenue of $531 million was down 2%, its lowest rate of decline in seven years. Domestic display advertising was flat but international surged 21%. Search revenue eased 1%. Subscription revenue from its legacy business fell 13%, in this case the lowest rate of decline in five years, the company said. In a conference call with investors Wednesday morning, AOL CEO Tim Armstrong said the flattish revenue was better than it appeared. “We have very strong growth going in video, mobile, premium formats,” he said. “We have the right products, the right level of staffing. It’s really about getting hyper-organized around this.” AOL posted a $946 million gain on patent sales worth more than $1 billion to Microsoft during the quarter. It’s returning the proceeds to stockholders through a transaction called a Dutch auction tender offer, which will see the company buy 14%-16% of its outstanding shares. Armstrong said costs were down on local news network Patch, a bone of contention with investors who’d like him to scrap it, and the service is on track to post revenue of $40 million-$50 million this year.