Talk about waving the white flag and sending out a coded signal at the same time.

That’s what Assembly Speaker Sheldon Silver, the powerful Lower East Side Democrat — who was the bane of the past four governors — did last week as he praised Gov. Cuomo and the Legislature in a speech that symbolized the changed atmosphere at the once dysfunctional state Capitol.

“Has there ever been a time when New Yorkers were more optimistic about their government?” asked Silver in a well-received address to the state Democratic Committee.

“The answer is no. And the reason is Governor Andrew Cuomo. He took office with a plan of action, and New Yorkers are overwhelmingly in his corner. What impresses me most of all is willingness to listen, his recognition that legislative leaders and legislators know what is best for the districts they represent.

“So it should come as no surprise that we have the most effective state government in the nation today, and the reason, the reason for it is very clear: We have the most effective state chief executive in the nation,’’ he continued.

Silver, known for liberal spending, an excruciatingly slow negotiating style and the unwillingness to close deals unless he gets “one more thing,’’ drove former governors crazy, to the point where George Pataki refused to even enter the same room with him, Mario Cuomo and Eliot Spitzer had ugly screaming matches with him, and David Paterson accused him of political double-crosses.

But current Gov. Cuomo has mastered dealing with the wily 68-year-old speaker — using a combination of respect, flattery and hard-ball political threats. Add to that the fact that Cuomo is one of the most popular political figures in the nation, and it’s clear why Silver decided to adopt the old adage, “If you can’t beat them, join them.’’

“If Shelly is anything, he’s a realist — and he realizes that Cuomo is just too popular and too tough for him to beat. So, at his age and after so long on the job, he’s decided to join him,’’ said a prominent Democrat.

Cuomo knows how to return a political kindness. He’s keynoting a fund-raising event for Silver in Manhattan tomorrow night.

Silver, meanwhile, signalled his near-desperate desire for a pay raise for state lawmakers as he claimed in his speech that state government, long known for its chaos and dysfunction, is the “most effective in the nation,’’ observers agree.

State lawmakers haven’t received a pay raise since 1999, and Cuomo has made it clear that he wouldn’t agree to sign one into law unless the Legislature changed its ways and worked cooperatively with the governor.

*

While the enthusiasm for Police Commissioner Ray Kelly to run for mayor next year has died down, it’s by no means extinguished.

Many of the same supporters who were boosting a possible Kelly candidacy earlier this spring, including influential state Republicans, are intentionally “letting it lie low under the radar until it becomes more timely,’’ said one of those involved in an informal “draft Ray Kelly’’ effort.

“Let the Democrats kill each other for a while, jockeying for position, and then let’s see if Ray might be willing to take another look at it,’’ said a second source, a top GOP activist.

Two weeks ago, former Staten Island Borough President Guy Molinari emerged from a private luncheon with Kelly saying he was convinced that the city’s longtime top cop “is not going to run. It is not something he is thinking about. It is not on his drawing board.’’

However, others close to Kelly insist he’s yet to make a final decision, and isn’t likely to do so for at least another six months.