a = [7, 9, 2, 8]
print sum(sorted(a)[-2:])3,269 karma · joined July 21, 2009
a = [7, 9, 2, 8]
print sum(sorted(a)[-2:])Who did recommend those useless candidates to you? A recruiter, perhaps? Read this horror story: http://bostik.iki.fi/aivoituksia/pages/recruiter-anxiety.htm...
The good developers generally have no trouble finding jobs, and therefore don't need recruiters' help. With the best and the brightest taken off the pool, the recruiters are mostly left with merely the mediocre and the bad ones. This in turn has collateral effects: any developer coming in via a recruiter already carries the stigma of "not good enough to find job on their own".
It evades sorting the array, but you have to search it twice.
a = [7, 9, 2, 8]
highest = max(a)
a.remove(highest)
nexthighest = max(a)
a.remove(nexthighest)
print highest + nexthighest
Optimisation: just scan the array once, and keep track of the two highest numbers. a = [7, 9, 2, 8]
highest = None
nexthighest = None
for item in a:
if not highest or item > highest:
highest = item
elif not nexthighest or item > nexthighest:
nexthighest = item
print highest + nexthighestOr, introduce them to more stable OSses, like Ubuntu instead of Windows. That worked for my neighbours ;-)
The website you're referring to, is https://canibesuperphished.com/
...and what a spelling errors:
"This kludge is needed because /bin/sh seems to set IFS to the defualt even if you have set it; We also can't just ignore it because it is hard/unplesent to code around or even a potential security problem because the test suiete explicitly checks to make sure setting IFS 'works'"
ESR writes about sloppy spelling: "Write in clear, grammatical, correctly-spelled language. We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway)."
"The radars work like finely tuned motion detectors, using radio waves to zero in on movements as slight as human breathing from a distance of more than 50 feet. They can detect whether anyone is inside of a house, where they are and whether they are moving."
Do you happen to know if it also works the other way round? For example, suppose I'm from the EU, can I travel to Australia as a tourist and legally telework from there?
It doesn't work the other way round. If I remember correctly, one is not allowed to telework from the USA on a tourist visum.
But I guess it's allright if you're from Sweden and travel to Spain to enjoy the Mediterrean during the day and work in the evening (both countries are in the EU).
What tactic do you use for this?
"As we finalize our installation setup for CoreOS this next week (after plowing through Ubuntu, Debian and CentOS)"
Pity he doesn't elaborate on that. I understand that CoreOS is his choice, but it would be nice to know why the other distros aren't.
...featuring a novel kind of diagrams which show you when to do what, for example, look at the bottom of http://www.cookingforengineers.com/recipe/227/Ratatouille
I wonder whether it could be lucrative to learn COBOL (and CICS!) and work on those legacy systems that are still out there.
"While CICS has its highest profile among financial institutions such as banks and insurance companies, over 90 percent of Fortune 500 companies are reported to run CICS along with many government entities." - Wikipedia
Authority has a reputation for being corrupt and inflexible, and this stereotype has been leveraged by some who assert that their own lack of authority somehow makes them a better authority.
Starling might say of the 9/11 attacks: "Every reputable structural engineer understands how fire caused the Twin Towers to collapse."
Bombo can reply: "I'm not an expert in engineering or anything, I'm just a regular guy asking questions."
Starling: "We should listen to what the people who know what they're talking about have to say."
Bombo: "Someone needs to stand up to these experts."
The idea that not knowing what you're talking about somehow makes you heroic or more reliable is incorrect. More likely, your lack of expertise simply makes you wrong.
"But something more potent than alcohol was needed for the X-15 rocket-driven supersonic research plane. Hydrazine was the first choice, but it sometimes exploded when used for regenerative cooling, and in 1949, when the program was conceived, there wasn't enough of it around, anyway. Bob Truax of the Navy, along with Winternitz of Reaction Motors, which was to develop the 50,000 pounds thrust motor, settled on ammonia as a reasonably satisfactory second best. The oxygen-ammonia combination had been fired by JPL, but RMI really worked it out in the early 50's. The great stability of the ammonia molecule made it a tough customer to burn and from the beginning they were plagued with rough running and combustion instability. All sorts of additives to the fuel were tried in the hope of alleviating the condition, among them methylamine and acetylene. Twenty-two percent of the latter gave smooth combustion, but was dangerously unstable, and the mixture wasn't used long. The combustion problems were eventually cured by improving the injector design, but it was a long and noisy process. At night, I could hear the motor being fired, ten miles away over two ranges of hills, and could tell how far the injector design had progressed, just by the way the thing sounded. Even when the motor, finally, was running the way it should, and the first of the series was ready to be shipped to the West Coast to be test-flown by Scott Crossfield, everybody had his fingers crossed. Lou Rapp, of RMI, flying across the continent, found himself with a knowledgeable seat mate, obviously in the aerospace business, who asked him his opinion of the motor. Lou blew up, and declared, with gestures, that it was a mechanical monster, an accident looking for a place to happen, and that he, personally, considered that flying with it was merely a somewhat expensive method of suicide. Then, remembering something he turned to his companion and asked. "By the way, I didn't get your name. What is it?". The reply was simple. "Oh, I'm Scott Crossfield."
However, hydrogen doesn't occur on Earth in a pure state (at least not in mineable quantities). There are no hydrogen wells.
Creating the hydrogen (for example, by electrolysis of water) is expensive and generally a net loss of energy. Maybe storing energy in hydrogen is feasible if it's generated with excess nuclear or solar electricity.