President Barack Obama is giving his gaffe-prone sidekick, Joe Biden, a big public high-five on Wednesday, just as a new book skewers Biden and numerous White House aides for incompetence and military micro-management.

The White House’s daily schedule lists five events where Obama will share billing with the vice president and even says press photographers will be allowed to record the two men sitting down for lunch.

The schedule was released at 7:31 pm, after publications began excerpting portions of the new memoir by Obama’s former defense sectary, Bob Gates.

“I think [Biden] has been wrong on nearly every major foreign policy and national security issue over the past four decades,” Gates wrote in his book, “Duty: Memoirs of a Secretary at War.”

“The President disagrees with Secretary Gates’ assessment — from his leadership on the Balkans in the Senate, to his efforts to end the war in Iraq, Joe Biden has been one of the leading statesmen of his time, and has helped advance America’s leadership in the world,” said the statement.

“President Obama relies on [the] good counsel every day” of statesman Joe Biden, it added.

The public embrace is very unusual. Biden is rarely given much billing in the White House’s schedules, and he is hardly ever photographed with Obama outside a major bill signing or ceremonial event.

Sometimes, Obama has deliberately distanced himself from Biden. During the 2012 campaign, Biden was temporarily sequestered after a series of smears and gaffes, including his claim to an African-American audience that the GOP candidate would enslave them.

But Obama’s embrace of Biden has a political purpose.

Biden and former Secretary of State Hillary Clinton are competing for the Democratic Party’s 2016 nomination.

Clinton is believed to be far ahead of Biden, but either politician would help Obama by cementing his regulatory policies if they were elected by the voters.

Gates’ new biography will make it even harder for Biden to keep up with Clinton.

During the 2009 debates over the Afghan campaign, Biden pressed for the near-complete withdrawal of U.S. forces — except for a small ground force and some drones — from Afghanistan. The policy would leave the ramshackle Afghan government without long-term support against Muslim tribal leaders or the aggressive alliance of Taliban and Al Qaida jihadis.

“I could not sign onto Vice President Biden’s preferred strategy of reducing our presence in Afghanistan to rely on counterterrorist strikes from afar,” Gates wrote. “‘Whac-A-Mole’ hits on Taliban leaders weren’t a long-term strategy,” Gates wrote.

During the Iraq campaign, then-Senator Biden claimed Iraq was broken by a civil war, and urged the country be divided several countries. However, he didn’t explain why his proposal wouldn’t force the country’s subgroups into an open, merciless and winnter-take-all fight over villages, cities and oil fields.

Gates’ book also slams Obama’s deputies for trying to micromanage military decisions, for bypassing the formal chain of command and for inserting domestic political priorities into national security debates.

“I also had to battle the bureaucratic inertia of the Pentagon, surmount internal conflicts within both administrations, avoid the partisan abyss in Congress… and resist the magnetic pull exercised by the White House, especially in the Obama administration, to bring everything under its control and micromanagement,” he wrote.

Obama’s “White House was by far the most centralized and controlling in national security of any I had seen since Richard Nixon and Henry Kissinger ruled the roost,” said Gates, who worked in senior posts for Presidents Ronald Reagan, George H. Bush, George W. Bush and Obama.

Political goals were openly discussed in Obama’s meetings.

“I joined a new, inexperienced president determined to change course—and equally determined from day one to win re-election,” Gates wrote.

“Domestic political considerations would therefore be a factor, though I believe never a decisive one, in virtually every major national security problem we tackled [and] the White House staff—including Chiefs of Staff Rahm Emanuel and then Bill Daley as well as such core political advisers as Valerie Jarrett, David Axelrod and Robert Gibbs —would have a role in national security decision making,” he wrote.

Gates also said Obama’s focus on the anti-jihad campaigns in Iraq and Afghanistan was reluctant and steeped in politics.

“Obama simply wanted to end the ‘bad’ war in Iraq and limit the U.S. role in the ‘good’ war in Afghanistan,” he wrote. “His fundamental problem in Afghanistan was that his political and philosophical preferences for winding down the U.S. role conflicted with his own pro-war public rhetoric… the nearly unanimous recommendations of his senior civilian and military advisers at the Departments of State and Defense, and the realities on the ground.”

In a March 2011 meeting on Afghan policy, Gates wrote, “As I sat there, I thought: The president doesn’t trust his commander [David Petraeus], can’t stand [Afghan President Hamid] Karzai, doesn’t believe in his own [Afghan] strategy and doesn’t consider the war to be his. For him, it’s all about getting out.”

One way in which Obama got out, according to official statements, was his decision to redefine the Afghan campaign as a one-on-one battle against the al-Qaida group. The redefinition allows Obama and his aides to not fight against Islam’s jihadi ideology which motivates al Qaida’s various leaders, aircraft-hijackers, gunmen, funders, supporters and political allies, from India to the United States.

The redefinition was included in the White House’s Tuesday statement defending Biden.

“It is well known that the President has been committed to achieving the mission of disrupting, dismantling and defeating al Qaeda, while also ensuring that we have a clear plan for winding down the war [In Afghanistan], which will end this year,” said the statement.

In fact, the war will continue once the U.S. retreats from the theater. For example, al-Qaida forces captured an important town in Iraq last week, following Obama’s decision to retreat from Iraq in 2010.

But Obama was also psychologically distant from his soldiers, Gates wrote in his memoir.

George W. Bush “was willing to disagree with his senior military advisers, but he never (to my knowledge) questioned their motives or mistrusted them personally,” Gates wrote. “Obama was respectful of senior officers and always heard them out, but he often disagreed with them and was deeply suspicious of their actions and recommendations.”

“Bush seemed to enjoy the company of the senior military; I think Obama considered time spent with generals and admirals an obligation.”

Follow Neil on Twitter