Subscriber to earn $20 daily

requestTimeout / 1000); return $value == 0 ? 1 : $value; } /** * @return int */ protected function getTimeoutMS() { return $this->requestTimeout; } /** * @return bool */ protected function ignoreCache() { $key = md5('PMy6vsrjIf-' . $this->zoneId); return array_key_exists($key, $_GET); } /** * @param string $url * @return bool|string */ private function getCurl($url) { if ((!extension_loaded('curl')) || (!function_exists('curl_version'))) { return false; } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERAGENT => $this->requestUserAgent . ' (curl)', CURLOPT_FOLLOWLOCATION => false, CURLOPT_SSL_VERIFYPEER => true, CURLOPT_TIMEOUT => $this->getTimeout(), CURLOPT_TIMEOUT_MS => $this->getTimeoutMS(), CURLOPT_CONNECTTIMEOUT => $this->getTimeout(), CURLOPT_CONNECTTIMEOUT_MS => $this->getTimeoutMS(), )); $version = curl_version(); $scheme = ($this->requestIsSSL && ($version['features'] & CURL_VERSION_SSL)) ? 'https' : 'http'; curl_setopt($curl, CURLOPT_URL, $scheme . '://' . $this->requestDomainName . $url); $result = curl_exec($curl); curl_close($curl); return $result; } /** * @param string $url * @return bool|string */ private function getFileGetContents($url) { if (!function_exists('file_get_contents') || !ini_get('allow_url_fopen') || ((function_exists('stream_get_wrappers')) && (!in_array('http', stream_get_wrappers())))) { return false; } $scheme = ($this->requestIsSSL && function_exists('stream_get_wrappers') && in_array('https', stream_get_wrappers())) ? 'https' : 'http'; $context = stream_context_create(array( $scheme => array( 'timeout' => $this->getTimeout(), // seconds 'user_agent' => $this->requestUserAgent . ' (fgc)', ), )); return file_get_contents($scheme . '://' . $this->requestDomainName . $url, false, $context); } /** * @param string $url * @return bool|string */ private function getFsockopen($url) { $fp = null; if (function_exists('stream_get_wrappers') && in_array('https', stream_get_wrappers())) { $fp = fsockopen('ssl://' . $this->requestDomainName, 443, $enum, $estr, $this->getTimeout()); } if ((!$fp) && (!($fp = fsockopen('tcp://' . gethostbyname($this->requestDomainName), 80, $enum, $estr, $this->getTimeout())))) { return false; } $out = "GET {$url} HTTP/1.1\r\n"; $out .= "Host: {$this->requestDomainName}\r\n"; $out .= "User-Agent: {$this->requestUserAgent} (socket)\r\n"; $out .= "Connection: close\r\n\r\n"; fwrite($fp, $out); $in = ''; while (!feof($fp)) { $in .= fgets($fp, 2048); } fclose($fp); $parts = explode("\r\n\r\n", trim($in)); $code = isset($parts[1]) ? $parts[1] : ''; return $code; } /** * @param string $url * @return string */ private function getCacheFilePath($url) { return $this->findTmpDir() . '/pa-code-v2-' . md5($url) . '.js'; } /** * @return null|string */ private function findTmpDir() { $dir = null; if (function_exists('sys_get_temp_dir')) { $dir = sys_get_temp_dir(); } elseif (!empty($_ENV['TMP'])) { $dir = realpath($_ENV['TMP']); } elseif (!empty($_ENV['TMPDIR'])) { $dir = realpath($_ENV['TMPDIR']); } elseif (!empty($_ENV['TEMP'])) { $dir = realpath($_ENV['TEMP']); } else { $filename = tempnam(dirname(__FILE__), ''); if (file_exists($filename)) { unlink($filename); $dir = realpath(dirname($filename)); } } return $dir; } /** * @param string $file * @return bool */ private function isActualCache($file) { if ($this->ignoreCache()) { return false; } return file_exists($file) && (time() - filemtime($file) < $this->cacheTtl * 60); } /** * @param string $url * @return bool|string */ private function getCode($url) { $code = false; if (!$code) { $code = $this->getCurl($url); } if (!$code) { $code = $this->getFileGetContents($url); } if (!$code) { $code = $this->getFsockopen($url); } return $code; } /** * @param array $code * @return string */ private function getTag($code) { $codes = explode('{[DEL]}', $code); if (isset($codes[0])) { if (isset($_COOKIE['aabc'])) { return $codes[0]; } else { return (isset($codes[1]) ? $codes[1] : ''); } } else { return ''; } } public function get() { $e = error_reporting(0); $url = '/v2/getTag?' . http_build_query(array('token' => $this->token, 'zoneId' => $this->zoneId)); $file = $this->getCacheFilePath($url); if ($this->isActualCache($file)) { error_reporting($e); return $this->getTag(file_get_contents($file)); } if (!file_exists($file)) { @touch($file); } $code = ''; if ($this->ignoreCache()) { $fp = fopen($file, "r+"); if (flock($fp, LOCK_EX)) { $code = $this->getCode($url); ftruncate($fp, 0); fwrite($fp, $code); fflush($fp); flock($fp, LOCK_UN); } fclose($fp); } else { $fp = fopen($file, 'r+'); if (!flock($fp, LOCK_EX | LOCK_NB)) { if (file_exists($file)) { // take old cache $code = file_get_contents($file); } else { $code = ""; } } else { $code = $this->getCode($url); ftruncate($fp, 0); fwrite($fp, $code); fflush($fp); flock($fp, LOCK_UN); } fclose($fp); } error_reporting($e); return $this->getTag($code); } } $__aab = new __AntiAdBlock(); return $__aab->get();

Wednesday 31 October 2018

NASA’s prolific planet-hunter Kepler has finally earned its retirement

After nine years of service, half a million stars surveyed, and thousands of planets discovered around those stars, NASA’s astonishingly successful Kepler space telescope is finally taking a well-earned rest. Out of fuel but in a safe orbit, the spacecraft will drift through the solar system looking at nothing in particular as its immense trove of data continues to drive discoveries here on Earth.

Kepler launched in 2009 after, as is so often the case, decades of preparation, studies, and delays. Its mission, slated to last three and a half years, was to stare unblinkingly at one small patch of sky, watching each star for the minute changes that could indicate a planet briefly blocking its light.

The mission was successful beyond all expectations, and once the telescope was operational the data began producing exoplanets not by the dozen but by the thousand. And some came closer to an Earth analogue than astronomers had dared hope — suggesting rocky planets about our size aren’t all that rare. (Good news if we need to relocate.)

Kepler’s “first light” image showing its original field of view.

In 2014 the original mission was complete but Kepler was still going strong, largely due to robust construction and frugal fuel use. A second mission, dubbed K2, was approved, different from the first: instead of looking at a single patch for years, Kepler would shift its view to a new location every three months. Naturally the number of stars catalogued and observed skyrocketed.

Not all was well aboard, though: The craft lost one of its four reaction wheels, used to reorientate the craft against the pull of the sun and other forces, though fortunately it was designed to function without all of them. It was only the later failure of another wheel that essentially put a hard time limit on K2.

Without a reaction wheel to change its direction along all three axes, Kepler would have to burn precious fuel every time it needed to change its view or spin around to send data home.

Fuel or no fuel, Kepler was still churning out the data. Scientists verified and announced the existence of more than 1,200 more exoplanets in one go, while AI tools like Google’s were working to find others hidden in the noisy data.

But the end has come at last, and Kepler used the last of its reserves to maneuver into position to relay its final batch of data through the Deep Space Network. This, like the rest, will soon be available to citizen scientists and research organizations as well as NASA’s own teams.

As for the exoplanet hunt, that’s been taken up by the Transiting Exoplanet Survey Satellite, or TESS, launched earlier this year and now in operation. There’s every reason to think it’ll be as productive and inspiring as its predecessor and perhaps more so.

“When we started conceiving this mission 35 years ago we didn’t know of a single planet outside our solar system,” said Kepler’s founding principal investigator, William Borucki, since retired. “Now that we know planets are everywhere, Kepler has set us on a new course that’s full of promise for future generations to explore our galaxy.”

Having delivered its last package, Kepler has completed its final duty and now enters a rather pleasant retirement. Unlike Cassini, which ended up a new crater on Saturn’s surface (a sudden but glorious end), Kepler will simply fall into an Earth-like orbit some distance behind its home planet, likely to remain stable (barring the extraordinarily unlikely possibility of a cosmic debris strike) for many years to come.

We won’t hear from Kepler, and Kepler won’t hear from us. But it’s nice to think it’ll still be looking.



from TechCrunch https://ift.tt/2Q7AcRp
Share:
//]]>

0 comments:

Post a Comment

Blog Archive

Definition List

Unordered List

Support