The Toronto stock market was little changed Thursday amid mixed earnings news from the resource sector and lower commodity prices.The S&P/TSX composite index gained 8.82 points to 12,681.12.The Canadian dollar rose 0.18 of a cent to 97.12 cents US.U.S. indexes were lower amid earnings from General Motors and Facebook that beat expectations and the Dow Jones industrials lost 60.5 points to 15,481.74. The Nasdaq edged 2.88 points ahead to 3,582.48 and the S&P 500 index declined 3.08 points to 1,682.86.Goldcorp Inc. (TSX:G) is reporting a US$1.93 billion net loss in the second quarter, which it says resulted from the writedown of a major Mexican operation. The Vancouver-based mining company says it would have been profitable in the second quarter without the writedown. However, its adjusted earnings were down from last year and missed analyst estimates and its shares were down 44 cents to $28.80.Teck Resources Ltd. (TSX:TCK.B) is reporting second-quarter adjusted profit of $197 million or 34 cents a share, down sharply from $398 million of profit a year ago but three cents above estimates. Teck, one of Canada’s largest coal producers and a major miner of copper, zinc and other commodities, said it’s increasing cost-reduction efforts to deal with lower prices for its products. Its shares advanced 62 cents to $24.31.Global fertilizer producer PotashCorp (TSX:POT) is lowering its profit estimate for the current year and planning to spend up to $2 billion to buy back some of its shares. PotashCorp posted quarterly net earnings of of $643 million, or 73 cents per diluted share, up from $522 million, or 60 cents per share in the same period a year ago. The results missed estimates of 79 cents and its stock dropped $2.05 to $37.12.Husky Energy (TSX:HSE) gained 37 cents to $29.95 as it said quarterly profit rose 40 per cent from a year ago to $605 million or 59 cents a share. Earnings ex-items were 62 cents, five cents better than estimates.In the U.S., General Motors says second-quarter net income fell 16 per to $1.26 billion or 75 cents a share cent as slowing international profits and losses in Europe offset strong North American earnings. Still, GM soundly beat Wall Street expectations. Excluding one-time items, it made 84 cents per share. Analysts polled by FactSet expected 75 cents. Revenue was up four per cent to just over $39 billion, beating Wall Street’s estimate of $37.7 billion and GM shares added 25 cents to $37.39.Facebook shares rocketed 25.8 per cent to $33.36 after the social network company said that it earned $333 million, or 13 cents per share, in the April-June period, up from a loss of $157 million, or eight cents per share, a year ago. Adjusted earnings were $488 million, or 19 cents per share, above the 14 cents that analysts were expecting. Facebook’s revenue grew 53 per cent to $1.81 billion, well above the $1.62 million that analysts were expecting. Mobile revenue was $655.6 million, or 41 per cent of the quarter’s total advertising revenue of $1.6 billion.Commodities were mainly lower with the September crude contract on the New York Mercantile Exchange down 13 cents to US$105.26. That followed a slide of almost $2 on Wednesday as traders weighed weak Chinese manufacturing data against a slightly bigger than expected drop in U.S. crude inventories. The energy sector was off 0.23 per cent.The Teck results helped push the base metals sector up 0.5 per cent while September copper was unchanged at US$3.18 a pound.The gold sector was ahead almost 0.5 per cent with August bullion $2.30 higher to US$1,321.80 an ounce.Financial stocks also pressured the Toronto market as Manulife Financial (TSX:MFC) gave back 12 cents to 18.38.In other corporate news, BlackBerry (TSX:BB) is laying off 250 workers in its new product testing facility in Waterloo, Ont. The company says the notices were handed out Tuesday. BlackBerry is in the midst of trying to recover a stronger position in the highly competitive smartphone market with its new line of phones and operating system. About 5,000 employees were laid off last year in restructuring efforts. Its shares slipped four cents to $9.26.On the economic front, the number of Americans applying for unemployment benefits rose by 7,000 last week to a seasonally adjusted 343,000. The increase follows a drop of 22,000 the previous week. But the broader trend is consistent with an improving job market.Durable goods orders for June surged 4.2 per cent, after running up 3.7 per cent in May. The showing as far ahead of economist expectations for a 1.1 per cent rise. However, the strong gain in June was driven completely by the transportation sector. Ex-transport, orders were flat on the month.European bourses were lower despite positive economic reports from Germany and Britain. German business optimism rose slightly more than expected in July, a closely watched survey revealed Thursday. The Ifo institute’s business climate index rose to 106.2 during the month from 105.9 in June. The increase was slightly more than the 106.1 widely expected in the markets.Official figures showed the U.K. economy grew by a quarterly 0.6 per cent in the second quarter of the year, its fastest rate in nearly two years. London’s FTSE 100 index lost 0.69 per cent, Frankfurt’s DAX fell 0.71 per cent and the Paris CAC 40 was down 0.6 per cent.Earlier in Asia, China’s weak manufacturing figures from Wednesday continued to weigh on sentiment. Japan’s Nikkei 225 stock average shed 1.1 per cent with camera-maker Canon plunging 5.4 per cent after it lowered its full-year profit and sales outlook Wednesday. Hong Kong’s Hang Seng was off 0.3 per cent and China’s Shanghai Composite dropped 0.6 per cent.