code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
#!/usr/bin/env python2.6 import sys import setuptools if sys.version_info >= (3,): protobuf = 'protobuf-py3>=2.5.1,<3.0.0' else: protobuf = 'protobuf>=2.3.0,<3.0.0' setuptools.setup( name='riemann-client', version='6.1.2', author="Sam Clements", author_email="[email protected]", url="https://github.com/borntyping/python-riemann-client", description="A Riemann client and command line tool", long_description=open('README.rst').read(), license="MIT", packages=[ 'riemann_client', ], install_requires=[ 'click>=3.1,<4.0', protobuf ], extras_require={ 'docs': [ 'sphinx', 'sphinx_rtd_theme' ] }, entry_points={ 'console_scripts': [ 'riemann-client = riemann_client.command:main', ] }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Topic :: Software Development :: Libraries', 'Topic :: System :: Monitoring', 'Topic :: System :: Networking', 'Topic :: System :: Systems Administration' ], )
jrmccarthy/python-riemann-client
setup.py
Python
mit
1,554
<?php declare(strict_types=1); /** * CakePHP(tm) : Rapid Development Framework (https://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) * @link https://cakephp.org CakePHP(tm) Project * @since 4.0.0 * @license https://opensource.org/licenses/mit-license.php MIT License */ namespace Cake\Mailer; use Cake\Core\Configure; use Cake\Core\Exception\Exception; use Cake\Http\Client\FormDataPart; use Cake\Utility\Hash; use Cake\Utility\Security; use Cake\Utility\Text; use Closure; use InvalidArgumentException; use JsonSerializable; use Psr\Http\Message\UploadedFileInterface; use Serializable; use SimpleXMLElement; /** * Email message class. * * This class is used for sending Internet Message Format based * on the standard outlined in https://www.rfc-editor.org/rfc/rfc2822.txt */ class Message implements JsonSerializable, Serializable { /** * Line length - no should more - RFC 2822 - 2.1.1 * * @var int */ public const LINE_LENGTH_SHOULD = 78; /** * Line length - no must more - RFC 2822 - 2.1.1 * * @var int */ public const LINE_LENGTH_MUST = 998; /** * Type of message - HTML * * @var string */ public const MESSAGE_HTML = 'html'; /** * Type of message - TEXT * * @var string */ public const MESSAGE_TEXT = 'text'; /** * Type of message - BOTH * * @var string */ public const MESSAGE_BOTH = 'both'; /** * Holds the regex pattern for email validation * * @var string */ public const EMAIL_PATTERN = '/^((?:[\p{L}0-9.!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-._]+)$/ui'; /** * Recipient of the email * * @var array */ protected $to = []; /** * The mail which the email is sent from * * @var array */ protected $from = []; /** * The sender email * * @var array */ protected $sender = []; /** * List of email(s) that the recipient will reply to * * @var array */ protected $replyTo = []; /** * The read receipt email * * @var array */ protected $readReceipt = []; /** * The mail that will be used in case of any errors like * - Remote mailserver down * - Remote user has exceeded his quota * - Unknown user * * @var array */ protected $returnPath = []; /** * Carbon Copy * * List of email's that should receive a copy of the email. * The Recipient WILL be able to see this list * * @var array */ protected $cc = []; /** * Blind Carbon Copy * * List of email's that should receive a copy of the email. * The Recipient WILL NOT be able to see this list * * @var array */ protected $bcc = []; /** * Message ID * * @var bool|string */ protected $messageId = true; /** * Domain for messageId generation. * Needs to be manually set for CLI mailing as env('HTTP_HOST') is empty * * @var string */ protected $domain = ''; /** * The subject of the email * * @var string */ protected $subject = ''; /** * Associative array of a user defined headers * Keys will be prefixed 'X-' as per RFC2822 Section 4.7.5 * * @var array */ protected $headers = []; /** * Text message * * @var string */ protected $textMessage = ''; /** * Html message * * @var string */ protected $htmlMessage = ''; /** * Final message to send * * @var array */ protected $message = []; /** * Available formats to be sent. * * @var array */ protected $emailFormatAvailable = [self::MESSAGE_TEXT, self::MESSAGE_HTML, self::MESSAGE_BOTH]; /** * What format should the email be sent in * * @var string */ protected $emailFormat = self::MESSAGE_TEXT; /** * Charset the email body is sent in * * @var string */ protected $charset = 'utf-8'; /** * Charset the email header is sent in * If null, the $charset property will be used as default * * @var string|null */ protected $headerCharset; /** * The email transfer encoding used. * If null, the $charset property is used for determined the transfer encoding. * * @var string|null */ protected $transferEncoding; /** * Available encoding to be set for transfer. * * @var array */ protected $transferEncodingAvailable = [ '7bit', '8bit', 'base64', 'binary', 'quoted-printable', ]; /** * The application wide charset, used to encode headers and body * * @var string|null */ protected $appCharset; /** * List of files that should be attached to the email. * * Only absolute paths * * @var array */ protected $attachments = []; /** * If set, boundary to use for multipart mime messages * * @var string|null */ protected $boundary; /** * Contains the optional priority of the email. * * @var int|null */ protected $priority; /** * 8Bit character sets * * @var array */ protected $charset8bit = ['UTF-8', 'SHIFT_JIS']; /** * Define Content-Type charset name * * @var array */ protected $contentTypeCharset = [ 'ISO-2022-JP-MS' => 'ISO-2022-JP', ]; /** * Regex for email validation * * If null, filter_var() will be used. Use the emailPattern() method * to set a custom pattern.' * * @var string|null */ protected $emailPattern = self::EMAIL_PATTERN; /** * Constructor * * @param array|null $config Array of configs, or string to load configs from app.php */ public function __construct(?array $config = null) { $this->appCharset = Configure::read('App.encoding'); if ($this->appCharset !== null) { $this->charset = $this->appCharset; } $this->domain = preg_replace('/\:\d+$/', '', (string)env('HTTP_HOST')); if (empty($this->domain)) { $this->domain = php_uname('n'); } if ($config) { $this->setConfig($config); } } /** * Sets "from" address. * * @param string|array $email Null to get, String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ public function setFrom($email, ?string $name = null) { return $this->setEmailSingle('from', $email, $name, 'From requires only 1 email address.'); } /** * Gets "from" address. * * @return array */ public function getFrom(): array { return $this->from; } /** * Sets the "sender" address. See RFC link below for full explanation. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException * @link https://tools.ietf.org/html/rfc2822.html#section-3.6.2 */ public function setSender($email, ?string $name = null) { return $this->setEmailSingle('sender', $email, $name, 'Sender requires only 1 email address.'); } /** * Gets the "sender" address. See RFC link below for full explanation. * * @return array * @link https://tools.ietf.org/html/rfc2822.html#section-3.6.2 */ public function getSender(): array { return $this->sender; } /** * Sets "Reply-To" address. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ public function setReplyTo($email, ?string $name = null) { return $this->setEmail('replyTo', $email, $name); } /** * Gets "Reply-To" address. * * @return array */ public function getReplyTo(): array { return $this->replyTo; } /** * Sets Read Receipt (Disposition-Notification-To header). * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ public function setReadReceipt($email, ?string $name = null) { return $this->setEmailSingle( 'readReceipt', $email, $name, 'Disposition-Notification-To requires only 1 email address.' ); } /** * Gets Read Receipt (Disposition-Notification-To header). * * @return array */ public function getReadReceipt(): array { return $this->readReceipt; } /** * Sets return path. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ public function setReturnPath($email, ?string $name = null) { return $this->setEmailSingle('returnPath', $email, $name, 'Return-Path requires only 1 email address.'); } /** * Gets return path. * * @return array */ public function getReturnPath(): array { return $this->returnPath; } /** * Sets "to" address. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function setTo($email, ?string $name = null) { return $this->setEmail('to', $email, $name); } /** * Gets "to" address * * @return array */ public function getTo(): array { return $this->to; } /** * Add "To" address. * * @param string|array $email Null to get, String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function addTo($email, ?string $name = null) { return $this->addEmail('to', $email, $name); } /** * Sets "cc" address. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function setCc($email, ?string $name = null) { return $this->setEmail('cc', $email, $name); } /** * Gets "cc" address. * * @return array */ public function getCc(): array { return $this->cc; } /** * Add "cc" address. * * @param string|array $email Null to get, String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function addCc($email, ?string $name = null) { return $this->addEmail('cc', $email, $name); } /** * Sets "bcc" address. * * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function setBcc($email, ?string $name = null) { return $this->setEmail('bcc', $email, $name); } /** * Gets "bcc" address. * * @return array */ public function getBcc(): array { return $this->bcc; } /** * Add "bcc" address. * * @param string|array $email Null to get, String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this */ public function addBcc($email, ?string $name = null) { return $this->addEmail('bcc', $email, $name); } /** * Charset setter. * * @param string $charset Character set. * @return $this */ public function setCharset(string $charset) { $this->charset = $charset; return $this; } /** * Charset getter. * * @return string Charset */ public function getCharset(): string { return $this->charset; } /** * HeaderCharset setter. * * @param string|null $charset Character set. * @return $this */ public function setHeaderCharset(?string $charset) { $this->headerCharset = $charset; return $this; } /** * HeaderCharset getter. * * @return string Charset */ public function getHeaderCharset(): string { return $this->headerCharset ?: $this->charset; } /** * TransferEncoding setter. * * @param string|null $encoding Encoding set. * @return $this * @throws \InvalidArgumentException */ public function setTransferEncoding(?string $encoding) { if ($encoding !== null) { $encoding = strtolower($encoding); if (!in_array($encoding, $this->transferEncodingAvailable, true)) { throw new InvalidArgumentException( sprintf( 'Transfer encoding not available. Can be : %s.', implode(', ', $this->transferEncodingAvailable) ) ); } } $this->transferEncoding = $encoding; return $this; } /** * TransferEncoding getter. * * @return string|null Encoding */ public function getTransferEncoding(): ?string { return $this->transferEncoding; } /** * EmailPattern setter/getter * * @param string|null $regex The pattern to use for email address validation, * null to unset the pattern and make use of filter_var() instead. * @return $this */ public function setEmailPattern(?string $regex) { $this->emailPattern = $regex; return $this; } /** * EmailPattern setter/getter * * @return string|null */ public function getEmailPattern(): ?string { return $this->emailPattern; } /** * Set email * * @param string $varName Property name * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ protected function setEmail(string $varName, $email, ?string $name) { if (!is_array($email)) { $this->validateEmail($email, $varName); $this->{$varName} = [$email => $name ?? $email]; return $this; } $list = []; foreach ($email as $key => $value) { if (is_int($key)) { $key = $value; } $this->validateEmail($key, $varName); $list[$key] = $value ?? $key; } $this->{$varName} = $list; return $this; } /** * Validate email address * * @param string $email Email address to validate * @param string $context Which property was set * @return void * @throws \InvalidArgumentException If email address does not validate */ protected function validateEmail(string $email, string $context): void { if ($this->emailPattern === null) { if (filter_var($email, FILTER_VALIDATE_EMAIL)) { return; } } elseif (preg_match($this->emailPattern, (string)$email)) { return; } $context = ltrim($context, '_'); if ($email === '') { throw new InvalidArgumentException(sprintf('The email set for "%s" is empty.', $context)); } throw new InvalidArgumentException(sprintf('Invalid email set for "%s". You passed "%s".', $context, $email)); } /** * Set only 1 email * * @param string $varName Property name * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @param string $throwMessage Exception message * @return $this * @throws \InvalidArgumentException */ protected function setEmailSingle(string $varName, $email, ?string $name, string $throwMessage) { if ($email === []) { $this->{$varName} = $email; return $this; } $current = $this->{$varName}; $this->setEmail($varName, $email, $name); if (count($this->{$varName}) !== 1) { $this->{$varName} = $current; throw new InvalidArgumentException($throwMessage); } return $this; } /** * Add email * * @param string $varName Property name * @param string|array $email String with email, * Array with email as key, name as value or email as value (without name) * @param string|null $name Name * @return $this * @throws \InvalidArgumentException */ protected function addEmail(string $varName, $email, ?string $name) { if (!is_array($email)) { $this->validateEmail($email, $varName); if ($name === null) { $name = $email; } $this->{$varName}[$email] = $name; return $this; } $list = []; foreach ($email as $key => $value) { if (is_int($key)) { $key = $value; } $this->validateEmail($key, $varName); $list[$key] = $value; } $this->{$varName} = array_merge($this->{$varName}, $list); return $this; } /** * Sets subject. * * @param string $subject Subject string. * @return $this */ public function setSubject(string $subject) { $this->subject = $this->encodeForHeader($subject); return $this; } /** * Gets subject. * * @return string */ public function getSubject(): string { return $this->subject; } /** * Get original subject without encoding * * @return string Original subject */ public function getOriginalSubject(): string { return $this->decodeForHeader($this->subject); } /** * Sets headers for the message * * @param array $headers Associative array containing headers to be set. * @return $this */ public function setHeaders(array $headers) { $this->headers = $headers; return $this; } /** * Add header for the message * * @param array $headers Headers to set. * @return $this */ public function addHeaders(array $headers) { $this->headers = Hash::merge($this->headers, $headers); return $this; } /** * Get list of headers * * ### Includes: * * - `from` * - `replyTo` * - `readReceipt` * - `returnPath` * - `to` * - `cc` * - `bcc` * - `subject` * * @param string[] $include List of headers. * @return string[] */ public function getHeaders(array $include = []): array { $this->createBoundary(); if ($include === array_values($include)) { $include = array_fill_keys($include, true); } $defaults = array_fill_keys( [ 'from', 'sender', 'replyTo', 'readReceipt', 'returnPath', 'to', 'cc', 'bcc', 'subject', ], false ); $include += $defaults; $headers = []; $relation = [ 'from' => 'From', 'replyTo' => 'Reply-To', 'readReceipt' => 'Disposition-Notification-To', 'returnPath' => 'Return-Path', 'to' => 'To', 'cc' => 'Cc', 'bcc' => 'Bcc', ]; $headersMultipleEmails = ['to', 'cc', 'bcc', 'replyTo']; foreach ($relation as $var => $header) { if ($include[$var]) { if (in_array($var, $headersMultipleEmails)) { $headers[$header] = implode(', ', $this->formatAddress($this->{$var})); } else { $headers[$header] = (string)current($this->formatAddress($this->{$var})); } } } if ($include['sender']) { if (key($this->sender) === key($this->from)) { $headers['Sender'] = ''; } else { $headers['Sender'] = (string)current($this->formatAddress($this->sender)); } } $headers += $this->headers; if (!isset($headers['Date'])) { $headers['Date'] = date(DATE_RFC2822); } if ($this->messageId !== false) { if ($this->messageId === true) { $this->messageId = '<' . str_replace('-', '', Text::uuid()) . '@' . $this->domain . '>'; } $headers['Message-ID'] = $this->messageId; } if ($this->priority) { $headers['X-Priority'] = (string)$this->priority; } if ($include['subject']) { $headers['Subject'] = $this->subject; } $headers['MIME-Version'] = '1.0'; if ($this->attachments) { $headers['Content-Type'] = 'multipart/mixed; boundary="' . (string)$this->boundary . '"'; } elseif ($this->emailFormat === static::MESSAGE_BOTH) { $headers['Content-Type'] = 'multipart/alternative; boundary="' . (string)$this->boundary . '"'; } elseif ($this->emailFormat === static::MESSAGE_TEXT) { $headers['Content-Type'] = 'text/plain; charset=' . $this->getContentTypeCharset(); } elseif ($this->emailFormat === static::MESSAGE_HTML) { $headers['Content-Type'] = 'text/html; charset=' . $this->getContentTypeCharset(); } $headers['Content-Transfer-Encoding'] = $this->getContentTransferEncoding(); return $headers; } /** * Get headers as string. * * @param string[] $include List of headers. * @param string $eol End of line string for concatenating headers. * @param \Closure $callback Callback to run each header value through before stringifying. * @return string * @see Message::getHeaders() */ public function getHeadersString(array $include = [], string $eol = "\r\n", ?Closure $callback = null): string { $lines = $this->getHeaders($include); if ($callback) { $lines = array_map($callback, $lines); } $headers = []; foreach ($lines as $key => $value) { if (empty($value) && $value !== '0') { continue; } foreach ((array)$value as $val) { $headers[] = $key . ': ' . $val; } } return implode($eol, $headers); } /** * Format addresses * * If the address contains non alphanumeric/whitespace characters, it will * be quoted as characters like `:` and `,` are known to cause issues * in address header fields. * * @param array $address Addresses to format. * @return array */ protected function formatAddress(array $address): array { $return = []; foreach ($address as $email => $alias) { if ($email === $alias) { $return[] = $email; } else { $encoded = $this->encodeForHeader($alias); if ($encoded === $alias && preg_match('/[^a-z0-9 ]/i', $encoded)) { $encoded = '"' . str_replace('"', '\"', $encoded) . '"'; } $return[] = sprintf('%s <%s>', $encoded, $email); } } return $return; } /** * Sets email format. * * @param string $format Formatting string. * @return $this * @throws \InvalidArgumentException */ public function setEmailFormat(string $format) { if (!in_array($format, $this->emailFormatAvailable, true)) { throw new InvalidArgumentException('Format not available.'); } $this->emailFormat = $format; return $this; } /** * Gets email format. * * @return string */ public function getEmailFormat(): string { return $this->emailFormat; } /** * Gets the body types that are in this email message * * @return array Array of types. Valid types are Email::MESSAGE_TEXT and Email::MESSAGE_HTML */ public function getBodyTypes(): array { $format = $this->emailFormat; if ($format === static::MESSAGE_BOTH) { return [static::MESSAGE_HTML, static::MESSAGE_TEXT]; } return [$format]; } /** * Sets message ID. * * @param bool|string $message True to generate a new Message-ID, False to ignore (not send in email), * String to set as Message-ID. * @return $this * @throws \InvalidArgumentException */ public function setMessageId($message) { if (is_bool($message)) { $this->messageId = $message; } else { if (!preg_match('/^\<.+@.+\>$/', $message)) { throw new InvalidArgumentException( 'Invalid format to Message-ID. The text should be something like "<[email protected]>"' ); } $this->messageId = $message; } return $this; } /** * Gets message ID. * * @return bool|string */ public function getMessageId() { return $this->messageId; } /** * Sets domain. * * Domain as top level (the part after @). * * @param string $domain Manually set the domain for CLI mailing. * @return $this */ public function setDomain(string $domain) { $this->domain = $domain; return $this; } /** * Gets domain. * * @return string */ public function getDomain(): string { return $this->domain; } /** * Add attachments to the email message * * Attachments can be defined in a few forms depending on how much control you need: * * Attach a single file: * * ``` * $this->setAttachments('path/to/file'); * ``` * * Attach a file with a different filename: * * ``` * $this->setAttachments(['custom_name.txt' => 'path/to/file.txt']); * ``` * * Attach a file and specify additional properties: * * ``` * $this->setAttachments(['custom_name.png' => [ * 'file' => 'path/to/file', * 'mimetype' => 'image/png', * 'contentId' => 'abc123', * 'contentDisposition' => false * ] * ]); * ``` * * Attach a file from string and specify additional properties: * * ``` * $this->setAttachments(['custom_name.png' => [ * 'data' => file_get_contents('path/to/file'), * 'mimetype' => 'image/png' * ] * ]); * ``` * * The `contentId` key allows you to specify an inline attachment. In your email text, you * can use `<img src="cid:abc123"/>` to display the image inline. * * The `contentDisposition` key allows you to disable the `Content-Disposition` header, this can improve * attachment compatibility with outlook email clients. * * @param array $attachments Array of filenames. * @return $this * @throws \InvalidArgumentException */ public function setAttachments(array $attachments) { $attach = []; foreach ($attachments as $name => $fileInfo) { if (!is_array($fileInfo)) { $fileInfo = ['file' => $fileInfo]; } if (!isset($fileInfo['file'])) { if (!isset($fileInfo['data'])) { throw new InvalidArgumentException('No file or data specified.'); } if (is_int($name)) { throw new InvalidArgumentException('No filename specified.'); } $fileInfo['data'] = chunk_split(base64_encode($fileInfo['data']), 76, "\r\n"); } elseif ($fileInfo['file'] instanceof UploadedFileInterface) { $fileInfo['mimetype'] = $fileInfo['file']->getClientMediaType(); if (is_int($name)) { /** @var string $name */ $name = $fileInfo['file']->getClientFilename(); } } elseif (is_string($fileInfo['file'])) { $fileName = $fileInfo['file']; $fileInfo['file'] = realpath($fileInfo['file']); if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) { throw new InvalidArgumentException(sprintf('File not found: "%s"', $fileName)); } if (is_int($name)) { $name = basename($fileInfo['file']); } } else { throw new InvalidArgumentException(sprintf( 'File must be a filepath or UploadedFileInterface instance. Found `%s` instead.', gettype($fileInfo['file']) )); } if ( !isset($fileInfo['mimetype']) && isset($fileInfo['file']) && is_string($fileInfo['file']) && function_exists('mime_content_type') ) { $fileInfo['mimetype'] = mime_content_type($fileInfo['file']); } if (!isset($fileInfo['mimetype'])) { $fileInfo['mimetype'] = 'application/octet-stream'; } $attach[$name] = $fileInfo; } $this->attachments = $attach; return $this; } /** * Gets attachments to the email message. * * @return array Array of attachments. */ public function getAttachments(): array { return $this->attachments; } /** * Add attachments * * @param array $attachments Array of filenames. * @return $this * @throws \InvalidArgumentException * @see \Cake\Mailer\Email::setAttachments() */ public function addAttachments(array $attachments) { $current = $this->attachments; $this->setAttachments($attachments); $this->attachments = array_merge($current, $this->attachments); return $this; } /** * Get generated message body as array. * * @return array */ public function getBody() { if (empty($this->message)) { $this->message = $this->generateMessage(); } return $this->message; } /** * Get generated body as string. * * @param string $eol End of line string for imploding. * @return string * @see Message::getBody() */ public function getBodyString(string $eol = "\r\n"): string { $lines = $this->getBody(); return implode($eol, $lines); } /** * Create unique boundary identifier * * @return void */ protected function createBoundary(): void { if ( $this->boundary === null && ( $this->attachments || $this->emailFormat === static::MESSAGE_BOTH ) ) { $this->boundary = md5(Security::randomBytes(16)); } } /** * Generate full message. * * @return string[] */ protected function generateMessage(): array { $this->createBoundary(); $msg = []; $contentIds = array_filter((array)Hash::extract($this->attachments, '{s}.contentId')); $hasInlineAttachments = count($contentIds) > 0; $hasAttachments = !empty($this->attachments); $hasMultipleTypes = $this->emailFormat === static::MESSAGE_BOTH; $multiPart = ($hasAttachments || $hasMultipleTypes); /** @var string $boundary */ $boundary = $this->boundary; $relBoundary = $textBoundary = $boundary; if ($hasInlineAttachments) { $msg[] = '--' . $boundary; $msg[] = 'Content-Type: multipart/related; boundary="rel-' . $boundary . '"'; $msg[] = ''; $relBoundary = $textBoundary = 'rel-' . $boundary; } if ($hasMultipleTypes && $hasAttachments) { $msg[] = '--' . $relBoundary; $msg[] = 'Content-Type: multipart/alternative; boundary="alt-' . $boundary . '"'; $msg[] = ''; $textBoundary = 'alt-' . $boundary; } if ( $this->emailFormat === static::MESSAGE_TEXT || $this->emailFormat === static::MESSAGE_BOTH ) { if ($multiPart) { $msg[] = '--' . $textBoundary; $msg[] = 'Content-Type: text/plain; charset=' . $this->getContentTypeCharset(); $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding(); $msg[] = ''; } $content = explode("\n", $this->textMessage); $msg = array_merge($msg, $content); $msg[] = ''; $msg[] = ''; } if ( $this->emailFormat === static::MESSAGE_HTML || $this->emailFormat === static::MESSAGE_BOTH ) { if ($multiPart) { $msg[] = '--' . $textBoundary; $msg[] = 'Content-Type: text/html; charset=' . $this->getContentTypeCharset(); $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding(); $msg[] = ''; } $content = explode("\n", $this->htmlMessage); $msg = array_merge($msg, $content); $msg[] = ''; $msg[] = ''; } if ($textBoundary !== $relBoundary) { $msg[] = '--' . $textBoundary . '--'; $msg[] = ''; } if ($hasInlineAttachments) { $attachments = $this->attachInlineFiles($relBoundary); $msg = array_merge($msg, $attachments); $msg[] = ''; $msg[] = '--' . $relBoundary . '--'; $msg[] = ''; } if ($hasAttachments) { $attachments = $this->attachFiles($boundary); $msg = array_merge($msg, $attachments); } if ($hasAttachments || $hasMultipleTypes) { $msg[] = ''; $msg[] = '--' . $boundary . '--'; $msg[] = ''; } return $msg; } /** * Attach non-embedded files by adding file contents inside boundaries. * * @param string|null $boundary Boundary to use. If null, will default to $this->boundary * @return string[] An array of lines to add to the message */ protected function attachFiles(?string $boundary = null): array { if ($boundary === null) { /** @var string $boundary */ $boundary = $this->boundary; } $msg = []; foreach ($this->attachments as $filename => $fileInfo) { if (!empty($fileInfo['contentId'])) { continue; } $data = $fileInfo['data'] ?? $this->readFile($fileInfo['file']); $hasDisposition = ( !isset($fileInfo['contentDisposition']) || $fileInfo['contentDisposition'] ); $part = new FormDataPart('', $data, '', $this->getHeaderCharset()); if ($hasDisposition) { $part->disposition('attachment'); $part->filename($filename); } $part->transferEncoding('base64'); $part->type($fileInfo['mimetype']); $msg[] = '--' . $boundary; $msg[] = (string)$part; $msg[] = ''; } return $msg; } /** * Attach inline/embedded files to the message. * * @param string|null $boundary Boundary to use. If null, will default to $this->boundary * @return string[] An array of lines to add to the message */ protected function attachInlineFiles(?string $boundary = null): array { if ($boundary === null) { /** @var string $boundary */ $boundary = $this->boundary; } $msg = []; foreach ($this->getAttachments() as $filename => $fileInfo) { if (empty($fileInfo['contentId'])) { continue; } $data = $fileInfo['data'] ?? $this->readFile($fileInfo['file']); $msg[] = '--' . $boundary; $part = new FormDataPart('', $data, 'inline', $this->getHeaderCharset()); $part->type($fileInfo['mimetype']); $part->transferEncoding('base64'); $part->contentId($fileInfo['contentId']); $part->filename($filename); $msg[] = (string)$part; $msg[] = ''; } return $msg; } /** * Sets priority. * * @param int|null $priority 1 (highest) to 5 (lowest) * @return $this */ public function setPriority(?int $priority) { $this->priority = $priority; return $this; } /** * Gets priority. * * @return int|null */ public function getPriority(): ?int { return $this->priority; } /** * Sets the configuration for this instance. * * @param array $config Config array. * @return $this */ public function setConfig(array $config) { $simpleMethods = [ 'from', 'sender', 'to', 'replyTo', 'readReceipt', 'returnPath', 'cc', 'bcc', 'messageId', 'domain', 'subject', 'attachments', 'emailFormat', 'emailPattern', 'charset', 'headerCharset', ]; foreach ($simpleMethods as $method) { if (isset($config[$method])) { $this->{'set' . ucfirst($method)}($config[$method]); } } if (isset($config['headers'])) { $this->setHeaders($config['headers']); } return $this; } /** * Set message body. * * @param array $content Content array with keys "text" and/or "html" with * content string of respective type. * @return $this */ public function setBody(array $content) { foreach ($content as $type => $text) { if (!in_array($type, $this->emailFormatAvailable, true)) { throw new InvalidArgumentException(sprintf( 'Invalid message type: "%s". Valid types are: "text", "html".', $type )); } $text = str_replace(["\r\n", "\r"], "\n", $text); $text = $this->encodeString($text, $this->getCharset()); $text = $this->wrap($text); $text = implode("\n", $text); $text = rtrim($text, "\n"); $property = "{$type}Message"; $this->$property = $text; } $this->boundary = null; $this->message = []; return $this; } /** * Set text body for message. * * @param string $content Content string * @return $this */ public function setBodyText(string $content) { $this->setBody([static::MESSAGE_TEXT => $content]); return $this; } /** * Set HTML body for message. * * @param string $content Content string * @return $this */ public function setBodyHtml(string $content) { $this->setBody([static::MESSAGE_HTML => $content]); return $this; } /** * Get text body of message. * * @return string */ public function getBodyText() { return $this->textMessage; } /** * Get HTML body of message. * * @return string */ public function getBodyHtml() { return $this->htmlMessage; } /** * Translates a string for one charset to another if the App.encoding value * differs and the mb_convert_encoding function exists * * @param string $text The text to be converted * @param string $charset the target encoding * @return string */ protected function encodeString(string $text, string $charset): string { if ($this->appCharset === $charset) { return $text; } if ($this->appCharset === null) { return mb_convert_encoding($text, $charset); } return mb_convert_encoding($text, $charset, $this->appCharset); } /** * Wrap the message to follow the RFC 2822 - 2.1.1 * * @param string|null $message Message to wrap * @param int $wrapLength The line length * @return array Wrapped message */ protected function wrap(?string $message = null, int $wrapLength = self::LINE_LENGTH_MUST): array { if ($message === null || strlen($message) === 0) { return ['']; } $message = str_replace(["\r\n", "\r"], "\n", $message); $lines = explode("\n", $message); $formatted = []; $cut = ($wrapLength === static::LINE_LENGTH_MUST); foreach ($lines as $line) { if (empty($line) && $line !== '0') { $formatted[] = ''; continue; } if (strlen($line) < $wrapLength) { $formatted[] = $line; continue; } if (!preg_match('/<[a-z]+.*>/i', $line)) { $formatted = array_merge( $formatted, explode("\n", Text::wordWrap($line, $wrapLength, "\n", $cut)) ); continue; } $tagOpen = false; $tmpLine = $tag = ''; $tmpLineLength = 0; for ($i = 0, $count = strlen($line); $i < $count; $i++) { $char = $line[$i]; if ($tagOpen) { $tag .= $char; if ($char === '>') { $tagLength = strlen($tag); if ($tagLength + $tmpLineLength < $wrapLength) { $tmpLine .= $tag; $tmpLineLength += $tagLength; } else { if ($tmpLineLength > 0) { $formatted = array_merge( $formatted, explode("\n", Text::wordWrap(trim($tmpLine), $wrapLength, "\n", $cut)) ); $tmpLine = ''; $tmpLineLength = 0; } if ($tagLength > $wrapLength) { $formatted[] = $tag; } else { $tmpLine = $tag; $tmpLineLength = $tagLength; } } $tag = ''; $tagOpen = false; } continue; } if ($char === '<') { $tagOpen = true; $tag = '<'; continue; } if ($char === ' ' && $tmpLineLength >= $wrapLength) { $formatted[] = $tmpLine; $tmpLineLength = 0; continue; } $tmpLine .= $char; $tmpLineLength++; if ($tmpLineLength === $wrapLength) { $nextChar = $line[$i + 1] ?? ''; if ($nextChar === ' ' || $nextChar === '<') { $formatted[] = trim($tmpLine); $tmpLine = ''; $tmpLineLength = 0; if ($nextChar === ' ') { $i++; } } else { $lastSpace = strrpos($tmpLine, ' '); if ($lastSpace === false) { continue; } $formatted[] = trim(substr($tmpLine, 0, $lastSpace)); $tmpLine = substr($tmpLine, $lastSpace + 1); $tmpLineLength = strlen($tmpLine); } } } if (!empty($tmpLine)) { $formatted[] = $tmpLine; } } $formatted[] = ''; return $formatted; } /** * Reset all the internal variables to be able to send out a new email. * * @return $this */ public function reset() { $this->to = []; $this->from = []; $this->sender = []; $this->replyTo = []; $this->readReceipt = []; $this->returnPath = []; $this->cc = []; $this->bcc = []; $this->messageId = true; $this->subject = ''; $this->headers = []; $this->textMessage = ''; $this->htmlMessage = ''; $this->message = []; $this->emailFormat = static::MESSAGE_TEXT; $this->priority = null; $this->charset = 'utf-8'; $this->headerCharset = null; $this->transferEncoding = null; $this->attachments = []; $this->emailPattern = static::EMAIL_PATTERN; return $this; } /** * Encode the specified string using the current charset * * @param string $text String to encode * @return string Encoded string */ protected function encodeForHeader(string $text): string { if ($this->appCharset === null) { return $text; } /** @var string $restore */ $restore = mb_internal_encoding(); mb_internal_encoding($this->appCharset); $return = mb_encode_mimeheader($text, $this->getHeaderCharset(), 'B'); mb_internal_encoding($restore); return $return; } /** * Decode the specified string * * @param string $text String to decode * @return string Decoded string */ protected function decodeForHeader(string $text): string { if ($this->appCharset === null) { return $text; } /** @var string $restore */ $restore = mb_internal_encoding(); mb_internal_encoding($this->appCharset); $return = mb_decode_mimeheader($text); mb_internal_encoding($restore); return $return; } /** * Read the file contents and return a base64 version of the file contents. * * @param string|\Psr\Http\Message\UploadedFileInterface $file The absolute path to the file to read * or UploadedFileInterface instance. * @return string File contents in base64 encoding */ protected function readFile($file): string { if (is_string($file)) { $content = (string)file_get_contents($file); } else { $content = (string)$file->getStream(); } return chunk_split(base64_encode($content)); } /** * Return the Content-Transfer Encoding value based * on the set transferEncoding or set charset. * * @return string */ public function getContentTransferEncoding(): string { if ($this->transferEncoding) { return $this->transferEncoding; } $charset = strtoupper($this->charset); if (in_array($charset, $this->charset8bit, true)) { return '8bit'; } return '7bit'; } /** * Return charset value for Content-Type. * * Checks fallback/compatibility types which include workarounds * for legacy japanese character sets. * * @return string */ public function getContentTypeCharset(): string { $charset = strtoupper($this->charset); if (array_key_exists($charset, $this->contentTypeCharset)) { return strtoupper($this->contentTypeCharset[$charset]); } return strtoupper($this->charset); } /** * Serializes the email object to a value that can be natively serialized and re-used * to clone this email instance. * * @return array Serializable array of configuration properties. * @throws \Exception When a view var object can not be properly serialized. */ public function jsonSerialize(): array { $properties = [ 'to', 'from', 'sender', 'replyTo', 'cc', 'bcc', 'subject', 'returnPath', 'readReceipt', 'emailFormat', 'emailPattern', 'domain', 'attachments', 'messageId', 'headers', 'appCharset', 'charset', 'headerCharset', ]; $array = []; foreach ($properties as $property) { $array[$property] = $this->{$property}; } array_walk($array['attachments'], function (&$item, $key): void { if (!empty($item['file'])) { $item['data'] = $this->readFile($item['file']); unset($item['file']); } }); return array_filter($array, function ($i) { return $i !== null && !is_array($i) && !is_bool($i) && strlen($i) || !empty($i); }); } /** * Configures an email instance object from serialized config. * * @param array $config Email configuration array. * @return $this Configured email instance. */ public function createFromArray(array $config) { foreach ($config as $property => $value) { $this->{$property} = $value; } return $this; } /** * Serializes the Email object. * * @return string */ public function serialize(): string { $array = $this->jsonSerialize(); array_walk_recursive($array, function (&$item, $key): void { if ($item instanceof SimpleXMLElement) { $item = json_decode(json_encode((array)$item), true); } }); return serialize($array); } /** * Unserializes the Email object. * * @param string $data Serialized string. * @return void */ public function unserialize($data) { $array = unserialize($data); if (!is_array($array)) { throw new Exception('Unable to unserialize message.'); } $this->createFromArray($array); } }
ADmad/cakephp
src/Mailer/Message.php
PHP
mit
52,178
--- layout: index --- <div class="col12"> <section class="post-home"> <h1>Latest From the Blog</h1> <ul class="post-list"> {% for post in site.posts %} <li> <small class="datetime" data-time="{{ post.date }}">{{ post.date | date_to_string }} </small> <a href="{{ post.url }}">{{ post.title }}</a> </li> {% endfor %} </ul> </section> </div>
newaeonweb/sasa-jekyll-theme
index.html
HTML
mit
368
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2020_07_01 module Models # # Bgp Communities sent over ExpressRoute with each route corresponding to a # prefix in this VNET. # class VirtualNetworkBgpCommunities include MsRestAzure # @return [String] The BGP community associated with the virtual network. attr_accessor :virtual_network_community # @return [String] The BGP community associated with the region of the # virtual network. attr_accessor :regional_community # # Mapper for VirtualNetworkBgpCommunities class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'VirtualNetworkBgpCommunities', type: { name: 'Composite', class_name: 'VirtualNetworkBgpCommunities', model_properties: { virtual_network_community: { client_side_validation: true, required: true, serialized_name: 'virtualNetworkCommunity', type: { name: 'String' } }, regional_community: { client_side_validation: true, required: false, read_only: true, serialized_name: 'regionalCommunity', type: { name: 'String' } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2020-07-01/generated/azure_mgmt_network/models/virtual_network_bgp_communities.rb
Ruby
mit
1,751
var http = require("http"), url = require("url"), fs = require("fs"), mysql = require("mysql") queryString = require("querystring"), uri = require("uri"); var connectionToMySQL = mysql.createConnection({ user: "root", password: "", database: "mySQLTest" }); /* * Sample links: * http://localhost:8888/mysql?query=select+*+from+foo * http://localhost:8888/mysql?query=insert+into+foo+values+%28%22hello%22,%22bob%22,%22m%22,%222012-10-04%22%29 */ http.createServer(function(request, response, nyar) { // response.writeHead(200, {"Content-Type": "text/plain"}); // Figure out which databse to call var databasePathName = url.parse(request.url, true).pathname; var queryPathName = url.parse(request.url, true).query; var queryPathNameStringify = queryString.stringify(queryPathName); // Parse out the query var fullQueryString = queryPathNameStringify.replace("query=", ""); var finalQueryToDatabase = decodeURIComponent(fullQueryString); console.log("Query to be executed: \'"+finalQueryToDatabase+"\'"); // Find out which database needs to be executed if (databasePathName == "/mysql") { console.log("mysql database needs to be executed") connectionToMySQL.query(finalQueryToDatabase+";", function (error, rows, fields) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.write(JSON.stringify(rows)); console.log(JSON.stringify(rows)); response.end(); }); } else if (databasePathName == "/redis") { console.log("redis database needs to be executed") } else if (databasePathName == "/mongodb") { console.log("mongodb database needs to be executed") } else { console.log("Nothing was found"); } // response.write('Here is your data: ' + parts + '\n'); fs.readFile('test.txt', 'utf-8', function (error, data) { response.writeHead(200, {'Content-Type': 'text/plain'}); data = 1; fs.writeFile('test.txt', data); }); response.end(); }).listen(8888);
timkang/CloudDatabases
old/server/server.js
JavaScript
mit
2,105
--- layout: post title: "171028-TIL" tags: [2017, TIL] categories: TIL description: "코딩 테스트" --- 오늘 한일 ======== #### 온라인 코딩 테스트를 봤다. - 총 세 문제였는데 2번 빼고는 일단 제공된 테스트 코드는 통과되게 구현 했다. - 볼링 게임의 첫 페이지 완료 및 점수 표지 페이지 작업 중 --- 오늘 느낀점 ========== - 1,3번도 그렇게 어려운 문제는 아니였는데 처음 어떻게 구현할지 고민하는데 시간을 좀 썼다. 알고리즘 문제들을 유형에 따라 풀어보면서 풀이법을 찾는 시간을 줄여야 겠다. - 이전에 작업했던 로또 페이지를 기반으로 index 페이지와 다음 페이지를 작업하고 있었다. 그러다 포비가 만들어 뒀던 페이지를 봤는데 이번 작업의 목표는 html, css 학습이 아닌 AJAX라 미련없이 해당 페이지로 변경했다. --- 내일 할일 ========= - 볼링을 웹에 올려보자 - 헌혈
Hue9010/hue9010.github.io
_posts/TIL/2017-10-28-171028TIL.md
Markdown
mit
998
local Gladius = _G.Gladius if not Gladius then DEFAULT_CHAT_FRAME:AddMessage(format("Module %s requires Gladius", "Class Icon")) end local L = Gladius.L local LSM -- Global Functions local _G = _G local pairs = pairs local select = select local strfind = string.find local tonumber = tonumber local tostring = tostring local unpack = unpack local CreateFrame = CreateFrame local GetSpecializationInfoByID = GetSpecializationInfoByID local GetSpellInfo = GetSpellInfo local GetTime = GetTime local UnitAura = UnitAura local UnitClass = UnitClass local CLASS_BUTTONS = CLASS_ICON_TCOORDS local function GetDefaultAuraList() local auraTable = { -- Higher Number is More Priority -- Priority List by P0rkz -- Unpurgable long lasting buffs --[GetSpellInfo(108292)] = 0, -- Heart of the Wild -- Mobility Auras (0) [GetSpellInfo(108843)] = 0, -- Blazing Speed [GetSpellInfo(65081)] = 0, -- Body and Soul [GetSpellInfo(108212)] = 0, -- Burst of Speed [GetSpellInfo(68992)] = 0, -- Darkflight [GetSpellInfo(1850)] = 0, -- Dash [GetSpellInfo(137452)] = 0, -- Displacer Beast [GetSpellInfo(114239)] = 0, -- Phantasm [GetSpellInfo(118922)] = 0, -- Posthaste [GetSpellInfo(85499)] = 0, -- Speed of Light [GetSpellInfo(2983)] = 0, -- Sprint [GetSpellInfo(06898)] = 0, -- Stampeding Roar [GetSpellInfo(116841)] = 0, -- Tiger's Lust -- Movement Reduction Auras (1) [GetSpellInfo(5116)] = 1, -- Concussive Shot [GetSpellInfo(120)] = 1, -- Cone of Cold [GetSpellInfo(13809)] = 1, -- Frost Trap -- Purgable Buffs (2) --[GetSpellInfo(16188)] = 2, -- Ancestral Swiftness [GetSpellInfo(31842)] = 2, -- Divine Favor --[GetSpellInfo(6346)] = 2, -- Fear Ward [GetSpellInfo(112965)] = 2, -- Fingers of Frost [GetSpellInfo(1044)] = 2, -- Hand of Freedom [GetSpellInfo(1022)] = 2, -- Hand of Protection --[GetSpellInfo(114039)] = 2, -- Hand of Purity [GetSpellInfo(6940)] = 2, -- Hand of Sacrifice [GetSpellInfo(11426)] = 2, -- Ice Barrier [GetSpellInfo(53271)] = 2, -- Master's Call --[GetSpellInfo(132158)] = 2, -- Nature's Swiftness --[GetSpellInfo(12043)] = 2, -- Presence of Mind [GetSpellInfo(48108)] = 2, -- Pyroblast! -- Defensive - Damage Redution Auras (3) --[GetSpellInfo(108978)] = 3, -- Alter Time [GetSpellInfo(108271)] = 3, -- Astral Shift [GetSpellInfo(22812)] = 3, -- Barkskin [GetSpellInfo(18499)] = 3, -- Berserker Rage --[GetSpellInfo(111397)] = 3, -- Blood Horror [GetSpellInfo(74001)] = 3, -- Combat Readiness [GetSpellInfo(31224)] = 3, -- Cloak of Shadows [GetSpellInfo(108359)] = 3, -- Dark Regeneration [GetSpellInfo(118038)] = 3, -- Die by the Sword [GetSpellInfo(498)] = 3, -- Divine Protection [GetSpellInfo(5277)] = 3, -- Evasion [GetSpellInfo(47788)] = 3, -- Guardian Spirit [GetSpellInfo(48792)] = 3, -- Icebound Fortitude [GetSpellInfo(66)] = 3, -- Invisibility [GetSpellInfo(102342)] = 3, -- Ironbark [GetSpellInfo(12975)] = 3, -- Last Stand [GetSpellInfo(49039)] = 3, -- Lichborne [GetSpellInfo(116849)] = 3, -- Life Cocoon [GetSpellInfo(114028)] = 3, -- Mass Spell Reflection --[GetSpellInfo(30884)] = 3, -- Nature's Guardian [GetSpellInfo(124974)] = 3, -- Nature's Vigil --[GetSpellInfo(137562)] = 3, -- Nimble Brew [GetSpellInfo(33206)] = 3, -- Pain Suppression [GetSpellInfo(53480)] = 3, -- Roar of Sacrifice --[GetSpellInfo(30823)] = 3, -- Shamanistic Rage [GetSpellInfo(871)] = 3, -- Shield Wall [GetSpellInfo(112833)] = 3, -- Spectral Guise [GetSpellInfo(23920)] = 3, -- Spell Reflection [GetSpellInfo(122470)] = 3, -- Touch of Karma [GetSpellInfo(61336)] = 3, -- Survival Instincts -- Offensive - Melee Auras (4) [GetSpellInfo(13750)] = 4, -- Adrenaline Rush [GetSpellInfo(152151)] = 4, -- Shadow Reflection [GetSpellInfo(107574)] = 4, -- Avatar --[GetSpellInfo(106952)] = 4, -- Berserk [GetSpellInfo(12292)] = 4, -- Bloodbath [GetSpellInfo(51271)] = 4, -- Pillar of Frost [GetSpellInfo(1719)] = 4, -- Recklessness --[GetSpellInfo(51713)] = 4, -- Shadow Dance -- Roots (5) [GetSpellInfo(91807)] = 5, -- Shambling Rush (Ghoul) ["96294"] = 5, -- Chains of Ice (Chilblains) [GetSpellInfo(61685)] = 5, -- Charge (Various) [GetSpellInfo(116706)] = 5, -- Disable --[GetSpellInfo(87194)] = 5, -- Mind Blast (Glyphed) [GetSpellInfo(114404)] = 5, -- Void Tendrils [GetSpellInfo(64695)] = 5, -- Earthgrab [GetSpellInfo(64803)] = 5, -- Entrapment --[GetSpellInfo(63685)] = 5, -- Freeze (Frozen Power) --[GetSpellInfo(111340)] = 5, -- Ice Ward [GetSpellInfo(107566)] = 5, -- Staggering Shout [GetSpellInfo(339)] = 5, -- Entangling Roots --[GetSpellInfo(113770)] = 5, -- Entangling Roots (Force of Nature) [GetSpellInfo(33395)] = 5, -- Freeze (Water Elemental) [GetSpellInfo(122)] = 5, -- Frost Nova --[GetSpellInfo(102051)] = 5, -- Frostjaw [GetSpellInfo(102359)] = 5, -- Mass Entanglement [GetSpellInfo(136634)] = 5, -- Narrow Escape [GetSpellInfo(105771)] = 5, -- Warbringer -- Offensive - Ranged / Spell Auras (6) [GetSpellInfo(12042)] = 6, -- Arcane Power [GetSpellInfo(114049)] = 6, -- Ascendance [GetSpellInfo(31884)] = 6, -- Avenging Wrath --[GetSpellInfo(113858)] = 6, -- Dark Soul: Instability --[GetSpellInfo(113861)] = 6, -- Dark Soul: Knowledge --[GetSpellInfo(113860)] = 6, -- Dark Soul: Misery [GetSpellInfo(16166)] = 6, -- Elemental Mastery [GetSpellInfo(12472)] = 6, -- Icy Veins [GetSpellInfo(33891)] = 6, -- Incarnation: Tree of Life [GetSpellInfo(102560)] = 6, -- Incarnation: Chosen of Elune [GetSpellInfo(102543)] = 6, -- Incarnation: King of the Jungle [GetSpellInfo(102558)] = 6, -- Incarnation: Son of Ursoc [GetSpellInfo(10060)] = 6, -- Power Infusion [GetSpellInfo(3045)] = 6, -- Rapid Fire --[GetSpellInfo(48505)] = 6, -- Starfall -- Silence and Spell Immunities Auras (7) [GetSpellInfo(31821)] = 7, -- Devotion Aura --[GetSpellInfo(115723)] = 7, -- Glyph of Ice Block [GetSpellInfo(8178)] = 7, -- Grounding Totem Effect [GetSpellInfo(131558)] = 7, -- Spiritwalker's Aegis [GetSpellInfo(104773)] = 7, -- Unending Resolve [GetSpellInfo(124488)] = 7, -- Zen Focus --[GetSpellInfo(159630)] = 7, -- Shadow Magic -- Silence Auras (8) [GetSpellInfo(1330)] = 8, -- Garrote (Silence) [GetSpellInfo(15487)] = 8, -- Silence [GetSpellInfo(47476)] = 8, -- Strangulate [GetSpellInfo(31935)] = 8, -- Avenger's Shield --[GetSpellInfo(137460)] = 8, -- Ring of Peace [GetSpellInfo(28730)] = 8, -- Arcane Torrent (Mana version) [GetSpellInfo(80483)] = 8, -- Arcane Torrent (Focus version) [GetSpellInfo(25046)] = 8, -- Arcane Torrent (Energy version) [GetSpellInfo(50613)] = 8, -- Arcane Torrent (Runic Power version) [GetSpellInfo(69179)] = 8, -- Arcane Torrent (Rage version) -- Disorients & Stuns Auras (9) [GetSpellInfo(108194)] = 9, -- Asphyxiate [GetSpellInfo(91800)] = 9, -- Gnaw (Ghoul) [GetSpellInfo(91797)] = 9, -- Monstrous Blow (Dark Transformation Ghoul) [GetSpellInfo(89766)] = 9, -- Axe Toss (Felguard) [GetSpellInfo(117526)] = 9, -- Binding Shot [GetSpellInfo(224729)] = 9, -- Bursting Shot [GetSpellInfo(213691)] = 9, -- Scatter Shot [GetSpellInfo(24394)] = 9, -- Intimidation [GetSpellInfo(105421)] = 9, -- Blinding Light [GetSpellInfo(7922)] = 9, -- Charge Stun --[GetSpellInfo(119392)] = 9, -- Charging Ox Wave [GetSpellInfo(1833)] = 9, -- Cheap Shot --[GetSpellInfo(118895)] = 9, -- Dragon Roar [GetSpellInfo(77505)] = 9, -- Earthquake [GetSpellInfo(120086)] = 9, -- Fist of Fury --[GetSpellInfo(44572)] = 9, -- Deep Freeze [GetSpellInfo(99)] = 9, -- Disorienting Roar [GetSpellInfo(31661)] = 9, -- Dragon's Breath --[GetSpellInfo(123393)] = 9, -- Breath of Fire (Glyphed) --[GetSpellInfo(105593)] = 9, -- Fist of Justice [GetSpellInfo(47481)] = 9, -- Gnaw [GetSpellInfo(1776)] = 9, -- Gouge [GetSpellInfo(853)] = 9, -- Hammer of Justice --[GetSpellInfo(119072)] = 9, -- Holy Wrath [GetSpellInfo(88625)] = 9, -- Holy Word: Chastise [GetSpellInfo(19577)] = 9, -- Intimidation [GetSpellInfo(408)] = 9, -- Kidney Shot [GetSpellInfo(119381)] = 9, -- Leg Sweep [GetSpellInfo(22570)] = 9, -- Maim [GetSpellInfo(5211)] = 9, -- Mighty Bash --[GetSpellInfo(113801)] = 9, -- Bash (Treants) [GetSpellInfo(118345)] = 9, -- Pulverize (Primal Earth Elemental) --[GetSpellInfo(115001)] = 9, -- Remorseless Winter [GetSpellInfo(30283)] = 9, -- Shadowfury [GetSpellInfo(22703)] = 9, -- Summon Infernal [GetSpellInfo(46968)] = 9, -- Shockwave [GetSpellInfo(118905)] = 9, -- Static Charge (Capacitor Totem Stun) [GetSpellInfo(132169)] = 9, -- Storm Bolt [GetSpellInfo(20549)] = 9, -- War Stomp [GetSpellInfo(16979)] = 9, -- Wild Charge [GetSpellInfo(117526)] = 9, -- Binding Shot ["163505"] = 9, -- Rake -- Crowd Controls Auras (10) [GetSpellInfo(710)] = 10, -- Banish [GetSpellInfo(2094)] = 10, -- Blind --[GetSpellInfo(137143)] = 10, -- Blood Horror [GetSpellInfo(33786)] = 10, -- Cyclone [GetSpellInfo(605)] = 10, -- Dominate Mind [GetSpellInfo(118699)] = 10, -- Fear [GetSpellInfo(3355)] = 10, -- Freezing Trap [GetSpellInfo(51514)] = 10, -- Hex [GetSpellInfo(5484)] = 10, -- Howl of Terror [GetSpellInfo(5246)] = 10, -- Intimidating Shout [GetSpellInfo(115268)] = 10, -- Mesmerize (Shivarra) [GetSpellInfo(6789)] = 10, -- Mortal Coil [GetSpellInfo(115078)] = 10, -- Paralysis [GetSpellInfo(118)] = 10, -- Polymorph [GetSpellInfo(8122)] = 10, -- Psychic Scream [GetSpellInfo(64044)] = 10, -- Psychic Horror [GetSpellInfo(20066)] = 10, -- Repentance [GetSpellInfo(82691)] = 10, -- Ring of Frost [GetSpellInfo(6770)] = 10, -- Sap [GetSpellInfo(107079)] = 10, -- Quaking Palm [GetSpellInfo(6358)] = 10, -- Seduction (Succubus) [GetSpellInfo(9484)] = 10, -- Shackle Undead --[GetSpellInfo(10326)] = 10, -- Turn Evil [GetSpellInfo(19386)] = 10, -- Wyvern Sting -- Immunity Auras (11) [GetSpellInfo(48707)] = 11, -- Anti-Magic Shell [GetSpellInfo(46924)] = 11, -- Bladestorm --[GetSpellInfo(110913)] = 11, -- Dark Bargain [GetSpellInfo(19263)] = 11, -- Deterrence [GetSpellInfo(47585)] = 11, -- Dispersion [GetSpellInfo(642)] = 11, -- Divine Shield [GetSpellInfo(45438)] = 11, -- Ice Block -- Drink (12) [GetSpellInfo(118358)] = 12, -- Drink } return auraTable end local ClassIcon = Gladius:NewModule("ClassIcon", false, true, { classIconAttachTo = "Frame", classIconAnchor = "TOPRIGHT", classIconRelativePoint = "TOPLEFT", classIconAdjustSize = false, classIconSize = 40, classIconOffsetX = -1, classIconOffsetY = 0, classIconFrameLevel = 1, classIconGloss = true, classIconGlossColor = {r = 1, g = 1, b = 1, a = 0.4}, classIconImportantAuras = true, classIconCrop = false, classIconCooldown = false, classIconCooldownReverse = false, classIconShowSpec = false, classIconDetached = false, classIconAuras = GetDefaultAuraList(), }) function ClassIcon:OnEnable() self:RegisterEvent("UNIT_AURA") self.version = 1 LSM = Gladius.LSM if not self.frame then self.frame = { } end Gladius.db.auraVersion = self.version end function ClassIcon:OnDisable() self:UnregisterAllEvents() for unit in pairs(self.frame) do self.frame[unit]:SetAlpha(0) end end function ClassIcon:GetAttachTo() return Gladius.db.classIconAttachTo end function ClassIcon:IsDetached() return Gladius.db.classIconDetached end function ClassIcon:GetFrame(unit) return self.frame[unit] end function ClassIcon:UNIT_AURA(event, unit) if not Gladius:IsValidUnit(unit) then return end -- important auras self:UpdateAura(unit) end function ClassIcon:UpdateColors(unit) self.frame[unit].normalTexture:SetVertexColor(Gladius.db.classIconGlossColor.r, Gladius.db.classIconGlossColor.g, Gladius.db.classIconGlossColor.b, Gladius.db.classIconGloss and Gladius.db.classIconGlossColor.a or 0) end function ClassIcon:UpdateAura(unit) local unitFrame = self.frame[unit] if not unitFrame then return end if not Gladius.db.classIconAuras then return end local aura for _, auraType in pairs({'HELPFUL', 'HARMFUL'}) do for i = 1, 40 do local name, _, icon, _, _, duration, expires, _, _, _, spellid = UnitAura(unit, i, auraType) if not name then break end local auraList = Gladius.db.classIconAuras local priority = auraList[name] or auraList[tostring(spellid)] if priority and (not aura or aura.priority < priority) then aura = { name = name, icon = icon, duration = duration, expires = expires, spellid = spellid, priority = priority } end end end if aura and (not unitFrame.aura or (unitFrame.aura.id ~= aura or unitFrame.aura.expires ~= aura.expires)) then self:ShowAura(unit, aura) elseif not aura then self.frame[unit].aura = nil self:SetClassIcon(unit) end end function ClassIcon:ShowAura(unit, aura) local unitFrame = self.frame[unit] unitFrame.aura = aura -- display aura unitFrame.texture:SetTexture(aura.icon) if Gladius.db.classIconCrop then unitFrame.texture:SetTexCoord(0.075, 0.925, 0.075, 0.925) else unitFrame.texture:SetTexCoord(0, 1, 0, 1) end local start if aura.expires then local timeLeft = aura.expires > 0 and aura.expires - GetTime() or 0 start = GetTime() - (aura.duration - timeLeft) end Gladius:Call(Gladius.modules.Timer, "SetTimer", unitFrame, aura.duration, start) end function ClassIcon:SetClassIcon(unit) if not self.frame[unit] then return end Gladius:Call(Gladius.modules.Timer, "HideTimer", self.frame[unit]) -- get unit class local class local specIcon if not Gladius.test then local frame = Gladius:GetUnitFrame(unit) class = frame.class specIcon = frame.specIcon else class = Gladius.testing[unit].unitClass local _, _, _, icon = GetSpecializationInfoByID(Gladius.testing[unit].unitSpecId) specIcon = icon end if Gladius.db.classIconShowSpec then if specIcon then self.frame[unit].texture:SetTexture(specIcon) local left, right, top, bottom = 0, 1, 0, 1 -- Crop class icon borders if Gladius.db.classIconCrop then left = left + (right - left) * 0.075 right = right - (right - left) * 0.075 top = top + (bottom - top) * 0.075 bottom = bottom - (bottom - top) * 0.075 end self.frame[unit].texture:SetTexCoord(left, right, top, bottom) end else if class then self.frame[unit].texture:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") local left, right, top, bottom = unpack(CLASS_BUTTONS[class]) -- Crop class icon borders if Gladius.db.classIconCrop then left = left + (right - left) * 0.075 right = right - (right - left) * 0.075 top = top + (bottom - top) * 0.075 bottom = bottom - (bottom - top) * 0.075 end self.frame[unit].texture:SetTexCoord(left, right, top, bottom) end end end function ClassIcon:CreateFrame(unit) local button = Gladius.buttons[unit] if not button then return end -- create frame self.frame[unit] = CreateFrame("CheckButton", "Gladius"..self.name.."Frame"..unit, button, "ActionButtonTemplate") self.frame[unit]:EnableMouse(false) self.frame[unit]:SetNormalTexture("Interface\\AddOns\\Gladius\\Images\\Gloss") self.frame[unit].texture = _G[self.frame[unit]:GetName().."Icon"] self.frame[unit].normalTexture = _G[self.frame[unit]:GetName().."NormalTexture"] self.frame[unit].cooldown = _G[self.frame[unit]:GetName().."Cooldown"] -- secure local secure = CreateFrame("Button", "Gladius"..self.name.."SecureButton"..unit, button, "SecureActionButtonTemplate") secure:RegisterForClicks("AnyUp") self.frame[unit].secure = secure end function ClassIcon:Update(unit) -- TODO: check why we need this >_< self.frame = self.frame or { } -- create frame if not self.frame[unit] then self:CreateFrame(unit) end local unitFrame = self.frame[unit] -- update frame unitFrame:ClearAllPoints() local parent = Gladius:GetParent(unit, Gladius.db.classIconAttachTo) unitFrame:SetPoint(Gladius.db.classIconAnchor, parent, Gladius.db.classIconRelativePoint, Gladius.db.classIconOffsetX, Gladius.db.classIconOffsetY) -- frame level unitFrame:SetFrameLevel(Gladius.db.classIconFrameLevel) if Gladius.db.classIconAdjustSize then local height = false -- need to rethink that --[[for _, module in pairs(Gladius.modules) do if module:GetAttachTo() == self.name then height = false end end]] if height then unitFrame:SetWidth(Gladius.buttons[unit].height) unitFrame:SetHeight(Gladius.buttons[unit].height) else unitFrame:SetWidth(Gladius.buttons[unit].frameHeight) unitFrame:SetHeight(Gladius.buttons[unit].frameHeight) end else unitFrame:SetWidth(Gladius.db.classIconSize) unitFrame:SetHeight(Gladius.db.classIconSize) end -- Secure frame if self.IsDetached() then unitFrame.secure:SetAllPoints(unitFrame) unitFrame.secure:SetHeight(unitFrame:GetHeight()) unitFrame.secure:SetWidth(unitFrame:GetWidth()) unitFrame.secure:Show() else unitFrame.secure:Hide() end unitFrame.texture:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") -- set frame mouse-interactable area local left, right, top, bottom = Gladius.buttons[unit]:GetHitRectInsets() if self:GetAttachTo() == "Frame" and not self:IsDetached() then if strfind(Gladius.db.classIconRelativePoint, "LEFT") then left = - unitFrame:GetWidth() + Gladius.db.classIconOffsetX else right = - unitFrame:GetWidth() + - Gladius.db.classIconOffsetX end -- search for an attached frame --[[for _, module in pairs(Gladius.modules) do if (module.attachTo and module:GetAttachTo() == self.name and module.frame and module.frame[unit]) then local attachedPoint = module.frame[unit]:GetPoint() if (strfind(Gladius.db.classIconRelativePoint, "LEFT") and (not attachedPoint or (attachedPoint and strfind(attachedPoint, "RIGHT")))) then left = left - module.frame[unit]:GetWidth() elseif (strfind(Gladius.db.classIconRelativePoint, "LEFT") and (not attachedPoint or (attachedPoint and strfind(attachedPoint, "LEFT")))) then right = right - module.frame[unit]:GetWidth() end end end]] -- top / bottom if unitFrame:GetHeight() > Gladius.buttons[unit]:GetHeight() then bottom = -(unitFrame:GetHeight() - Gladius.buttons[unit]:GetHeight()) + Gladius.db.classIconOffsetY end Gladius.buttons[unit]:SetHitRectInsets(left, right, 0, 0) Gladius.buttons[unit].secure:SetHitRectInsets(left, right, 0, 0) end -- style action button unitFrame.normalTexture:SetHeight(unitFrame:GetHeight() + unitFrame:GetHeight() * 0.4) unitFrame.normalTexture:SetWidth(unitFrame:GetWidth() + unitFrame:GetWidth() * 0.4) unitFrame.normalTexture:ClearAllPoints() unitFrame.normalTexture:SetPoint("CENTER", 0, 0) unitFrame:SetNormalTexture("Interface\\AddOns\\Gladius\\Images\\Gloss") unitFrame.texture:ClearAllPoints() unitFrame.texture:SetPoint("TOPLEFT", unitFrame, "TOPLEFT") unitFrame.texture:SetPoint("BOTTOMRIGHT", unitFrame, "BOTTOMRIGHT") unitFrame.normalTexture:SetVertexColor(Gladius.db.classIconGlossColor.r, Gladius.db.classIconGlossColor.g, Gladius.db.classIconGlossColor.b, Gladius.db.classIconGloss and Gladius.db.classIconGlossColor.a or 0) unitFrame.texture:SetTexCoord(left, right, top, bottom) -- cooldown unitFrame.cooldown.isDisabled = not Gladius.db.classIconCooldown unitFrame.cooldown:SetReverse(Gladius.db.classIconCooldownReverse) Gladius:Call(Gladius.modules.Timer, "RegisterTimer", unitFrame, Gladius.db.classIconCooldown) -- hide unitFrame:SetAlpha(0) self.frame[unit] = unitFrame end function ClassIcon:Show(unit) local testing = Gladius.test -- show frame self.frame[unit]:SetAlpha(1) -- set class icon self:UpdateAura(unit) end function ClassIcon:Reset(unit) -- reset frame self.frame[unit].aura = nil self.frame[unit]:SetScript("OnUpdate", nil) -- reset cooldown self.frame[unit].cooldown:SetCooldown(0, 0) -- reset texture self.frame[unit].texture:SetTexture("") -- hide self.frame[unit]:SetAlpha(0) end function ClassIcon:ResetModule() Gladius.db.classIconAuras = { } Gladius.db.classIconAuras = GetDefaultAuraList() local newAura = Gladius.options.args[self.name].args.auraList.args.newAura Gladius.options.args[self.name].args.auraList.args = { newAura = newAura, } for aura, priority in pairs(Gladius.db.classIconAuras) do if priority then local isNum = tonumber(aura) ~= nil local name = isNum and GetSpellInfo(aura) or aura Gladius.options.args[self.name].args.auraList.args[aura] = self:SetupAura(aura, priority, name) end end end function ClassIcon:Test(unit) if not Gladius.db.classIconImportantAuras then return end if unit == "arena1" then self:ShowAura(unit, { icon = select(3, GetSpellInfo(45438)), duration = 10 }) elseif unit == "arena2" then self:ShowAura(unit, { icon = select(3, GetSpellInfo(19263)), duration = 5 }) end end function ClassIcon:GetOptions() local options = { general = { type = "group", name = L["General"], order = 1, args = { widget = { type = "group", name = L["Widget"], desc = L["Widget settings"], inline = true, order = 1, args = { classIconImportantAuras = { type = "toggle", name = L["Class Icon Important Auras"], desc = L["Show important auras instead of the class icon"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, order = 5, }, classIconCrop = { type = "toggle", name = L["Class Icon Crop Borders"], desc = L["Toggle if the class icon borders should be cropped or not."], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 6, }, sep = { type = "description", name = "", width = "full", order = 7, }, classIconCooldown = { type = "toggle", name = L["Class Icon Cooldown Spiral"], desc = L["Display the cooldown spiral for important auras"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 10, }, classIconCooldownReverse = { type = "toggle", name = L["Class Icon Cooldown Reverse"], desc = L["Invert the dark/bright part of the cooldown spiral"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 15, }, classIconShowSpec = { type = "toggle", name = L["Class Icon Spec Icon"], desc = L["Shows the specialization icon instead of the class icon"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 16, }, sep2 = { type = "description", name = "", width = "full", order = 17, }, classIconGloss = { type = "toggle", name = L["Class Icon Gloss"], desc = L["Toggle gloss on the class icon"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 20, }, classIconGlossColor = { type = "color", name = L["Class Icon Gloss Color"], desc = L["Color of the class icon gloss"], get = function(info) return Gladius:GetColorOption(info) end, set = function(info, r, g, b, a) return Gladius:SetColorOption(info, r, g, b, a) end, hasAlpha = true, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 25, }, sep3 = { type = "description", name = "", width = "full", order = 27, }, classIconFrameLevel = { type = "range", name = L["Class Icon Frame Level"], desc = L["Frame level of the class icon"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, min = 1, max = 5, step = 1, width = "double", order = 30, }, }, }, size = { type = "group", name = L["Size"], desc = L["Size settings"], inline = true, order = 2, args = { classIconAdjustSize = { type = "toggle", name = L["Class Icon Adjust Size"], desc = L["Adjust class icon size to the frame size"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, order = 5, }, classIconSize = { type = "range", name = L["Class Icon Size"], desc = L["Size of the class icon"], min = 10, max = 100, step = 1, disabled = function() return Gladius.dbi.profile.classIconAdjustSize or not Gladius.dbi.profile.modules[self.name] end, order = 10, }, }, }, position = { type = "group", name = L["Position"], desc = L["Position settings"], inline = true, order = 3, args = { classIconAttachTo = { type = "select", name = L["Class Icon Attach To"], desc = L["Attach class icon to given frame"], values = function() return Gladius:GetModules(self.name) end, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 5, }, classIconDetached = { type = "toggle", name = L["Detached from frame"], desc = L["Detach the cast bar from the frame itself"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, order = 6, }, classIconPosition = { type = "select", name = L["Class Icon Position"], desc = L["Position of the class icon"], values={ ["LEFT"] = L["Left"], ["RIGHT"] = L["Right"] }, get = function() return strfind(Gladius.db.classIconAnchor, "RIGHT") and "LEFT" or "RIGHT" end, set = function(info, value) if (value == "LEFT") then Gladius.db.classIconAnchor = "TOPRIGHT" Gladius.db.classIconRelativePoint = "TOPLEFT" else Gladius.db.classIconAnchor = "TOPLEFT" Gladius.db.classIconRelativePoint = "TOPRIGHT" end Gladius:UpdateFrame(info[1]) end, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return Gladius.db.advancedOptions end, order = 7, }, sep = { type = "description", name = "", width = "full", order = 8, }, classIconAnchor = { type = "select", name = L["Class Icon Anchor"], desc = L["Anchor of the class icon"], values = function() return Gladius:GetPositions() end, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 10, }, classIconRelativePoint = { type = "select", name = L["Class Icon Relative Point"], desc = L["Relative point of the class icon"], values = function() return Gladius:GetPositions() end, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, hidden = function() return not Gladius.db.advancedOptions end, order = 15, }, sep2 = { type = "description", name = "", width = "full", order = 17, }, classIconOffsetX = { type = "range", name = L["Class Icon Offset X"], desc = L["X offset of the class icon"], min = - 100, max = 100, step = 1, disabled = function() return not Gladius.dbi.profile.modules[self.name] end, order = 20, }, classIconOffsetY = { type = "range", name = L["Class Icon Offset Y"], desc = L["Y offset of the class icon"], disabled = function() return not Gladius.dbi.profile.modules[self.name] end, min = - 50, max = 50, step = 1, order = 25, }, }, }, }, }, auraList = { type = "group", name = L["Auras"], childGroups = "tree", order = 3, args = { newAura = { type = "group", name = L["New Aura"], desc = L["New Aura"], inline = true, order = 1, args = { name = { type = "input", name = L["Name"], desc = L["Name of the aura"], get = function() return self.newAuraName or "" end, set = function(info, value) self.newAuraName = value end, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, order = 1, }, priority = { type = "range", name = L["Priority"], desc = L["Select what priority the aura should have - higher equals more priority"], get = function() return self.newAuraPriority or 0 end, set = function(info, value) self.newAuraPriority = value end, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, min = 0, max = 20, step = 1, order = 2, }, add = { type = "execute", name = L["Add new Aura"], func = function(info) if not self.newAuraName or self.newAuraName == "" then return end if not self.newAuraPriority then self.newAuraPriority = 0 end local isNum = tonumber(self.newAuraName) ~= nil local name = isNum and GetSpellInfo(self.newAuraName) or self.newAuraName Gladius.options.args[self.name].args.auraList.args[self.newAuraName] = self:SetupAura(self.newAuraName, self.newAuraPriority, name) Gladius.db.classIconAuras[self.newAuraName] = self.newAuraPriority self.newAuraName = "" end, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras or not self.newAuraName or self.newAuraName == "" end, order = 3, }, }, }, }, }, } for aura, priority in pairs(Gladius.db.classIconAuras) do if priority then local isNum = tonumber(aura) ~= nil local name = isNum and GetSpellInfo(aura) or aura options.auraList.args[aura] = self:SetupAura(aura, priority, name) end end return options end local function setAura(info, value) if info[#(info)] == "name" then if info[#(info) - 1] == value then return end -- create new aura Gladius.db.classIconAuras[value] = Gladius.db.classIconAuras[info[#(info) - 1]] -- delete old aura Gladius.db.classIconAuras[info[#(info) - 1]] = nil local newAura = Gladius.options.args["ClassIcon"].args.auraList.args.newAura Gladius.options.args["ClassIcon"].args.auraList.args = { newAura = newAura, } for aura, priority in pairs(Gladius.db.classIconAuras) do if priority then local isNum = tonumber(aura) ~= nil local name = isNum and GetSpellInfo(aura) or aura Gladius.options.args["ClassIcon"].args.auraList.args[aura] = ClassIcon:SetupAura(aura, priority, name) end end else Gladius.dbi.profile.classIconAuras[info[#(info) - 1]] = value end end local function getAura(info) if info[#(info)] == "name" then return info[#(info) - 1] else return Gladius.dbi.profile.classIconAuras[info[#(info) - 1]] end end function ClassIcon:SetupAura(aura, priority, name) local name = name or aura return { type = "group", name = name, desc = name, get = getAura, set = setAura, args = { name = { type = "input", name = L["Name or ID"], desc = L["Name or ID of the aura"], order = 1, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, }, priority = { type = "range", name = L["Priority"], desc = L["Select what priority the aura should have - higher equals more priority"], min = 0, max = 20, step = 1, order = 2, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, }, delete = { type = "execute", name = L["Delete"], func = function(info) local defaults = GetDefaultAuraList() if defaults[info[#(info) - 1]] then Gladius.db.classIconAuras[info[#(info) - 1]] = false else Gladius.db.classIconAuras[info[#(info) - 1]] = nil end local newAura = Gladius.options.args[self.name].args.auraList.args.newAura Gladius.options.args[self.name].args.auraList.args = { newAura = newAura, } for aura, priority in pairs(Gladius.db.classIconAuras) do if priority then local isNum = tonumber(aura) ~= nil local name = isNum and GetSpellInfo(aura) or aura Gladius.options.args[self.name].args.auraList.args[aura] = self:SetupAura(aura, priority, name) end end end, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, order = 3, }, reset = { type = "execute", name = L["Reset Auras"], func = function(info) self:ResetModule() end, disabled = function() return not Gladius.dbi.profile.modules[self.name] or not Gladius.db.classIconImportantAuras end, order = 4, }, }, } end
liruqi/bigfoot
Interface/AddOns/Gladius/modules/classicon.lua
Lua
mit
35,485
var d3 = require('d3'); var svg, legend; var w = 900, h = 600, padding = 60, r = 2; var xColumn, yColumn, tColumn; var xScale, yScale, tScale; var setup = function () { xColumn = "tid"; yColumn = "antall"; tColumn = "alder"; xScale = d3.scale.linear().range([padding, w-padding]); yScale = d3.scale.linear().range([h - padding, padding]); tScale = d3.scale.category20(); svg = d3.select('.fig4-1').append('svg').attr('width', w).attr('height', h); legend = d3.select('.fig4-1').append('div'); d3.csv('http://data.ssb.no/api/v0/dataset/65195.csv?lang=no', type, function (data) { var filtered = data.filter(function (d) { return d['kjønn'] == '0 Begge kjønn'; }) displayLegend(filtered); }); }; var type = function (d) { d["antall"] = +d["Personer etter alder, kjønn og tid"]; d["tid"] = d["tid"]; d["alder"] = getString(d["alder"]); return d; }; var draw = function (data) { var path = svg.selectAll(".line").data([data]); path.enter().append('path').attr("class", "line"); path.transition() .attr("d", line) .attr("stroke", function (d) { return tScale(d[0][tColumn]); }); }; var run = function () { setup(); }; var displayLegend = function (data) { xScale.domain( d3.extent(data, function (d) { return d[xColumn]; }) ); yScale.domain( [0, d3.max(data, function (d) { return d[yColumn]; })] ); var xAxis = d3.svg.axis().scale(xScale).orient('bottom').ticks(10).tickFormat(d3.format("f")); var yAxis = d3.svg.axis().scale(yScale).orient('left').ticks(6); svg.append('g').attr('class', 'axis') .attr("transform", "translate(0," + (h - padding) + ")") .call(xAxis); svg.append('g').attr('class', 'axis') .attr("transform", "translate(" + padding + ", 0)") .call(yAxis); legend.selectAll('p').data(getTypes(data)).enter().append('p') .html(function (d) { return d; }) .style('background-color', function (d) { return tScale(d); }) .on('mouseover', function (d) { var filteredData = data.filter( function (x) { return x['alder'] == d; }); draw(filteredData); }); }; var line = d3.svg.line() .x(function(d) { return xScale(d[xColumn]); }) .y(function(d) { return yScale(d[yColumn]); }) .interpolate('basis'); var getString = function (string) { return string.substring(string.indexOf(' ')); }; var categorize = function (data) { var cat = []; data.forEach(function (d) { cat[ d['alder'] ] = cat[ d['alder'] ] || []; cat[ d['alder'] ].push(d); }); return cat; } var getTypes = function (data) { var categories = []; data.forEach( function (d) { if( categories.indexOf(d[tColumn]) == -1 ) { categories.push(d[tColumn]); } }); return categories; }; var isOfType = function (d, type) { return d['alder'] == type; }; module.exports = { run: run };
kgolid/D3licious
js/figures/fig4-1.js
JavaScript
mit
2,873
package seedu.tasklist.ui; import java.util.logging.Logger; import javafx.fxml.FXML; import javafx.scene.Scene; import javafx.scene.layout.Region; import javafx.scene.web.WebView; import javafx.stage.Stage; import seedu.tasklist.commons.core.LogsCenter; import seedu.tasklist.commons.util.FxViewUtil; /** * Controller for a help page */ public class HelpWindow extends UiPart<Region> { private static final Logger logger = LogsCenter.getLogger(HelpWindow.class); private static final String ICON = "/images/help_icon.png"; private static final String FXML = "HelpWindow.fxml"; private static final String TITLE = "Help"; private static final String USERGUIDE_URL = "https://github.com/CS2103JAN2017-W14-B1/main/blob/master/docs/UserGuide.md#5-command-summary"; @FXML private WebView browser; private final Stage dialogStage; public HelpWindow() { super(FXML); Scene scene = new Scene(getRoot()); //Null passed as the parent stage to make it non-modal. dialogStage = createDialogStage(TITLE, null, scene); dialogStage.setMaximized(true); //TODO: set a more appropriate initial size FxViewUtil.setStageIcon(dialogStage, ICON); browser.getEngine().load(USERGUIDE_URL); FxViewUtil.applyAnchorBoundaryParameters(browser, 0.0, 0.0, 0.0, 0.0); } public void show() { logger.fine("Showing help page about the application."); dialogStage.showAndWait(); } }
CS2103JAN2017-W14-B1/main
src/main/java/seedu/tasklist/ui/HelpWindow.java
Java
mit
1,499
<?xml version="1.0" ?><!DOCTYPE TS><TS language="la" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About POPCoin</source> <translation>Informatio de POPCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;POPCoin&lt;/b&gt; version</source> <translation>&lt;b&gt;POPCoin&lt;/b&gt; versio</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source> <translation>Hoc est experimentale programma. Distributum sub MIT/X11 licentia programmatum, vide comitantem plicam COPYING vel http://www.opensource.org/licenses/mit-license.php. Hoc productum continet programmata composita ab OpenSSL Project pro utendo in OpenSSL Toolkit (http://www.openssl.org/) et programmata cifrarum scripta ab Eric Young ([email protected]) et UPnP programmata scripta ab Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>POPCoin</source> <translation>POPCoin curatores</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Liber Inscriptionum</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Dupliciter-clicca ut inscriptionem vel titulum mutes</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Crea novam inscriptionem</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copia inscriptionem iam selectam in latibulum systematis</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Nova Inscriptio</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your POPCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Haec sunt inscriptiones POPCoin tuae pro accipendo pensitationes. Cupias variam ad quemque mittentem dare ut melius scias quem tibi pensare.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copia Inscriptionem</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Monstra codicem &amp;QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a POPCoin address</source> <translation>Signa nuntium ut demonstres inscriptionem POPCoin a te possessam esse</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signa &amp;Nuntium</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Dele active selectam inscriptionem ex enumeratione</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exporta data in hac tabella in plicam</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exporta</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified POPCoin address</source> <translation>Verifica nuntium ut cures signatum esse cum specificata inscriptione POPCoin</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verifica Nuntium</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Dele</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your POPCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Hae sunt inscriptiones mittendi pensitationes. Semper inspice quantitatem et inscriptionem accipiendi antequam nummos mittis.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copia &amp;Titulum</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Muta</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Mitte &amp;Nummos</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exporta Data Libri Inscriptionum</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma Separata Plica (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Error exportandi</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Non potuisse scribere in plicam %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Titulus</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(nullus titulus)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialogus Tesserae</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Insere tesseram</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova tessera</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Itera novam tesseram</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Insero novam tesseram cassidili.&lt;br/&gt;Sodes tessera &lt;b&gt;10 pluriumve fortuitarum litterarum&lt;/b&gt; utere aut &lt;b&gt;octo pluriumve verborum&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Cifra cassidile</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Huic operationi necesse est tessera cassidili tuo ut cassidile reseret.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Resera cassidile</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Huic operationi necesse est tessera cassidili tuo ut cassidile decifret.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Decifra cassidile</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Muta tesseram</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Insero veterem novamque tesseram cassidili.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirma cifrationem cassidilis</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR POPCOIN&lt;/b&gt;!</source> <translation>Monitio: Si cassidile tuum cifras et tesseram amittis, tu &lt;b&gt;AMITTES OMNES TUOS NUMMOS BITOS&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Certusne es te velle tuum cassidile cifrare?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>GRAVE: Oportet ulla prioria conservata quae fecisti de plica tui cassidilis reponi a nove generata cifrata plica cassidilis. Propter securitatem, prioria conservata de plica non cifrata cassidilis inutilia fiet simul atque incipis uti novo cifrato cassidili.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Monitio: Litterae ut capitales seratae sunt!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Cassidile cifratum</translation> </message> <message> <location line="-56"/> <source>POPCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your popcoins from being stolen by malware infecting your computer.</source> <translation>POPCoin iam desinet ut finiat actionem cifrandi. Memento cassidile cifrare non posse cuncte curare ne tui nummi clepantur ab malis programatibus in tuo computatro.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Cassidile cifrare abortum est</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Cassidile cifrare abortum est propter internum errorem. Tuum cassidile cifratum non est.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>Tesserae datae non eaedem sunt.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>Cassidile reserare abortum est.</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Tessera inserta pro cassidilis decifrando prava erat.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Cassidile decifrare abortum est.</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Tessera cassidilis successa est in mutando.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Signa &amp;nuntium...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Synchronizans cum rete...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>&amp;Summarium</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Monstra generale summarium cassidilis</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transactiones</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Inspicio historiam transactionum</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Muta indicem salvatarum inscriptionum titulorumque</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Monstra indicem inscriptionum quibus pensitationes acceptandae</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>E&amp;xi</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Exi applicatione</translation> </message> <message> <location line="+4"/> <source>Show information about POPCoin</source> <translation>Monstra informationem de POPCoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Informatio de &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Monstra informationem de Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Optiones</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Cifra Cassidile...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Conserva Cassidile...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Muta tesseram...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importans frusta ab disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Recreans indicem frustorum in disco...</translation> </message> <message> <location line="-347"/> <source>Send coins to a POPCoin address</source> <translation>Mitte nummos ad inscriptionem POPCoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for POPCoin</source> <translation>Muta configurationis optiones pro POPCoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Conserva cassidile in locum alium</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Muta tesseram utam pro cassidilis cifrando</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Fenestra &amp;Debug</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Aperi terminalem debug et diagnosticalem</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verifica nuntium...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>POPCoin</source> <translation>POPCoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Cassidile</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Mitte</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Accipe</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>&amp;Inscriptiones</translation> </message> <message> <location line="+22"/> <source>&amp;About POPCoin</source> <translation>&amp;Informatio de POPCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Monstra/Occulta</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Monstra vel occulta Fenestram principem</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Cifra claves privatas quae cassidili tui sunt</translation> </message> <message> <location line="+7"/> <source>Sign messages with your POPCoin addresses to prove you own them</source> <translation>Signa nuntios cum tuis inscriptionibus POPCoin ut demonstres te eas possidere</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified POPCoin addresses</source> <translation>Verifica nuntios ut certus sis eos signatos esse cum specificatis inscriptionibus POPCoin</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Plica</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>&amp;Configuratio</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>&amp;Auxilium</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Tabella instrumentorum &quot;Tabs&quot;</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+47"/> <source>POPCoin client</source> <translation>POPCoin cliens</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to POPCoin network</source> <translation><numerusform>%n activa conexio ad rete POPCoin</numerusform><numerusform>%n activae conexiones ad rete POPCoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Nulla fons frustorum absens...</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Perfecta %1 de %2 (aestimato) frusta historiae transactionum.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Processae %1 frusta historiae transactionum.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horae</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dies</numerusform><numerusform>%n dies</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n hebdomas</numerusform><numerusform>%n hebdomades</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 post</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Postremum acceptum frustum generatum est %1 abhinc.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transactiones post hoc nondum visibiles erunt.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Monitio</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informatio</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Haec transactio maior est quam limen magnitudinis. Adhuc potes id mittere mercede %1, quae it nodis qui procedunt tuam transactionem et adiuvat sustinere rete. Visne mercedem solvere?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Recentissimo</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Persequens...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirma mercedem transactionis</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transactio missa</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transactio incipiens</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Dies: %1 Quantitas: %2 Typus: %3 Inscriptio: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Tractatio URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid POPCoin address or malformed URI parameters.</source> <translation>URI intellegi non posse! Huius causa possit inscriptionem POPCoin non validam aut URI parametra maleformata.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;reseratum&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;seratum&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. POPCoin can no longer continue safely and will quit.</source> <translation>Error fatalis accidit. POPCoin nondum pergere tute potest, et exibit.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Monitio Retis</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Muta Inscriptionem</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Titulus</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Titulus associatus huic insertione libri inscriptionum</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Inscriptio</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Titulus associatus huic insertione libri inscriptionum. Haec tantum mutari potest pro inscriptionibus mittendi</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nova inscriptio accipiendi</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nova inscriptio mittendi</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Muta inscriptionem accipiendi</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Muta inscriptionem mittendi</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Inserta inscriptio &quot;%1&quot; iam in libro inscriptionum est.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid POPCoin address.</source> <translation>Inscriptio inserta &quot;%1&quot; non valida inscriptio POPCoin est.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Non potuisse cassidile reserare</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generare novam clavem abortum est.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>POPCoin-Qt</source> <translation>POPCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versio</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Usus:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>Optiones mandati intiantis</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>UI optiones</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Constitue linguam, exempli gratia &quot;de_DE&quot; (praedefinitum: lingua systematis)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Incipe minifactum ut icon</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Monstra principem imaginem ad initium (praedefinitum: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Optiones</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Princeps</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Optionalis merces transactionum singulis kB quae adiuvat curare tuas transactiones processas esse celeriter. Plurimi transactiones 1kB sunt.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Solve &amp;mercedem transactionis</translation> </message> <message> <location line="+31"/> <source>Automatically start POPCoin after logging in to the system.</source> <translation>Pelle POPCoin per se postquam in systema inire.</translation> </message> <message> <location line="+3"/> <source>&amp;Start POPCoin on system login</source> <translation>&amp;Pelle POPCoin cum inire systema</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Reconstitue omnes optiones clientis ad praedefinita.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Reconstitue Optiones</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Rete</translation> </message> <message> <location line="+6"/> <source>Automatically open the POPCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Aperi per se portam clientis POPCoin in itineratore. Hoc tantum effectivum est si itineratrum tuum supportat UPnP et id activum est.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Designa portam utendo &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the POPCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Connecte ad rete POPCoin per SOCKS vicarium (e.g. quando conectens per Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>&amp;Conecte per SOCKS vicarium:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP vicarii:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Inscriptio IP vicarii (e.g. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta vicarii (e.g. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Versio:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS versio vicarii (e.g. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Fenestra</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Monstra tantum iconem in tabella systematis postquam fenestram minifactam est.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minifac in tabellam systematis potius quam applicationum</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minifac potius quam exire applicatione quando fenestra clausa sit. Si haec optio activa est, applicatio clausa erit tantum postquam selegeris Exi in menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inifac ad claudendum</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;UI</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Lingua monstranda utenti:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting POPCoin.</source> <translation>Lingua monstranda utenti hic constitui potest. Haec configuratio effectiva erit postquam POPCoin iterum initiatum erit.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unita qua quantitates monstrare:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Selige praedefinitam unitam subdivisionis monstrare in interfacie et quando nummos mittere</translation> </message> <message> <location line="+9"/> <source>Whether to show POPCoin addresses in the transaction list or not.</source> <translation>Num monstrare inscriptiones POPCoin in enumeratione transactionum.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>&amp;Monstra inscriptiones in enumeratione transactionum</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancella</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Applica</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>praedefinitum</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirma optionum reconstituere</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Aliis configurationibus fortasse necesse est clientem iterum initiare ut effectivae sint.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Vis procedere?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Monitio</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting POPCoin.</source> <translation>Haec configuratio effectiva erit postquam POPCoin iterum initiatum erit.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Inscriptio vicarii tradita non valida est.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Schema</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the POPCoin network after a connection is established, but this process has not completed yet.</source> <translation>Monstrata informatio fortasse non recentissima est. Tuum cassidile per se synchronizat cum rete POPCoin postquam conexio constabilita est, sed hoc actio nondum perfecta est.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Pendendum:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Non confirmata:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Cassidile</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Immatura:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Fossum pendendum quod nondum maturum est</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Recentes transactiones&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>Tuum pendendum iam nunc</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Totali nummi transactionum quae adhuc confirmandae sunt, et nondum afficiunt pendendum</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>non synchronizato</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start popcoin: click-to-pay handler</source> <translation>POPCoin incipere non potest: cliccare-ad-pensandum handler</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Dialogus QR Codicis</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Posce Pensitationem</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Quantitas:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Titulus:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Nuntius:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Salva ut...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Error codificandi URI in codicem QR.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Inserta quantitas non est valida, sodes proba.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Resultato URI nimis longo, conare minuere verba pro titulo / nuntio.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Salva codicem QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Imagines PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nomen clientis</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/A</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versio clientis</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informatio</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Utens OpenSSL versione</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempus initiandi</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rete</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Numerus conexionum</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>In testnet</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Catena frustorum</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Numerus frustorum iam nunc</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Aestimatus totalis numerus frustorum</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Hora postremi frusti</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Aperi</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Optiones mandati initiantis</translation> </message> <message> <location line="+7"/> <source>Show the POPCoin-Qt help message to get a list with possible POPCoin command-line options.</source> <translation>Monstra nuntium auxilii POPCoin-Qt ut videas enumerationem possibilium optionum POPCoin mandati initiantis.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Monstra</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Terminale</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Dies aedificandi</translation> </message> <message> <location line="-104"/> <source>POPCoin - Debug window</source> <translation>POPCoin - Fenestra debug</translation> </message> <message> <location line="+25"/> <source>POPCoin Core</source> <translation>POPCoin Nucleus</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Debug catalogi plica</translation> </message> <message> <location line="+7"/> <source>Open the POPCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Aperi plicam catalogi de POPCoin debug ex activo indice datorum. Hoc possit pauca secunda pro plicis magnis catalogi.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Vacuefac terminale</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the POPCoin RPC console.</source> <translation>Bene ventio in terminale RPC de POPCoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Utere sagittis sursum deorsumque ut per historiam naviges, et &lt;b&gt;Ctrl+L&lt;/b&gt; ut scrinium vacuefacias.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Scribe &lt;b&gt;help&lt;/b&gt; pro summario possibilium mandatorum.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Mitte Nummos</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Mitte pluribus accipientibus simul</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adde &amp;Accipientem</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Remove omnes campos transactionis</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Vacuefac &amp;Omnia</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Pendendum:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirma actionem mittendi</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Mitte</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; ad %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirma mittendum nummorum</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Certus es te velle mittere %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>et</translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>Inscriptio accipientis non est valida, sodes reproba.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Oportet quantitatem ad pensandum maiorem quam 0 esse.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Quantitas est ultra quod habes.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Quantitas est ultra quod habes cum merces transactionis %1 includitur.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Geminata inscriptio inventa, tantum posse mittere ad quamque inscriptionem semel singulare operatione.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Error: Creare transactionem abortum est!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Error: transactio reiecta est. Hoc fiat si alii nummorum in tuo cassidili iam soluti sunt, ut si usus es exemplar de wallet.dat et nummi soluti sunt in exemplari sed non hic notati ut soluti.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Schema</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Quantitas:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Pensa &amp;Ad:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</source> <translation>Inscriptio cui mittere pensitationem (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Insero titulum huic inscriptioni ut eam in tuum librum inscriptionum addas.</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Titulus:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Selige inscriptionem ex libro inscriptionum</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Conglutina inscriptionem ex latibulo</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Remove hunc accipientem</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a POPCoin address (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</source> <translation>Insero inscriptionem POPCoin (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Signationes - Signa / Verifica nuntium</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>&amp;Signa Nuntium</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Potes nuntios signare inscriptionibus tuis ut demonstres te eas possidere. Cautus es non amibiguum signare, quia impetus phiscatorum conentur te fallere ut signes identitatem tuam ad eos. Solas signa sententias cuncte descriptas quibus convenis.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</source> <translation>Inscriptio qua signare nuntium (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Selige inscriptionem ex librum inscriptionum</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Glutina inscriptionem ex latibulo</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Insere hic nuntium quod vis signare</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Signatio</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copia signationem in latibulum systematis</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this POPCoin address</source> <translation>Signa nuntium ut demonstres hanc inscriptionem POPCoin a te possessa esse</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Signa &amp;Nuntium</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Reconstitue omnes campos signandi nuntii</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Vacuefac &amp;Omnia</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verifica Nuntium</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Insere inscriptionem signantem, nuntium (cura ut copias intermissiones linearum, spatia, tabs, et cetera exacte) et signationem infra ut nuntium verifices. Cautus esto ne magis legas in signationem quam in nuntio signato ipso est, ut vites falli ab impetu homo-in-medio.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</source> <translation>Inscriptio qua nuntius signatus est (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified POPCoin address</source> <translation>Verifica nuntium ut cures signatum esse cum specifica inscriptione POPCoin</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verifica &amp;Nuntium</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Reconstitue omnes campos verificandi nuntii</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a POPCoin address (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</source> <translation>Insere inscriptionem POPCoin (e.g. sSxjmkQbhzcbnhNLPru6TwPy4HRPogaDcK)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clicca &quot;Signa Nuntium&quot; ut signatio generetur</translation> </message> <message> <location line="+3"/> <source>Enter POPCoin signature</source> <translation>Insere signationem POPCoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Inscriptio inserta non valida est.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Sodes inscriptionem proba et rursus conare.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Inserta inscriptio clavem non refert.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Cassidilis reserare cancellatum est.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Clavis privata absens est pro inserta inscriptione.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Nuntium signare abortum est.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Nuntius signatus.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Signatio decodificari non potuit.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Sodes signationem proba et rursus conare.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Signatio non convenit digesto nuntii</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Nuntium verificare abortum est.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Nuntius verificatus.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>POPCoin</source> <translation>POPCoin curatores</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Apertum donec %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/non conecto</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/non confirmata</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmationes</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Status</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, disseminatum per %n nodo</numerusform><numerusform>, disseminata per %n nodis</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Fons</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Generatum</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Ab</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Ad</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>inscriptio propria</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>titulus</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Creditum</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>maturum erit in %n plure frusto</numerusform><numerusform>maturum erit in %n pluribus frustis</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>non acceptum</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debitum</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Transactionis merces</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Cuncta quantitas</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Nuntius</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Annotatio</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID transactionis</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Nummis generatis necesse est maturitas 120 frustorum antequam illi transmitti possunt. Cum hoc frustum generavisti, disseminatum est ad rete ut addatur ad catenam frustorum. Si aboritur inire catenam, status eius mutabit in &quot;non acceptum&quot; et non transmittabile erit. Hoc interdum accidat si alter nodus frustum generat paucis secundis ante vel post tuum.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informatio de debug</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transactio</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Lectenda</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verum</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falsum</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, nondum prospere disseminatum est</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform>Aperi pro %n pluribus frustis</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>ignotum</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Particularia transactionis</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Haec tabula monstrat descriptionem verbosam transactionis</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Typus</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aperi pro %n plure frusto</numerusform><numerusform>Aperi pro %n pluribus frustis</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Apertum donec %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Non conectum (%1 confirmationes)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Non confirmatum (%1 de %2 confirmationibus)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmatum (%1 confirmationes)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Fossum pendendum utibile erit quando id maturum est post %n plus frustum</numerusform><numerusform>Fossum pendendum utibile erit quando id maturum est post %n pluria frusta</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Hoc frustum non acceptum est ab ulla alia nodis et probabiliter non acceptum erit!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Generatum sed non acceptum</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Acceptum cum</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Acceptum ab</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Missum ad</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pensitatio ad te ipsum</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Fossa</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transactionis. Supervola cum mure ut monstretur numerus confirmationum.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Dies et tempus quando transactio accepta est.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Typus transactionis.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Inscriptio destinationis transactionis.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantitas remota ex pendendo aut addita ei.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Omne</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hodie</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Hac hebdomade</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Hoc mense</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Postremo mense</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Hoc anno</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Intervallum...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Acceptum cum</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Missum ad</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Ad te ipsum</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Fossa</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Alia</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Insere inscriptionem vel titulum ut quaeras</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantitas minima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copia inscriptionem</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copia titulum</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copia quantitatem</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copia transactionis ID</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Muta titulum</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Monstra particularia transactionis</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exporta Data Transactionum</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma Separata Plica (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmatum</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Dies</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Typus</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Titulus</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Inscriptio</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantitas</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Error exportandi</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Non potuisse scribere ad plicam %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Intervallum:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>ad</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Mitte Nummos</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exporta</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exporta data in hac tabella in plicam</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Conserva cassidile</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Data cassidilis (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Conservare abortum est.</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Error erat conante salvare data cassidilis ad novum locum.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Successum in conservando</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Successum in salvando data cassidilis in novum locum.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>POPCoin version</source> <translation>Versio de POPCoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Usus:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or popcoind</source> <translation>Mitte mandatum ad -server vel popcoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Enumera mandata</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Accipe auxilium pro mandato</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Optiones:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: popcoin.conf)</source> <translation>Specifica configurationis plicam (praedefinitum: popcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: popcoind.pid)</source> <translation>Specifica pid plicam (praedefinitum: popcoin.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Specifica indicem datorum</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Constitue magnitudinem databasis cache in megabytes (praedefinitum: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9247 or testnet: 19247)</source> <translation>Ausculta pro conexionibus in &lt;porta&gt; (praedefinitum: 9247 vel testnet: 19247)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manutene non plures quam &lt;n&gt; conexiones ad paria (praedefinitum: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Conecta ad nodum acceptare inscriptiones parium, et disconecte</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Specifica tuam propriam publicam inscriptionem</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Limen pro disconectendo paria improba (praedefinitum: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Numerum secundorum prohibere ne paria improba reconectant (praedefinitum: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Error erat dum initians portam RPC %u pro auscultando in IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9347 or testnet: 19347)</source> <translation>Ausculta pro conexionibus JSON-RPC in &lt;porta&gt; (praedefinitum: 9347 vel testnet: 19347)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Accipe terminalis et JSON-RPC mandata.</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Operare infere sicut daemon et mandata accipe</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utere rete experimentale</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Accipe conexiones externas (praedefinitum: 1 nisi -proxy neque -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=popcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;POPCoin Alert&quot; [email protected] </source> <translation>%s, necesse est te rpcpassword constituere in plica configurationis: %s Hortatur te hanc fortuitam tesseram uti: rpcuser=popcoinrpc rpcpassword=%s (non est necesse te hanc tesseram meminisse) Nomen usoris et tessera eadem esse NON POSSUNT. Si plica non existit, eam crea cum permissionibus ut eius dominus tantum sinitur id legere. Quoque hortatur alertnotify constituere ut tu notificetur de problematibus; exempli gratia: alertnotify=echo %%s | mail -s &quot;POPCoin Notificatio&quot; [email protected] </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Error erat dum initians portam RPC %u pro auscultando in IPv6, labens retrorsum ad IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Conglutina ad inscriptionem datam et semper in eam ausculta. Utere [moderatrum]:porta notationem pro IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. POPCoin is probably already running.</source> <translation>Non posse serare datorum indicem %s. POPCoin probabiliter iam operatur.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Error: Transactio eiecta est! Hoc possit accidere si alii nummorum in cassidili tuo iam soluti sint, ut si usus es exemplar de wallet.dat et nummi soluti sunt in exemplari sed non hic notati ut soluti.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Error: Huic transactioni necesse est merces saltem %s propter eius magnitudinem, complexitatem, vel usum recentum acceptorum nummorum!</translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Facere mandatum quotiescumque notificatio affinis accipitur (%s in mandato mutatur in nuntium) </translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Facere mandatum quotiescumque cassidilis transactio mutet (%s in mandato sbstituitur ab TxID)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Constitue magnitudinem maximam transactionum magnae-prioritatis/parvae-mercedis in octetis/bytes (praedefinitum: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Hoc est prae-dimittum experimentala aedes - utere eo periculo tuo proprio - nolite utere fodendo vel applicationibus mercatoriis</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Monitio: -paytxfee constitutum valde magnum! Hoc est merces transactionis solves si mittis transactionem.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Monitio: Monstratae transactiones fortasse non recta sint! Forte oportet tibi progredere, an aliis nodis progredere.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong POPCoin will not work properly.</source> <translation>Monitio: Sodes cura ut dies tempusque computatri tui recti sunt! Si horologium tuum pravum est, POPCoin non proprie fungetur.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Monitio: error legendo wallet.dat! Omnes claves recte lectae, sed data transactionum vel libri inscriptionum fortasse desint vel prava sint.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Monitio: wallet.data corrupta, data salvata! Originalis wallet.dat salvata ut wallet.{timestamp}.bak in %s; si pendendum tuum vel transactiones pravae sunt, oportet ab conservato restituere.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Conare recipere claves privatas de corrupto wallet.dat</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Optiones creandi frustorum:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Conecte sole ad nodos specificatos (vel nodum specificatum)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Corruptum databasum frustorum invenitur</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Discooperi propriam inscriptionem IP (praedefinitum: 1 quando auscultans et nullum -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Visne reficere databasum frustorum iam?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Error initiando databasem frustorum</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Error initiando systematem databasi cassidilis %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Error legendo frustorum databasem</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Error aperiendo databasum frustorum</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Error: Inopia spatii disci!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Error: Cassidile seratum, non posse transactionem creare!</translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Error: systematis error:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Non potuisse auscultare in ulla porta. Utere -listen=0 si hoc vis.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Non potuisse informationem frusti legere </translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Non potuisse frustum legere</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Synchronizare indicem frustorum abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Scribere indicem frustorum abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Scribere informationem abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Scribere frustum abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Scribere informationem plicae abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Scribere databasem nummorum abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Scribere indicem transactionum abortum est</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Scribere data pro cancellando mutationes abortum est</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Inveni paria utendo DNS quaerendo (praedefinitum: 1 nisi -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Genera nummos (praedefinitum: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Quot frusta proba ad initium (praedefinitum: 288, 0 = omnia)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Quam perfecta frustorum verificatio est (0-4, praedefinitum: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Inopia descriptorum plicarum.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Restituere indicem catenae frustorum ex activis plicis blk000??.dat</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Constitue numerum filorum ad tractandum RPC postulationes (praedefinitum: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verificante frusta...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verificante cassidilem...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importat frusta ab externa plica blk000??.dat</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Constitue numerum filorum verificationis scriptorum (Maximum 16, 0 = auto, &lt;0 = tot corda libera erunt, praedefinitum: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informatio</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Inscriptio -tor non valida: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantitas non valida pro -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantitas non valida pro -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Manutene completam indicem transactionum (praedefinitum: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Maxima magnitudo memoriae pro datis accipendis singulis conexionibus, &lt;n&gt;*1000 octetis/bytes (praedefinitum: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maxima magnitudo memoriae pro datis mittendis singulis conexionibus, &lt;n&gt;*1000 octetis/bytes (praedefinitum: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Tantum accipe catenam frustorum convenientem internis lapidibus (praedefinitum: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Tantum conecte ad nodos in rete &lt;net&gt; (IPv4, IPv6 aut Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Exscribe additiciam informationem pro debug. Implicat omnes alias optiones -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Exscribe additiciam informationem pro retis debug.</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Antepone pittacium temporis ante exscriptum de debug </translation> </message> <message> <location line="+5"/> <source>SSL options: (see the POPCoin Wiki for SSL setup instructions)</source> <translation>Optiones SSL: (vide vici de POPCoin pro instructionibus SSL configurationis)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Selige versionem socks vicarii utendam (4-5, praedefinitum: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Mitte informationem vestigii/debug ad terminale potius quam plicam debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Mitte informationem vestigii/debug ad debugger</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Constitue maximam magnitudinem frusti in octetis/bytes (praedefinitum: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Constitue minimam magnitudinem frusti in octetis/bytes (praedefinitum: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Diminue plicam debug.log ad initium clientis (praedefinitum: 1 nisi -debug)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Signandum transactionis abortum est</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Specifica tempumfati conexionis in millisecundis (praedefinitum: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Systematis error:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Magnitudo transactionis nimis parva</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Necesse est magnitudines transactionum positivas esse.</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transactio nimis magna</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Utere UPnP designare portam auscultandi (praedefinitum: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Utere UPnP designare portam auscultandi (praedefinitum: 1 quando auscultans)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utere vicarium ut extendas ad tor servitia occulta (praedefinitum: idem ut -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nomen utentis pro conexionibus JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Monitio</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Monitio: Haec versio obsoleta est, progressio postulata!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Oportet recreare databases utendo -reindex ut mutes -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupta, salvare abortum est</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Tessera pro conexionibus JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitte conexionibus JSON-RPC ex inscriptione specificata</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Mitte mandata nodo operanti in &lt;ip&gt; (praedefinitum: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Pelle mandatum quando optissimum frustum mutat (%s in mandato substituitur ab hash frusti)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Progredere cassidile ad formam recentissimam</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Constitue magnitudinem stagni clavium ad &lt;n&gt; (praedefinitum: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Iterum perlege catenam frustorum propter absentes cassidilis transactiones</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Utere OpenSSL (https) pro conexionibus JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Plica certificationis daemonis moderantis (praedefinitum: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Clavis privata daemonis moderans (praedefinitum: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Acceptabiles cifrae (praedefinitum: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Hic nuntius auxilii</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Non posse conglutinare ad %s in hoc computatro (conglutinare redidit errorem %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Conecte per socks vicarium</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitte quaerenda DNS pro -addnode, -seednode, et -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Legens inscriptiones...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Error legendi wallet.dat: Cassidile corruptum</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of POPCoin</source> <translation>Error legendi wallet.dat: Cassidili necesse est recentior versio POPCoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart POPCoin to complete</source> <translation>Cassidili necesse erat rescribi: Repelle POPCoin ut compleas</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Error legendi wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Inscriptio -proxy non valida: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Ignotum rete specificatum in -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Ignota -socks vicarii versio postulata: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Non posse resolvere -bind inscriptonem: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Non posse resolvere -externalip inscriptionem: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantitas non valida pro -paytxfee=&lt;quantitas&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Quantitas non valida</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Inopia nummorum</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Legens indicem frustorum...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adice nodum cui conectere et conare sustinere conexionem apertam</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. POPCoin is probably already running.</source> <translation>Non posse conglutinare ad %s in hoc cumputatro. POPCoin probabiliter iam operatur.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Merces per KB addere ad transactiones tu mittas</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Legens cassidile...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Non posse cassidile regredi</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Non posse scribere praedefinitam inscriptionem</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Iterum perlegens...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Completo lengendi</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Ut utaris optione %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Error</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Necesse est te rpcpassword=&lt;tesseram&gt; constituere in plica configurationum: %s Si plica non existat, crea eam cum permissionibus ut solus eius dominus eam legere sinatur.</translation> </message> </context> </TS>
popcointeam/popcoin
src/qt/locale/bitcoin_la.ts
TypeScript
mit
117,030
package main import ( "fmt" "os" "strings" "github.com/PuerkitoBio/goquery" ) func GetNews() { doc, err := goquery.NewDocument("https://gocn.io/") if err != nil { fmt.Println(err) } doc.Find("a").Each(func(i int, s *goquery.Selection) { match := "GoCN每日新闻(" if strings.Contains(s.Text(), match) { url, _ := s.Attr("href") fmt.Println(match, url) os.Exit(0) } }) } func main() { GetNews() }
TeamFat/go-way
code/goquery/main.go
GO
mit
428
require 'browser/audio/node' module Browser; module Audio class Context include Native::Wrapper alias_native :destination alias_native :listener alias_native :state alias_native :sample_rate, :sampleRate alias_native :current_time, :currentTime def self.supported? Browser.support?('Audio') || Browser.support?('Audio (Chrome)') end if Browser.supports? 'Audio' def initialize super `new AudioContext()` end elsif Browser.supports? 'Audio (Chrome)' def initialize super `new webkitAudioContext()` end else def initialize raise NotImplementedError, 'Audio unsupported' end end def gain Node::Gain.new(self) end def oscillator Node::Oscillator.new(self) end def delay(max_time) Node::Delay.new(self, max_time) end def dynamics_compressor Node::DynamicsCompressor.new(self) end def biquad_filter Node::BiquadFilter.new(self) end def stereo_panner Node::StereoPanner.new(self) end def periodic_wave(real, imaginary) `#{@native}.createPeriodicWave(new Float32Array(#{real}), new Float32Array(#{imaginary}));` end alias_native :suspend alias_native :resume alias_native :close end end; end
opal/opal-browser
opal/browser/audio.rb
Ruby
mit
1,231
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ class Google_Service_CloudDebugger_CloudRepoSourceContext extends Google_Model { protected $aliasContextType = 'Google_Service_CloudDebugger_AliasContext'; protected $aliasContextDataType = ''; public $aliasName; protected $repoIdType = 'Google_Service_CloudDebugger_RepoId'; protected $repoIdDataType = ''; public $revisionId; public function setAliasContext(Google_Service_CloudDebugger_AliasContext $aliasContext) { $this->aliasContext = $aliasContext; } public function getAliasContext() { return $this->aliasContext; } public function setAliasName($aliasName) { $this->aliasName = $aliasName; } public function getAliasName() { return $this->aliasName; } public function setRepoId(Google_Service_CloudDebugger_RepoId $repoId) { $this->repoId = $repoId; } public function getRepoId() { return $this->repoId; } public function setRevisionId($revisionId) { $this->revisionId = $revisionId; } public function getRevisionId() { return $this->revisionId; } }
dwivivagoal/KuizMilioner
application/libraries/php-google-sdk/google/apiclient-services/src/Google/Service/CloudDebugger/CloudRepoSourceContext.php
PHP
mit
1,649
/* * The MIT License (MIT) * * Copyright (c) 2007-2015 Broad Institute * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.broad.igv.feature.genome.fasta; import org.apache.log4j.Logger; import org.broad.igv.Globals; import org.broad.igv.feature.genome.GenomeImporter; import org.broad.igv.util.ParsingUtils; import java.io.BufferedReader; import java.io.IOException; import java.util.LinkedHashMap; import java.util.Set; /** * Representation of a fasta (.fai) index. This is a modified version of a similar class in Picard, but extended * to handle loading by URLs. * * @auther jrobinso * @since 2011 Aug 7 */ public class FastaIndex { static Logger log = Logger.getLogger(FastaIndex.class); /** * Store the entries. Use a LinkedHashMap for consistent iteration in insertion order. */ private final LinkedHashMap<String, FastaSequenceIndexEntry> sequenceEntries = new LinkedHashMap<String, FastaSequenceIndexEntry>(); public FastaIndex(String indexPath) throws IOException { parseIndexFile(indexPath); } public Set<String> getSequenceNames() { return sequenceEntries.keySet(); } public FastaSequenceIndexEntry getIndexEntry(String name) { return sequenceEntries.get(name); } public int getSequenceSize(String name) { FastaSequenceIndexEntry entry = sequenceEntries.get(name); return entry == null ? -1 : (int) entry.getSize(); } /** * Parse the contents of an index file * <p/> * Example index file * <p/> * sequenceName size locationInFile basesPerLine bytesPerLine * chr01p 6220112 8 50 51 * chr02q 8059593 6344531 50 51 * chr03q 5803340 14565324 50 51 * * @param indexFile File to parse. * @throws java.io.FileNotFoundException Thrown if file could not be opened. */ private void parseIndexFile(String indexFile) throws IOException { BufferedReader reader = null; try { reader = ParsingUtils.openBufferedReader(indexFile); String nextLine; while ((nextLine = reader.readLine()) != null) { // Tokenize and validate the index line. String[] tokens = Globals.singleTabMultiSpacePattern.split(nextLine); int nTokens = tokens.length; if (nTokens != 5) { log.info("Skipping fasta index line: " + nextLine); continue; } // Parse the index line. String contig = tokens[0]; contig = GenomeImporter.SEQUENCE_NAME_SPLITTER.split(contig, 2)[0]; long size = Long.parseLong(tokens[1]); long location = Long.parseLong(tokens[2]); int basesPerLine = Integer.parseInt(tokens[3]); int bytesPerLine = Integer.parseInt(tokens[4]); // Build sequence structure add(new FastaSequenceIndexEntry(contig, location, size, basesPerLine, bytesPerLine)); } } finally { if (reader != null) { reader.close(); } } } private void add(FastaSequenceIndexEntry indexEntry) { final FastaSequenceIndexEntry ret = sequenceEntries.put(indexEntry.getContig(), indexEntry); if (ret != null) { throw new RuntimeException("Contig '" + indexEntry.getContig() + "' already exists in fasta index."); } } /** * Hold an individual entry in a fasta sequence index file. */ public static class FastaSequenceIndexEntry { private String contig; private long position; private long size; private int basesPerLine; private int bytesPerLine; /** * Create a new entry with the given parameters. * * @param contig Contig this entry represents. * @param position Location (byte coordinate) in the fasta file. * @param size The number of bases in the contig. * @param basesPerLine How many bases are on each line. * @param bytesPerLine How many bytes are on each line (includes newline characters). */ public FastaSequenceIndexEntry(String contig, long position, long size, int basesPerLine, int bytesPerLine) { this.contig = contig; this.position = position; this.size = size; this.basesPerLine = basesPerLine; this.bytesPerLine = bytesPerLine; } /** * @return The contig. */ public String getContig() { return contig; } /** * @return seek position within the fasta, in bytes */ public long getPosition() { return position; } /** * @return size of the contig bases, in bytes. */ public long getSize() { return size; } /** * @return Number of bases in a given fasta line */ public int getBasesPerLine() { return basesPerLine; } /** * @return Number of bytes (bases + whitespace) in a line. */ public int getBytesPerLine() { return bytesPerLine; } /** * @return A string representation of the contig line. */ public String toString() { return String.format("contig %s; position %d; size %d; basesPerLine %d; bytesPerLine %d", contig, position, size, basesPerLine, bytesPerLine); } } }
amwenger/igv
src/main/java/org/broad/igv/feature/genome/fasta/FastaIndex.java
Java
mit
6,901
<?php namespace Soga\NominaBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table(name="contrato") * @ORM\Entity(repositoryClass="Soga\NominaBundle\Repository\ContratoRepository") */ class Contrato { /** * @ORM\Id * @ORM\Column(name="contrato", type="string", length=6) */ private $contrato; /** * @ORM\Column(name="fechainic", type="date", nullable=true) */ private $fechainic; /** * @ORM\Column(name="fechater", type="date", nullable=true) */ private $fechater; /** * @ORM\Column(name="codemple", type="string", length=5) */ private $codemple; /** * @ORM\Column(name="salario", type="string", length=10) */ private $salario; /** * @ORM\Column(name="salario_ibc", type="integer") */ private $salarioIbc; /** * @ORM\Column(name="salario_anterior", type="integer") */ private $salarioAnterior; /** * @ORM\Column(name="salario_fecha_desde", type="date", nullable=true) */ private $salarioFechaDesde; /** * @ORM\Column(name="codigo_caja_pk", type="integer") */ private $codigoCajaPk; /** * @ORM\Column(name="codigo_tipo_cotizante_fk", type="integer") */ private $codigoTipoCotizanteFk; /** * @ORM\Column(name="codigo_subtipo_cotizante_fk", type="integer") */ private $codigoSubtipoCotizanteFk; /** * @ORM\Column(name="tiposalario", type="string", length=20) */ private $tipoSalario; /** * Set contrato * * @param string $contrato * @return Contrato */ public function setContrato($contrato) { $this->contrato = $contrato; return $this; } /** * Get contrato * * @return string */ public function getContrato() { return $this->contrato; } /** * Set fechainic * * @param \DateTime $fechainic * @return Contrato */ public function setFechainic($fechainic) { $this->fechainic = $fechainic; return $this; } /** * Get fechainic * * @return \DateTime */ public function getFechainic() { return $this->fechainic; } /** * Set fechater * * @param \DateTime $fechater * @return Contrato */ public function setFechater($fechater) { $this->fechater = $fechater; return $this; } /** * Get fechater * * @return \DateTime */ public function getFechater() { return $this->fechater; } /** * Set codemple * * @param string $codemple * @return Contrato */ public function setCodemple($codemple) { $this->codemple = $codemple; return $this; } /** * Get codemple * * @return string */ public function getCodemple() { return $this->codemple; } /** * Set salario * * @param string $salario * @return Contrato */ public function setSalario($salario) { $this->salario = $salario; return $this; } /** * Get salario * * @return string */ public function getSalario() { return $this->salario; } /** * Set salarioIbc * * @param integer $salarioIbc * @return Contrato */ public function setSalarioIbc($salarioIbc) { $this->salarioIbc = $salarioIbc; return $this; } /** * Get salarioIbc * * @return integer */ public function getSalarioIbc() { return $this->salarioIbc; } /** * Set salarioAnterior * * @param integer $salarioAnterior * @return Contrato */ public function setSalarioAnterior($salarioAnterior) { $this->salarioAnterior = $salarioAnterior; return $this; } /** * Get salarioAnterior * * @return integer */ public function getSalarioAnterior() { return $this->salarioAnterior; } /** * Set salarioFechaDesde * * @param \DateTime $salarioFechaDesde * @return Contrato */ public function setSalarioFechaDesde($salarioFechaDesde) { $this->salarioFechaDesde = $salarioFechaDesde; return $this; } /** * Get salarioFechaDesde * * @return \DateTime */ public function getSalarioFechaDesde() { return $this->salarioFechaDesde; } /** * Set codigoCajaPk * * @param integer $codigoCajaPk * @return Contrato */ public function setCodigoCajaPk($codigoCajaPk) { $this->codigoCajaPk = $codigoCajaPk; return $this; } /** * Get codigoCajaPk * * @return integer */ public function getCodigoCajaPk() { return $this->codigoCajaPk; } /** * Set codigoTipoCotizanteFk * * @param integer $codigoTipoCotizanteFk * @return Contrato */ public function setCodigoTipoCotizanteFk($codigoTipoCotizanteFk) { $this->codigoTipoCotizanteFk = $codigoTipoCotizanteFk; return $this; } /** * Get codigoTipoCotizanteFk * * @return integer */ public function getCodigoTipoCotizanteFk() { return $this->codigoTipoCotizanteFk; } /** * Set codigoSubtipoCotizanteFk * * @param integer $codigoSubtipoCotizanteFk * @return Contrato */ public function setCodigoSubtipoCotizanteFk($codigoSubtipoCotizanteFk) { $this->codigoSubtipoCotizanteFk = $codigoSubtipoCotizanteFk; return $this; } /** * Get codigoSubtipoCotizanteFk * * @return integer */ public function getCodigoSubtipoCotizanteFk() { return $this->codigoSubtipoCotizanteFk; } /** * Set tipoSalario * * @param string $tipoSalario * @return Contrato */ public function setTipoSalario($tipoSalario) { $this->tipoSalario = $tipoSalario; return $this; } /** * Get tipoSalario * * @return string */ public function getTipoSalario() { return $this->tipoSalario; } }
wariox3/soga
src/Soga/NominaBundle/Entity/Contrato.php
PHP
mit
6,442
package main import "github.com/philharnish/forge/src/data/graph/bloom/benchmarks" func main() { benchmarks.ArraySizes() benchmarks.MapSizes() // Run C bindings. cbindings() }
PhilHarnish/forge
bin/bloom/main.go
GO
mit
182
package Controller; public class Professor extends Usuario { private int matriculaProfessor; private String nome; private String especialidade; public int getMatriculaProfessor() { return matriculaProfessor; } public void setMatriculaProfessor(int matriculaProfessor) { this.matriculaProfessor = matriculaProfessor; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getEspecialidade() { return especialidade; } public void setEspecialidade(String especialidade) { this.especialidade = especialidade; } public Professor(String login, String senha, int tipo, int matriculaProfessor, String nome, String especialidade) { super(login, senha, tipo); this.matriculaProfessor = matriculaProfessor; this.nome = nome; this.especialidade = especialidade; } public String toString() { return "Professor [matriculaProfessor=" + matriculaProfessor + ", nome=" + nome + ", especialidade=" + especialidade + "]"; } public void mostrar(){ System.out.println("Informações do professor: "); System.out.println("Login: " + super.getLogin()); System.out.println("Senha: *****"); System.out.println("Matricula: " + matriculaProfessor); System.out.println("Nome: " +nome); System.out.println("Especialidade: " + especialidade); } }
GiovanniSM20/Java
src/14_ClassesAbstratas/src/controller/Professor.java
Java
mit
1,347
<?php namespace Rauma\Messaging\Response; use Zend\Diactoros\Response\TextResponse as DiactorosResponse; class TextResponse extends DiactorosResponse { }
xmeltrut/rauma
src/Messaging/Response/TextResponse.php
PHP
mit
157
(function() { 'use strict'; angular.module('events-calendar-app', []); })();
priscilacng/angular-events-calendar
src/js/events-calendar-app.js
JavaScript
mit
86
/* | This is an auto generated file. | | Editing might turn out rather futile. */ /* | Export. */ var jion$ast_postIncrement; if( NODE ) { jion$ast_postIncrement = module.exports; } else { jion$ast_postIncrement = { }; } var jion$ast_and, jion$ast_arrayLiteral, jion$ast_assign, jion$ast_boolean, jion$ast_call, jion$ast_comma, jion$ast_condition, jion$ast_delete, jion$ast_differs, jion$ast_divide, jion$ast_divideAssign, jion$ast_dot, jion$ast_equals, jion$ast_func, jion$ast_greaterThan, jion$ast_instanceof, jion$ast_lessThan, jion$ast_member, jion$ast_minus, jion$ast_minusAssign, jion$ast_multiply, jion$ast_multiplyAssign, jion$ast_negate, jion$ast_new, jion$ast_not, jion$ast_null, jion$ast_number, jion$ast_objLiteral, jion$ast_or, jion$ast_plus, jion$ast_plusAssign, jion$ast_postDecrement, jion$ast_postIncrement, jion$ast_preDecrement, jion$ast_preIncrement, jion$ast_string, jion$ast_typeof, jion$ast_var, jion_proto; /* | Capsule */ ( function( ) { 'use strict'; /* | Node includes. */ if( NODE ) { jion$ast_and = require( '../ast/and' ); jion$ast_arrayLiteral = require( '../ast/arrayLiteral' ); jion$ast_assign = require( '../ast/assign' ); jion$ast_boolean = require( '../ast/boolean' ); jion$ast_call = require( '../ast/call' ); jion$ast_comma = require( '../ast/comma' ); jion$ast_condition = require( '../ast/condition' ); jion$ast_delete = require( '../ast/delete' ); jion$ast_differs = require( '../ast/differs' ); jion$ast_divide = require( '../ast/divide' ); jion$ast_divideAssign = require( '../ast/divideAssign' ); jion$ast_dot = require( '../ast/dot' ); jion$ast_equals = require( '../ast/equals' ); jion$ast_func = require( '../ast/func' ); jion$ast_greaterThan = require( '../ast/greaterThan' ); jion$ast_instanceof = require( '../ast/instanceof' ); jion$ast_lessThan = require( '../ast/lessThan' ); jion$ast_member = require( '../ast/member' ); jion$ast_minus = require( '../ast/minus' ); jion$ast_minusAssign = require( '../ast/minusAssign' ); jion$ast_multiply = require( '../ast/multiply' ); jion$ast_multiplyAssign = require( '../ast/multiplyAssign' ); jion$ast_negate = require( '../ast/negate' ); jion$ast_new = require( '../ast/new' ); jion$ast_not = require( '../ast/not' ); jion$ast_null = require( '../ast/null' ); jion$ast_number = require( '../ast/number' ); jion$ast_objLiteral = require( '../ast/objLiteral' ); jion$ast_or = require( '../ast/or' ); jion$ast_plus = require( '../ast/plus' ); jion$ast_plusAssign = require( '../ast/plusAssign' ); jion$ast_postDecrement = require( '../ast/postDecrement' ); jion$ast_preDecrement = require( '../ast/preDecrement' ); jion$ast_preIncrement = require( '../ast/preIncrement' ); jion$ast_string = require( '../ast/string' ); jion$ast_typeof = require( '../ast/typeof' ); jion$ast_var = require( '../ast/var' ); require( '../proto' ); } /* | Constructor. */ var Constructor, prototype; Constructor = function( v_expr // the expression to post increment ) { if( prototype.__have_lazy ) { this.__lazy = { }; } this.expr = v_expr; if( FREEZE ) { Object.freeze( this ); } }; /* | Prototype shortcut */ prototype = Constructor.prototype; jion$ast_postIncrement.prototype = prototype; /* | Creates a new postIncrement object. */ jion$ast_postIncrement.create = prototype.create = function( // free strings ) { var a, aZ, arg, inherit, v_expr; if( this !== jion$ast_postIncrement ) { inherit = this; v_expr = this.expr; } for( a = 0, aZ = arguments.length; a < aZ; a += 2 ) { arg = arguments[ a + 1 ]; switch( arguments[ a ] ) { case 'expr' : if( arg !== pass ) { v_expr = arg; } break; default : throw new Error( ); } } /**/if( CHECK ) /**/{ /**/ if( v_expr === undefined ) /**/ { /**/ throw new Error( ); /**/ } /**/ /**/ if( v_expr === null ) /**/ { /**/ throw new Error( ); /**/ } /**/ /**/ if( /**/ v_expr.reflect !== 'ast_and' /**/ && /**/ v_expr.reflect !== 'ast_arrayLiteral' /**/ && /**/ v_expr.reflect !== 'ast_assign' /**/ && /**/ v_expr.reflect !== 'ast_boolean' /**/ && /**/ v_expr.reflect !== 'ast_call' /**/ && /**/ v_expr.reflect !== 'ast_comma' /**/ && /**/ v_expr.reflect !== 'ast_condition' /**/ && /**/ v_expr.reflect !== 'ast_delete' /**/ && /**/ v_expr.reflect !== 'ast_differs' /**/ && /**/ v_expr.reflect !== 'ast_divide' /**/ && /**/ v_expr.reflect !== 'ast_divideAssign' /**/ && /**/ v_expr.reflect !== 'ast_dot' /**/ && /**/ v_expr.reflect !== 'ast_equals' /**/ && /**/ v_expr.reflect !== 'ast_func' /**/ && /**/ v_expr.reflect !== 'ast_greaterThan' /**/ && /**/ v_expr.reflect !== 'ast_instanceof' /**/ && /**/ v_expr.reflect !== 'ast_lessThan' /**/ && /**/ v_expr.reflect !== 'ast_member' /**/ && /**/ v_expr.reflect !== 'ast_minus' /**/ && /**/ v_expr.reflect !== 'ast_minusAssign' /**/ && /**/ v_expr.reflect !== 'ast_multiply' /**/ && /**/ v_expr.reflect !== 'ast_multiplyAssign' /**/ && /**/ v_expr.reflect !== 'ast_negate' /**/ && /**/ v_expr.reflect !== 'ast_new' /**/ && /**/ v_expr.reflect !== 'ast_not' /**/ && /**/ v_expr.reflect !== 'ast_null' /**/ && /**/ v_expr.reflect !== 'ast_number' /**/ && /**/ v_expr.reflect !== 'ast_objLiteral' /**/ && /**/ v_expr.reflect !== 'ast_or' /**/ && /**/ v_expr.reflect !== 'ast_plus' /**/ && /**/ v_expr.reflect !== 'ast_plusAssign' /**/ && /**/ v_expr.reflect !== 'ast_postDecrement' /**/ && /**/ v_expr.reflect !== 'ast_postIncrement' /**/ && /**/ v_expr.reflect !== 'ast_preDecrement' /**/ && /**/ v_expr.reflect !== 'ast_preIncrement' /**/ && /**/ v_expr.reflect !== 'ast_string' /**/ && /**/ v_expr.reflect !== 'ast_typeof' /**/ && /**/ v_expr.reflect !== 'ast_var' /**/ ) /**/ { /**/ throw new Error( ); /**/ } /**/} if( inherit && ( v_expr === inherit.expr || v_expr.equals( inherit.expr ) ) ) { return inherit; } return new Constructor( v_expr ); }; /* | Reflection. */ prototype.reflect = 'ast_postIncrement'; /* | Name Reflection. */ prototype.reflectName = 'postIncrement'; /* | Sets values by path. */ prototype.setPath = jion_proto.setPath; /* | Gets values by path */ prototype.getPath = jion_proto.getPath; /* | Tests equality of object. */ prototype.equals = function( obj // object to compare to ) { if( this === obj ) { return true; } if( !obj ) { return false; } if( obj.reflect !== 'ast_postIncrement' ) { return false; } return this.expr === obj.expr || this.expr.equals( obj.expr ); }; } )( );
axkibe/jion
jioncode/src-ast-postIncrement.js
JavaScript
mit
6,647
#!/usr/bin/env bash cd $(dirname $(readlink -f $0)) source ../../utils/libdeploy.bash if groups | grep -qv docker then execute_with_privilege sudo usermod -a -G docker $USER write_to_messages " docker - You should log out then log back in to be able to use docker." fi
tiborsimon/dotfiles
configs/docker/02_config_user.bash
Shell
mit
275
var makeSS = function (el) { "use strict"; // collection of all slides var $slideshows = document.querySelectorAll(el), $slideshow = {}, Slideshow = { init: function (el) { // keep track of current slide this.counter = 0; this.el = el; // collection of all individual slides this.$items = el.querySelectorAll('figure'); // total number of slides this.numItems = this.$items.length; // set class so first slide is visible this.$items[0].classList.add('show'); this.injectControls(el); this.addEventListeners(el); }, showCurrent: function (i) { if (i > 0) { this.counter = (this.counter + 1 === this.numItems) ? 0 : this.counter + 1; } else { this.counter = (this.counter - 1 < 0) ? this.numItems - 1 : this.counter - 1; } [].forEach.call(this.$items, function (el) { el.classList.remove('show'); }); this.$items[this.counter].classList.add('show'); }, injectControls: function (el) { var spanPrev = document.createElement("span"), spanNext = document.createElement("span"), docFrag = document.createDocumentFragment(); /* add classes */ spanPrev.classList.add('prev'); spanNext.classList.add('next'); /* add contents */ spanPrev.innerHTML = '&laquo;'; spanNext.innerHTML = '&raquo;'; /* append the new elements to a document fragment [1] then append the fragment to the DOM */ docFrag.appendChild(spanPrev); docFrag.appendChild(spanNext); el.appendChild(docFrag); }, addEventListeners: function (el) { var that = this; el.querySelector('.next').addEventListener('click', function () { that.showCurrent(1); }, false); el.querySelector('.prev').addEventListener('click', function () { that.showCurrent(-1); }, false); } }; [].forEach.call($slideshows, function (el) { $slideshow = Object.create(Slideshow); $slideshow.init(el); }); }; makeSS('.demo1');
kevinwu127/testWebsite
js/main.js
JavaScript
mit
2,902
<!DOCTYPE html> <html class="no-js"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta charset="utf-8"> <meta content="IE=edge" http-equiv="X-UA-Compatible"> <meta name="keywords"> <meta name="description"> <title>Citizens Advice style guide- Stop receiving junk mail </title> <!-- Mobile Specific Metas--> <meta content="width=device-width, initial-scale=1, maximum-scale=2.0" name="viewport"> <meta content="48a2415d-980f-4763-a5b9-e10e000636b3" name="cab-guid"> <meta content="EWS" name="cab-extent"> <meta content="/static/images/apple-touch-icon.png"> <meta content="B53C5C20449FC2233D3862B4DBEDFA3E" name="msvalidate.01"> <!-- Stylesheets--> <link href="css/guide.css" rel="stylesheet"> <link href="images/favicon/32.png" rel="shortcut icon"> <link href="images/favicon/228.png" rel="apple-touch-icon"> <script>/** * @fileoverview * * Scripts to go directly into the <head> element * These should be very small and therefore they should not be included as a file, but as inline JS * * This script needs minfiying before being added to the <head> */ ( function (document, window ) { /** * Update the no-js class to js */ var html = document.documentElement; html.className = html.className.replace(/\bno-js\b/, 'js'); /** * Creates a dummy version of $ * Any functions add will be queued to run after jQuery is built and ready */ window.$ = function (fn) { var q = window.$.q = window.$.q || []; q.push(fn); if (typeof fn !== 'function') { throw new Error('jQuery not yet loaded'); } }; /** * Cookie banner */ if (/\beprivacy=3(;|$)/i.test(document.cookie)) { html.className += ' hide-cookie-monster'; } /** * Are (session) cookies accepted */ document.cookie = 'z=1; path=/'; if (/(?:^| )z=1(?:;|$)/.test(document.cookie)) { document.cookie = 'z=; expires=' + new Date(0).toUTCString() + '; path=/'; } else { html.className = html.className += ' no-cookies'; } }( document, window )); </script> </head> <body><!--[if IE 8]><div class="ie8"><![endif]--> <div class="skip-nav"><a class="screenreader screenreader--focusable">Skip to content</a><a class="screenreader screenreader--focusable">Skip to footer</a></div> <header class="main-header"> <div class="main-header__content"><a href="index.html" title="Citizens Advice home" class="main-header__logo"><img onerror="this.onerror=null;this.src='images/logos/ca-logo_100px.svg.png';" alt="Citizens Advice" src="images/ca-logo_100px.svg" height="80"><img onerror="this.onerror=null;this.src='images/logos/ca-logo-hz-white-280px.svg.png';" alt="Citizens Advice" src="images/ca-logo-hz-white-280px.svg" class="main-header__img--mobile no-print wide"></a> <div data-track-zone="top-bar" class="main-header__links"><a href="" class="main-header__menu-link js-toggle-menu"><i class="icon-menu"></i>Menu</a> <nav class="main-header__top-nav"><a href="#">Cymraeg</a></a><a href="" class="hide-offline main-header__login"><i class="icon-key"></i>Sign-in</a></nav> <form action="" class="main-header__search hide-offline"> <label for="main-header__search__input" class="screenreader">Search</label> <input id="main-header__search__input" name="q" placeholder="" type="search" class="main-header__search__input"> <button title="Search" type="submit" class="main-header__search__submit"><i class="icon-search icon--no-text"></i><span class="screenreader">Search</span></button> </form> </div> </div> </header> <nav data-track-zone="main-nav" style="overflow: visible;" class="main-nav"> <ul class="nav-list-primary"> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Benefits</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Work</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Debt and money</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Consumer</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Relationships</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Housing</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Law and rights</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Discrimination</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Tax</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Healthcare</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">Education</a></li> <li style="display: list-item;" class="top-item js-mega-menu"><a href="#">More from us</a></li> <li style="display: none;" class="nav-list-primary-more js-more-menu"><a href="#">More<i class="icon-down"></i></a></li> </ul> </nav> <div class="main-container"> <nav class="main-breadcrumb"> <div class="main-breadcrumb__content"><span class="breadcrumb__item"><a href="index.html" title="Home">Home</a><i class="icon-guillemet-right"></i></span><span class="breadcrumb__item"><a href="index.html#templates" title="Templates">Templates</a><i class="icon-guillemet-right"></i></span><span class="breadcrumb__item">Content</span> </div> </nav> <div class="main-content"> <div id="main" role="main" class="main-content__right"> <div class="title"> <h1 class="title__heading js-ref"><span class="title__title">Stop receiving junk mail</span></h1> </div> <div class="articleContent"> <div> <h2>Your emails</h2> <div class="callout--confirmation">Your emails to Royal Mail, Direct Marketing Association and Mailing Preference Service have been sent.</div> <p>You’ll start to see a difference in the amount of junk mail you receive within the next 4 weeks.</p> </div> </div> </div> <div class="print-only"> <h2>This section is print only</h2> </div> </div> </div> <div class="footer-feedback"> <h2 class="screenreader">Feedback</h2> <div class="footer-feedback__content"> <p>Is there anything wrong with this page? <a href="#">Let us know</a>.</p> </div> </div> <div id="footer" data-track-zone="footer" class="main-footer"> <div class="main-footer__content flex-row js-equal-height"> <div class="main-footer__box col-md-3 col-sm-6"> <h2>Advice</h2> <ul class="li--arrow"> <li><a href="#">Benefits</a></li> <li><a href="#">Work</a></li> <li><a href="#">Debt and money</a></li> <li><a href="#">Consumer</a></li> <li><a href="#">Relationships</a></li> <li><a href="#">Housing</a></li> <li><a href="#">Law and rights</a></li> <li><a href="#">Discrimination</a></li> <li><a href="#">Tax</a></li> <li><a href="#">Healthcare</a></li> <li><a href="#">Education</a></li> <li><a href="#">A to Z of advice</a></li> </ul> </div> <div class="main-footer__box col-md-3 col-sm-6"> <h2>Resources and tools</h2> <ul class="li--arrow"> <li><a href="#">Budgeting tool</a></li> <li><a href="#">Advice fact sheets</a></li> <li><a href="#">Advice online, by phone and in person</a></li> </ul> </div> <div class="main-footer__box col-md-3 col-sm-6"> <h2>More from us</h2> <ul class="li--arrow"> <li><a href="#">About us</a></li> <li><a href="#">Annual reports</a></li> <li><a href="#">Contact us</a></li> <li><a href="#">Complaints</a></li> <li><a href="#">Blogs</a></li> <li><a href="#">Campaigns</a></li> <li><a href="#">Media</a></li> <li><a href="#">Policy research</a></li> <li><a href="#">Support us</a></li> <li><a href="#">Volunteering</a></li> <li><a href="#">Jobs</a></li> </ul> </div> <div class="main-footer__box col-md-3 col-sm-6"> <h2>About Citizens Advice</h2> <ul class="li--arrow"> <li><a href="#">How we provide advice</a></li> <li><a href="#">The difference we make</a></li> <li><a href="#">Support us</a></li> <li><a href="#">How Citizens Advice works</a></li> <li><a href="#">Accessibility</a></li> <li><a href="#">Disclaimer and copyright</a></li> <li><a href="#">Privacy and cookies</a></li> </ul> </div> <div class="main-footer__box main-footer__box--copyright"> <div> <p><img alt="" height="100" src="images/ca-logo_100px.svg" width="100">Copyright © 2015 Citizens Advice. All rights reserved.<br>Citizens Advice is an operating name of the National Association of Citizens Advice Bureaux. Registered charity number 279057<br>VAT number 726 0202 76 Company limited by guarantee. Registered number 1436945 England<br>Registered office: Citizens Advice, 3rd Floor North, 200 Aldersgate, London, EC1A 4HD</p> </div> </div> </div> </div> <div class="notice"> <div class="notice__content"> <p>We no longer support Internet Explorer 8. To avoid problems viewing this website, please consider upgrading to <a href="#" class="a-external-link">Google Chrome</a>.</p> </div> </div><!--[if IE 8]></div><![endif]--> <script src="js/vendor/jquery-1.11.3.min.js"></script> <script src="js/translate.js"></script> <script src="js/jquery.fn.cssSlide.js"></script> <script src="js/revealable.js"></script> <script src="js/prism.js"></script> <script src="js/smooth.js"></script> <script src="js/jquery.fn.top-sticky.js"></script> <!--script(src="js/advisor.js")--> <script src="js/sidebar.js"></script> <!--script(src="js/core.js")--> <script> var filename = document.location.pathname.match(/[^\/]+$/)[0]; $(document).ready(function() { $('.section-nav a[href="' + filename + '"]').addClass('active'); }); </script> </body> </html>
citizensadvice/cab-testing
research/post/tool-2/post-tool-4b.html
HTML
mit
10,726
all: gcc -O1 -o test permutation_in_string.c
begeekmyfriend/leetcode
0567_permutation_in_string/Makefile
Makefile
mit
46
// This file is automatically generated. package adila.db; /* * Hisense E860 * * DEVICE: E860 * MODEL: E860 */ final class e860_e860 { public static final String DATA = "Hisense|E860|"; }
karim/adila
database/src/main/java/adila/db/e860_e860.java
Java
mit
199
#include "uml/impl/ReadIsClassifiedObjectActionImpl.hpp" #ifdef NDEBUG #define DEBUG_MESSAGE(a) /**/ #else #define DEBUG_MESSAGE(a) a #endif #ifdef ACTIVITY_DEBUG_ON #define ACT_DEBUG(a) a #else #define ACT_DEBUG(a) /**/ #endif //#include "util/ProfileCallCount.hpp" #include <cassert> #include <iostream> #include <sstream> #include <stdexcept> #include "abstractDataTypes/SubsetUnion.hpp" #include "abstractDataTypes/AnyEObject.hpp" #include "abstractDataTypes/AnyEObjectBag.hpp" #include "abstractDataTypes/SubsetUnion.hpp" #include "ecore/EAnnotation.hpp" #include "ecore/EClass.hpp" #include "ecore/EAttribute.hpp" #include "ecore/EStructuralFeature.hpp" #include "ecore/ecorePackage.hpp" //Forward declaration includes #include "persistence/interfaces/XLoadHandler.hpp" // used for Persistence #include "persistence/interfaces/XSaveHandler.hpp" // used for Persistence #include <exception> // used in Persistence #include "uml/umlFactory.hpp" #include "uml/Action.hpp" #include "uml/Activity.hpp" #include "uml/ActivityEdge.hpp" #include "uml/ActivityGroup.hpp" #include "uml/ActivityNode.hpp" #include "uml/ActivityPartition.hpp" #include "uml/Classifier.hpp" #include "uml/Comment.hpp" #include "uml/Constraint.hpp" #include "uml/Dependency.hpp" #include "uml/Element.hpp" #include "uml/ExceptionHandler.hpp" #include "uml/InputPin.hpp" #include "uml/InterruptibleActivityRegion.hpp" #include "uml/Namespace.hpp" #include "uml/OutputPin.hpp" #include "uml/RedefinableElement.hpp" #include "uml/StringExpression.hpp" #include "uml/StructuredActivityNode.hpp" //Factories and Package includes #include "uml/umlPackage.hpp" using namespace uml; //********************************* // Constructor / Destructor //********************************* ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl() { /* NOTE: Due to virtual inheritance, base class constrcutors may not be called correctly */ } ReadIsClassifiedObjectActionImpl::~ReadIsClassifiedObjectActionImpl() { #ifdef SHOW_DELETION std::cout << "-------------------------------------------------------------------------------------------------\r\ndelete ReadIsClassifiedObjectAction "<< this << "\r\n------------------------------------------------------------------------ " << std::endl; #endif } //Additional constructor for the containments back reference ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl(std::weak_ptr<uml::Activity> par_activity) :ReadIsClassifiedObjectActionImpl() { m_activity = par_activity; m_owner = par_activity; } //Additional constructor for the containments back reference ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl(std::weak_ptr<uml::StructuredActivityNode> par_inStructuredNode) :ReadIsClassifiedObjectActionImpl() { m_inStructuredNode = par_inStructuredNode; m_owner = par_inStructuredNode; } //Additional constructor for the containments back reference ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl(std::weak_ptr<uml::Namespace> par_namespace) :ReadIsClassifiedObjectActionImpl() { m_namespace = par_namespace; m_owner = par_namespace; } //Additional constructor for the containments back reference ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl(std::weak_ptr<uml::Element> par_owner) :ReadIsClassifiedObjectActionImpl() { m_owner = par_owner; } ReadIsClassifiedObjectActionImpl::ReadIsClassifiedObjectActionImpl(const ReadIsClassifiedObjectActionImpl & obj): ReadIsClassifiedObjectActionImpl() { *this = obj; } ReadIsClassifiedObjectActionImpl& ReadIsClassifiedObjectActionImpl::operator=(const ReadIsClassifiedObjectActionImpl & obj) { //call overloaded =Operator for each base class ActionImpl::operator=(obj); /* TODO: Find out if this call is necessary * Currently, this causes an error because it calls an implicit assignment operator of ReadIsClassifiedObjectAction * which is generated by the compiler (as ReadIsClassifiedObjectAction is an abstract class and does not have a user-defined assignment operator). * Implicit compiler-generated assignment operators however only create shallow copies of members, * which implies, that not a real deep copy is created when using the copy()-method. * * NOTE: Since all members are deep-copied by this assignment-operator anyway, why is it even necessary to call this implicit assignment-operator? * This is only done for ecore-models, not for UML-models. */ //ReadIsClassifiedObjectAction::operator=(obj); //create copy of all Attributes #ifdef SHOW_COPIES std::cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\ncopy ReadIsClassifiedObjectAction "<< this << "\r\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " << std::endl; #endif //Clone Attributes with (deep copy) m_isDirect = obj.getIsDirect(); //copy references with no containment (soft copy) m_classifier = obj.getClassifier(); //Clone references with containment (deep copy) //clone reference 'object' if(obj.getObject()!=nullptr) { m_object = std::dynamic_pointer_cast<uml::InputPin>(obj.getObject()->copy()); } //clone reference 'result' if(obj.getResult()!=nullptr) { m_result = std::dynamic_pointer_cast<uml::OutputPin>(obj.getResult()->copy()); } return *this; } std::shared_ptr<ecore::EObject> ReadIsClassifiedObjectActionImpl::copy() const { std::shared_ptr<ReadIsClassifiedObjectActionImpl> element(new ReadIsClassifiedObjectActionImpl()); *element =(*this); element->setThisReadIsClassifiedObjectActionPtr(element); return element; } //********************************* // Operations //********************************* bool ReadIsClassifiedObjectActionImpl::boolean_result(Any diagnostics,std::shared_ptr<std::map < Any, Any>> context) { throw std::runtime_error("UnsupportedOperationException: " + std::string(__PRETTY_FUNCTION__)); } bool ReadIsClassifiedObjectActionImpl::multiplicity_of_input(Any diagnostics,std::shared_ptr<std::map < Any, Any>> context) { throw std::runtime_error("UnsupportedOperationException: " + std::string(__PRETTY_FUNCTION__)); } bool ReadIsClassifiedObjectActionImpl::multiplicity_of_output(Any diagnostics,std::shared_ptr<std::map < Any, Any>> context) { throw std::runtime_error("UnsupportedOperationException: " + std::string(__PRETTY_FUNCTION__)); } bool ReadIsClassifiedObjectActionImpl::no_type(Any diagnostics,std::shared_ptr<std::map < Any, Any>> context) { throw std::runtime_error("UnsupportedOperationException: " + std::string(__PRETTY_FUNCTION__)); } //********************************* // Attribute Getters & Setters //********************************* /* Getter & Setter for attribute isDirect */ bool ReadIsClassifiedObjectActionImpl::getIsDirect() const { return m_isDirect; } void ReadIsClassifiedObjectActionImpl::setIsDirect(bool _isDirect) { m_isDirect = _isDirect; } //********************************* // Reference Getters & Setters //********************************* /* Getter & Setter for reference classifier */ std::shared_ptr<uml::Classifier> ReadIsClassifiedObjectActionImpl::getClassifier() const { return m_classifier; } void ReadIsClassifiedObjectActionImpl::setClassifier(std::shared_ptr<uml::Classifier> _classifier) { m_classifier = _classifier; } /* Getter & Setter for reference object */ std::shared_ptr<uml::InputPin> ReadIsClassifiedObjectActionImpl::getObject() const { return m_object; } void ReadIsClassifiedObjectActionImpl::setObject(std::shared_ptr<uml::InputPin> _object) { m_object = _object; } /* Getter & Setter for reference result */ std::shared_ptr<uml::OutputPin> ReadIsClassifiedObjectActionImpl::getResult() const { return m_result; } void ReadIsClassifiedObjectActionImpl::setResult(std::shared_ptr<uml::OutputPin> _result) { m_result = _result; } //********************************* // Union Getter //********************************* std::shared_ptr<Union<uml::ActivityGroup>> ReadIsClassifiedObjectActionImpl::getInGroup() const { if(m_inGroup == nullptr) { /*Union*/ m_inGroup.reset(new Union<uml::ActivityGroup>()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising Union: " << "m_inGroup - Union<uml::ActivityGroup>()" << std::endl; #endif } return m_inGroup; } std::shared_ptr<SubsetUnion<uml::InputPin, uml::Element>> ReadIsClassifiedObjectActionImpl::getInput() const { if(m_input == nullptr) { /*SubsetUnion*/ m_input.reset(new SubsetUnion<uml::InputPin, uml::Element >()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising shared pointer SubsetUnion: " << "m_input - SubsetUnion<uml::InputPin, uml::Element >()" << std::endl; #endif /*SubsetUnion*/ getInput()->initSubsetUnion(getOwnedElement()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising value SubsetUnion: " << "m_input - SubsetUnion<uml::InputPin, uml::Element >(getOwnedElement())" << std::endl; #endif } return m_input; } std::shared_ptr<SubsetUnion<uml::OutputPin, uml::Element>> ReadIsClassifiedObjectActionImpl::getOutput() const { if(m_output == nullptr) { /*SubsetUnion*/ m_output.reset(new SubsetUnion<uml::OutputPin, uml::Element >()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising shared pointer SubsetUnion: " << "m_output - SubsetUnion<uml::OutputPin, uml::Element >()" << std::endl; #endif /*SubsetUnion*/ getOutput()->initSubsetUnion(getOwnedElement()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising value SubsetUnion: " << "m_output - SubsetUnion<uml::OutputPin, uml::Element >(getOwnedElement())" << std::endl; #endif } return m_output; } std::shared_ptr<Union<uml::Element>> ReadIsClassifiedObjectActionImpl::getOwnedElement() const { if(m_ownedElement == nullptr) { /*Union*/ m_ownedElement.reset(new Union<uml::Element>()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising Union: " << "m_ownedElement - Union<uml::Element>()" << std::endl; #endif } return m_ownedElement; } std::weak_ptr<uml::Element> ReadIsClassifiedObjectActionImpl::getOwner() const { return m_owner; } std::shared_ptr<Union<uml::RedefinableElement>> ReadIsClassifiedObjectActionImpl::getRedefinedElement() const { if(m_redefinedElement == nullptr) { /*Union*/ m_redefinedElement.reset(new Union<uml::RedefinableElement>()); #ifdef SHOW_SUBSET_UNION std::cout << "Initialising Union: " << "m_redefinedElement - Union<uml::RedefinableElement>()" << std::endl; #endif } return m_redefinedElement; } //********************************* // Container Getter //********************************* std::shared_ptr<ecore::EObject> ReadIsClassifiedObjectActionImpl::eContainer() const { if(auto wp = m_activity.lock()) { return wp; } if(auto wp = m_inStructuredNode.lock()) { return wp; } if(auto wp = m_namespace.lock()) { return wp; } if(auto wp = m_owner.lock()) { return wp; } return nullptr; } //********************************* // Persistence Functions //********************************* void ReadIsClassifiedObjectActionImpl::load(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) { std::map<std::string, std::string> attr_list = loadHandler->getAttributeList(); loadAttributes(loadHandler, attr_list); // // Create new objects (from references (containment == true)) // // get umlFactory int numNodes = loadHandler->getNumOfChildNodes(); for(int ii = 0; ii < numNodes; ii++) { loadNode(loadHandler->getNextNodeName(), loadHandler); } } void ReadIsClassifiedObjectActionImpl::loadAttributes(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler, std::map<std::string, std::string> attr_list) { try { std::map<std::string, std::string>::const_iterator iter; iter = attr_list.find("isDirect"); if ( iter != attr_list.end() ) { // this attribute is a 'bool' bool value; std::istringstream(iter->second) >> std::boolalpha >> value; this->setIsDirect(value); } std::shared_ptr<ecore::EClass> metaClass = this->eClass(); // get MetaClass iter = attr_list.find("classifier"); if ( iter != attr_list.end() ) { // add unresolvedReference to loadHandler's list loadHandler->addUnresolvedReference(iter->second, loadHandler->getCurrentObject(), metaClass->getEStructuralFeature("classifier")); // TODO use getEStructuralFeature() with id, for faster access to EStructuralFeature } } catch (std::exception& e) { std::cout << "| ERROR | " << e.what() << std::endl; } catch (...) { std::cout << "| ERROR | " << "Exception occurred" << std::endl; } ActionImpl::loadAttributes(loadHandler, attr_list); } void ReadIsClassifiedObjectActionImpl::loadNode(std::string nodeName, std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) { try { if ( nodeName.compare("object") == 0 ) { std::string typeName = loadHandler->getCurrentXSITypeName(); if (typeName.empty()) { typeName = "InputPin"; } loadHandler->handleChild(this->getObject()); return; } if ( nodeName.compare("result") == 0 ) { std::string typeName = loadHandler->getCurrentXSITypeName(); if (typeName.empty()) { typeName = "OutputPin"; } loadHandler->handleChild(this->getResult()); return; } } catch (std::exception& e) { std::cout << "| ERROR | " << e.what() << std::endl; } catch (...) { std::cout << "| ERROR | " << "Exception occurred" << std::endl; } //load BasePackage Nodes ActionImpl::loadNode(nodeName, loadHandler); } void ReadIsClassifiedObjectActionImpl::resolveReferences(const int featureID, std::vector<std::shared_ptr<ecore::EObject> > references) { switch(featureID) { case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_CLASSIFIER: { if (references.size() == 1) { // Cast object to correct type std::shared_ptr<uml::Classifier> _classifier = std::dynamic_pointer_cast<uml::Classifier>( references.front() ); setClassifier(_classifier); } return; } } ActionImpl::resolveReferences(featureID, references); } void ReadIsClassifiedObjectActionImpl::save(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const { saveContent(saveHandler); ActionImpl::saveContent(saveHandler); ExecutableNodeImpl::saveContent(saveHandler); ActivityNodeImpl::saveContent(saveHandler); RedefinableElementImpl::saveContent(saveHandler); NamedElementImpl::saveContent(saveHandler); ElementImpl::saveContent(saveHandler); ObjectImpl::saveContent(saveHandler); ecore::EObjectImpl::saveContent(saveHandler); } void ReadIsClassifiedObjectActionImpl::saveContent(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const { try { std::shared_ptr<uml::umlPackage> package = uml::umlPackage::eInstance(); // Save 'object' std::shared_ptr<uml::InputPin> object = this->getObject(); if (object != nullptr) { saveHandler->addReference(object, "object", object->eClass() != package->getInputPin_Class()); } // Save 'result' std::shared_ptr<uml::OutputPin> result = this->getResult(); if (result != nullptr) { saveHandler->addReference(result, "result", result->eClass() != package->getOutputPin_Class()); } // Add attributes if ( this->eIsSet(package->getReadIsClassifiedObjectAction_Attribute_isDirect()) ) { saveHandler->addAttribute("isDirect", this->getIsDirect()); } // Add references saveHandler->addReference(this->getClassifier(), "classifier", getClassifier()->eClass() != uml::umlPackage::eInstance()->getClassifier_Class()); } catch (std::exception& e) { std::cout << "| ERROR | " << e.what() << std::endl; } } std::shared_ptr<ecore::EClass> ReadIsClassifiedObjectActionImpl::eStaticClass() const { return uml::umlPackage::eInstance()->getReadIsClassifiedObjectAction_Class(); } //********************************* // EStructuralFeature Get/Set/IsSet //********************************* Any ReadIsClassifiedObjectActionImpl::eGet(int featureID, bool resolve, bool coreType) const { switch(featureID) { case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_CLASSIFIER: return eAny(getClassifier(),uml::umlPackage::CLASSIFIER_CLASS,false); //19427 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_ISDIRECT: return eAny(getIsDirect(),ecore::ecorePackage::EBOOLEAN_CLASS,false); //19428 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_OBJECT: return eAny(getObject(),uml::umlPackage::INPUTPIN_CLASS,false); //19429 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_RESULT: return eAny(getResult(),uml::umlPackage::OUTPUTPIN_CLASS,false); //19430 } return ActionImpl::eGet(featureID, resolve, coreType); } bool ReadIsClassifiedObjectActionImpl::internalEIsSet(int featureID) const { switch(featureID) { case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_CLASSIFIER: return getClassifier() != nullptr; //19427 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_ISDIRECT: return getIsDirect() != false; //19428 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_OBJECT: return getObject() != nullptr; //19429 case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_RESULT: return getResult() != nullptr; //19430 } return ActionImpl::internalEIsSet(featureID); } bool ReadIsClassifiedObjectActionImpl::eSet(int featureID, Any newValue) { switch(featureID) { case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_CLASSIFIER: { // CAST Any to uml::Classifier std::shared_ptr<ecore::EObject> _temp = newValue->get<std::shared_ptr<ecore::EObject>>(); std::shared_ptr<uml::Classifier> _classifier = std::dynamic_pointer_cast<uml::Classifier>(_temp); setClassifier(_classifier); //19427 return true; } case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_ISDIRECT: { // CAST Any to bool bool _isDirect = newValue->get<bool>(); setIsDirect(_isDirect); //19428 return true; } case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_OBJECT: { // CAST Any to uml::InputPin std::shared_ptr<ecore::EObject> _temp = newValue->get<std::shared_ptr<ecore::EObject>>(); std::shared_ptr<uml::InputPin> _object = std::dynamic_pointer_cast<uml::InputPin>(_temp); setObject(_object); //19429 return true; } case uml::umlPackage::READISCLASSIFIEDOBJECTACTION_ATTRIBUTE_RESULT: { // CAST Any to uml::OutputPin std::shared_ptr<ecore::EObject> _temp = newValue->get<std::shared_ptr<ecore::EObject>>(); std::shared_ptr<uml::OutputPin> _result = std::dynamic_pointer_cast<uml::OutputPin>(_temp); setResult(_result); //19430 return true; } } return ActionImpl::eSet(featureID, newValue); } //********************************* // EOperation Invoke //********************************* Any ReadIsClassifiedObjectActionImpl::eInvoke(int operationID, std::shared_ptr<std::list<Any>> arguments) { Any result; switch(operationID) { // uml::ReadIsClassifiedObjectAction::boolean_result(Any, std::map) : bool: 879439704 case umlPackage::READISCLASSIFIEDOBJECTACTION_OPERATION_BOOLEAN_RESULT_EDIAGNOSTICCHAIN_EMAP: { //Retrieve input parameter 'diagnostics' //parameter 0 Any incoming_param_diagnostics; std::list<Any>::const_iterator incoming_param_diagnostics_arguments_citer = std::next(arguments->begin(), 0); incoming_param_diagnostics = (*incoming_param_diagnostics_arguments_citer)->get<Any >(); //Retrieve input parameter 'context' //parameter 1 std::shared_ptr<std::map < Any, Any>> incoming_param_context; std::list<Any>::const_iterator incoming_param_context_arguments_citer = std::next(arguments->begin(), 1); incoming_param_context = (*incoming_param_context_arguments_citer)->get<std::shared_ptr<std::map < Any, Any>> >(); result = eAny(this->boolean_result(incoming_param_diagnostics,incoming_param_context),0,false); break; } // uml::ReadIsClassifiedObjectAction::multiplicity_of_input(Any, std::map) : bool: 283873246 case umlPackage::READISCLASSIFIEDOBJECTACTION_OPERATION_MULTIPLICITY_OF_INPUT_EDIAGNOSTICCHAIN_EMAP: { //Retrieve input parameter 'diagnostics' //parameter 0 Any incoming_param_diagnostics; std::list<Any>::const_iterator incoming_param_diagnostics_arguments_citer = std::next(arguments->begin(), 0); incoming_param_diagnostics = (*incoming_param_diagnostics_arguments_citer)->get<Any >(); //Retrieve input parameter 'context' //parameter 1 std::shared_ptr<std::map < Any, Any>> incoming_param_context; std::list<Any>::const_iterator incoming_param_context_arguments_citer = std::next(arguments->begin(), 1); incoming_param_context = (*incoming_param_context_arguments_citer)->get<std::shared_ptr<std::map < Any, Any>> >(); result = eAny(this->multiplicity_of_input(incoming_param_diagnostics,incoming_param_context),0,false); break; } // uml::ReadIsClassifiedObjectAction::multiplicity_of_output(Any, std::map) : bool: 1528670395 case umlPackage::READISCLASSIFIEDOBJECTACTION_OPERATION_MULTIPLICITY_OF_OUTPUT_EDIAGNOSTICCHAIN_EMAP: { //Retrieve input parameter 'diagnostics' //parameter 0 Any incoming_param_diagnostics; std::list<Any>::const_iterator incoming_param_diagnostics_arguments_citer = std::next(arguments->begin(), 0); incoming_param_diagnostics = (*incoming_param_diagnostics_arguments_citer)->get<Any >(); //Retrieve input parameter 'context' //parameter 1 std::shared_ptr<std::map < Any, Any>> incoming_param_context; std::list<Any>::const_iterator incoming_param_context_arguments_citer = std::next(arguments->begin(), 1); incoming_param_context = (*incoming_param_context_arguments_citer)->get<std::shared_ptr<std::map < Any, Any>> >(); result = eAny(this->multiplicity_of_output(incoming_param_diagnostics,incoming_param_context),0,false); break; } // uml::ReadIsClassifiedObjectAction::no_type(Any, std::map) : bool: 3290549392 case umlPackage::READISCLASSIFIEDOBJECTACTION_OPERATION_NO_TYPE_EDIAGNOSTICCHAIN_EMAP: { //Retrieve input parameter 'diagnostics' //parameter 0 Any incoming_param_diagnostics; std::list<Any>::const_iterator incoming_param_diagnostics_arguments_citer = std::next(arguments->begin(), 0); incoming_param_diagnostics = (*incoming_param_diagnostics_arguments_citer)->get<Any >(); //Retrieve input parameter 'context' //parameter 1 std::shared_ptr<std::map < Any, Any>> incoming_param_context; std::list<Any>::const_iterator incoming_param_context_arguments_citer = std::next(arguments->begin(), 1); incoming_param_context = (*incoming_param_context_arguments_citer)->get<std::shared_ptr<std::map < Any, Any>> >(); result = eAny(this->no_type(incoming_param_diagnostics,incoming_param_context),0,false); break; } default: { // call superTypes result = ActionImpl::eInvoke(operationID, arguments); if (result && !result->isEmpty()) break; break; } } return result; } std::shared_ptr<uml::ReadIsClassifiedObjectAction> ReadIsClassifiedObjectActionImpl::getThisReadIsClassifiedObjectActionPtr() const { return m_thisReadIsClassifiedObjectActionPtr.lock(); } void ReadIsClassifiedObjectActionImpl::setThisReadIsClassifiedObjectActionPtr(std::weak_ptr<uml::ReadIsClassifiedObjectAction> thisReadIsClassifiedObjectActionPtr) { m_thisReadIsClassifiedObjectActionPtr = thisReadIsClassifiedObjectActionPtr; setThisActionPtr(thisReadIsClassifiedObjectActionPtr); }
MDE4CPP/MDE4CPP
src/uml/uml/src_gen/uml/impl/ReadIsClassifiedObjectActionImpl.cpp
C++
mit
23,504
# practice 練習
masa0704ymd/practice
README.md
Markdown
mit
18
''' Package *.uproject and release it to output location defined in ue4config.py ''' import os, sys, argparse, json, shutil, subprocess import ue4util, gitutil, ziputil, uploadutil def package(project_file, project_output_folder): ''' Build project ''' # UATScriptTemplate = '{UATScript} BuildCookRun -project={ProjectFile} -archivedirectory={OutputFolder} -noP4 -platform={Platform} -clientconfig=Development -serverconfig=Development -cook -allmaps -stage -pak -archive -build' # See help information in Engine/Source/Programs/AutomationTool/AutomationUtils/ProjectParams.cs # cmd = UATScriptTemplate.format( # UATScript = ue4util.get_UAT_script(), # Platform = ue4util.get_platform_name(), # OutputFolder = ue4util.get_real_abspath(project_output_folder), # ProjectFile = project_file # ) cmd = [ ue4util.get_UAT_script(), 'BuildCookRun', '-project=%s' % project_file, '-archivedirectory=%s' % ue4util.get_real_abspath(project_output_folder), '-noP4', '-platform=%s' % ue4util.get_platform_name(), '-clientconfig=Development', '-serverconfig=Development', '-cook', '-allmaps', '-stage', '-pak', '-archive', '-build' ] print cmd # ue4util.run_ue4cmd(cmd, False) subprocess.call(cmd) def save_version_info(info_filename, project_file, project_output_folder, plugin_version): ''' Save the version info of UnrealCV plugin and the game for easier issue tracking''' project_name = ue4util.get_project_name(project_file) project_folder = os.path.dirname(project_file) if gitutil.is_dirty(project_folder): return False # if gitutil.is_dirty(plugin_folder): # return False # plugin_version = gitutil.get_short_version(plugin_folder) assert(len(plugin_version) == 7 or len(plugin_version) == 0) project_version = gitutil.get_short_version(project_folder) assert(len(project_version) == 7 or len(project_version) == 0) info = dict( project_name = project_name, project_version = project_version, plugin_version = plugin_version, platform = ue4util.get_platform_name(), ) ue4util.mkdirp(os.path.dirname(info_filename)) with open(info_filename, 'w') as f: json.dump(info, f, indent = 4) print 'Save project info to file %s' % info_filename # print json.dumps(info, indent = 4) return True def main(): # Files is relative to this python script cur_dir = os.path.dirname(os.path.abspath(__file__)) # Parse command line arguments parser = argparse.ArgumentParser() parser.add_argument('project_file') parser.add_argument('--engine_path') # Add here just as a placeholder # parser.add_argument('--clean', action='store_true') # args = parser.parse_args() args, _ = parser.parse_known_args() # Read project information project_file = ue4util.get_real_abspath(args.project_file) project_name = ue4util.get_project_name(project_file) # Get plugin information project_folder = os.path.dirname(project_file) plugin_infofile = os.path.join(project_folder, 'Plugins', 'unrealcv', 'unrealcv-info.txt') if not os.path.isfile(plugin_infofile): exit('Plugin not exist in the project') else: with open(plugin_infofile, 'r') as f: plugin_info = json.load(f) plugin_version = plugin_info['plugin_version'] project_version = gitutil.get_short_version(project_folder) project_output_folder = os.path.join(cur_dir, 'built_project/%s/%s-%s' % (project_name, project_version, plugin_version)) info_filename = os.path.join(project_output_folder, '%s-info.txt' % project_name) # if args.clean and os.path.isdir(project_output_folder): # # Use a very strict check to avoid acciently perform the delete # # --force might be dangerous, use it with care # project_output_folder = ue4util.get_real_abspath(project_output_folder) # print 'Try to delete existing compiled project %s' % project_output_folder # assert(project_name in project_output_folder) # assert('*' not in project_output_folder) # assert(project_output_folder.count('/') > 2) # assert(len(project_output_folder) > 10) # shutil.rmtree(project_output_folder) if os.path.isdir(project_output_folder): print 'Output directory %s exist, delete it first' % project_output_folder else: # Package game and save version info package(project_file, project_output_folder) # Save version info after build finished # Save one to version folder save_version_info(info_filename, project_file, project_output_folder, plugin_version) # Save one to project folder project_root_folder = os.path.join(cur_dir, 'built_project/%s' % project_name) root_info_filename = os.path.join(project_root_folder, '%s-info.txt' % project_name) save_version_info(root_info_filename, project_file, project_output_folder, plugin_version) if __name__ == '__main__': main()
qiuwch/unrealcv
client/scripts/build-project.py
Python
mit
5,188
package sk.stuba.fiit.perconik.ivda.server.metrics; /** * Created by Seky on 7. 3. 2015. */ public interface SourceCodeMetric { public int eval(String code); }
sekys/ivda
src/sk/stuba/fiit/perconik/ivda/server/metrics/SourceCodeMetric.java
Java
mit
167
module Nanc.AST.ConstantExpression where import Debug.Trace import Data.Word import Language.C intValue :: CExpr -> Word64 intValue (CConst (CIntConst i _)) = fromIntegral $ getCInteger i intValue expr = trace ("Unknown ConstantIntExpression: " ++ (show expr)) undefined
tinco/nanc
Nanc/AST/ConstantExpression.hs
Haskell
mit
274
using System.Web; using System.Web.Mvc; namespace Brume.PreviewOnline { public class FilterConfig { public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); } } }
alienblog/OfficePreviewOnline
Brume.Common.Office/Brume.PreviewOnline/App_Start/FilterConfig.cs
C#
mit
273
# Release History ## 12.1.0-beta.2 (Unreleased) ## 12.1.0-beta.1 (2019-12-18) - Added SAS generation methods on clients to improve discoverability and convenience of sas. Deprecated setFilePath, setShareName generateSasQueryParameters methods on ShareServiceSasSignatureValues to direct users to using the methods added on clients. ## 12.0.0 (2019-12-04) This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-storage-file_12.0.0/sdk/storage/azure-storage-file-share/README.md) and [samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-storage-file_12.0.0/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share) - GA release. - Changed return type for forceCloseHandle from void to CloseHandlesInfo. - Changed return type for forceCloseAllHandles from int to CloseHandlesInfo. - Upgraded to version 1.1.0 of Azure Core. ## 12.0.0-preview.5 (2019-10-31) - Renamed FileReference to StorageFileItem - Changed response of ShareClient.listFilesAndDirectories FileReference to StorageFileItem - FileUploadRangeFromUrlInfo eTag() changed to getETag() and lastModified() changed to getLastModidified() - Changed response of FileAsyncClient.download() from Mono<FileDownloadInfo> to Flux<ByteBuffer> - Renamed FileAsyncClient.downloadWithPropertiesWithResponse to downloadLoadWithResponse - Removed FileAsyncClient.uploadWithResponse(Flux<ByteBuffer>, long, long) - Changed response of FileClient.download() from FileDownloadInfo to voif - Renamed FileClient.downloadWithPropertiesWithResponse to downloadLoadWithResponse - Changed FileClient upload methods to take InputStreams instead of ByteBuffers - Removed FileClient.uploadWithResponse(ByteBuffer, long, long) - Deleted FileDownloadInfo - Removed FileProperty from public API - Removed BaseFileClientBuilder - Removed FileClientBuilder, ShareClientBuilder, and FileServiceClientBuilder inheritance of BaseFileClientBuilder - Renamed ListShatesOptions getMaxResults and setMaxResults to getMaxResultsPerPage and setMaxResultsPerPage - Removes StorageError and StorageErrorException from public API - Renamed StorageErrorCode to FileErrorCode, SignedIdentifier to FileSignedIdentifier, StorageServiceProperties to FileServiceProperties, CorRules to FileCorRules, AccessPolicy to FileAccessPolicy, and Metrics to FileMetrics - Renamed FileHTTPHeaders to FileHttpHeaders and removed File from getter names - Replaced forceCloseHandles(String, boolean) with forceCloseHandle(String) and forceCloseHandles(boolean) - Renamed StorageException to FileStorageException - Added FileServiceVersion and the ability to set it on client builders - Replaced URL parameters with String on uploadRangeFromUrl - Replaced startCopy with beginCopy and return poller - Renamed FileSasPermission getters to use has prefix - Changed return type for FileClient.downloadWithProperties from Response<Void> to FileDownloadResponse and FileAsyncClient.downloadWithProperties from Mono<Response<Flux<ByteBuffer>>> to Mono<FileDownloadAsyncResponse> ## 12.0.0-preview.4 (2019-10-8) For details on the Azure SDK for Java (October 2019 Preview) release, you can refer to the [release announcement](https://aka.ms/azure-sdk-preview4-java). This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-storage-file_12.0.0-preview.4/sdk/storage/azure-storage-file/README.md) and [samples](https://github.com/Azure/azure-sdk-for-java/blob/azure-storage-file_12.0.0-preview.4/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file) - Getters and setters were updated to use Java Bean notation. - Added `getShareName`, `getDirectoryPath` and `getFilePath` for fetching the resource names. - Updated to be fully compliant with the Java 9 Platform Module System. - Changed `VoidResponse` to `Response<Void>` on sync API, and `Mono<VoidResponse>` to `Mono<Response<Void>>` on async API. - Fixed metadata does not allow capital letter issue. [`Bug 5295`](https://github.com/Azure/azure-sdk-for-java/issues/5295) - Updated the return type of `downloadToFile` API to `FileProperties` on sync API and `Mono<FileProperties>` on async API. - `getFileServiceUrl`, `getShareUrl`, `getDirectoryUrl`, `getFileUrl` API now returns URL with scheme, host, resource name and snapshot if any. - Removed SAS token generation APIs from clients, use FileServiceSasSignatureValues to generate SAS tokens. - Removed `SASTokenCredential`, `SASTokenCredentialPolicy` and the corresponding `credential(SASTokenCredential)` method in client builder, and added sasToken(String) instead. ## 12.0.0-preview.3 (2019-09-10) For details on the Azure SDK for Java (September 2019 Preview) release, you can refer to the [release announcement](https://aka.ms/azure-sdk-preview3-java). This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/085c8570b411defff26860ef56ea189af07d3d6a/sdk/storage/azure-storage-file/README.md) and [samples](https://github.com/Azure/azure-sdk-for-java/tree/085c8570b411defff26860ef56ea189af07d3d6a/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file) demonstrate the new API. - Added tracing telemetry on maximum overload API. - Added generate SAS token APIs. - Throw `StorageException` with error code when get error response from service. - Moved `ReactorNettyClient` into a separate module as default plugin. Customer can configure a custom http client through builder. - Throw `UnexpectedLengthException` when the upload body length does not match the input length. [GitHub #4193](https://github.com/Azure/azure-sdk-for-java/issues/4193) - Added validation policy to check the equality of request client id between request and response. - Added `PageFlux` on async APIs and `PageIterable` on sync APIs. - Upgraded to use service version 2019-02-02 from 2018-11-09. - Replaced `ByteBuf` with `ByteBuffer` and removed dependency on `Netty`. - Added `uploadRangeFromUrl` APIs on sync and async File client. - Added `timeout` parameter for sync APIs which allows requests throw exception if no response received within the time span. - Added `azure-storage-common` as a dependency. - Added the ability for the user to obtain file SMB properties and file permissions from getProperties APIs on File and Directory and download APIs on File. - Added setProperties APIs on sync and async Directory client. Allows users to set file SMB properties and file permission. **Breaking changes: New API design** - Changed list responses to `PagedFlux` on async APIs and `PagedIterable` on sync APIs. - Replaced setHttpHeaders with setProperties APIs on sync and async File client. Additionally Allows users to set file SMB properties and file permission. - Added file smb properties and file permission parameters to create APIs on sync and async File and Directory clients. ## 12.0.0-preview.2 (2019-08-08) Version 12.0.0-preview.2 is a preview of our efforts in creating a client library that is developer-friendly, idiomatic to the Java ecosystem, and as consistent across different languages and platforms as possible. The principles that guide our efforts can be found in the [Azure SDK Design Guidelines for Java](https://azuresdkspecs.z5.web.core.windows.net/JavaSpec.html). For details on the Azure SDK for Java (August 2019 Preview) release, you can refer to the [release announcement](https://aka.ms/azure-sdk-preview2-java). This package's [documentation](https://github.com/Azure/azure-sdk-for-java/blob/azure-storage-file_12.0.0-preview.2/sdk/storage/azure-storage-file/README.md) and [samples](https://github.com/Azure/azure-sdk-for-java/tree/azure-storage-file_12.0.0-preview.2/sdk/storage/azure-storage-file/src/samples/java/com/azure/storage/file) demonstrate the new API. ### Features included in `azure-storage-file` - This is initial SDK release for storage file service. - Packages scoped by functionality - `azure-storage-file` contains a `FileServiceClient`, `FileServiceAsyncClient`, `ShareClient`, `ShareAsyncClient`, `DirectoryClient`, `DirectoryAsyncClient`, `FileClient` and `FileAsyncClient` for storage file operations. - Client instances are scoped to storage file service. - Reactive streams support using [Project Reactor](https://projectreactor.io/).
navalev/azure-sdk-for-java
sdk/storage/azure-storage-file-share/CHANGELOG.md
Markdown
mit
8,256
import { useEffect, useRef, useState } from 'react'; import { ActorRef, Interpreter, Subscribable } from 'xstate'; import { isActorWithState } from './useActor'; import { getServiceSnapshot } from './useService'; function isService(actor: any): actor is Interpreter<any, any, any, any> { return 'state' in actor && 'machine' in actor; } const defaultCompare = (a, b) => a === b; const defaultGetSnapshot = (a) => isService(a) ? getServiceSnapshot(a) : isActorWithState(a) ? a.state : undefined; export function useSelector< TActor extends ActorRef<any, any>, T, TEmitted = TActor extends Subscribable<infer Emitted> ? Emitted : never >( actor: TActor, selector: (emitted: TEmitted) => T, compare: (a: T, b: T) => boolean = defaultCompare, getSnapshot: (a: TActor) => TEmitted = defaultGetSnapshot ) { const [selected, setSelected] = useState(() => selector(getSnapshot(actor))); const selectedRef = useRef<T>(selected); useEffect(() => { const updateSelectedIfChanged = (nextSelected: T) => { if (!compare(selectedRef.current, nextSelected)) { setSelected(nextSelected); selectedRef.current = nextSelected; } }; const initialSelected = selector(getSnapshot(actor)); updateSelectedIfChanged(initialSelected); const sub = actor.subscribe((emitted) => { const nextSelected = selector(emitted); updateSelectedIfChanged(nextSelected); }); return () => sub.unsubscribe(); }, [selector, compare]); return selected; }
davidkpiano/xstate
packages/xstate-react/src/useSelector.ts
TypeScript
mit
1,530
package iolocal; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class FastReaderClass { static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } } public static void main(String[] args) { // TODO Auto-generated method stub } }
anhsirksai/coding
TutorialJPAProject/interviewPrep/src/iolocal/FastReaderClass.java
Java
mit
442
module Engineblog module ApplicationHelper end end
AlexTremigliozzi/engineblog
app/helpers/engineblog/application_helper.rb
Ruby
mit
55
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <!-- must set here! --> <base th:href="${#httpServletRequest.getScheme() + '://' + #httpServletRequest.getServerName() + ':' + #request.getServerPort() + #request.getContextPath() + '/'} "> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>列表</title> </head> <body> <div class="col-lg-12"> <div class="ibox "> <div class="ibox-title"> <h5>列表</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <!-- search start --> <div class="row"> <div class="col-lg-12"> <div class="form-group row"> <div class="col-lg-2"> <input id="name" name="name" placeholder="名称" class="form-control" /> </div> <div class="col-lg-2"> <select id="type" name="type"></select> </div> </div> <div class="form-group row"> <div class="col-lg-2"> <button type="button" id="queryBt" class="btn btn-primary ">查询</button> </div> </div> </div> </div> <!-- search end --> <div class="table-responsive"> <table id="dt0" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%"> <thead> <tr> <th>id</th> <th>名称</th> <th>类型</th> <th>目标类型</th> <th>链接</th> <th>跳转目标地址</th> <th>添加时间</th> </tr> </thead> </table> </div> </div> </div> </div> <div th:replace="include/web/webjs :: webjs"></div> <script src="/static/js/project/app/bus/appBannerList.js"></script> </body> </html>
brucevsked/vskeddemolist
vskeddemos/mavenproject/springboot2list/springboot2d3/src/main/resources/templates/app/bus/appBannerList.html
HTML
mit
1,967
/* Copyright (c) 2017 InversePalindrome Memento Mori - GameOverState.cpp InversePalindrome.com */ #include "GameOverState.hpp" #include "StateMachine.hpp" #include <SFGUI/Image.hpp> GameOverState::GameOverState(StateMachine& stateMachine, SharedData& sharedData) : State(stateMachine, sharedData), background(sharedData.textures[Textures::ID::GameOverBackground]), playButton(sfg::Button::Create()), menuButton(sfg::Button::Create()), leaderboardButton(sfg::Button::Create()) { background.setPosition(sf::Vector2f(840.f, 420.f)); playButton->SetImage(sfg::Image::Create(sharedData.images[Images::ID::PlayButton])); playButton->SetPosition(sf::Vector2f(1180.f, 680.f)); playButton->GetSignal(sfg::Widget::OnLeftClick).Connect([this] { transitionToPlay(); }); menuButton->SetImage(sfg::Image::Create(sharedData.images[Images::ID::MenuButton])); menuButton->SetPosition(sf::Vector2f(940.f, 680.f)); menuButton->GetSignal(sfg::Widget::OnLeftClick).Connect([this] { transitionToMenu(); }); leaderboardButton->SetImage(sfg::Image::Create(sharedData.images[Images::ID::LeaderboardButton])); leaderboardButton->SetPosition(sf::Vector2f(1420.f, 680.f)); leaderboardButton->GetSignal(sfg::Widget::OnLeftClick).Connect([this] { transitionToLeaderboard(); }); sharedData.hud.Add(playButton); sharedData.hud.Add(menuButton); sharedData.hud.Add(leaderboardButton); } void GameOverState::handleEvent(const sf::Event& event) { } void GameOverState::update(sf::Time deltaTime) { this->playButton->Show(true); this->menuButton->Show(true); this->leaderboardButton->Show(true); } void GameOverState::draw() { this->sharedData.window.draw(this->background); } bool GameOverState::isTransparent() { return true; } void GameOverState::transitionToPlay() { this->playButton->Show(false); this->menuButton->Show(false); this->leaderboardButton->Show(false); this->stateMachine.clearStates(); this->stateMachine.pushState(StateMachine::StateID::Game); } void GameOverState::transitionToMenu() { this->playButton->Show(false); this->menuButton->Show(false); this->leaderboardButton->Show(false); this->stateMachine.clearStates(); this->stateMachine.pushState(StateMachine::StateID::Menu); } void GameOverState::transitionToLeaderboard() { this->playButton->Show(false); this->menuButton->Show(false); this->leaderboardButton->Show(false); this->stateMachine.pushState(StateMachine::StateID::Leaderboard); }
InversePalindrome/Memento-Mori
src/GameOverState.cpp
C++
mit
2,638
class AddAuthorsKeyToBooks < ActiveRecord::Migration def change add_reference :books, :author, index: true, foreign_key: true end end
allen-garvey/booklist-rails
db/migrate/20151004040126_add_authors_key_to_books.rb
Ruby
mit
142
<!DOCTYPE html> <html> <head> <meta charset='utf-8'> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"> <link rel="shortcut icon" type="image/png" href="/static/zhihu2.png" /> <title>Eva:林水溶的博客</title> </head> <body> <script src="https://cdn.bootcss.com/device.js/0.2.7/device.js"></script> <div id="app"></div> <!-- built files will be auto injected --> </body> </html>
shuiRong/Eva
Eva_SSR/FrontEnd/index.html
HTML
mit
446
/* * The MIT License (MIT) * * Copyright (c) 2015 Olivier Clermont, Jonathan Ermel, Mathieu Fortin-Boulay, Philippe Legault & Nicolas Ménard * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package rtdc.core.controller; import rtdc.core.event.ActionCompleteEvent; import rtdc.core.event.Event; import rtdc.core.event.FetchUnitsEvent; import rtdc.core.exception.ValidationException; import rtdc.core.i18n.ResBundle; import rtdc.core.model.Action; import rtdc.core.model.SimpleValidator; import rtdc.core.model.Unit; import rtdc.core.model.User; import rtdc.core.service.Service; import rtdc.core.util.Cache; import rtdc.core.util.Pair; import rtdc.core.util.Stringifier; import rtdc.core.view.AddActionView; import java.util.*; public class AddActionController extends Controller<AddActionView> implements ActionCompleteEvent.Handler { private Action RtdcCurrentAction; private String currentAction; public AddActionController(final AddActionView view){ super(view); Event.subscribe(ActionCompleteEvent.TYPE, this); Service.getUnits(); view.getTaskUiElement().setArray(Action.Task.values()); view.getTaskUiElement().setStringifier(Action.Task.getStringifier()); view.getStatusUiElement().setArray(Action.Status.values()); view.getStatusUiElement().setStringifier(Action.Status.getStringifier()); view.getUnitUiElement().setArray(new Unit[]{((User)Cache.getInstance().get("sessionUser")).getUnit()}); view.getUnitUiElement().setStringifier(new Stringifier<Unit>() { @Override public String toString(Unit unit) { return unit == null? "": unit.getName(); } }); RtdcCurrentAction = (Action) Cache.getInstance().remove("action"); if (RtdcCurrentAction != null) { view.setTitle(ResBundle.get().editActionTitle()); view.getRoleUiElement().setValue(RtdcCurrentAction.getRoleResponsible()); view.getTargetUiElement().setValue(RtdcCurrentAction.getTarget()); view.getDeadlineUiElement().setValue(RtdcCurrentAction.getDeadline()); view.getDescriptionUiElement().setValue(RtdcCurrentAction.getDescription()); view.getUnitUiElement().setValue(RtdcCurrentAction.getUnit()); view.getStatusUiElement().setValue(RtdcCurrentAction.getStatus()); view.getTaskUiElement().setValue(RtdcCurrentAction.getTask()); } else { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.HOUR_OF_DAY, 2); view.getDeadlineUiElement().setValue(cal.getTime()); } } @Override String getTitle() { return ResBundle.get().addActionTitle(); } public void addAction() { if (RtdcCurrentAction != null) { currentAction = "edit"; RtdcCurrentAction.setId(RtdcCurrentAction.getId()); } else { currentAction = "add"; RtdcCurrentAction = new Action(); } RtdcCurrentAction.setTask(view.getTaskUiElement().getValue()); RtdcCurrentAction.setRoleResponsible(view.getRoleUiElement().getValue()); RtdcCurrentAction.setTarget(view.getTargetUiElement().getValue()); RtdcCurrentAction.setDeadline(view.getDeadlineUiElement().getValue()); RtdcCurrentAction.setDescription(view.getDescriptionUiElement().getValue()); RtdcCurrentAction.setStatus(view.getStatusUiElement().getValue()); RtdcCurrentAction.setUnit(view.getUnitUiElement().getValue()); RtdcCurrentAction.setLastUpdate(new Date()); Service.updateOrSaveActions(RtdcCurrentAction); } public void validateDescription(){ try{ SimpleValidator.validateActionDescription(view.getDescriptionUiElement().getValue()); view.getDescriptionUiElement().setErrorMessage(null); }catch(ValidationException e){ view.getDescriptionUiElement().setErrorMessage(e.getMessage()); } } @Override public void onActionComplete(ActionCompleteEvent event) { if(event.getObjectType().equals("action")){ if(currentAction.equals("add")) RtdcCurrentAction.setId(event.getObjectId()); Cache.getInstance().put("action", new Pair(currentAction, RtdcCurrentAction)); view.closeDialog(); } } @Override public void onStop() { super.onStop(); Event.unsubscribe(ActionCompleteEvent.TYPE, this); } }
Bathlamos/RTDC
core/src/main/java/rtdc/core/controller/AddActionController.java
Java
mit
5,606
<?php // this file can not ve viewed unless it's included from pre_installer_code.php if(!isset($included_in_pre_installer)) { die('You\'re attempting to access this file the wrong way.'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="title" content="siwapp - Installer" /> <title>siwapp - Preinstall</title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="stylesheet" type="text/css" media="all" href="css/tripoli/tripoli.css" /> <!--[if ie]><link rel="stylesheet" type="text/css" media="all" href="css/tripoli/tripoli.ie.css" /><![endif]--> <link rel="stylesheet" type="text/css" media="all" href="css/siwapp/layout.css" /> <link rel="stylesheet" type="text/css" media="all" href="css/siwapp/typography.css" /> <link rel="stylesheet" type="text/css" media="all" href="css/siwapp/buttons.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/siwapp/theme.css" /> <link rel="stylesheet" type="text/css" media="all" href="css/siwapp/controls.css" /> <link rel="stylesheet" type="text/css" media="print" href="css/siwapp/print.css" /> <link rel="stylesheet" type="text/css" media="all" href="css/ui-orange/ui.all.css" /> <link rel="stylesheet" type="text/css" media="all" href="css/siwapp/installer.css" /> </head> <body class="static step0"> <div id="hd"></div> <div id="bd"> <div id="bd-content"> <form id="step0Form" class="installerForm" action="" method="get"> <div id="header"> <h2>Pre-installation instructions</h2> <ul> <li class="buttons"> <button type="submit" id="finish" class="btn"><span><span>Start</span></span></button> </li> </ul> </div> <div id="content"> <p> SIWAPP is based on the symfony framework, and it needs to have access to certain special files and directories to work. </p> <?php if(!is_dir($options['sf_root_dir'].'/config')):?> <p> The webpage you're seeing right now is located at: <br/> <code><?php echo dirname(__FILE__)?></code><br/><br/> And SIWAPP expects to find the symfony root directory at:<br/> <code><?php echo $options['sf_root_dir']?></code><br/> </p> <p>However, <strong>SIWAPP can't find that directory</strong>. Please type here the path of the symfony root directory:</p> <p><input name="sf_root_dir" size="50"/></p> <?php elseif(!is_writable($options['sf_root_dir'].'/cache')): ?> <input name="sf_root_dir" type="hidden" value="<?php echo $options['sf_root_dir']?>"/> <p><strong>SIWAPP can't write to the "cache" directory.</strong><br/> The "cache" directory should be located at: <br/> <code><?php echo $options['sf_root_dir']?>/cache</code><br/> Please make sure it exists and the web server can write to it. </p> <?php else:?> <input name="sf_root_dir" type="hidden" value="<?php echo $options['sf_root_dir']?>"/> <?php endif?> <?php if(!$pdo):?> <p><strong>Your php distribution doesn't support PDO</strong>. SIWAPP , as being based on the symfony framework, relies heavily on PDO. You need to enable PDO support in you PHP. <?php endif?> <p>Once you've solved the indicated problems, reload this page, or just click on the "start" button.</p> <div style="text-align: center;"> <a href="http://www.siwapp.org/">Siwapp</a> is Free Software released under the MIT license </div> </div> </div> </form> </div> <!-- div#bd-content --> </div> <!-- div#bd --> </body> </html>
markerdmann/Siwapp
web/pre_installer_instructions.php
PHP
mit
4,035
package com.lin.mobilesafe.utils; import android.util.Log; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; /** * Created by Administrator on 2016/7/6 0006. */ public class MD5Utils { public static String md5(String str) { try { // MD5的加密器 MessageDigest md = MessageDigest.getInstance("MD5"); byte[] bytes = str.getBytes(); byte[] digest = md.digest(bytes); StringBuilder stringBuilder = new StringBuilder(); for (byte b : digest) { int temp = 0xff & b; String hexString = Integer.toHexString(temp); if (hexString.length() == 1) { hexString = "0" + hexString; } stringBuilder.append(hexString); } Log.e("MD5", stringBuilder.toString()); return stringBuilder.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } }
zhanglingg/MobileSafe
app/src/main/java/com/lin/mobilesafe/utils/MD5Utils.java
Java
mit
1,062
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <meta charset="utf-8"> <title>phpDocumentor » \Riverline\DynamoDB\Collection</title> <meta name="author" content="Mike van Riel"> <meta name="description" content=""> <link href="../css/template.css" rel="stylesheet" media="all"> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico"> <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"><div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">phpDocumentor</a><div class="nav-collapse"><ul class="nav"> <li class="dropdown"> <a href="#api" class="dropdown-toggle" data-toggle="dropdown"> API Documentation <b class="caret"></b></a><ul class="dropdown-menu"> <li><a>Namespaces</a></li> <li><a href="../namespaces/Riverline.html"><i class="icon-th"></i> Riverline</a></li> </ul> </li> <li class="dropdown" id="charts-menu"> <a href="#charts" class="dropdown-toggle" data-toggle="dropdown"> Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul> </li> <li class="dropdown" id="reports-menu"> <a href="#reports" class="dropdown-toggle" data-toggle="dropdown"> Reports <b class="caret"></b></a><ul class="dropdown-menu"> <li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors  <span class="label label-info">137</span></a></li> <li><a href="../markers.html"><i class="icon-map-marker"></i> Markers  <ul><li>todo  <span class="label label-info">1</span> </li></ul></a></li> <li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements  <span class="label label-info">0</span></a></li> </ul> </li> </ul></div> </div></div> <div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div> </div> <div id="___" class="container"> <noscript><div class="alert alert-warning"> Javascript is disabled; several features are only available if Javascript is enabled. </div></noscript> <div class="row"> <div class="span4"> <span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio"> <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button> </div> <ul class="side-nav nav nav-list"> <li class="nav-header"> <i class="icon-custom icon-method"></i> Methods</li> <li class="method public "><a href="#__construct" title="__construct :: "><span class="description">__construct() </span><pre>__construct()</pre></a></li> <li class="method public "><a href="#add" title="add :: Add an item to the collection"><span class="description">Add an item to the collection</span><pre>add()</pre></a></li> <li class="method public "><a href="#count" title="count :: "><span class="description">count() </span><pre>count()</pre></a></li> <li class="method public "><a href="#getIterator" title="getIterator :: "><span class="description">getIterator() </span><pre>getIterator()</pre></a></li> <li class="method public "><a href="#getLastKey" title="getLastKey :: Return the previous request last key"><span class="description">Return the previous request last key</span><pre>getLastKey()</pre></a></li> <li class="method public "><a href="#more" title="more :: Return true if the previous request has more items to retreive"><span class="description">Return true if the previous request has more items to retreive</span><pre>more()</pre></a></li> <li class="method public "><a href="#shift" title="shift :: Remove an item off the beginning of the collection"><span class="description">Remove an item off the beginning of the collection</span><pre>shift()</pre></a></li> <li class="nav-header"> <i class="icon-custom icon-property"></i> Properties</li> <li class="nav-header protected">» Protected</li> <li class="property protected "><a href="#%24items" title="$items :: The items collection"><span class="description">The items collection</span><pre>$items</pre></a></li> <li class="property protected "><a href="#%24lastKey" title="$lastKey :: The previous request last key"><span class="description">The previous request last key</span><pre>$lastKey</pre></a></li> </ul> </div> <div class="span8"> <a name="%5CRiverline%5CDynamoDB%5CCollection" id="\Riverline\DynamoDB\Collection"></a><ul class="breadcrumb"> <li> <a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span> </li> <li><a href="../namespaces/Riverline.html">Riverline</a></li> <span class="divider">\</span><li><a href="../namespaces/Riverline.DynamoDB.html">DynamoDB</a></li> <li class="active"> <span class="divider">\</span><a href="../classes/Riverline.DynamoDB.Collection.html">Collection</a> </li> </ul> <div href="../classes/Riverline.DynamoDB.Collection.html" class="element class"> <p class="short_description"></p> <div class="details"> <p class="long_description"></p> <table class="table table-bordered"><tr> <th>class</th> <td></td> </tr></table> <h3> <i class="icon-custom icon-method"></i> Methods</h3> <a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse"> <h2>__construct() </h2> <pre>__construct(string | null $lastKey) </pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <h3>Parameters</h3> <div class="subelement argument"> <h4>$lastKey</h4> <code>stringnull</code><p>The previous request last key</p></div> </div></div> </div> <a name="add" id="add"></a><div class="element clickable method public add" data-toggle="collapse" data-target=".add .collapse"> <h2>Add an item to the collection</h2> <pre>add(Item $item) </pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <h3>Parameters</h3> <div class="subelement argument"> <h4>$item</h4> <code><a href="../classes/Riverline.DynamoDB.Item.html">\Riverline\DynamoDB\Item</a></code> </div> </div></div> </div> <a name="count" id="count"></a><div class="element clickable method public count" data-toggle="collapse" data-target=".count .collapse"> <h2>count() </h2> <pre>count() : int</pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <table class="table table-bordered"><tr> <th>see</th> <td>\Countable</td> </tr></table> <h3>Returns</h3> <div class="subelement response"><code>int</code></div> </div></div> </div> <a name="getIterator" id="getIterator"></a><div class="element clickable method public getIterator" data-toggle="collapse" data-target=".getIterator .collapse"> <h2>getIterator() </h2> <pre>getIterator() : <a href="http://php.net/manual/en/class.arrayiterator.php">\ArrayIterator</a></pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <table class="table table-bordered"><tr> <th>see</th> <td>\IteratorAggregate</td> </tr></table> <h3>Returns</h3> <div class="subelement response"><code><a href="http://php.net/manual/en/class.arrayiterator.php">\ArrayIterator</a></code></div> </div></div> </div> <a name="getLastKey" id="getLastKey"></a><div class="element clickable method public getLastKey" data-toggle="collapse" data-target=".getLastKey .collapse"> <h2>Return the previous request last key</h2> <pre>getLastKey() : null | string</pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <h3>Returns</h3> <div class="subelement response"> <code>null</code><code>string</code> </div> </div></div> </div> <a name="more" id="more"></a><div class="element clickable method public more" data-toggle="collapse" data-target=".more .collapse"> <h2>Return true if the previous request has more items to retreive</h2> <pre>more() : bool</pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <h3>Returns</h3> <div class="subelement response"><code>bool</code></div> </div></div> </div> <a name="shift" id="shift"></a><div class="element clickable method public shift" data-toggle="collapse" data-target=".shift .collapse"> <h2>Remove an item off the beginning of the collection</h2> <pre>shift() : <a href="../classes/Riverline.DynamoDB.Item.html">\Riverline\DynamoDB\Item</a></pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <p class="long_description"></p> <h3>Returns</h3> <div class="subelement response"><code><a href="../classes/Riverline.DynamoDB.Item.html">\Riverline\DynamoDB\Item</a></code></div> </div></div> </div> <h3> <i class="icon-custom icon-property"></i> Properties</h3> <a name="%24items" id="$items"> </a><div class="element clickable property protected $items" data-toggle="collapse" data-target=".$items .collapse"> <h2>The items collection</h2> <pre>$items : array</pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div> </div> <a name="%24lastKey" id="$lastKey"> </a><div class="element clickable property protected $lastKey" data-toggle="collapse" data-target=".$lastKey .collapse"> <h2>The previous request last key</h2> <pre>$lastKey : string | null</pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div> </div> </div> </div> </div> </div> <div class="row"><footer class="span12"> Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br> Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a3</a> and<br> generated on 2012-08-10T18:46:40+02:00.<br></footer></div> </div> </body> </html>
rcambien/riverline-dynamodb
docs/classes/Riverline.DynamoDB.Collection.html
HTML
mit
11,755
// // IDAppPackageHandler.h // ResignTool // // Created by Injoy on 2017/9/19. // Copyright © 2017年 Injoy. All rights reserved. // #import <Foundation/Foundation.h> #import "IDProvisioningProfile.h" static NSString *kKeyBundleIDChange = @"keyBundleIDChange"; static NSString *kCFBundleIdentifier = @"CFBundleIdentifier"; static NSString *kCFBundleDisplayName = @"CFBundleDisplayName"; static NSString *kCFBundleName = @"CFBundleName"; static NSString *kCFBundleShortVersionString = @"CFBundleShortVersionString"; static NSString *kCFBundleVersion = @"CFBundleVersion"; static NSString *kCFBundleIcons = @"CFBundleIcons"; static NSString *kCFBundlePrimaryIcon = @"CFBundlePrimaryIcon"; static NSString *kCFBundleIconFiles = @"CFBundleIconFiles"; static NSString *kCFBundleIconsipad = @"CFBundleIcons~ipad"; static NSString *kMinimumOSVersion = @"MinimumOSVersion"; static NSString *kPayloadDirName = @"Payload"; static NSString *kInfoPlistFilename = @"Info.plist"; static NSString *kEntitlementsPlistFilename = @"Entitlements.plist"; static NSString *kCodeSignatureDirectory = @"_CodeSignature"; static NSString *kEmbeddedProvisioningFilename = @"embedded"; static NSString *kAppIdentifier = @"application-identifier"; static NSString *kTeamIdentifier = @"com.apple.developer.team-identifier"; static NSString *kKeychainAccessGroups = @"keychain-access-groups"; static NSString *kIconNormal = @"iconNormal"; static NSString *kIconRetina = @"iconRetina"; typedef void(^SuccessBlock)(id); typedef void(^ErrorBlock)(NSString *errorString); typedef void(^LogBlock)(NSString *logString); @interface IDAppPackageHandler : NSObject @property (strong, readonly) NSString *bundleDisplayName; @property (strong, readonly) NSString *bundleID; @property (strong, readonly) IDProvisioningProfile *embeddedMobileprovision; /// 包的路径 @property (strong) NSString* packagePath; /// 包解压的路径 @property (strong) NSString* workPath; /// xxx.app 路径 @property (strong) NSString* appPath; - (instancetype)initWithPackagePath:(NSString *)path; /** 解压 @param success 成功 @param error 失败 */ - (void)unzipIpa:(void (^)(void))success error:(void (^)(NSString *error))error; - (BOOL)removeCodeSignatureDirectory; /** 封装好的重签方法 @param provisioningprofile 顾名思义 @param certificateName 顾名思义 @param bundleIdentifier 顾名思义 @param displayName 顾名思义 @param destinationPath 顾名思义 @param logBlock 顾名思义 @param errorBlock 顾名思义 @param successBlock 顾名思义 */ - (void)resignWithProvisioningProfile:(IDProvisioningProfile *)provisioningprofile certificate:(NSString *)certificateName bundleIdentifier:(NSString *)bundleIdentifier displayName:(NSString *)displayName destinationPath:(NSString *)destinationPath log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; #pragma mark - 签名流程 - (void)createEntitlementsWithProvisioning:(IDProvisioningProfile *)provisioningprofile log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; - (void)editInfoPlistWithIdentifier:(NSString *)bundleIdentifier displayName:(NSString *)displayName log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; - (void)editEmbeddedProvision:(IDProvisioningProfile *)provisioningprofile log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; - (void)doCodesign:(NSString *)certificateName log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; - (void)zipPackageToDirPath:(NSString *)zipDirPath log:(LogBlock)logBlock error:(ErrorBlock)errorBlock success:(SuccessBlock)successBlock; @end
InjoyDeng/ResignTool
ResignTool/Factory/IDAppPackageHandler.h
C
mit
4,173
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes.rb', __FILE__) describe "String#sum" do it "returns a basic n-bit checksum of the characters in self" do "ruby".sum.should == 450 "ruby".sum(8).should == 194 "rubinius".sum(23).should == 881 end it "tries to convert n to an integer using to_int" do obj = mock('8') obj.should_receive(:to_int).and_return(8) "hello".sum(obj).should == "hello".sum(8) end end
undees/rubyspec
core/string/sum_spec.rb
Ruby
mit
497
# frozen_string_literal: true require "attr_extras" module Formatting module Number def format_number(number, opts = {}) FormatNumber.new(number, opts).format end end class FormatNumber attr_private :input_number, :thousands_separator, :decimal_separator, :round, :min_decimals, :decimals_on_integers, :treat_zero_decimals_as_integer, :explicit_sign, :blank_when_zero def initialize(input_number, opts) @input_number = input_number @thousands_separator = opts.fetch(:thousands_separator) { default_thousands_separator } @decimal_separator = opts.fetch(:decimal_separator) { default_decimal_separator } @round = opts.fetch(:round, 2) @min_decimals = opts.fetch(:min_decimals, 2) @decimals_on_integers = opts.fetch(:decimals_on_integers, true) @treat_zero_decimals_as_integer = opts.fetch(:treat_zero_decimals_as_integer, false) @explicit_sign = opts.fetch(:explicit_sign, false) @blank_when_zero = opts.fetch(:blank_when_zero, false) end def format number = input_number if treat_zero_decimals_as_integer && number.modulo(1).zero? number = number.to_i end has_decimals = number.to_s.include?(".") if blank_when_zero return "" if number.zero? end # Avoid negative zero. number = number.abs if number.zero? if round number = number.round(round) if has_decimals end integer, decimals = number.to_s.split(".") # Separate groups by thousands separator. integer.gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{thousands_separator}") if explicit_sign integer = "+#{integer}" if number > 0 end if min_decimals && (has_decimals || decimals_on_integers) decimals ||= "0" decimals = decimals.ljust(min_decimals, "0") end [ integer, decimals ].compact.join(decimal_separator) end private def default_thousands_separator t_format(:delimiter, NON_BREAKING_SPACE) end def default_decimal_separator t_format(:separator, ".") end def t_format(key, default) if defined?(I18n) && I18n.respond_to?(:t) I18n.t(key, scope: "number.format", default: default) else default end end end end
barsoom/formatting
lib/formatting/number.rb
Ruby
mit
2,352
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for USN-2113-1 # # Security announcement date: 2014-02-18 00:00:00 UTC # Script generation date: 2017-01-01 21:03:37 UTC # # Operating System: Ubuntu 12.04 LTS # Architecture: x86_64 # # Vulnerable packages fix on version: # - linux-image-3.11.0-17-generic:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic-lpae:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic-lpae:3.11.0-17.31~precise1 # # Last versions recommanded by security team: # - linux-image-3.11.0-17-generic:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic-lpae:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic:3.11.0-17.31~precise1 # - linux-image-3.11.0-17-generic-lpae:3.11.0-17.31~precise1 # # CVE List: # - CVE-2013-4563 # - CVE-2013-4579 # - CVE-2013-4587 # - CVE-2013-6367 # - CVE-2013-6368 # - CVE-2013-6376 # - CVE-2013-6382 # - CVE-2013-6432 # - CVE-2013-7263 # - CVE-2013-7264 # - CVE-2013-7265 # - CVE-2013-7266 # - CVE-2013-7267 # - CVE-2013-7268 # - CVE-2013-7269 # - CVE-2013-7270 # - CVE-2013-7271 # - CVE-2013-7281 # - CVE-2013-7339 # - CVE-2014-1438 # - CVE-2014-1446 # - CVE-2013-4563 # - CVE-2013-4579 # - CVE-2013-4587 # - CVE-2013-6367 # - CVE-2013-6368 # - CVE-2013-6376 # - CVE-2013-6382 # - CVE-2013-6432 # - CVE-2013-7263 # - CVE-2013-7264 # - CVE-2013-7265 # - CVE-2013-7266 # - CVE-2013-7267 # - CVE-2013-7268 # - CVE-2013-7269 # - CVE-2013-7270 # - CVE-2013-7271 # - CVE-2013-7281 # - CVE-2013-7339 # - CVE-2014-1438 # - CVE-2014-1446 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo apt-get install --only-upgrade linux-image-3.11.0-17-generic=3.11.0-17.31~precise1 -y sudo apt-get install --only-upgrade linux-image-3.11.0-17-generic-lpae=3.11.0-17.31~precise1 -y sudo apt-get install --only-upgrade linux-image-3.11.0-17-generic=3.11.0-17.31~precise1 -y sudo apt-get install --only-upgrade linux-image-3.11.0-17-generic-lpae=3.11.0-17.31~precise1 -y
Cyberwatch/cbw-security-fixes
Ubuntu_12.04_LTS/x86_64/2014/USN-2113-1.sh
Shell
mit
2,171
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for USN-3097-1 # # Security announcement date: 2016-10-10 00:00:00 UTC # Script generation date: 2017-01-01 21:05:39 UTC # # Operating System: Ubuntu 12.04 LTS # Architecture: i386 # # Vulnerable packages fix on version: # - linux-image-3.2.0-111-virtual:3.2.0-111.153 # - linux-image-3.2.0-111-generic-pae:3.2.0-111.153 # - linux-image-3.2.0-111-generic:3.2.0-111.153 # # Last versions recommanded by security team: # - linux-image-3.2.0-111-virtual:3.2.0-111.153 # - linux-image-3.2.0-111-generic-pae:3.2.0-111.153 # - linux-image-3.2.0-111-generic:3.2.0-111.153 # # CVE List: # - CVE-2016-6828 # - CVE-2016-6136 # - CVE-2016-6480 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo apt-get install --only-upgrade linux-image-3.2.0-111-virtual=3.2.0-111.153 -y sudo apt-get install --only-upgrade linux-image-3.2.0-111-generic-pae=3.2.0-111.153 -y sudo apt-get install --only-upgrade linux-image-3.2.0-111-generic=3.2.0-111.153 -y
Cyberwatch/cbw-security-fixes
Ubuntu_12.04_LTS/i386/2016/USN-3097-1.sh
Shell
mit
1,092
var gulp = require('gulp'); var minifyCss = require('gulp-minify-css'); var static = require('node-static'); var fileServer = new static.Server('./'); var http = require('http'); gulp.task('styles', function () { gulp.src('css/*.css') .pipe(minifyCss()) .pipe(gulp.dest('./dist/')) }); gulp.task('watch', function () { gulp.watch('css/*.css', ['styles']) }); gulp.task('server', function () { http.createServer(function (request, response) { request.addListener('end', function() { fileServer.serve(request, response); }).resume(); }).listen(8080); }); gulp.task('default', ['styles', 'server', 'watch']);
nluo/udacity-project1
gulpfile.js
JavaScript
mit
662
/* * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2015 Daniel Campora * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef __INCLUDED_MPCONFIGPORT_H #define __INCLUDED_MPCONFIGPORT_H #include <stdint.h> #ifndef BOOTLOADER #include "FreeRTOS.h" #include "semphr.h" #endif // options to control how Micro Python is built #define MICROPY_ALLOC_PATH_MAX (128) #define MICROPY_PERSISTENT_CODE_LOAD (1) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_COMP_MODULE_CONST (1) #define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_FINALISER (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0) #define MICROPY_STACK_CHECK (0) #define MICROPY_HELPER_REPL (1) #define MICROPY_ENABLE_SOURCE_LINE (1) #define MICROPY_ENABLE_DOC_STRING (0) #define MICROPY_REPL_AUTO_INDENT (1) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE) #define MICROPY_OPT_COMPUTED_GOTO (0) #define MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE (0) #define MICROPY_READER_VFS (1) #ifndef DEBUG // we need ram on the launchxl while debugging #define MICROPY_CPYTHON_COMPAT (1) #else #define MICROPY_CPYTHON_COMPAT (0) #endif #define MICROPY_QSTR_BYTES_IN_HASH (1) // fatfs configuration used in ffconf.h #define MICROPY_FATFS_ENABLE_LFN (2) #define MICROPY_FATFS_MAX_LFN (MICROPY_ALLOC_PATH_MAX) #define MICROPY_FATFS_LFN_CODE_PAGE (437) // 1=SFN/ANSI 437=LFN/U.S.(OEM) #define MICROPY_FATFS_RPATH (2) #define MICROPY_FATFS_REENTRANT (1) #define MICROPY_FATFS_TIMEOUT (2500) #define MICROPY_FATFS_SYNC_T SemaphoreHandle_t #define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_VFS (1) #define MICROPY_VFS_FAT (1) #define MICROPY_PY_ASYNC_AWAIT (0) #define MICROPY_PY_BUILTINS_TIMEOUTERROR (1) #define MICROPY_PY_ALL_SPECIAL_METHODS (1) #define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_TEXT cc3200_help_text #ifndef DEBUG #define MICROPY_PY_BUILTINS_STR_UNICODE (1) #define MICROPY_PY_BUILTINS_STR_SPLITLINES (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) #define MICROPY_PY_BUILTINS_FROZENSET (1) #define MICROPY_PY_BUILTINS_EXECFILE (1) #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #else #define MICROPY_PY_BUILTINS_STR_UNICODE (0) #define MICROPY_PY_BUILTINS_STR_SPLITLINES (0) #define MICROPY_PY_BUILTINS_MEMORYVIEW (0) #define MICROPY_PY_BUILTINS_FROZENSET (0) #define MICROPY_PY_BUILTINS_EXECFILE (0) #define MICROPY_PY_ARRAY_SLICE_ASSIGN (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #endif #define MICROPY_PY_MICROPYTHON_MEM_INFO (0) #define MICROPY_PY_SYS_MAXSIZE (1) #define MICROPY_PY_SYS_EXIT (1) #define MICROPY_PY_SYS_STDFILES (1) #define MICROPY_PY_CMATH (0) #define MICROPY_PY_IO (1) #define MICROPY_PY_IO_FILEIO (1) #define MICROPY_PY_THREAD (1) #define MICROPY_PY_THREAD_GIL (1) #define MICROPY_PY_UBINASCII (0) #define MICROPY_PY_UCTYPES (0) #define MICROPY_PY_UZLIB (0) #define MICROPY_PY_UJSON (1) #define MICROPY_PY_URE (1) #define MICROPY_PY_UHEAPQ (0) #define MICROPY_PY_UHASHLIB (0) #define MICROPY_PY_USELECT (1) #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) #define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0) // TODO these should be generic, not bound to fatfs #define mp_type_fileio fatfs_type_fileio #define mp_type_textio fatfs_type_textio // use vfs's functions for import stat and builtin open #define mp_import_stat mp_vfs_import_stat #define mp_builtin_open mp_vfs_open #define mp_builtin_open_obj mp_vfs_open_obj // extra built in names to add to the global namespace #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \ // extra built in modules to add to the list of known ones extern const struct _mp_obj_module_t machine_module; extern const struct _mp_obj_module_t wipy_module; extern const struct _mp_obj_module_t mp_module_ure; extern const struct _mp_obj_module_t mp_module_ujson; extern const struct _mp_obj_module_t mp_module_uos; extern const struct _mp_obj_module_t mp_module_utime; extern const struct _mp_obj_module_t mp_module_uselect; extern const struct _mp_obj_module_t mp_module_usocket; extern const struct _mp_obj_module_t mp_module_network; extern const struct _mp_obj_module_t mp_module_ubinascii; extern const struct _mp_obj_module_t mp_module_ussl; #define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR_umachine), (mp_obj_t)&machine_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_wipy), (mp_obj_t)&wipy_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&mp_module_uos }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_utime }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_uselect), (mp_obj_t)&mp_module_uselect }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mp_module_network }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_ubinascii), (mp_obj_t)&mp_module_ubinascii }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_ussl), (mp_obj_t)&mp_module_ussl }, \ #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&mp_module_ustruct }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_re), (mp_obj_t)&mp_module_ure }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_json), (mp_obj_t)&mp_module_ujson }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&mp_module_uos }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&mp_module_utime }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_module_uselect }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&mp_module_usocket }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_binascii), (mp_obj_t)&mp_module_ubinascii }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_ssl), (mp_obj_t)&mp_module_ussl }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&machine_module }, \ // extra constants #define MICROPY_PORT_CONSTANTS \ { MP_OBJ_NEW_QSTR(MP_QSTR_umachine), (mp_obj_t)&machine_module }, \ // vm state and root pointers for the gc #define MP_STATE_PORT MP_STATE_VM #define MICROPY_PORT_ROOT_POINTERS \ const char *readline_hist[8]; \ mp_obj_t mp_const_user_interrupt; \ mp_obj_t machine_config_main; \ mp_obj_list_t pyb_sleep_obj_list; \ mp_obj_list_t mp_irq_obj_list; \ mp_obj_list_t pyb_timer_channel_obj_list; \ struct _pyb_uart_obj_t *pyb_uart_objs[2]; \ struct _os_term_dup_obj_t *os_term_dup_obj; \ // type definitions for the specific machine #define BYTES_PER_WORD (4) #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1)) #define MP_SSIZE_MAX (0x7FFFFFFF) #define UINT_FMT "%u" #define INT_FMT "%d" typedef int32_t mp_int_t; // must be pointer size typedef unsigned int mp_uint_t; // must be pointer size typedef long mp_off_t; #define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len) #define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq() #define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state) #define MICROPY_EVENT_POLL_HOOK __WFI(); // assembly functions to handle critical sections, interrupt // disabling/enabling and sleep mode enter/exit #include "cc3200_asm.h" // We need to provide a declaration/definition of alloca() #include <alloca.h> // Include board specific configuration #include "mpconfigboard.h" #define MICROPY_MPHALPORT_H "cc3200_hal.h" #define MICROPY_PORT_HAS_TELNET (1) #define MICROPY_PORT_HAS_FTP (1) #define MICROPY_PY_SYS_PLATFORM "WiPy" #define MICROPY_PORT_WLAN_AP_SSID "wipy-wlan" #define MICROPY_PORT_WLAN_AP_KEY "www.wipy.io" #define MICROPY_PORT_WLAN_AP_SECURITY SL_SEC_TYPE_WPA_WPA2 #define MICROPY_PORT_WLAN_AP_CHANNEL 5 #endif // __INCLUDED_MPCONFIGPORT_H
mhoffma/micropython
cc3200/mpconfigport.h
C
mit
11,146
/* Copyright (c) 2006, Michael Kazhdan and Matthew Bolitho All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Johns Hopkins University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef MARCHING_CUBES_INCLUDED #define MARCHING_CUBES_INCLUDED #include <stdio.h> #include <type_traits> #include "Mesh/PoissonRecon/Geometry.h" #include "Mesh/PoissonRecon/Window.h" namespace HyperCube { enum Direction{ BACK , CROSS , FRONT }; inline Direction Opposite( Direction dir ){ return dir==BACK ? FRONT : ( dir==FRONT ? BACK : CROSS ); } // The number of k-dimensional elements in a d-dimensional cube is equal to // the number of (k-1)-dimensional elements in a (d-1)-dimensional hypercube plus twice the number of k-dimensional elements in a (d-1)-dimensional hypercube // Number of elements of dimension K in a cube of dimension D template< unsigned int D , unsigned int K > struct ElementNum { static const unsigned int Value = 2 * ElementNum< D-1 , K >::Value + ElementNum< D-1 , K-1 >::Value; }; template< unsigned int D > struct ElementNum< D , 0 >{ static const unsigned int Value = 2 * ElementNum< D-1 , 0 >::Value; }; template< unsigned int D > struct ElementNum< D , D >{ static const unsigned int Value = 1; }; template< > struct ElementNum< 0 , 0 >{ static const unsigned int Value = 1; }; // [WARNING] This shouldn't really happen, but we need to support the definition of OverlapElementNum template< unsigned int K > struct ElementNum< 0 , K >{ static const unsigned int Value = K==0 ? 1 : 0; }; template< unsigned int D , unsigned int K1 , unsigned int K2 > struct OverlapElementNum { static const unsigned int Value = K1>=K2 ? ElementNum< K1 , K2 >::Value : OverlapElementNum< D-1 , K1 , K2 >::Value + OverlapElementNum< D-1 , K1 , K2-1 >::Value; }; template< unsigned int D , unsigned int K > struct OverlapElementNum< D , D , K >{ static const unsigned int Value = ElementNum< D , K >::Value; }; template< unsigned int D > struct OverlapElementNum< D , D , 0 >{ static const unsigned int Value = ElementNum< D , 0 >::Value; }; template< unsigned int D , unsigned int K > struct OverlapElementNum< D , K , 0 >{ static const unsigned int Value = ElementNum< K , 0 >::Value; }; template< unsigned int D , unsigned int K > struct OverlapElementNum< D , K , K >{ static const unsigned int Value = 1; }; template< unsigned int D , unsigned int K > struct OverlapElementNum< D , K , D >{ static const unsigned int Value = 1; }; template< unsigned int D > struct OverlapElementNum< D , D , D >{ static const unsigned int Value = 1; }; template< unsigned int D > struct OverlapElementNum< D , 0 , 0 >{ static const unsigned int Value = 1; }; template< unsigned int D > struct Cube { // Corner index (x,y,z,...) -> x + 2*y + 4*z + ... // CROSS -> the D-th axis // Representation of a K-dimensional element of the cube template< unsigned int K > struct Element { static_assert( D>=K , "[ERROR] Element dimension exceeds cube dimension" ); // The index of the element, sorted as: // 1. All K-dimensional elements contained in the back face // 2. All K-dimensional elements spanning the D-th axis // 3. All K-dimensional elements contained in the front face unsigned int index; // Initialize by index Element( unsigned int idx=0 ); // Initialize by co-index: // 1. A K-dimensional element in either BACK or FRONT // 2. A (K-1)-dimensional element extruded across the D-th axis Element( Direction dir , unsigned int coIndex ); // Given a K-Dimensional sub-element living inside a DK-dimensional sub-cube, get the element relative to the D-dimensional cube template< unsigned int DK > Element( Element< DK > subCube , typename Cube< DK >::template Element< K > subElement ); // Initialize by setting the directions Element( const Direction dirs[D] ); // Print the element to the specified stream void print( FILE* fp=stdout ) const; // Sets the direction and co-index of the element void factor( Direction& dir , unsigned int& coIndex ) const; // Returns the direction along which the element lives Direction direction( void ) const; // Returns the co-index of the element unsigned int coIndex( void ) const; // Compute the directions of the element void directions( Direction* dirs ) const; // Returns the antipodal element typename Cube< D >::template Element< K > antipodal( void ) const; // Comparison operators bool operator < ( Element e ) const { return index< e.index; } bool operator <= ( Element e ) const { return index<=e.index; } bool operator > ( Element e ) const { return index> e.index; } bool operator >= ( Element e ) const { return index>=e.index; } bool operator == ( Element e ) const { return index==e.index; } bool operator != ( Element e ) const { return index!=e.index; } bool operator < ( unsigned int i ) const { return index< i; } bool operator <= ( unsigned int i ) const { return index<=i; } bool operator > ( unsigned int i ) const { return index> i; } bool operator >= ( unsigned int i ) const { return index>=i; } bool operator == ( unsigned int i ) const { return index==i; } bool operator != ( unsigned int i ) const { return index!=i; } // Increment operators Element& operator ++ ( void ) { index++ ; return *this; } Element operator ++ ( int ) { index++ ; return Element(index-1); } protected: template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D!=0 && _K!=0 >::type _setElement( Direction dir , unsigned int coIndex ); template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D!=0 && _K==0 >::type _setElement( Direction dir , unsigned int coIndex ); template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D==0 && _K==0 >::type _setElement( Direction dir , unsigned int coIndex ); template< unsigned int KD > typename std::enable_if< (D> KD) && (KD>K) && K!=0 >::type _setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ); template< unsigned int KD > typename std::enable_if< (D> KD) && (KD>K) && K==0 >::type _setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ); template< unsigned int KD > typename std::enable_if< (D==KD) && (KD>K) >::type _setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ); template< unsigned int KD > typename std::enable_if< (KD==K) >::type _setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ); template< unsigned int _D=D > typename std::enable_if< _D!=0 >::type _setElement( const Direction* dirs ); template< unsigned int _D=D > typename std::enable_if< _D==0 >::type _setElement( const Direction* dirs ); template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D==_K >::type _factor( Direction& dir , unsigned int& coIndex ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D!=_K && _K!=0 >::type _factor( Direction& dir , unsigned int& coIndex ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D!=_K && _K==0 >::type _factor( Direction& dir , unsigned int& coIndex ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< (_D>_K) && _K!=0 >::type _directions( Direction* dirs ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< (_D>_K) && _K==0 >::type _directions( Direction* dirs ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D==_K >::type _directions( Direction* dirs ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< (_D>_K) && _K!=0 , Element >::type _antipodal( void ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< (_D>_K) && _K==0 , Element >::type _antipodal( void ) const; template< unsigned int _D=D , unsigned int _K=K > typename std::enable_if< _D==_K , Element >::type _antipodal( void ) const; }; // A way of indexing the cubes incident on an element template< unsigned int K > using IncidentCubeIndex = typename Cube< D-K >::template Element< 0 >; // Number of elements of dimension K template< unsigned int K > static constexpr unsigned int ElementNum( void ){ return HyperCube::ElementNum< D , K >::Value; } // Number of cubes incident to an element of dimension K template< unsigned int K > static constexpr unsigned int IncidentCubeNum( void ){ return HyperCube::ElementNum< D-K , 0 >::Value; } // Number of overlapping elements of dimension K1 / K2 template< unsigned int K1 , unsigned int K2 > static constexpr unsigned int OverlapElementNum( void ){ return HyperCube::OverlapElementNum< D , K1 , K2 >::Value; } // Is the face outward-facing static bool IsOriented( Element< D-1 > e ); // Is one element contained in the other? template< unsigned int K1 , unsigned int K2 > static bool Overlap( Element< K1 > e1 , Element< K2 > e2 ); // If K1>K2: returns all elements contained in e // Else: returns all elements containing e template< unsigned int K1 , unsigned int K2 > static void OverlapElements( Element< K1 > e , Element< K2 >* es ); // Returns the marching-cubes index for the set of values template< typename Real > static unsigned int MCIndex( const Real values[ Cube::ElementNum< 0 >() ] , Real iso ); // Extracts the marching-cubes sub-index for the associated element template< unsigned int K > static unsigned int ElementMCIndex( Element< K > element , unsigned int mcIndex ); // Does the marching cubes index have a zero-crossing static bool HasMCRoots( unsigned int mcIndex ); // Sets the offset of the incident cube relative to the center cube, x[i] \in {-1,0,1} template< unsigned int K > static void CellOffset( Element< K > e , IncidentCubeIndex< K > d , int x[D] ); // Returns the linearized offset of the incident cube relative to the center cube, \in [0,3^D) template< unsigned int K > static unsigned int CellOffset( Element< K > e , IncidentCubeIndex< K > d ); // Returns the index of the incident cube that is the source template< unsigned int K > static typename Cube< D >::template IncidentCubeIndex< K > IncidentCube( Element< K > e ); // Returns the corresponding element in the incident cube template< unsigned int K > static typename Cube< D >::template Element< K > IncidentElement( Element< K > e , IncidentCubeIndex< K > d ); protected: template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1>=K2) , bool >::type _Overlap( Element< K1 > e1 , Element< K2 > e2 ); template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1< K2) , bool >::type _Overlap( Element< K1 > e1 , Element< K2 > e2 ); template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1>=K2) >::type _OverlapElements( Element< K1 > e , Element< K2 >* es ); template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1< K2) && D==K2 >::type _OverlapElements( Element< K1 > e , Element< K2 >* es ); template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1< K2) && D!=K2 && K1!=0 >::type _OverlapElements( Element< K1 > e , Element< K2 >* es ); template< unsigned int K1 , unsigned int K2 > static typename std::enable_if< (K1< K2) && D!=K2 && K1==0 >::type _OverlapElements( Element< K1 > e , Element< K2 >* es ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K , IncidentCubeIndex< K > >::type _IncidentCube( Element< K > e ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && _D!=0 && K!=0 , IncidentCubeIndex< K > >::type _IncidentCube( Element< K > e ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && _D!=0 && K==0 , IncidentCubeIndex< K > >::type _IncidentCube( Element< K > e ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d , int* x ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K!=0 >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d , int* x ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K==0 >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d , int* x ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K && K==0 , unsigned int >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K && K!=0 , unsigned int >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K!=0 , unsigned int >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K==0 , unsigned int >::type _CellOffset( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K , Element< K > >::type _IncidentElement( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && _D!=0 && K!=0 , Element< K > >::type _IncidentElement( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && _D!=0 && K==0 , Element< K > >::type _IncidentElement( Element< K > e , IncidentCubeIndex< K > d ); template< unsigned int _D=D > static typename std::enable_if< _D!=1 >::type _FactorOrientation( Element< D-1 > e , unsigned int& dim , Direction& dir ); template< unsigned int _D=D > static typename std::enable_if< _D==1 >::type _FactorOrientation( Element< D-1 > e , unsigned int& dim , Direction& dir ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K!=0 , unsigned int >::type _ElementMCIndex( Element< K > element , unsigned int mcIndex ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D!=K && K==0 , unsigned int >::type _ElementMCIndex( Element< K > element , unsigned int mcIndex ); template< unsigned int K , unsigned int _D=D > static typename std::enable_if< _D==K , unsigned int >::type _ElementMCIndex( Element< K > element , unsigned int mcIndex ); template< unsigned int DD > friend struct Cube; }; // Specialized class for extracting iso-curves from a square struct MarchingSquares { const static unsigned int MAX_EDGES=2; static const int edges[1<<HyperCube::Cube< 2 >::ElementNum< 0 >()][2*MAX_EDGES+1]; static int AddEdgeIndices( unsigned char mcIndex , int* edges); }; /////////////////// // Cube::Element // /////////////////// template< unsigned int D > template< unsigned int K > Cube< D >::Element< K >::Element( unsigned int idx ) : index( idx ){} template< unsigned int D > template< unsigned int K > Cube< D >::Element< K >::Element( Direction dir , unsigned int coIndex ){ _setElement( dir , coIndex ); } template< unsigned int D > template< unsigned int K > template< unsigned int DK > Cube< D >::Element< K >::Element( Element< DK > subCube , typename Cube< DK >::template Element< K > subElement ) { static_assert( DK>=K , "[ERROR] Element::Element: sub-cube dimension cannot be smaller than the sub-element dimension" ); static_assert( DK<=D , "[ERROR] Element::Element: sub-cube dimension cannot be larger than the cube dimension" ); _setElement( subCube , subElement ); } template< unsigned int D > template< unsigned int K > Cube< D >::Element< K >::Element( const Direction dirs[D] ){ _setElement( dirs ); } template< unsigned int D > template< unsigned int K > template< unsigned int KD > typename std::enable_if< (D>KD) && (KD>K) && K!=0 >::type Cube< D >::Element< K >::_setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ) { Direction dir ; unsigned int coIndex; subCube.factor( dir , coIndex ); // If the sub-cube lies entirely in the back/front, we can compute the element in the smaller cube. if( dir==BACK || dir==FRONT ) { typename Cube< D-1 >::template Element< KD > _subCube( coIndex ); typename Cube< D-1 >::template Element< K > _element( _subCube , subElement ); *this = Element( dir , _element.index ); } else { typename Cube< D-1 >::template Element< KD-1 > _subCube( coIndex ); Direction _dir ; unsigned int _coIndex; subElement.factor( _dir , _coIndex ); // If the sub-element lies entirely in the back/front, we can compute the element in the smaller cube. if( _dir==BACK || _dir==FRONT ) { typename Cube< KD-1 >::template Element< K > _subElement( _coIndex ); typename Cube< D-1 >::template Element< K > _element( _subCube , _subElement ); *this = Element( _dir , _element.index ); } // Otherwise else { typename Cube< KD-1 >::template Element< K-1 > _subElement( _coIndex ); typename Cube< D-1 >::template Element< K-1 > _element( _subCube , _subElement ); *this = Element( _dir , _element.index ); } } } template< unsigned int D > template< unsigned int K > template< unsigned int KD > typename std::enable_if< (D>KD) && (KD>K) && K==0 >::type Cube< D >::Element< K >::_setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ) { Direction dir ; unsigned int coIndex; subCube.factor( dir , coIndex ); // If the sub-cube lies entirely in the back/front, we can compute the element in the smaller cube. if( dir==BACK || dir==FRONT ) { typename Cube< D-1 >::template Element< KD > _subCube( coIndex ); typename Cube< D-1 >::template Element< K > _element( _subCube , subElement ); *this = Element( dir , _element.index ); } else { typename Cube< D-1 >::template Element< KD-1 > _subCube( coIndex ); Direction _dir ; unsigned int _coIndex; subElement.factor( _dir , _coIndex ); // If the sub-element lies entirely in the back/front, we can compute the element in the smaller cube. if( _dir==BACK || _dir==FRONT ) { typename Cube< KD-1 >::template Element< K > _subElement( _coIndex ); typename Cube< D-1 >::template Element< K > _element( _subCube , _subElement ); *this = Element( _dir , _element.index ); } } } template< unsigned int D > template< unsigned int K > template< unsigned int KD > typename std::enable_if< (D==KD) && (KD>K) >::type Cube< D >::Element< K >::_setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ){ *this = subElement; } template< unsigned int D > template< unsigned int K > template< unsigned int KD > typename std::enable_if< (KD==K) >::type Cube< D >::Element< K >::_setElement( typename Cube< D >::template Element< KD > subCube , typename Cube< KD >::template Element< K > subElement ){ *this = subCube; } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D!=0 && _K!=0 >::type Cube< D >::Element< K >::_setElement( Direction dir , unsigned int coIndex ) { switch( dir ) { case BACK: index = coIndex ; break; case CROSS: index = coIndex + HyperCube::ElementNum< D-1 , K >::Value ; break; case FRONT: index = coIndex + HyperCube::ElementNum< D-1 , K >::Value + HyperCube::ElementNum< D-1 , K-1 >::Value ; break; default: ERROR_OUT( "Bad direction: " , dir ); } } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D!=0 && _K==0 >::type Cube< D >::Element< K >::_setElement( Direction dir , unsigned int coIndex ) { switch( dir ) { case BACK: index = coIndex ; break; case FRONT: index = coIndex + HyperCube::ElementNum< D-1 , K >::Value ; break; default: ERROR_OUT( "Bad direction: " , dir ); } } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D==0 && _K==0 >::type Cube< D >::Element< K >::_setElement( Direction dir , unsigned int coIndex ){ index = coIndex; } template< unsigned int D > template< unsigned int K > template< unsigned int _D > typename std::enable_if< _D!=0 >::type Cube< D >::Element< K>::_setElement( const Direction* dirs ) { if( dirs[D-1]==CROSS ) *this = Element( dirs[D-1] , typename Cube< D-1 >::template Element< K-1 >( dirs ).index ); else *this = Element( dirs[D-1] , typename Cube< D-1 >::template Element< K >( dirs ).index ); } template< unsigned int D > template< unsigned int K > template< unsigned int _D > typename std::enable_if< _D==0 >::type Cube< D >::Element< K>::_setElement( const Direction* dirs ){} template< unsigned int D > template< unsigned int K > void Cube< D >::Element< K >::print( FILE* fp ) const { Direction dirs[D==0?1:D]; directions( dirs ); for( int d=0 ; d<D ; d++ ) fprintf( fp , "%c" , dirs[d]==BACK ? 'B' : ( dirs[d]==CROSS ? 'C' : 'F' ) ); } template< unsigned int D > template< unsigned int K > void Cube< D >::Element< K >::factor( Direction& dir , unsigned int& coIndex ) const { _factor( dir , coIndex ); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D!=_K && _K!=0 >::type Cube< D >::Element< K >::_factor( Direction& dir , unsigned int& coIndex ) const { if ( index<HyperCube::ElementNum< D-1 , K >::Value ) dir = BACK , coIndex = index; else if( index<HyperCube::ElementNum< D-1 , K >::Value + HyperCube::ElementNum< D-1 , K-1 >::Value ) dir = CROSS , coIndex = index - HyperCube::ElementNum< D-1 , K >::Value; else dir = FRONT , coIndex = index - HyperCube::ElementNum< D-1 , K >::Value - HyperCube::ElementNum< D-1 , K-1 >::Value; } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D!=_K && _K==0 >::type Cube< D >::Element< K >::_factor( Direction& dir , unsigned int& coIndex ) const { if ( index<HyperCube::ElementNum< D-1 , K >::Value ) dir = BACK , coIndex = index; else dir = FRONT , coIndex = index - HyperCube::ElementNum< D-1 , K >::Value; } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D==_K >::type Cube< D >::Element< K >::_factor( Direction& dir , unsigned int& coIndex ) const { dir=CROSS , coIndex=0; } template< unsigned int D > template< unsigned int K > Direction Cube< D >::Element< K >::direction( void ) const { Direction dir ; unsigned int coIndex; factor( dir , coIndex ); return dir; } template< unsigned int D > template< unsigned int K > unsigned int Cube< D >::Element< K >::coIndex( void ) const { Direction dir ; unsigned int coIndex; factor( dir , coIndex ); return coIndex; } template< unsigned int D > template< unsigned int K > void Cube< D >::Element< K >::directions( Direction* dirs ) const { _directions( dirs ); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< (_D>_K) && _K!=0 >::type Cube< D >::Element< K >::_directions( Direction* dirs ) const { unsigned int coIndex; factor( dirs[D-1] , coIndex ); if( dirs[D-1]==CROSS ) typename Cube< D-1 >::template Element< K-1 >( coIndex ).directions( dirs ); else typename Cube< D-1 >::template Element< K >( coIndex ).directions( dirs ); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< (_D>_K) && _K==0 >::type Cube< D >::Element< K >::_directions( Direction* dirs ) const { unsigned int coIndex; factor( dirs[D-1] , coIndex ); if( dirs[D-1]==FRONT || dirs[D-1]==BACK ) typename Cube< D-1 >::template Element< K >( coIndex ).directions( dirs ); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > typename std::enable_if< _D==_K >::type Cube< D >::Element< K >::_directions( Direction* dirs ) const { for( int d=0 ; d<D ; d++ ) dirs[d] = CROSS; } template< unsigned int D > template< unsigned int K > typename Cube< D >::template Element< K > Cube< D >::Element< K >::antipodal( void ) const { return _antipodal(); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > #ifdef _MSC_VER typename std::enable_if< (_D>_K) && _K!=0 , typename Cube< D >::Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const #else // !_MSC_VER typename std::enable_if< (_D>_K) && _K!=0 , typename Cube< D >::template Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const #endif // _MSC_VER { Direction dir ; unsigned int coIndex; factor( dir , coIndex ); if ( dir==CROSS ) return Element< K >( CROSS , typename Cube< D-1 >::template Element< K-1 >( coIndex ).antipodal().index ); else if( dir==FRONT ) return Element< K >( BACK , typename Cube< D-1 >::template Element< K >( coIndex ).antipodal().index ); else if( dir==BACK ) return Element< K >( FRONT , typename Cube< D-1 >::template Element< K >( coIndex ).antipodal().index ); return Element< K >(); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > #ifdef _MSC_VER typename std::enable_if< (_D>_K) && _K==0 , typename Cube< D >::Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const #else // !_MSC_VER typename std::enable_if< (_D>_K) && _K==0 , typename Cube< D >::template Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const #endif // _MSC_VER { Direction dir ; unsigned int coIndex; factor( dir , coIndex ); if ( dir==FRONT ) return Element< K >( BACK , typename Cube< D-1 >::template Element< K >( coIndex ).antipodal().index ); else if( dir==BACK ) return Element< K >( FRONT , typename Cube< D-1 >::template Element< K >( coIndex ).antipodal().index ); return Element< K >(); } template< unsigned int D > template< unsigned int K > template< unsigned int _D , unsigned int _K > #ifdef _MSC_VER typename std::enable_if< _D==_K , typename Cube< D >::Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const { return *this; } #else // !_MSC_VER typename std::enable_if< _D==_K , typename Cube< D >::template Element< K > >::type Cube< D >::Element< K >::_antipodal( void ) const { return *this; } #endif // _MSC_VER ////////// // Cube // ////////// template< unsigned int D > template< unsigned int K1 , unsigned int K2 > bool Cube< D >::Overlap( Element< K1 > e1 , Element< K2 > e2 ){ return _Overlap( e1 , e2 ); } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1>=K2) , bool >::type Cube< D >::_Overlap( Element< K1 > e1 , Element< K2 > e2 ) { Direction dir1[ D ] , dir2[ D ]; e1.directions( dir1 ) , e2.directions( dir2 ); for( int d=0 ; d<D ; d++ ) if( dir1[d]!=CROSS && dir1[d]!=dir2[d] ) return false; return true; } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1< K2) , bool >::type Cube< D >::_Overlap( Element< K1 > e1 , Element< K2 > e2 ){ return _Overlap( e2 , e1 ); } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > void Cube< D >::OverlapElements( Element< K1 > e , Element< K2 >* es ){ _OverlapElements( e , es ); } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1>=K2) >::type Cube< D >::_OverlapElements( Element< K1 > e , Element< K2 >* es ) { for( typename Cube< K1 >::template Element< K2 > _e ; _e<Cube< K1 >::template ElementNum< K2 >() ; _e++ ) es[_e.index] = Element< K2 >( e , _e ); } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1< K2) && D==K2 >::type Cube< D >::_OverlapElements( Element< K1 > e , Element< K2 >* es ) { es[0] = Element< D >(); } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1< K2) && D!=K2 && K1!=0 >::type Cube< D >::_OverlapElements( Element< K1 > e , Element< K2 >* es ) { Direction dir = e.direction() ; unsigned int coIndex; e.factor( dir , coIndex ); if( dir==FRONT || dir==BACK ) { typename Cube< D-1 >::template Element< K2 > _es1[ HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value ]; typename Cube< D-1 >::template Element< K2-1 > _es2[ HyperCube::OverlapElementNum< D-1 , K1 , K2-1 >::Value ]; Cube< D-1 >::OverlapElements( typename Cube< D-1 >::template Element< K1 >( coIndex ) , _es1 ); Cube< D-1 >::OverlapElements( typename Cube< D-1 >::template Element< K1 >( coIndex ) , _es2 ); for( unsigned int i=0 ; i<HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value ; i++ ) es[i] = typename Cube< D >::template Element< K2 >( dir , _es1[i].index ); es += HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value; for( unsigned int i=0 ; i<HyperCube::OverlapElementNum< D-1 , K1 , K2-1 >::Value ; i++ ) es[i] = typename Cube< D >::template Element< K2 >( CROSS , _es2[i].index ); } else if( dir==CROSS ) { typename Cube< D-1 >::template Element< K2-1 > _es1[ HyperCube::OverlapElementNum< D-1 , K1-1 , K2-1 >::Value ]; Cube< D-1 >::OverlapElements( typename Cube< D-1 >::template Element< K1-1 >( coIndex ) , _es1 ); for( unsigned int i=0 ; i<HyperCube::OverlapElementNum< D-1 , K1-1 , K2-1 >::Value ; i++ ) es[i] = typename Cube< D >::template Element< K2 >( CROSS , _es1[i].index ); } } template< unsigned int D > template< unsigned int K1 , unsigned int K2 > typename std::enable_if< (K1< K2) && D!=K2 && K1==0 >::type Cube< D >::_OverlapElements( Element< K1 > e , Element< K2 >* es ) { Direction dir = e.direction() ; unsigned int coIndex; e.factor( dir , coIndex ); if( dir==FRONT || dir==BACK ) { typename Cube< D-1 >::template Element< K2 > _es1[ HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value ]; typename Cube< D-1 >::template Element< K2-1 > _es2[ HyperCube::OverlapElementNum< D-1 , K1 , K2-1 >::Value ]; Cube< D-1 >::OverlapElements( typename Cube< D-1 >::template Element< K1 >( coIndex ) , _es1 ); Cube< D-1 >::OverlapElements( typename Cube< D-1 >::template Element< K1 >( coIndex ) , _es2 ); for( unsigned int i=0 ; i<HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value ; i++ ) es[i] = typename Cube< D >::template Element< K2 >( dir , _es1[i].index ); es += HyperCube::OverlapElementNum< D-1 , K1 , K2 >::Value; for( unsigned int i=0 ; i<HyperCube::OverlapElementNum< D-1 , K1 , K2-1 >::Value ; i++ ) es[i] = typename Cube< D >::template Element< K2 >( CROSS , _es2[i].index ); } } template< unsigned int D > template< unsigned int K > typename Cube< D >::template IncidentCubeIndex< K > Cube< D >::IncidentCube( Element< K > e ){ return _IncidentCube( e ); } template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D==K , typename Cube< D >::IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ){ return IncidentCubeIndex< D >(); } #else // !_MSC_VER typename std::enable_if< _D==K , typename Cube< D >::template IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ){ return IncidentCubeIndex< D >(); } #endif // _MSC_VER template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D!=K && _D!=0 && K!=0 , typename Cube< D >::IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ) #else // !_MSC_VER typename std::enable_if< _D!=K && _D!=0 && K!=0 , typename Cube< D >::template IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ) #endif // _MSC_VER { Direction dir ; unsigned int coIndex; e.factor( dir , coIndex ); if ( dir==CROSS ) return Cube< D-1 >::IncidentCube( typename Cube< D-1 >::template Element< K-1 >( coIndex ) ); else if( dir==FRONT ) return IncidentCubeIndex< K >( BACK , Cube< D-1 >::IncidentCube( typename Cube< D-1 >::template Element< K >( coIndex ) ).index ); else return IncidentCubeIndex< K >( FRONT , Cube< D-1 >::IncidentCube( typename Cube< D-1 >::template Element< K >( coIndex ) ).index ); } template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D!=K && _D!=0 && K==0 , typename Cube< D >::IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ) #else // !_MSC_VER typename std::enable_if< _D!=K && _D!=0 && K==0 , typename Cube< D >::template IncidentCubeIndex< K > >::type Cube< D >::_IncidentCube( Element< K > e ) #endif // _MSC_VER { Direction dir ; unsigned int coIndex; e.factor( dir , coIndex ); if( dir==FRONT ) return IncidentCubeIndex< K >( BACK , Cube< D-1 >::IncidentCube( typename Cube< D-1 >::template Element< K >( coIndex ) ).index ); else return IncidentCubeIndex< K >( FRONT , Cube< D-1 >::IncidentCube( typename Cube< D-1 >::template Element< K >( coIndex ) ).index ); } template< unsigned int D > bool Cube< D >::IsOriented( Element< D-1 > e ) { unsigned int dim ; Direction dir; _FactorOrientation( e , dim , dir ); return (dir==FRONT) ^ ((D-dim-1)&1); } template< unsigned int D > template< unsigned int _D > typename std::enable_if< _D!=1 >::type Cube< D >::_FactorOrientation( Element< D-1 > e , unsigned int& dim , Direction& dir ) { unsigned int coIndex; e.factor( dir , coIndex ); if( dir==CROSS ) Cube< D-1 >::template _FactorOrientation( typename Cube< D-1 >::template Element< D-2 >( coIndex ) , dim , dir ); else dim = D-1; } template< unsigned int D > template< unsigned int _D > typename std::enable_if< _D==1 >::type Cube< D >::_FactorOrientation( Element< D-1 > e , unsigned int& dim , Direction& dir ) { unsigned int coIndex; e.factor( dir , coIndex ); dim = 0; } template< unsigned int D > template< typename Real > unsigned int Cube< D >::MCIndex( const Real values[ Cube< D >::ElementNum< 0 >() ] , Real iso ) { unsigned int mcIdx = 0; for( unsigned int c=0 ; c<ElementNum< 0 >() ; c++ ) if( values[c]<iso ) mcIdx |= (1<<c); return mcIdx; } template< unsigned int D > template< unsigned int K > unsigned int Cube< D >::ElementMCIndex( Element< K > element , unsigned int mcIndex ){ return _ElementMCIndex( element , mcIndex ); } template< unsigned int D > bool Cube< D >::HasMCRoots( unsigned int mcIndex ) { static const unsigned int Mask = (1<<(1<<D)) - 1; return mcIndex!=0 && ( mcIndex & Mask )!=Mask; } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K!=0 , unsigned int >::type Cube< D >::_ElementMCIndex( Element< K > element , unsigned int mcIndex ) { static const unsigned int Mask = ( 1<<( ElementNum< 0 >() / 2 ) ) - 1; static const unsigned int Shift = ElementNum< 0 >() / 2 , _Shift = Cube< K >::template ElementNum< 0 >() / 2; unsigned int mcIndex0 = mcIndex & Mask , mcIndex1 = ( mcIndex>>Shift ) & Mask; Direction dir ; unsigned int coIndex; element.factor( dir , coIndex ); if( dir==CROSS ) return Cube< D-1 >::template ElementMCIndex< K-1 >( coIndex , mcIndex0 ) | ( Cube< D-1 >::template ElementMCIndex< K-1 >( coIndex , mcIndex1 )<<_Shift ); else return Cube< D-1 >::template ElementMCIndex< K >( coIndex , dir==BACK ? mcIndex0 : mcIndex1 ); } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K==0 , unsigned int >::type Cube< D >::_ElementMCIndex( Element< K > element , unsigned int mcIndex ) { static const unsigned int Mask = ( 1<<( ElementNum< 0 >() / 2 ) ) - 1; static const unsigned int Shift = ElementNum< 0 >() / 2 , _Shift = Cube< K >::template ElementNum< 0 >() / 2; unsigned int mcIndex0 = mcIndex & Mask , mcIndex1 = ( mcIndex>>Shift ) & Mask; Direction dir ; unsigned int coIndex; element.factor( dir , coIndex ); return Cube< D-1 >::template ElementMCIndex< K >( typename Cube< D-1 >::template Element< K >( coIndex ) , dir==BACK ? mcIndex0 : mcIndex1 ); } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D==K , unsigned int >::type Cube< D >::_ElementMCIndex( Element< K > element , unsigned int mcIndex ){ return mcIndex; } template< unsigned int D > template< unsigned int K > void Cube< D >::CellOffset( Element< K > e , IncidentCubeIndex< K > d , int x[D] ){ _CellOffset( e , d , x ); } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D==K >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d , int *x ){ for( int d=0 ; d<D ; d++ ) x[d] = 0; } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K!=0 >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d , int *x ) { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if ( eDir==CROSS ){ x[D-1] = 0 ; Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K-1 >( eCoIndex ) , d , x ); } else if( eDir==BACK ){ x[D-1] = -1 + ( dDir==BACK ? 0 : 1 ) ; Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) , x ); } else if( eDir==FRONT ){ x[D-1] = 0 + ( dDir==BACK ? 0 : 1 ) ; Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) , x ); } } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K==0 >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d , int *x ) { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if ( eDir==BACK ){ x[D-1] = -1 + ( dDir==BACK ? 0 : 1 ) ; Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) , x ); } else if( eDir==FRONT ){ x[D-1] = 0 + ( dDir==BACK ? 0 : 1 ) ; Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) , x ); } } template< unsigned int D > template< unsigned int K > unsigned int Cube< D >::CellOffset( Element< K > e , IncidentCubeIndex< K > d ){ return _CellOffset( e , d ); } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D==K && K==0 , unsigned int >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d ){ return 0; } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D==K && K!=0 , unsigned int >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d ){ return WindowIndex< IsotropicUIntPack< D , 3 > , IsotropicUIntPack< D , 1 > >::Index; } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K!=0 , unsigned int >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d ) { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if ( eDir==CROSS ){ return 1 + Cube< D-1 >::template CellOffset( typename Cube< D-1 >::template Element< K-1 >( eCoIndex ) , d ) * 3; } else if( eDir==BACK ){ return 0 + ( dDir==BACK ? 0 : 1 ) + Cube< D-1 >::template CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ) * 3; } else if( eDir==FRONT ){ return 1 + ( dDir==BACK ? 0 : 1 ) + Cube< D-1 >::template CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ) * 3; } return 0; } template< unsigned int D > template< unsigned int K , unsigned int _D > typename std::enable_if< _D!=K && K==0 , unsigned int >::type Cube< D >::_CellOffset( Element< K > e , IncidentCubeIndex< K > d ) { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if ( eDir==BACK ){ return 0 + ( dDir==BACK ? 0 : 1 ) + Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ) * 3; } else if( eDir==FRONT ){ return 1 + ( dDir==BACK ? 0 : 1 ) + Cube< D-1 >::CellOffset( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ) * 3; } return 0; } template< unsigned int D > template< unsigned int K > typename Cube< D >::template Element< K > Cube< D >::IncidentElement( Element< K > e , IncidentCubeIndex< K > d ){ return _IncidentElement( e , d ); } template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D==K , typename Cube< D >::Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ){ return e; } #else // !_MSC_VER typename std::enable_if< _D==K , typename Cube< D >::template Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ){ return e; } #endif // _MSC_VER template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D!=K && _D!=0 && K!=0 , typename Cube< D >::Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ) #else // !_MSC_VER typename std::enable_if< _D!=K && _D!=0 && K!=0 , typename Cube< D >::template Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ) #endif // _MSC_VER { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if ( eDir==CROSS ) return Element< K >( eDir , Cube< D-1 >::template IncidentElement( typename Cube< D-1 >::template Element< K-1 >( eCoIndex ) , d ).index ); else if( eDir==dDir ) return Element< K >( Opposite( eDir ) , Cube< D-1 >::template IncidentElement( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ).index ); else return Element< K >( eDir , Cube< D-1 >::template IncidentElement( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ).index ); } template< unsigned int D > template< unsigned int K , unsigned int _D > #ifdef _MSC_VER typename std::enable_if< _D!=K && _D!=0 && K==0 , typename Cube< D >::Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ) #else // !_MSC_VER typename std::enable_if< _D!=K && _D!=0 && K==0 , typename Cube< D >::template Element< K > >::type Cube< D >::_IncidentElement( Element< K > e , IncidentCubeIndex< K > d ) #endif // _MSC_VER { Direction eDir , dDir ; unsigned int eCoIndex , dCoIndex; e.factor( eDir , eCoIndex ) , d.factor( dDir , dCoIndex ); if( eDir==dDir ) return Element< K >( Opposite( eDir ) , Cube< D-1 >::template IncidentElement( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ).index ); else return Element< K >( eDir , Cube< D-1 >::template IncidentElement( typename Cube< D-1 >::template Element< K >( eCoIndex ) , typename Cube< D-1 >::template IncidentCubeIndex< K >( dCoIndex ) ).index ); } ///////////////////// // MarchingSquares // ///////////////////// const int MarchingSquares::edges[][MAX_EDGES*2+1] = { // Positive to the right // Positive in center /////////////////////////////////// (0,0) (1,0) (0,1) (1,1) { -1 , -1 , -1 , -1 , -1 } , // - - - - // { 1 , 0 , -1 , -1 , -1 } , // + - - - // (0,0) - (0,1) | (0,0) - (1,0) { 0 , 2 , -1 , -1 , -1 } , // - + - - // (0,0) - (1,0) | (1,0) - (1,1) { 1 , 2 , -1 , -1 , -1 } , // + + - - // (0,0) - (0,1) | (1,0) - (1,1) { 3 , 1 , -1 , -1 , -1 } , // - - + - // (0,1) - (1,1) | (0,0) - (0,1) { 3 , 0 , -1 , -1 , -1 } , // + - + - // (0,1) - (1,1) | (0,0) - (1,0) { 0 , 1 , 3 , 2 , -1 } , // - + + - // (0,0) - (1,0) | (0,0) - (0,1) & (0,1) - (1,1) | (1,0) - (1,1) { 3 , 2 , -1 , -1 , -1 } , // + + + - // (0,1) - (1,1) | (1,0) - (1,1) { 2 , 3 , -1 , -1 , -1 } , // - - - + // (1,0) - (1,1) | (0,1) - (1,1) { 1 , 3 , 2 , 0 , -1 } , // + - - + // (0,0) - (0,1) | (0,1) - (1,1) & (1,0) - (1,1) | (0,0) - (1,0) { 0 , 3 , -1 , -1 , -1 } , // - + - + // (0,0) - (1,0) | (0,1) - (1,1) { 1 , 3 , -1 , -1 , -1 } , // + + - + // (0,0) - (0,1) | (0,1) - (1,1) { 2 , 1 , -1 , -1 , -1 } , // - - + + // (1,0) - (1,1) | (0,0) - (0,1) { 2 , 0 , -1 , -1 , -1 } , // + - + + // (1,0) - (1,1) | (0,0) - (1,0) { 0 , 1 , -1 , -1 , -1 } , // - + + + // (0,0) - (1,0) | (0,0) - (0,1) { -1 , -1 , -1 , -1 , -1 } , // + + + + // }; inline int MarchingSquares::AddEdgeIndices( unsigned char mcIndex , int* isoIndices ) { int nEdges = 0; /* Square is entirely in/out of the surface */ if( mcIndex==0 || mcIndex==15 ) return 0; /* Create the edges */ for( int i=0 ; edges[mcIndex][i]!=-1 ; i+=2 ) { for( int j=0 ; j<2 ; j++ ) isoIndices[i+j] = edges[mcIndex][i+j]; nEdges++; } return nEdges; } } #endif //MARCHING_CUBES_INCLUDED
ahmadhasan2k8/PoissonRecon
modules/PoissonRecon/include/Mesh/PoissonRecon/MarchingCubes.h
C
mit
48,805
# == Schema Information # # Table name: coupons # # id :integer not null, primary key # type :string(255) not null # code :string(255) not null # amount :decimal(8, 2) default(0.0) # minimum_value :decimal(8, 2) # percent :integer default(0) # description :text not null # combine :boolean default(FALSE) # starts_at :datetime # expires_at :datetime # created_at :datetime not null # updated_at :datetime not null # # Read about factories at http://github.com/thoughtbot/factory_girl #:type => "CouponValue", #:code => "TEST COUPON", #:amount => "10.00", #:minimum_value => "19.99", #:percent => nil, #:description => "Describe my coupon", #:combine => false FactoryGirl.define do factory :coupon do type "CouponValue" code "TEST COUPON" amount "10.00" minimum_value "19.99" percent nil description "Describe my coupon" combine false starts_at "2011-01-08 19:39:58" expires_at "2012-01-08 19:39:58" end factory :coupon_percent, class: "CouponPercent" do code "TEST COUPON" amount "10.00" minimum_value "19.99" percent 10 description "Describe my coupon" combine false starts_at "2011-01-08 19:39:58" expires_at "2012-01-08 19:39:58" end factory :coupon_value, class: "CouponValue" do code "TEST COUPON" amount "10.00" minimum_value "19.99" percent nil description "Describe my coupon" combine false starts_at "2011-01-08 19:39:58" expires_at "2012-01-08 19:39:58" end factory :coupon_one_time_percent, class: "CouponOneTimePercent" do percent 10.0 end factory :coupon_one_time_value, class: "CouponOneTimeValue" do end end# Read about factories at http://github.com/thoughtbot/factory_girl
gustavoguichard/qrshirts
spec/factories/coupons.rb
Ruby
mit
1,992
<?php return [ /* |-------------------------------------------------------------------------- | Authentication Defaults |-------------------------------------------------------------------------- | | This option controls the default authentication "guard" and password | reset options for your application. You may change these defaults | as required, but they're a perfect start for most applications. | */ 'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], /* |-------------------------------------------------------------------------- | Authentication Guards |-------------------------------------------------------------------------- | | Next, you may define every authentication guard for your application. | Of course, a great default configuration has been defined for you | here which uses session storage and the Eloquent user provider. | | All authentication drivers have a user provider. This defines how the | users are actually retrieved out of your database or other storage | mechanisms used by this application to persist your user's data. | | Supported: "session", "token" | */ 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ], ], /* |-------------------------------------------------------------------------- | User Providers |-------------------------------------------------------------------------- | | All authentication drivers have a user provider. This defines how the | users are actually retrieved out of your database or other storage | mechanisms used by this application to persist your user's data. | | If you have multiple user tables or models you may configure multiple | sources which represent each model / table. These sources may then | be assigned to any extra authentication guards you have defined. | | Supported: "database", "eloquent" | */ 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => Barryvanveen\Users\User::class, ], // 'users' => [ // 'driver' => 'database', // 'table' => 'users', // ], ], /* |-------------------------------------------------------------------------- | Resetting Passwords |-------------------------------------------------------------------------- | | Here you may set the options for resetting passwords including the view | that is your password reset e-mail. You may also set the name of the | table that maintains all of the reset tokens for your application. | | You may specify multiple password reset configurations if you have more | than one user table or model in the application and you want to have | separate password reset settings based on the specific user types. | | The expire time is the number of minutes that the reset token should be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | */ 'passwords' => [ 'users' => [ 'provider' => 'users', 'email' => 'auth.emails.password', 'table' => 'password_resets', 'expire' => 60, ], ], ];
barryvanveen/barryvanveen
config/auth.php
PHP
mit
3,560
<?php return unserialize('a:2:{i:0;O:30:"Doctrine\\ORM\\Mapping\\ManyToOne":4:{s:12:"targetEntity";s:6:"Author";s:7:"cascade";N;s:5:"fetch";s:4:"LAZY";s:10:"inversedBy";s:5:"posts";}i:1;O:31:"Doctrine\\ORM\\Mapping\\JoinColumn":7:{s:4:"name";s:8:"authorID";s:20:"referencedColumnName";s:2:"id";s:6:"unique";b:0;s:8:"nullable";b:1;s:8:"onDelete";N;s:16:"columnDefinition";N;s:9:"fieldName";N;}}');
BazzD/Symfony-demo
app/cache/dev/annotations/77c320f0c0cf2491d9d60639223743ef96eec870$author.cache.php
PHP
mit
396
<?php return array ( 'id' => 'htc_x7500_ver1_subie612', 'fallback' => 'htc_x7500_ver1', 'capabilities' => array ( 'columns' => '16', 'rows' => '36', 'resolution_width' => '640', 'resolution_height' => '480', 'colors' => '65536', 'max_deck_size' => '3000', 'mms_max_size' => '614400', 'mms_max_width' => '1600', 'mms_max_height' => '1600', 'uaprof' => 'http://www.htcmms.com.tw/gen/Athena-1.0.xml', 'oma_support' => 'true', ), );
cuckata23/wurfl-data
data/htc_x7500_ver1_subie612.php
PHP
mit
484
/* ========================================================================== Author's custom styles ========================================================================== */ /* GLOBAL STYLES -------------------------------------------------- */ /* Padding below the footer and lighter body text */ body { padding-bottom: 40px; color: #5a5a5a; } body > .container:nth-of-type(2) { padding-top:80px; } html, body { -webkit-font-smoothing: antialiased; -moz-font-smoothing: normal; -o-font-smoothing: antialiased; font-smoothing: antialiased; } footer { margin-top:80px; } /* FONTS -------------------------------------------------- */ body, .btn { font-family: "myriad-pro-1","myriad-pro-2", 'Helvetica Neue', Helvetica, Arial, sans-serif; } /* GRAYSCALE IMAGES -------------------------------------------------- */ /* Making images subtle until hover */ .img-gray-hover img, img.gray-hover, .img-gray img, img.gray { opacity:0; } .img-gray-hover-new img, img.gray-hover-new, .img-gray-new img, img.gray-new { opacity:1; -webkit-transform: translate3d(0,0,0); -webkit-filter: grayscale(30%) contrast(100%) brightness(70%); -ms-filter: grayscale(30%) contrast(100%) brightness(70%); -o-filter: grayscale(30%) contrast(100%) brightness(70%); /* filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'0.4\'/></filter><filter id=\'contrast\'><feColorMatrix type=\'contrast\' values=\'0.8\'/></filter><filter id=\'brightness\'><feColorMatrix type=\'brightness\' values=\'1.0\'/></filter></svg>#grayscale"); /* Firefox 10+ */ -webkit-transition: -webkit-filter .5s ease-in-out, opacity .5s ease-in; -moz-transition: filter .5s ease-in-out, opacity .5s ease-in; -ms-transition: -ms-filter .5s ease-in-out, opacity .5s ease-in; -o-transition: -o-filter .5s ease-in-out, opacity .5s ease-in; transition: *filter .5s ease-in-out, opacity .5s ease-in; } .img-gray-hover-new:hover img, img.gray-hover-new:hover { -webkit-filter: grayscale(0%) contrast(100%) brightness(100%); -ms-filter: grayscale(0%) contrast(100%) brightness(100%); -o-filter: grayscale(0%) contrast(100%) brightness(100%); /* filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'1.0\'/></filter><filter id=\'contrast\'><feColorMatrix type=\'contrast\' values=\'1.0\'/></filter><filter id=\'brightness\'><feColorMatrix type=\'brightness\' values=\'1.0\'/></filter></svg>#grayscale"); /* Firefox 10+ */ -webkit-transition: -webkit-filter .5s ease-in-out, opacity .5s ease-in; -moz-transition: filter .5s ease-in-out, opacity .5s ease-in; -ms-transition: -ms-filter .5s ease-in-out, opacity .5s ease-in; -o-transition: -o-filter .5s ease-in-out, opacity .5s ease-in; transition: *filter .5s ease-in-out, opacity .5s ease-in; } .img-gray-hover-old img, img.gray-hover-old, .img-gray-old img, img.gray-old { opacity:1; -webkit-transform: translate3d(0,0,0); -webkit-filter: grayscale(30%) contrast(80%) brightness(-0.1); -ms-filter: grayscale(30%) contrast(80%) brightness(-0.1); -o-filter: grayscale(30%) contrast(80%) brightness(-0.1); /* filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'0.4\'/></filter><filter id=\'contrast\'><feColorMatrix type=\'contrast\' values=\'0.8\'/></filter><filter id=\'brightness\'><feColorMatrix type=\'brightness\' values=\'1.0\'/></filter></svg>#grayscale"); /* Firefox 10+ */ -webkit-transition: -webkit-filter .5s ease-in-out, opacity .5s ease-in; -moz-transition: filter .5s ease-in-out, opacity .5s ease-in; -ms-transition: -ms-filter .5s ease-in-out, opacity .5s ease-in; -o-transition: -o-filter .5s ease-in-out, opacity .5s ease-in; transition: *filter .5s ease-in-out, opacity .5s ease-in; } .img-gray-hover-old:hover img, img.gray-hover-old:hover { -webkit-filter: grayscale(0%) contrast(100%) brightness(0); -ms-filter: grayscale(0%) contrast(100%) brightness(0); -o-filter: grayscale(0%) contrast(100%) brightness(0); /* filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'saturate\' values=\'1.0\'/></filter><filter id=\'contrast\'><feColorMatrix type=\'contrast\' values=\'1.0\'/></filter><filter id=\'brightness\'><feColorMatrix type=\'brightness\' values=\'1.0\'/></filter></svg>#grayscale"); /* Firefox 10+ */ -webkit-transition: -webkit-filter .5s ease-in-out, opacity .5s ease-in; -moz-transition: filter .5s ease-in-out, opacity .5s ease-in; -ms-transition: -ms-filter .5s ease-in-out, opacity .5s ease-in; -o-transition: -o-filter .5s ease-in-out, opacity .5s ease-in; transition: *filter .5s ease-in-out, opacity .5s ease-in; } /** HEADER ARROW -------------------------------------------------- */ a.header{ color:inherit; text-decoration:none; } .page-header .backarrow{ display:inline; } .page-header:hover .backarrow > *{ width:170px; margin-left:-30px; } .page-header .backarrow > *{ -webkit-transition: width .5s ease-in-out, margin-left .5s ease-in-out; -moz-transition: width .5s ease-in-out, margin-left .5s ease-in-out; -ms-transition: width .5s ease-in-out, margin-left .5s ease-in-out; -o-transition: width .5s ease-in-out, margin-left .5s ease-in-out; transition: width .5s ease-in-out, margin-left .5s ease-in-out; overflow:hidden; margin-left:0px; white-space:nowrap; display:inline-block; width:0px; } a.header .page-header h1 > small, a.header .page-header h1{ -webkit-transition: color .5s ease-in-out; -moz-transition: color .5s ease-in-out; -ms-transition: color .5s ease-in-out; -o-transition: color .5s ease-in-out; transition: color .5s ease-in-out; } a.header .page-header:hover h1 > small, a.header .page-header:hover h1{ color:#e8e8e8; } /* CUSTOMIZE THE NAVBAR -------------------------------------------------- */ /* Special class on .container surrounding .navbar, used for positioning it into place. */ .navbar-wrapper { position: absolute; top: 0; left: 0; right: 0; z-index: 10; margin-top: 20px; } /* Remove border and change up box shadow for more contrast */ .navbar .navbar-inner { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } /* Downsize the brand/project name a bit */ .navbar .brand { padding: 15px 20px 16px; /* Increase vertical padding to match navbar links */ font-size: 15px; font-weight: bold; text-shadow: 0 -1px 0 rgba(0,0,0,.5); } .navbar .brand span{ font-weight: normal; } /* Navbar links: put to the right */ .navbar .nav { float: right; margin-right:0px; } /* Navbar links: increase padding for taller navbar */ .navbar .nav > li > a { padding: 15px 20px; } /* Offset the responsive button for proper vertical alignment */ .navbar .btn-navbar { margin-top: 10px; } /* BUTTONS */ .btn { background-image:none; border:none; box-shadow: 0 2px 0px #E6E6E6; } .btn:hover { box-shadow:0 4px #BFBFBF; position:relative; top:-2px; } .btn:active, .btn.active { -webkit-box-shadow: inset 0 2px 0px rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 0 2px 0px rgba(0, 0, 0, 0.15); box-shadow: inset 0 2px 0px rgba(0, 0, 0, 0.15); } .btn-outline { background:rgba(25,25,25,0.1); border: solid 2px white; box-shadow:none; position:inherit; top:inherit; color:white; text-shadow:none; font-weight:600; } .btn-outline:hover { border:none; } .btn-primary { box-shadow: 0 2px 0px #04C; } .btn-primary:hover { box-shadow: 0 4px #002A80; } .btn-info { box-shadow: 0 2px 0px #2F96B4; } .btn-info:hover { box-shadow: 0 4px #1F6377; } .btn-success { box-shadow: 0 2px 0px #51A351; } .btn-success:hover { box-shadow: 0 4px #387038; } .btn-warning { box-shadow: 0 2px 0px #F89406; } .btn-warning:hover { box-shadow: 0 4px #AD6704; } .btn-danger { box-shadow: 0 2px 0px #BD362F; } .btn-danger:hover { box-shadow: 0 4px #802420; } .btn-inverse { box-shadow: 0 2px 0px #000; } .btn-inverse:hover { box-shadow: 0 4px #333; } .btn-link, .btn-link:hover, .btn-link:active{ position:inherit; top:inherit; box-shadow: none; } .btn:active { box-shadow: 0 0px; position:relative; top:2px; } /* CUSTOMIZE THE CAROUSEL -------------------------------------------------- */ /* Carousel base class */ .carousel-frontpage { margin-bottom: 60px; } .carousel-loader { background-color:#bbb; color:#ffffff; } .carousel-frontpage .container { position: relative; z-index: 9; } .carousel .carousel-control { height: 80px; margin-top: 0; font-size: 80px; text-shadow: 0 1px 1px rgba(0,0,0,.4); background-color: transparent; border: 0; } .carousel-fade .item {-webkit-transition: opacity 1.5s; -moz-transition: opacity 1.5s; -ms-transition: opacity 1.5s; -o-transition: opacity 1.5s; transition: opacity 1.5s;} .carousel-fade .active.left {left:0;opacity:0;z-index:2;} .carousel-fade .active.right {left:0;opacity:0;z-index:2;} .carousel-fade .next {left:0;opacity:1;z-index:1;} .carousel-frontpage .left { left: 5px; } .carousel-frontpage .right { right: 5px; } .carousel-frontpage, .carousel-frontpage .item, .carousel .item { height: 500px; } .carousel img.vertical-center, .carousel-frontpage img.vertical-center { min-width: 100%; max-width:100%; max-height:1000%; height: auto; } .carousel img.horisontal-center, .carousel-frontpage img.horisontal-center { min-height: 100%; width: auto; max-width:1000%; max-height:100%; } .carousel-frontpage img { position: absolute; top: 0; left: 0; } .carousel-inner > .item > img { -webkit-transition: margin-top .1s ease-in-out; /* Saf3.2+, Chrome */ -moz-transition: margin-top .1s ease-in-out; /* FF4+ */ -ms-transition: margin-top .1s ease-in-out; /* IE10? */ -o-transition: margin-top .1s ease-in-out; /* Opera 10.5+ */ transition: margin-top .1s ease-in-out; /* css 3 */ } .carousel-frontpage .carousel-caption { background-color: transparent; position: static; max-width: 550px; padding: 0 20px; margin-top: 190px; } .carousel-frontpage .carousel-caption h1, .carousel-frontpage .carousel-caption .lead { margin: 0; line-height: 1.45; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,.4); font-size:22px; } .carousel-frontpage .carousel-caption h1 a { color:inherit; text-decoration:none; } .carousel-frontpage .carousel-caption h1 { font-size: 50px; font-weight: 300; line-height: 1.25; text-shadow: 1px 1px 2px rgba(0,0,0,.2); letter-spacing: -1px; } .carousel-frontpage .carousel-caption .btn { margin-top: 10px; } .carousel-frontpage .carousel-caption .lead { font-weight:normal; } .carousel-loader .carousel-caption h1, .carousel-loader .carousel-caption .lead { text-shadow: 0px 1px 1px rgba(0,0,0,.5); } .carousel-inner > .measuring { display: block; } /* TAGS -------------------------------------------------- */ .tag { opacity: 0.4; } .tag .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; margin-top: 6px; } .tooltip { font-size: 12px; } /* MARKETING CONTENT -------------------------------------------------- */ /* Center align the text within the three columns below the carousel */ .marketing .span4 { text-align: center; } .marketing h2 { font-weight: normal; } .marketing .span4 p { margin-left: 10px; margin-right: 10px; } /* Featurettes ------------------------- */ .featurette-divider { margin: 80px 0; /* Space out the Bootstrap <hr> more */ } .featurette { padding-top: 120px; /* Vertically center images part 1: add padding above and below text. */ overflow: hidden; /* Vertically center images part 2: clear their floats. */ } .featurette-image { margin-top: -20px; /* Vertically center images part 3: negative margin up the image the same amount of the padding to center it. */ } /* Give some space on the sides of the floated elements so text doesn't run right into it. */ .featurette-image.pull-left { margin-right: 40px; } .featurette-image.pull-right { margin-left: 40px; } /* Thin out the marketing headings */ .featurette-heading { font-size: 50px; font-weight: 300; line-height: 1; letter-spacing: -1px; } /* ICONS -------------------------------------------------- */ [class^="icon-"], [class*=" icon-"] { background-image: url("/images/glyphicons-halflings.png"); } /* White icons with optional class, or on hover/active states of certain elements */ .icon-white, .nav-pills > .active > a > [class^="icon-"], .nav-pills > .active > a > [class*=" icon-"], .nav-list > .active > a > [class^="icon-"], .nav-list > .active > a > [class*=" icon-"], .navbar-inverse .nav > .active > a > [class^="icon-"], .navbar-inverse .nav > .active > a > [class*=" icon-"], .dropdown-menu > li > a:hover > [class^="icon-"], .dropdown-menu > li > a:hover > [class*=" icon-"], .dropdown-menu > .active > a > [class^="icon-"], .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"] { background-image: url("/images/glyphicons-halflings-white.png"); } /* RESPONSIVE CSS -------------------------------------------------- */ @media (max-width: 979px) { /* Navbar links: put to the right */ .navbar .nav { float: left; margin-right:0px; width: 100%; } .container .navbar-wrapper { margin-bottom:0; width: auto; } .navbar-inner { border-radius: 0; margin: -20px 0; } .carousel-frontpage, .carousel-frontpage .item, .carousel .item { height: 500px; } .carousel img, .carousel-frontpage img { overflow:hide; } .featurette { height: auto; padding: 0; } .featurette-image.pull-left, .featurette-image.pull-right { display: block; float: none; max-width: 40%; margin: 0 auto 20px; } } @media (max-width: 767px) { .navbar-inner { margin: -20px; } .carousel-frontpage { margin-left: -20px; margin-right: -20px; } .carousel-frontpage .container { } .carousel-frontpage, .carousel-frontpage .item, .carousel .item { height: 300px; } .carousel-frontpage .carousel-caption { width: 100%; padding: 0 18px; margin-top: 90px; } .carousel-frontpage .carousel-caption h1 { font-size: 24px; font-weight: normal; letter-spacing: 0px; } .carousel-frontpage .carousel-caption lead { font-size: 24px; } .carousel-frontpage .carousel-caption .materials { font-size: 14px; margin: 10px 0; } .marketing .span4 + .span4 { margin-top: 40px; } .featurette-heading { font-size: 30px; } .featurette .lead { font-size: 18px; line-height: 1.5; } } @media print { body { margin:40pt 40pt 40pt 40pt; } .navbar { display:none; } }
olekristensen/stacey
public/docs/css/main.css
CSS
mit
15,517
# coding: utf-8 # In[1]: def loadNiftiDTI(basedir, basename='dti', reorient=False): from nibabel import nifti1 # ====== MAIN FUNCTION START =========================== # PRE-LOAD THE FIRST EIGENVALUE VOLUME TO GET HEADER PARAMS L = ni.load('{}/{}_L1.nii.gz'.format(basedir, basename)) s,m,n = L.get_data().shape # LOAD AND BUILD EIGENVALUES VOLUME evl = [L.get_data()] evl.append(ni.load('{}/{}_L2.nii.gz'.format(basedir, basename)).get_data()) evl.append(ni.load('{}/{}_L3.nii.gz'.format(basedir, basename)).get_data()) evl = np.array(evl) evl[evl<0] = 0 # LOAD AND BUILD EIGENVECTORS VOLUME evt = [ni.load('{}/{}_V1.nii.gz'.format(basedir, basename)).get_data()] evt.append(ni.load('{}/{}_V2.nii.gz'.format(basedir, basename)).get_data()) evt.append(ni.load('{}/{}_V3.nii.gz'.format(basedir, basename)).get_data()) evt = np.array(evt).transpose(0,4,1,2,3) T = np.diag(np.ones(4)) if reorient: # GET QFORM AFFINE MATRIX (see Nifti and nibabel specifications) T = L.get_header().get_qform() # COMPUTE ROTATION MATRIX TO ALIGN SAGITTAL PLANE R = alignSagittalPlane(T) evl, evt, T = rotateDTI(evl, evt, R) return (evl, evt, T) # In[ ]:
mariecpereira/IA369Z
deliver/functions_will/loadNiftiDTI.py
Python
mit
1,265
--- id: 125 title: Afficher les sites suivis dans le bandeau avec KnockoutJS– 3 date: 2014-07-03T05:54:08+00:00 author: Ghislain layout: post guid: http://ghislainfo.wordpress.com/?p=125 permalink: /2014/07/03/knockoutjs-rest-sp2013/ geo_public: - 0 publicize_linkedin_url: - 'http://www.linkedin.com/updates?discuss=&scope=155989633&stype=M&topic=5890326400413499392&type=U&a=s6Pj' categories: - JavaScript tags: - JSOM - KnockoutJS - REST - SharePoint 2013 --- J’avais envie de découvrir KnockoutJS (KO) et coder la même fonctionnalité m’a paru être un bon exercice pratique. Première différence : comme KO préfère le JSON, j’ai fait appel aux fonctionnalités de suivi avec des appels REST plutôt que par le ClientContext. Deuxième différence : l’utilisation de MVVM (Modèle-Vue-VueModèle) propose un confort certains à la lecture et la maintenance du code. Dans ce cadre d’utilisation et vu mes connaissances, KO m’a bien plu. Simple à appréhender, il permet d’avoir un code plus propre sans trop d’effort. Le nombre de ligne est sensiblement le même mais comme c’est plus lisible et maintenable, on gagne à l’utiliser. **Astuce :** Lorsque l’on utilise la méthode POST dans une page SharePoint, il faut penser à passer le formDigest au risque d’avoir pour réponse : _**&lsquo;**_**_The security validation for this page is invalid&nbsp;&raquo;_** <pre class="brush: jscript; light: true; title: ; notranslate" title="">var formDigest = $(&quot;[name='__REQUESTDIGEST']&quot;).val(); $.ajax({ headers: { &quot;X-RequestDigest&quot;: formDigest },</pre> Les lignes nécessaires sont surlignées dans le code JavaScript. <pre class="brush: xml; title: HTML; notranslate" title="HTML">&lt;ul class=&quot;ms-core-menu-list&quot; id=&quot;custom-sites-menu&quot;&gt;     &lt;LI&gt;         &lt;DIV class=&quot;subcontainer&quot; data-bind=&quot;foreach: sites&quot;&gt;             &lt;DIV data-bind=&quot;attr: { id: CleanId }&quot;&gt;                 &lt;SPAN class=ms-core-menu-link&gt;                     &lt;A data-bind=&quot;attr: { href: Uri }&quot;&gt;&lt;span data-bind=&quot;text: Name&quot;&gt;&lt;/span&gt;&lt;/A&gt;                     &lt;A data-bind=&quot;click: $root.removeFollowedSite&quot; &gt;                         &lt;IMG src=&quot;/_layouts/15/images/CAA.RSE.Communities/UnfollowWhite.png&quot; width=20 height=20&gt;                     &lt;/A&gt;                 &lt;/SPAN&gt;             &lt;/DIV&gt;         &lt;/DIV&gt;     &lt;/LI&gt;     &lt;LI class=clear&gt;         &lt;a class=&quot;ms-core-menu-link footer&quot; data-bind=&quot;attr: { href: personnalSite}&quot;&gt;             Ma page de suivi         &lt;/a&gt;     &lt;/LI&gt; &lt;/ul&gt; &lt;script type='text/javascript' src='/_layouts/15/CAA.RSE.Communities/js/knockout-3.1.0.js'&gt;&lt;/script&gt; &lt;script src=&quot;/_layouts/15/CAA.RSE.Communities/js/gla-followedsites-ko.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;link href=&quot;/_layouts/15/CAA.RSE.Communities/css/gla-followedsites.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;</pre> <pre class="brush: jscript; highlight: [4,8]; title: JavaScript; notranslate" title="JavaScript">// AJAX - Post data to stop following a site function stopFollowingSite(siteUrl, cleanSiteId) {     var stopFollowingUrl = &quot;http://sps2013/sites/test/_api/social.following/stopfollowing(ActorType=2,ContentUri=@v,Id=null)?@v='&quot;+ siteUrl + &quot;'&quot;     var formDigest = $(&quot;[name='__REQUESTDIGEST']&quot;).val();     $.ajax({         url: stopFollowingUrl,         type: &quot;POST&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot;, &quot;X-RequestDigest&quot;: formDigest },         success: function(data){},         error: function (xhr, ajaxOptions, thrownError) {             alert(xhr.status + &quot; : &quot; + thrownError);             //alert(xhr.responseText);         }     }); } // wrapper function FollowedSite(data) {     this.Name = ko.observable(data.Name);     this.Uri = ko.observable(data.Uri);     this.CleanId = ko.computed(function() {return data.Id.split(&quot;.&quot;).join(&quot;&quot;);}, this); } function TaskListViewModel() {     // Data     var self = this;     self.sites = ko.observableArray([]);     self.personnalSite = ko.observable();     self.removeFollowedSite = function(site) {         stopFollowingSite(site.Uri(), site.CleanId());         self.sites.remove(site)     };     // AJAX - Get all sites the current user is following     var requestFollowedUri = _spPageContextInfo.webAbsoluteUrl + &quot;/_api/social.following/my/followed(types=4)&quot;;     $.ajax({         url: requestFollowedUri,         type: &quot;GET&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot; },         success: function(data){             var mappedFollowedSites = $.map(data.d.Followed.results, function(item) { return new FollowedSite(item) });             self.sites(mappedFollowedSites);         },         error: function(){alert(&quot;Failed to get followed sites.&quot;);         }     });     // AJAX - Get current user's personnal site     var requestFollowedSiteUri = _spPageContextInfo.webAbsoluteUrl + &quot;/_api/social.following/my/followedsitesuri&quot;;     $.ajax({         url: requestFollowedSiteUri,         type: &quot;GET&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot; },         success: function(data){self.personnalSite(data.d.FollowedSitesUri);},         error: function(){alert(&quot;Failed to get personnel site.&quot;);         }     }); } ko.applyBindings(new TaskListViewModel()); jQuery(document).ready(function () {     //add link in SuiteLink     var navU = jQuery(&quot;#suiteLinksBox &gt; ul.ms-core-suiteLinkList&quot;);     var addNode = jQuery(&quot;&lt;a id='Suite_CustomSites_ShellAddNew' href='#' class='ms-core-suiteLink-a' /&gt;&quot;)     .append(jQuery(&quot;&lt;span/&gt;&quot;)         .text(&quot;Communaut351s&quot;)         .append(jQuery(&quot;&lt;span class='ms-suitenav-downarrowBox'/&gt;&quot;)                 .append(jQuery(&quot;&lt;img class='ms-suitenav-downarrowIcon' src='/_layouts/15/images/spcommon.png?rev=23' /&gt;&quot;))         )     );     // retrieve KO generated menu     var menu = jQuery(&quot;#custom-sites-menu&quot;);          newLi = jQuery(&quot;&lt;li/&gt;&quot;).attr(&quot;class&quot;, &quot;ms-core-suiteLink&quot;)         .append(addNode)         .append(menu);     navU.prepend(newLi); });</pre> **Références:** [Afficher les sites suivis dans le bandeau](http://ghislainfo.wordpress.com/2014/06/02/afficher-les-sites-suivis-dans-le-bandeau/ "Afficher les sites suivis dans le bandeau") [Afficher les sites suivis dans le bandeau &#8211; 2](http://ghislainfo.wordpress.com/2014/06/09/afficher-les-sites-suivis-dans-le-bandeau-2/ "Afficher les sites suivis dans le bandeau – 2") [J’avais envie de découvrir KnockoutJS (KO) et coder la même fonctionnalité m’a paru être un bon exercice pratique. Première différence : comme KO préfère le JSON, j’ai fait appel aux fonctionnalités de suivi avec des appels REST plutôt que par le ClientContext. Deuxième différence : l’utilisation de MVVM (Modèle-Vue-VueModèle) propose un confort certains à la lecture et la maintenance du code. Dans ce cadre d’utilisation et vu mes connaissances, KO m’a bien plu. Simple à appréhender, il permet d’avoir un code plus propre sans trop d’effort. Le nombre de ligne est sensiblement le même mais comme c’est plus lisible et maintenable, on gagne à l’utiliser. **Astuce :** Lorsque l’on utilise la méthode POST dans une page SharePoint, il faut penser à passer le formDigest au risque d’avoir pour réponse : _**&lsquo;**_**_The security validation for this page is invalid&nbsp;&raquo;_** <pre class="brush: jscript; light: true; title: ; notranslate" title="">var formDigest = $(&quot;[name='__REQUESTDIGEST']&quot;).val(); $.ajax({ headers: { &quot;X-RequestDigest&quot;: formDigest },</pre> Les lignes nécessaires sont surlignées dans le code JavaScript. <pre class="brush: xml; title: HTML; notranslate" title="HTML">&lt;ul class=&quot;ms-core-menu-list&quot; id=&quot;custom-sites-menu&quot;&gt;     &lt;LI&gt;         &lt;DIV class=&quot;subcontainer&quot; data-bind=&quot;foreach: sites&quot;&gt;             &lt;DIV data-bind=&quot;attr: { id: CleanId }&quot;&gt;                 &lt;SPAN class=ms-core-menu-link&gt;                     &lt;A data-bind=&quot;attr: { href: Uri }&quot;&gt;&lt;span data-bind=&quot;text: Name&quot;&gt;&lt;/span&gt;&lt;/A&gt;                     &lt;A data-bind=&quot;click: $root.removeFollowedSite&quot; &gt;                         &lt;IMG src=&quot;/_layouts/15/images/CAA.RSE.Communities/UnfollowWhite.png&quot; width=20 height=20&gt;                     &lt;/A&gt;                 &lt;/SPAN&gt;             &lt;/DIV&gt;         &lt;/DIV&gt;     &lt;/LI&gt;     &lt;LI class=clear&gt;         &lt;a class=&quot;ms-core-menu-link footer&quot; data-bind=&quot;attr: { href: personnalSite}&quot;&gt;             Ma page de suivi         &lt;/a&gt;     &lt;/LI&gt; &lt;/ul&gt; &lt;script type='text/javascript' src='/_layouts/15/CAA.RSE.Communities/js/knockout-3.1.0.js'&gt;&lt;/script&gt; &lt;script src=&quot;/_layouts/15/CAA.RSE.Communities/js/gla-followedsites-ko.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;link href=&quot;/_layouts/15/CAA.RSE.Communities/css/gla-followedsites.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;</pre> <pre class="brush: jscript; highlight: [4,8]; title: JavaScript; notranslate" title="JavaScript">// AJAX - Post data to stop following a site function stopFollowingSite(siteUrl, cleanSiteId) {     var stopFollowingUrl = &quot;http://sps2013/sites/test/_api/social.following/stopfollowing(ActorType=2,ContentUri=@v,Id=null)?@v='&quot;+ siteUrl + &quot;'&quot;     var formDigest = $(&quot;[name='__REQUESTDIGEST']&quot;).val();     $.ajax({         url: stopFollowingUrl,         type: &quot;POST&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot;, &quot;X-RequestDigest&quot;: formDigest },         success: function(data){},         error: function (xhr, ajaxOptions, thrownError) {             alert(xhr.status + &quot; : &quot; + thrownError);             //alert(xhr.responseText);         }     }); } // wrapper function FollowedSite(data) {     this.Name = ko.observable(data.Name);     this.Uri = ko.observable(data.Uri);     this.CleanId = ko.computed(function() {return data.Id.split(&quot;.&quot;).join(&quot;&quot;);}, this); } function TaskListViewModel() {     // Data     var self = this;     self.sites = ko.observableArray([]);     self.personnalSite = ko.observable();     self.removeFollowedSite = function(site) {         stopFollowingSite(site.Uri(), site.CleanId());         self.sites.remove(site)     };     // AJAX - Get all sites the current user is following     var requestFollowedUri = _spPageContextInfo.webAbsoluteUrl + &quot;/_api/social.following/my/followed(types=4)&quot;;     $.ajax({         url: requestFollowedUri,         type: &quot;GET&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot; },         success: function(data){             var mappedFollowedSites = $.map(data.d.Followed.results, function(item) { return new FollowedSite(item) });             self.sites(mappedFollowedSites);         },         error: function(){alert(&quot;Failed to get followed sites.&quot;);         }     });     // AJAX - Get current user's personnal site     var requestFollowedSiteUri = _spPageContextInfo.webAbsoluteUrl + &quot;/_api/social.following/my/followedsitesuri&quot;;     $.ajax({         url: requestFollowedSiteUri,         type: &quot;GET&quot;,         headers: { &quot;ACCEPT&quot;: &quot;application/json;odata=verbose&quot; },         success: function(data){self.personnalSite(data.d.FollowedSitesUri);},         error: function(){alert(&quot;Failed to get personnel site.&quot;);         }     }); } ko.applyBindings(new TaskListViewModel()); jQuery(document).ready(function () {     //add link in SuiteLink     var navU = jQuery(&quot;#suiteLinksBox &gt; ul.ms-core-suiteLinkList&quot;);     var addNode = jQuery(&quot;&lt;a id='Suite_CustomSites_ShellAddNew' href='#' class='ms-core-suiteLink-a' /&gt;&quot;)     .append(jQuery(&quot;&lt;span/&gt;&quot;)         .text(&quot;Communaut351s&quot;)         .append(jQuery(&quot;&lt;span class='ms-suitenav-downarrowBox'/&gt;&quot;)                 .append(jQuery(&quot;&lt;img class='ms-suitenav-downarrowIcon' src='/_layouts/15/images/spcommon.png?rev=23' /&gt;&quot;))         )     );     // retrieve KO generated menu     var menu = jQuery(&quot;#custom-sites-menu&quot;);          newLi = jQuery(&quot;&lt;li/&gt;&quot;).attr(&quot;class&quot;, &quot;ms-core-suiteLink&quot;)         .append(addNode)         .append(menu);     navU.prepend(newLi); });</pre> **Références:** [Afficher les sites suivis dans le bandeau](http://ghislainfo.wordpress.com/2014/06/02/afficher-les-sites-suivis-dans-le-bandeau/ "Afficher les sites suivis dans le bandeau") [Afficher les sites suivis dans le bandeau &#8211; 2](http://ghislainfo.wordpress.com/2014/06/09/afficher-les-sites-suivis-dans-le-bandeau-2/ "Afficher les sites suivis dans le bandeau – 2") ](http://msdn.microsoft.com/fr-fr/library/office/dn194080%28v=office.15%29.aspx) [KnockoutJS](http://knockoutjs.com/) [Découvrir KnockoutJS](http://learn.knockoutjs.com)
GhislainL/ghislainl.github.io
_posts/2014-07-03-knockoutjs-rest-sp2013.md
Markdown
mit
14,589
--- title: "Bulunduğun yeri Finder'da aç" date: Sep 29, 2009 00:13 tags: osx external_url: http://osx.gelistiriciyiz.biz/2009/09/29/bulundugun-yeri-finderda-ac/ ---
gelistiriciyiz-biz/gelistiriciyiz.biz
source/posts/2009-09-29-bulundugun-yeri-finderda-ac.md
Markdown
mit
167
--- layout: page title: Anna Novak's 58th Birthday date: 2016-05-24 author: Howard Atkinson tags: weekly links, java status: published summary: Nulla maximus ligula vitae pulvinar facilisis. Aliquam egestas. banner: images/banner/leisure-02.jpg booking: startDate: 05/14/2019 endDate: 05/15/2019 ctyhocn: DAYHHHX groupCode: AN5B published: true --- Quisque tempor orci a odio convallis bibendum. Suspendisse et risus vitae urna congue rhoncus. Quisque lorem tellus, sollicitudin vel sem sit amet, consequat congue massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur pellentesque, eros in molestie tempus, ipsum nisl sagittis felis, vel malesuada tortor risus nec risus. Pellentesque pretium at quam at euismod. Aenean sed faucibus nisl, molestie aliquam nisi. Ut dolor justo, elementum vitae bibendum in, ultrices a sapien. Praesent mattis ligula magna, vel convallis libero sagittis eu. Sed euismod lorem aliquam, congue orci nec, sagittis odio. Pellentesque vel leo quis leo auctor scelerisque quis at augue. Phasellus vitae neque velit. * Vivamus et massa vitae nibh laoreet tincidunt sit amet et nisi. Vivamus velit tortor, vestibulum iaculis imperdiet quis, volutpat sed leo. Donec in eleifend ex. Aenean ac volutpat sapien. Vivamus justo lacus, rhoncus id sollicitudin eget, vulputate in erat. Vivamus id imperdiet arcu, ut imperdiet felis. Donec mollis dignissim orci in fermentum. Nulla elit augue, euismod id varius quis, imperdiet efficitur orci. Maecenas arcu risus, fringilla ut neque at, imperdiet convallis sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce vehicula nibh sit amet tristique convallis. Proin id quam a velit pellentesque lacinia sed tristique lacus. Aliquam ultrices lacinia est vitae sodales. Proin vel mollis mauris. Pellentesque tortor mi, lacinia vel libero eu, luctus tincidunt nulla. Praesent viverra turpis id imperdiet feugiat. Nunc interdum augue a ligula convallis, ac finibus erat convallis. Suspendisse quis mi non nibh tincidunt pellentesque vitae id massa. Etiam nec rhoncus lacus, ultrices consectetur lectus. Nullam in fringilla diam. Mauris a nunc dignissim, semper velit quis, facilisis velit. Donec viverra justo eu est dapibus rutrum. Aliquam lacinia tellus sem, eu sodales lectus efficitur mollis. In ultricies sem eu velit suscipit, ut vulputate nibh porttitor. Pellentesque vel metus lacinia lectus viverra vehicula sed at sem. Fusce ultricies vestibulum nisl vel pulvinar. In ac nibh varius odio feugiat semper.
KlishGroup/prose-pogs
pogs/D/DAYHHHX/AN5B/index.md
Markdown
mit
2,587
--- layout: page title: Peak Media Trade Fair date: 2016-05-24 author: Victoria Weber tags: weekly links, java status: published summary: Phasellus malesuada quam non nunc sagittis. banner: images/banner/leisure-02.jpg booking: startDate: 03/01/2017 endDate: 03/04/2017 ctyhocn: MOBATHX groupCode: PMTF published: true --- Aenean malesuada risus nec diam egestas tincidunt. Sed sed magna justo. Etiam rhoncus porttitor turpis eget commodo. Morbi non euismod nisi, ac venenatis nibh. Etiam eu porta magna. Aliquam faucibus at nibh non porta. Morbi magna lacus, commodo at malesuada non, rutrum sit amet dolor. Aenean ac enim id dolor tempor rhoncus sit amet eget tortor. Vivamus nisl augue, mattis sit amet velit sit amet, venenatis sollicitudin tortor. Quisque tincidunt feugiat mi eget pharetra. Praesent sit amet urna ultricies turpis ultricies rutrum. Nam mi lacus, imperdiet et nisl non, dictum consectetur erat. Fusce sed orci lacus. Curabitur et egestas odio, vel molestie arcu. Sed congue non lacus et bibendum. Phasellus facilisis urna sed lorem bibendum placerat. * Proin lobortis diam et lectus ultrices posuere. Pellentesque posuere massa porttitor eros tincidunt tempus. Donec dictum, mauris non maximus dictum, diam nibh laoreet lectus, nec tincidunt eros magna a leo. Sed hendrerit, ligula ut elementum sollicitudin, justo nulla scelerisque arcu, vel suscipit eros mi vel sem. Aenean tincidunt libero ipsum, nec sagittis quam commodo non. Etiam facilisis in tellus tempor elementum. Donec nec nulla interdum justo ultricies blandit sit amet in lacus. Nunc non tortor at risus laoreet laoreet at vitae nisi. Donec ultrices ultrices purus at viverra. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam et venenatis tortor. Morbi sed lorem et lacus ullamcorper vestibulum. In hac habitasse platea dictumst. Etiam pretium iaculis est at consectetur. Nam accumsan, diam pellentesque imperdiet cursus, lacus ante porttitor sapien, id ultricies leo ex quis nunc. Curabitur id accumsan libero. Vivamus nec nisi molestie, imperdiet velit molestie, ullamcorper est. Quisque condimentum lectus a sapien fermentum finibus. Morbi nec ex justo. Mauris ac orci eu neque pulvinar tincidunt. Aliquam aliquam sollicitudin quam ut sagittis. Vivamus tristique, turpis sit amet interdum venenatis, nulla nisl venenatis urna, eu ultrices turpis magna eu libero. Nam vitae justo eleifend mi maximus ornare. Suspendisse a orci libero. Curabitur scelerisque pharetra ipsum sit amet ultrices. Aliquam at mattis ligula. Vivamus ullamcorper ante quis dictum dignissim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque scelerisque posuere diam id consequat. In vitae elit vitae lacus tempor scelerisque. Vestibulum id nisi interdum, malesuada nibh id, pharetra velit. Nam urna erat, luctus ut sapien id, condimentum porta sapien.
KlishGroup/prose-pogs
pogs/M/MOBATHX/PMTF/index.md
Markdown
mit
2,926
docker run -p 80:80 -v /Users/kenta/schemane/www:/var/www/html --name php -d php:custom
yasiki/schemane
docker/docker_run_phpcustom.sh
Shell
mit
88
/** * Required modules. */ var FS = require('fs-extra'); var PATH = require('path'); var chokidar = require('chokidar'); var glob = require('glob'); var Walker = require("walker"); var filesize = require("filesize"); /** * The default export is just a shorthand for `fs.enableForwardSlashes()` */ var fs = module.exports = function ( ) { return fs.enableForwardSlashes(); }; /** * Shallow clone of `fs-extra` to `efe` */ Object.keys(FS).forEach( function ( key ) { fs[key] = FS[key]; } ); /** * Expose version of `efe`. */ fs.VERSION = require('./package.json').version; /** * Ensures forward slashes are used on Windows. */ var normalize = PATH.normalize; var resolve = PATH.resolve; fs.enableForwardSlashes = function ( ) { if ( PATH.sep === '\\' ) { fs.normalize = PATH.normalize = function ( ) { return normalize.apply(PATH, arguments).replace('\\', '/'); }; fs.resolve = PATH.resolve = function ( ) { return resolve.apply(PATH, arguments).replace('\\', '/'); }; } return fs; }; fs.disableForwardSlashes = function ( ) { fs.normalize = PATH.normalize = normalize; fs.resolve = PATH.resolve = resolve; return fs; }; fs.resetNormalize = fs.disableForwardSlashes; /** * Remove `deprecated` warning when using `fs.exists(Sync)`. */ if ( fs.access && fs.accessSync ) { fs.exists = function ( path, callback ) { fs.access(path, fs.F_OK, function(err){ if ( err ) throw err; callback(err ? null : true); }); }; fs.existsSync = function ( path ) { return fs.accessSync(path, fs.F_OK) ? false : true; }; } /** * Attach methods from other modules to `efe`. */ fs.normalize = PATH.normalize; fs.resolve = PATH.resolve; fs.join = PATH.join; fs.isAbsolute = PATH.isAbsolute; fs.relative = PATH.relative; fs.dirname = PATH.dirname; fs.basename = PATH.basename; fs.extname = PATH.extname; fs.sep = PATH.sep; fs.delimiter = PATH.delimiter; fs.parse = PATH.parse; fs.format = PATH.format; fs.Watcher = chokidar.FSWatcher; fs.watch = chokidar.watch; fs.hasMagic = glob.hasMagic; fs.glob = glob; fs.globSync = glob.sync; fs.Glob = glob.Glob; fs.writeFile = FS.outputFile; fs.writeFileSync = FS.outputFileSync; fs.Walker = Walker; /** * Update the `stats` object returned by methods using `fs.Stats`. */ function modifyStatsObject ( stats, path ) { stats.path = path; stats.basename = fs.basename(path); stats.dirname = fs.dirname(path); stats.extname = fs.extname(path); return stats; } ["stat", "lstat", "fstat"].forEach(function(method){ fs[method] = function ( path, callback ) { FS[method](path, function(err, stats){ callback(err, stats ? modifyStatsObject(stats, path) : stats); }); }; fs[method + 'Sync'] = function ( path ) { return modifyStatsObject(FS[method + 'Sync'](path), path); }; }); /** * Walk the directory tree, firing `callback` on every item that's not a directory. * * @param {String} path * @param {Function} callback */ fs.walk = function ( path, callback ) { fs.lstat(path, function(err, stats){ if ( err ) { callback(err); } else { if ( stats.isDirectory() ) { fs.readdir(path, function(err, items){ if ( err ) { callback(err); } else { items.forEach(function(item){ fs.walk(fs.join(path, item), callback); }); } }); } else { callback(null, path, stats); } } }); }; fs.walkSync = function ( path, callback ) { var stats = fs.lstatSync(path); if ( stats.isDirectory() ) fs.readdirSync(path).forEach(function(item){ fs.walkSync(fs.join(path, item), callback); }); else callback(path, stats); }; /** * Check if the given path is of a specific type. * * Passing a callback will turn these methods into Async's, * but if there's no callback, these are just sync methods. * * @param {String} path * @param {Function} callback (optional) * @return {Boolean|Null} */ [ "isFile", "isDirectory", "isBlockDevice", "isCharacterDevice", "isSymbolicLink", "isFIFO", "isSocket" ].forEach(function(method){ fs[method] = function ( path, callback ) { if ( arguments.length === 1 ) { return FS.lstatSync(path)[method](); } FS.lstat(path, function(err, stats){ if ( err ) throw err; callback(stats ? stats[method]() : false); }); }; fs[method + 'Sync'] = function ( path ) { return FS.lstatSync(path)[method](); }; }); /** * Some aliases for path checking methods. */ fs.isBlock = fs.isBlockDevice; fs.isBlockSync = fs.isBlockDeviceSync; fs.isCharacter = fs.isCharacterDevice; fs.isCharacterSync = fs.isCharacterDeviceSync; fs.isSymbolic = fs.isSymbolicLink; fs.isSymbolicSync = fs.isSymbolicLinkSync; fs.isLink = fs.isSymbolicLink; fs.isLinkSync = fs.isSymbolicLinkSync; /** * Return total size of the given path. * * @param {String} path * @param {Object} options (optional) * @param {Function} callback (optional) * @return {Number|Null} */ fs.size = function ( path, options, callback ) { if ( arguments.length === 2 ) { if ( typeof options === 'function' ) { callback = options; options = null; } } if ( typeof callback === 'function' ) { var size = 0; Walker(path) .on('entry', function(entry, stat){ size += stat.size; }) .on('error', function(er, entry, stat){ callback(er, size, entry, stat); }) .on('end', function(){ if ( size && options ) { size = filesize(size, options); } callback(null, size); }); } else { return fs.sizeSync(path, options); } }; fs.sizeSync = function ( path, options ) { var size = 0; if ( fs.isDirectory(path) ) { fs.walkSync(path, function(path, stats){ size += stats.size; }); } else { size = FS.lstatSync(path).size; } return options ? filesize(size, options) : size; };
futagoza/efe
index.js
JavaScript
mit
6,000
<?php /** * Created by PhpStorm. * User: Sinri * Date: 2017/7/20 * Time: 12:00 */ require_once __DIR__ . '/../../vendor/autoload.php'; require_once __DIR__ . '/../../autoload.php'; $host = ''; $password = ''; $port = 6379; $database = 255; if (file_exists(__DIR__ . '/redis_config.php')) { require __DIR__ . '/redis_config.php'; } $key = __METHOD__; $queue = new \sinri\enoch\service\RedisQueue($key, $host, $port, $database, $password); echo "clean ..." . PHP_EOL; $done = $queue->deleteQueue(); var_dump($done); $item = new \sinri\enoch\service\RedisQueueItem(["name" => 'Ein']); echo "push " . json_encode($item) . PHP_EOL; $index = $queue->addToQueueTail($item); $item->setQueueItemIndex($index); var_dump($index); $item = new \sinri\enoch\service\RedisQueueItem(["name" => 'Zwie']); echo "push " . json_encode($item) . PHP_EOL; $index = $queue->addToQueueTail($item); $item->setQueueItemIndex($index); var_dump($index); echo "pop one" . PHP_EOL; $item = $queue->takeFromQueueHead(); if ($item) { $item->handle(); echo PHP_EOL; } else { echo "item is not available" . PHP_EOL; } echo "LENGTH=" . $queue->queueLength() . PHP_EOL; for ($i = 0; $i < 3; $i++) { echo "index at " . $i . PHP_EOL; $item = $queue->objectAtIndex($i); if ($item) { echo "view object at " . $item->getQueueItemIndex() . " : " . $item->getQueueItemData() . PHP_EOL; } else { echo "item is not available" . PHP_EOL; } } echo "pop one" . PHP_EOL; $item = $queue->takeFromQueueHead(); if ($item) { $item->handle(); echo PHP_EOL; } else { echo "item is not available" . PHP_EOL; }
sinri/enoch
test/queue/redis_queue_test.php
PHP
mit
1,635
#!/usr/bin/env python # -*- coding: UTF-8 -*- # """oclubs Forms.""" from __future__ import absolute_import from oclubs.forms import classroom_forms from oclubs.forms import reservation_forms __all__ = ['classroom_forms', 'reservation_forms']
SHSIDers/oclubs
oclubs/forms/__init__.py
Python
mit
246
export class Class12 { anotherInstanceProp1: string; anotherInstanceProp2: boolean; newDivNode: HTMLElement | null; constructor() { this.anotherInstanceProp1 = "Class 12 / Module 1"; this.anotherInstanceProp2 = true; this.newDivNode = document.getElementById("newDivNode"); // this.newNodeMethod is not a function if (this.newDivNode) { this.newDivNode.innerHTML = this.anotherInstanceProp1; } else { console.warn("No new node available - constructor") } } newNodeMethod() { if (this.newDivNode) { this.newDivNode.innerHTML = this.anotherInstanceProp1; } else { console.warn("No new node available - method"); } } }
enanox/awful-typescript-library-agnostic-webpack-poc
module1/class12.ts
TypeScript
mit
777
/*Owner & Copyrights: Vance King Saxbe. A.*//*Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @[email protected]. Development teams from Power Dominion Enterprise, Precieux Consulting. Project sponsored by GoldSax Foundation, GoldSax Group and executed by GoldSax Manager.*/ /* $quote = file_get_contents('http://finance.google.co.uk/finance/info?client=ig&q=NASDAQ:SNDK'); $avgp = "66.25"; $high = "67.99"; $low = "66.14"; $json = str_replace("\n", "", $quote); $data = substr($json, 4, strlen($json) -5); $json_output = json_decode($data, true); echo "&L=".$json_output['l']."&N=SNDK&"; $temp = file_get_contents("SNDKTEMP.txt", "r"); */ $json_output['l'] = file_get_contents('SNDKLAST.txt'); $avgp = "66.25"; $high = "67.99"; $low = "66.14"; echo "&L=".$json_output['l']."&N=SNDK&"; $temp = file_get_contents("SNDKTEMP.txt", "r"); if ($json_output['l'] != $temp ) { $mhigh = ($avgp + $high)/2; $mlow = ($avgp + $low)/2; $llow = ($low - (($avgp - $low)/2)); $hhigh = ($high + (($high - $avgp)/2)); $diff = $json_output['l'] - $temp; $diff = number_format($diff, 2, '.', ''); $avgp = number_format($avgp, 2, '.', ''); if ( $json_output['l'] > $temp ) { if ( ($json_output['l'] > $mhigh ) && ($json_output['l'] < $high)) { echo "&sign=au" ; } if ( ($json_output['l'] < $mlow ) && ($json_output['l'] > $low)) { echo "&sign=ad" ; } if ( $json_output['l'] < $llow ) { echo "&sign=as" ; } if ( $json_output['l'] > $hhigh ) { echo "&sign=al" ; } if ( ($json_output['l'] < $hhigh) && ($json_output['l'] > $high)) { echo "&sign=auu" ; } if ( ($json_output['l'] > $llow) && ($json_output['l'] < $low)) { echo "&sign=add" ; } //else { echo "&sign=a" ; } $filedish = fopen("C:\wamp\www\malert.txt", "a+"); $write = fputs($filedish, "SanDisk:".$json_output['l']. ":Moving up:".$diff.":".$high.":".$low.":".$avgp."\r\n"); fclose( $filedish );} if ( $json_output['l'] < $temp ) { if ( ($json_output['l'] >$mhigh) && ($json_output['l'] < $high)) { echo "&sign=bu" ; } if ( ($json_output['l'] < $mlow) && ($json_output['l'] > $low)) { echo "&sign=bd" ; } if ( $json_output['l'] < $llow ) { echo "&sign=bs" ; } if ( $json_output['l'] > $hhigh ) { echo "&sign=bl" ; } if ( ($json_output['l'] < $hhigh) && ($json_output['l'] > $high)) { echo "&sign=buu" ; } if ( ($json_output['l'] > $llow) && ($json_output['l'] < $low)) { echo "&sign=bdd" ; } // else { echo "&sign=b" ; } $filedish = fopen("C:\wamp\www\malert.txt", "a+"); $write = fputs($filedish, "SanDisk:".$json_output['l']. ":Moving down:".$diff.":".$high.":".$low.":".$avgp."\r\n"); fclose( $filedish );} $my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $index = file_get_contents("SNP500LAST.txt"); $time = date('h:i:s',$new_time); $filename= 'SNDK.txt'; $file = fopen($filename, "a+" ); fwrite( $file, $json_output['l'].":".$index.":".$time."\r\n" ); fclose( $file ); if (($json_output['l'] > $mhigh ) && ($temp<= $mhigh )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $risk = ($json_output['l'] - $low) * (200000/$json_output['l']); $risk = (int)$risk; $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Approaching:PHIGH:".$high.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $mhigh ) && ($temp>= $mhigh )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($high - $json_output['l']) * (200000/$json_output['l']); $risk = (int)$risk; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Moving Down:PHIGH:".$high.":short Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $mlow ) && ($temp<= $mlow )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $risk = ($json_output['l'] - $low) * (200000/$json_output['l']); $risk = (int)$risk; $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Moving Up:PLOW:".$low.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $mlow ) && ($temp>= $mlow )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($high - $json_output['l']) * (200000/$json_output['l']); $risk = (int)$risk; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Approaching:PLOW:".$low.":short Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $high ) && ($temp<= $high )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $risk = ($json_output['l'] - $low) * (200000/$json_output['l']); $risk = (int)$risk; $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Breaking:PHIGH:".$high.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $hhigh ) && ($temp<= $hhigh )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $risk = ($json_output['l'] - $low) * (200000/$json_output['l']); $risk = (int)$risk; $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Moving Beyond:PHIGH:".$high.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $hhigh ) && ($temp>= $hhigh )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l']. ":Coming near:PHIGH:".$high.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $high ) && ($temp>= $high )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l']. ":Retracing:PHIGH:".$high."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $llow ) && ($temp>= $llow )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($high - $json_output['l']) * (200000/$json_output['l']); $risk = (int)$risk; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Breaking Beyond:PLOW:".$low.":short Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $low ) && ($temp>= $low )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($high - $json_output['l']) * (200000/$json_output['l']); $risk = (int)$risk; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Breaking:PLOW:".$low.":short Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $llow ) && ($temp<= $llow )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Coming near:PLOW:".$low.":short Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $low ) && ($temp<= $low )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:". $json_output['l'].":Retracing:PLOW:".$low."\r\n"); fclose( $filedash ); } if (($json_output['l'] > $avgp ) && ($temp<= $avgp )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($json_output['l'] - $low) * (200000/$json_output['l']); $risk = (int)$risk; $avgp = number_format($avgp, 2, '.', ''); $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Sliding up:PAVG:".$avgp.":Buy Cost:".$risk."\r\n"); fclose( $filedash ); } if (($json_output['l'] < $avgp ) && ($temp>= $avgp )) {$my_time = date('h:i:s',time()); $seconds2add = 19800; $new_time= strtotime($my_time); $new_time+=$seconds2add; $risk = ($high - $json_output['l']) * (200000/$json_output['l']); $risk = (int)$risk; $avgp = number_format($avgp, 2, '.', ''); $time = date('h:i:s',$new_time); $filedash = fopen("C:\wamp\www\alert.txt", "a+"); $wrote = fputs($filedash, "SanDisk:".$json_output['l']. ":Sliding down:PAVG:".$avgp.":Short Cost:".$risk."\r\n"); fclose( $filedash ); } } $filedash = fopen("SNDKTEMP.txt", "w"); $wrote = fputs($filedash, $json_output['l']); fclose( $filedash ); //echo "&chg=".$json_output['cp']."&"; ?> /*email to provide support at [email protected], [email protected], For donations please write to [email protected]*/
VanceKingSaxbeA/NYSE-Engine
App/SNDK.php
PHP
mit
10,320
"""Test utilities.""" import textwrap import astunparse def translation_eq(f, truth, print_f=False): """helper function for test_translate functions compares an AST to the string truth, which should contain Python code. truth is first dedented. """ f.compile() translation = f.translation translation_s = astunparse.unparse(translation) if print_f: print translation_s truth_s = "\n" + textwrap.dedent(truth) + "\n" assert translation_s == truth_s
cyrus-/tydy
tydy/util/testing.py
Python
mit
499
<?php namespace AppBundle\Module; use Clastic\NodeBundle\Module\NodeModuleInterface; /** * Proxy. */ class ProxyModule implements NodeModuleInterface { /** * The name of the module. * * @return string */ public function getName() { return 'Proxy'; } /** * The name of the module. * * @return string */ public function getIdentifier() { return 'proxy'; } /** * @return string */ public function getEntityName() { return 'AppBundle:Proxy'; } /** * @return string|bool */ public function getDetailTemplate() { return 'AppBundle:Proxy:detail.html.twig'; } }
NoUseFreak/clastic-proxy
src/AppBundle/Module/ProxyModule.php
PHP
mit
718
--- date: "2015-07-07T11:17:38Z" title: Package Display Format menu: doc: weight: 50 parent: Features --- Package Display Format ---------------------- Some aptly commands ([aptly mirror search](/doc/aptly/mirror/search), [aptly package search](/doc/aptly/package/search), [aptly repo search](/doc/aptly/repo/search), [aptly snapshot search](/doc/aptly/snapshot/search)) support `-format` flag which allows to modify how search results are printed. Golang templates are used to specify display format, with all package stanza fields available to template. In addition to package stanza fields aptly provides additional: * `Key`: internal aptly package ID, unique for all packages in aptly (combination of `ShortKey` and `FilesHash`). * `FilesHash`: hash that includes MD5 of all packages files. * `ShortKey`: package ID, which is unique in single list (mirror, repo, snapshot, ...), but not unique in whole aptly package collection. To access any field, use `{{.Field}}`, every other character would be passed to output as is. For example, default aptly display format could be implemented with the following template: {{.Package}}_{{.Version}}_{{.Architecture}} To display package name with dependencies: {{.Package}} || {{.Depends}} This might produce following output: libyaml-libyaml-perl || perl (>= 5.14.2-21+deb7u1), perlapi-5.14.2, libc6 (>= 2.3.4) liberubis-ruby1.9.1 || ruby-erubis ... For example: $ aptly package search -format="{{.Package}} (version {{.Version}})" 'Name (~ ^lib.*)' libbluray-doc (version 1:0.2.2-1) libglobus-gsi-callback-doc (version 4.2-1) libtimedate-perl (version 1.2000-1) libwebauth6 (version 4.1.1-2) ... More information on Golang template syntax: http://godoc.org/text/template
aptly-dev/aptly-dev.github.io
content/doc/feature/package-display.md
Markdown
mit
1,815
require 'abstract_unit' require 'active_support/core_ext/kernel' class KernelTest < ActiveSupport::TestCase # def test_silence_warnings # silence_warnings { assert_nil $VERBOSE } # assert_equal 1234, silence_warnings { 1234 } # end # # def test_silence_warnings_verbose_invariant # old_verbose = $VERBOSE # silence_warnings { raise } # flunk # rescue # assert_equal old_verbose, $VERBOSE # end # # # def test_enable_warnings # enable_warnings { assert_equal true, $VERBOSE } # assert_equal 1234, enable_warnings { 1234 } # end # # def test_enable_warnings_verbose_invariant # old_verbose = $VERBOSE # enable_warnings { raise } # flunk # rescue # assert_equal old_verbose, $VERBOSE # end # # # def test_silence_stderr # old_stderr_position = STDERR.tell # silence_stderr { STDERR.puts 'hello world' } # assert_equal old_stderr_position, STDERR.tell # rescue Errno::ESPIPE # # Skip if we can't STDERR.tell # end # # def test_quietly # old_stdout_position, old_stderr_position = STDOUT.tell, STDERR.tell # quietly do # puts 'see me, feel me' # STDERR.puts 'touch me, heal me' # end # assert_equal old_stdout_position, STDOUT.tell # assert_equal old_stderr_position, STDERR.tell # rescue Errno::ESPIPE # # Skip if we can't STDERR.tell # end # # def test_silence_stderr_with_return_value # assert_equal 1, silence_stderr { 1 } # end def test_class_eval o = Object.new class << o; @x = 1; end assert_equal 1, o.class_eval { @x } end # def test_capture # assert_equal 'STDERR', capture(:stderr) { $stderr.print 'STDERR' } # assert_equal 'STDOUT', capture(:stdout) { print 'STDOUT' } # assert_equal "STDERR\n", capture(:stderr) { system('echo STDERR 1>&2') } # assert_equal "STDOUT\n", capture(:stdout) { system('echo STDOUT') } # end end # class KernelSuppressTest < ActiveSupport::TestCase # def test_reraise # assert_raise(LoadError) do # suppress(ArgumentError) { raise LoadError } # end # end # # def test_suppression # suppress(ArgumentError) { raise ArgumentError } # suppress(LoadError) { raise LoadError } # suppress(LoadError, ArgumentError) { raise LoadError } # suppress(LoadError, ArgumentError) { raise ArgumentError } # end # end # # class MockStdErr # attr_reader :output # def puts(message) # @output ||= [] # @output << message # end # # def info(message) # puts(message) # end # # def write(message) # puts(message) # end # end # # class KernelDebuggerTest < ActiveSupport::TestCase # def test_debugger_not_available_message_to_stderr # old_stderr = $stderr # $stderr = MockStdErr.new # debugger # assert_match(/Debugger requested/, $stderr.output.first) # ensure # $stderr = old_stderr # end # # def test_debugger_not_available_message_to_rails_logger # rails = Class.new do # def self.logger # @logger ||= MockStdErr.new # end # end # Object.const_set(:Rails, rails) # debugger # assert_match(/Debugger requested/, rails.logger.output.first) # ensure # Object.send(:remove_const, :Rails) # end # end
opal/opal-activesupport
test/core_ext/kernel_test.rb
Ruby
mit
3,253
--- title: Clustering Atomic Hosts with Kubernetes, Ansible, and Vagrant author: jbrooks date: 2015-09-21 18:31:32 UTC tags: kubernetes, atomic, docker, vagrant, ansible, libvirt, openstack, atomicapp comments: true published: true --- A single Atomic Host is a fine place to run your containers, but these hosts are much more fun when bunched into clusters, a task that we can manage with the help of [Kubernetes](http://kubernetes.io/). There are a lot of [great guides](https://github.com/kubernetes/kubernetes/blob/release-1.0/docs/getting-started-guides/README.md) for setting up a kubernetes cluster, but my favorite involves ansible and vagrant, and lives in the kubernetes [contrib](https://github.com/kubernetes/contrib/) repository on Github. This install method can be used with the libvirt, virtualbox or openstack vagrant providers. You can also use the ansible scripts on their own, if vagrant isn't your thing. READMORE ## Prerequisites To follow along, you'll need a machine with vagrant and a provider for libvirt, virtualbox, or openstack. I typically use libvirt on Fedora, but I've had success with virtualbox on Fedora as well -- if someone wants to test this with virtualbox and Windows or OS X, please let me know if it works. I'm using Fedora 22, and this command pulled in the specific dependencies I needed: ``` dnf install -y vagrant-libvirt libvirt-devel gcc gcc-c++ ruby-devel ``` The way that this `Vagrantfile` is currently written, you're required to have the `vagrant-openstack-provider` installed, whether you're using it or not, so either install it: ``` $ vagrant plugin install vagrant-openstack-provider ``` Or, comment out this line in the `Vagrantfile`: ``` require 'vagrant-openstack-provider' ``` If you do intend to use openstack, you'll need to copy `openstack_config.yml.example` to `openstack_config.yml` and edit `openstack_config.yml` to include your own credentials and other details specific to your openstack cloud. You'll need to upload one of the [qcow2-formatted atomic images](http://www.projectatomic.io/download/) to openstack, as well, and specify that image by name in this config file. ## DNS, kube-addons, and SELinux One of the nice things about this method of bringing up a kubernetes cluster is that it configures the set of [kubernetes addons](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons), which includes [DNS support](https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/README.md). However, a major open issue with the DNS addon (and at least some of the others) is the way that it conflicts with SELinux. The ansible scripts take care of putting SELinux into permissive mode -- a workaround I hope won't be required for too long. ## Get the code I made a fork of the kubernetes contrib repo with a [small set of changes](https://github.com/kubernetes/contrib/compare/master...jasonbrooks:atomic) to make atomic hosts work. Mostly, the changes boil down to _skip this step if you're on an atomic host_, but I've also modded the Vagrantfile to add support for setting a `distro_type`, so you can indicate whether you want to use Fedora Atomic (`export DISTRO_TYPE=fedora-atomic`), or CentOS Atomic (`export DISTRO_TYPE=centos-atomic`). The default in the script is CentOS Atomic. Grab my fork by git cloning it or by downloading the zip archive: ``` $ git clone https://github.com/jasonbrooks/contrib.git $ cd contrib/ansible/vagrant ``` ``` $ wget https://github.com/jasonbrooks/contrib/archive/atomic.zip $ unzip atomic.zip $ cd contrib-atomic/ansible/vagrant ``` ## Bring up the cluster We'll use vagrant to bring up our kube-master and kube-nodes. The default number of nodes is 2, but you can change this by setting a different env variable for `NUM_NODES`. ``` $ vagrant up --no-provision --provider=libvirt ``` If your Atomic Host image needs updating, you can do it before provisioning, like this: ``` $ for i in {kube-node-1,kube-master,kube-node-2}; do vagrant ssh $i -c "sudo atomic host upgrade"; done $ vagrant reload --no-provision ``` Time to configure kubernetes, by running the ansible playbook on the kube-master: ``` $ vagrant provision kube-master ``` Kubernetes should be all set up now. ## Testing it out I typically test out my kubernetes clusters by running the upstream project's [guestbook-go sample application](https://github.com/kubernetes/kubernetes/tree/master/examples/guestbook-go), which features a simple front end app that runs across multiple hosts, and a redis-based backend that divides its work between a master node and a few slave nodes. I've [packaged guestbook-go](https://github.com/projectatomic/nulecule/tree/master/examples/guestbook-go) into an [Atomicapp](http://www.projectatomic.io/docs/atomicapp/) for ease of deployment: ``` $ vagrant ssh kube-master $ mkdir guest && cd guest $ sudo atomic run projectatomic/guestbookgo-app ``` Once the app is up and running, which you can discern by watching `kubectl get pods`, you can figure out the IP and port on which to access the app in your browser: ``` $ kubectl get pods --watch NAME READY STATUS RESTARTS AGE guestbook-hv1cy 1/1 Running 0 1m guestbook-nkkew 1/1 Running 0 1m guestbook-w2urm 1/1 Running 0 1m redis-master-4qr7s 1/1 Running 0 1m redis-slave-3gvcn 1/1 Running 0 1m redis-slave-btki8 1/1 Running 0 1m $ kubectl describe nodes kube-node-1 | grep Addresses Addresses: 192.168.121.66 $ kubectl describe service guestbook | grep NodePort NodePort: <unnamed> 32615/TCP ``` Based on the output above, you'd be able to reach your app at `http://192.168.121.66:32615`: ![](images/guestbook-go.png) ## Next steps I'm keen to see / help realize a fix for running SELinux in enforcing mode. Also, I'm working on getting my atomic-friendly changes merged upstream, so we won't need to mess with a fork.
goern/atomic-site
source/blog/2015-09-21-clustering-atomic-hosts-with-kubernetes-ansible-and-vagrant.html.md
Markdown
mit
6,024
# encoding: utf-8 module MailStats class InterceptorPrototype VALID_URL_REGEX = /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix def self.delivering_email(message) message.body.parts.each do |part| part.body = self.process(part, message.to, message.subject) if part.content_type =~ /text\/html/ end end def self.process(part) part.body.to_s end end end
kavu/mail_stats
lib/mail_stats/interceptors/interceptor_prototype.rb
Ruby
mit
446
--- layout: post status: publish published: true title: Week Nine author: display_name: Dylan login: dylan email: [email protected] url: / author_login: dylan author_email: [email protected] author_url: / date: '2017-03-01 10:10:00 -0600' date_gmt: '2017-03-01 10:10:00 -0600' categories: - Awesome - 2017 tags: [] comments: --- ![Week Nine - Dylan looking insane at the end of a panoramic of Wellington NZ](https://raw.githubusercontent.com/dylanreed/dylan.blog/gh-pages/images/weekly-blog/Weekly-Blog-Post-Nine.jpg) This week was spent worrying about my colonoscopy for nothing. They found nothing or note. I just need to avoid stress. LOL. In that vain I am trying to get back on track. That means: More Fiction Writing and Reading. See how I used a bunch of caps. That means it is important. It also means that I my blog posts may get shorter unless something crazy is happening. I recently made myself a schedule of my writing and if I follow it there will be so many more stories released. So... Stay tuned for that. Don't forget that you can support my writing efforts on [Patreon](https://www.patreon.com/dylanreed)
dylanreed/dylan.blog
_posts/2017-03-02-week-nine.markdown
Markdown
mit
1,145
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateTableTemperaturesPodsTimeExclude extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('temperatures_pods_time_exclude', function($table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->integer('unit_id')->unsigned(); $table->foreign('unit_id')->references('id')->on('units')->onDelete('cascade'); $table->integer('area_id')->unsigned(); $table->foreign('area_id')->references('id')->on('temperatures_pods_areas')->onDelete('cascade'); $table->string('week_days')->nullable()->default(NULL); $table->TinyInteger('all_day')->default(0); $table->string('from')->nullable()->default(NULL); $table->string('to')->nullable()->default(NULL); $table->TinyInteger('active')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }
denislevin/webapp-dashboard
app/database/migrations/2015_06_25_174453_create_table_temperatures_pods_time_exclude.php
PHP
mit
1,159
import axios from '../../../lib/utils/axios_utils'; import { __ } from '../../../locale'; import { deprecatedCreateFlash as flash } from '../../../flash'; export default class PayloadPreviewer { constructor(trigger, container) { this.trigger = trigger; this.container = container; this.isVisible = false; this.isInserted = false; } init() { this.spinner = this.trigger.querySelector('.js-spinner'); this.text = this.trigger.querySelector('.js-text'); this.trigger.addEventListener('click', event => { event.preventDefault(); if (this.isVisible) return this.hidePayload(); return this.requestPayload(); }); } requestPayload() { if (this.isInserted) return this.showPayload(); this.spinner.classList.add('d-inline-flex'); return axios .get(this.container.dataset.endpoint, { responseType: 'text', }) .then(({ data }) => { this.spinner.classList.remove('d-inline-flex'); this.insertPayload(data); }) .catch(() => { this.spinner.classList.remove('d-inline-flex'); flash(__('Error fetching payload data.')); }); } hidePayload() { this.isVisible = false; this.container.classList.add('d-none'); this.text.textContent = __('Preview payload'); } showPayload() { this.isVisible = true; this.container.classList.remove('d-none'); this.text.textContent = __('Hide payload'); } insertPayload(data) { this.isInserted = true; this.container.innerHTML = data; this.showPayload(); } }
mmkassem/gitlabhq
app/assets/javascripts/pages/admin/application_settings/payload_previewer.js
JavaScript
mit
1,578
<h2>Viewing <span class='muted'>#<?php echo $content->id; ?></span></h2> <p> <strong>Title:</strong> <?php echo $content->title; ?></p> <p> <strong>Slug:</strong> <?php echo $content->slug; ?></p> <p> <strong>Summary:</strong> <?php echo $content->summary; ?></p> <p> <strong>Body:</strong> <?php echo $content->body; ?></p> <p> <strong>User id:</strong> <?php echo $content->user_id; ?></p> <?php echo Html::anchor('content/edit/'.$content->id, 'Edit'); ?> | <?php echo Html::anchor('content', 'Back'); ?>
dailenearanas/iJMC-WebApp
fuel/app/views/content/view.php
PHP
mit
518
/* * Copyright (c) 2016 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.junit; import org.junit.rules.TestRule; import org.mockito.Incubating; import org.mockito.internal.configuration.plugins.Plugins; import org.mockito.internal.junit.JUnitRule; import org.mockito.internal.junit.JUnitTestRule; import org.mockito.internal.junit.VerificationCollectorImpl; import org.mockito.quality.Strictness; /** * Mockito supports JUnit via: * <li> * <ul>JUnit Rules - see {@link MockitoRule}</ul> * <ul>JUnit runners - see {@link MockitoJUnitRunner}</ul> * <ul><a href="http://javadoc.io/doc/org.mockito/mockito-junit-jupiter/latest/org/mockito/junit/jupiter/MockitoExtension.html">JUnit Jupiter extension</a></ul> * </li> * * @since 1.10.17 */ public class MockitoJUnit { /** * Creates rule instance that initiates &#064;Mocks * For more details and examples see {@link MockitoRule}. * * @return the rule instance * @since 1.10.17 */ public static MockitoRule rule() { return new JUnitRule(Plugins.getMockitoLogger(), Strictness.WARN); } /** * Creates a rule instance that initiates &#064;Mocks and is a {@link TestRule}. Use this method * only when you need to explicitly need a {@link TestRule}, for example if you need to compose * multiple rules using a {@link org.junit.rules.RuleChain}. Otherwise, always prefer {@link #rule()} * See {@link MockitoRule}. * * @param testInstance The instance to initiate mocks for * @return the rule instance * @since 3.3.0 */ public static MockitoTestRule testRule(Object testInstance) { return new JUnitTestRule(Plugins.getMockitoLogger(), Strictness.WARN, testInstance); } /** * Creates a rule instance that can perform lazy verifications. * * @see VerificationCollector * @return the rule instance * @since 2.1.0 */ @Incubating public static VerificationCollector collector() { return new VerificationCollectorImpl(); } }
ze-pequeno/mockito
src/main/java/org/mockito/junit/MockitoJUnit.java
Java
mit
2,118
module SensuAPIProxy VERSION = "0.1.2" end
y13i/sensu_api_proxy
lib/sensu_api_proxy/version.rb
Ruby
mit
45
import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii import scipy.constants as const from scipy.optimize import curve_fit import uncertainties.unumpy as unp from uncertainties import ufloat from uncertainties.unumpy import (nominal_values as noms, std_devs as stds) U, f = np.genfromtxt('Rohdaten/Teil1.txt', unpack=True) Dy_R, Dy_U, Nd_R, Nd_U, Gd_R, Gd_U = np.genfromtxt('Rohdaten/Teil2.txt', unpack=True) U1 = [Dy_U, Nd_U, Gd_U] R = [Dy_R, Nd_R, Gd_R] #Umrechnung in SI einheiten Ohm und V Dy_R = Dy_R * 5e-3 Nd_R = Nd_R * 5e-3 Gd_R = Gd_R * 5e-3 Dy_U = Dy_U * 1e-3 Nd_U = Nd_U * 1e-3 Gd_U = Gd_U * 1e-3 #------------------- Konstanten T = 298.15 #Kelvin (25°Celsius) mu_0 = const.mu_0 plt.plot(f, U, 'rx', label='Messdaten') plt.grid() plt.legend(loc='best') plt.xlabel('Spannung U / mV') plt.ylabel('Frequenz $f$ / kHz') plt.tight_layout() plt.savefig('build/Frequenz.pdf') print('maximale Spannung: ', np.max(U)) #-------------- Dichten in kg/m^3 rho_Dy = 7.8 * 1e3 rho_Nd = 7.24 * 1e3 rho_Gd = 7.4 * 1e3 rho = [rho_Dy, rho_Nd, rho_Gd] ##-------------- Querschnittsberechnung #r_Dy = 8.15/2 * 1e-3 #m #r_Nd = 8/2 * 1e-3 #r_Gd = 8.025/2 * 1e-3 # #Q_Dy = np.pi * r_Dy**2 #Q_Nd = np.pi * r_Nd**2 #Q_Gd = np.pi * r_Gd**2 #-------------- Berechnung von Qreal m_Dy = 15.1 * 1e-3 #gramm m_Nd = 9 * 1e-3 m_Gd = 14.08 * 1e-3 m = [m_Dy, m_Nd, m_Gd] #Längen l_Dy = (15 - 0.7) * 1e-2 #m l_Nd = (15.5 - 0.7) * 1e-2 l_Gd = (14.08 - 0.7) * 1e-2 l = [l_Dy, l_Nd, l_Gd] Q_Dy = m_Dy/(l_Dy*rho_Dy) Q_Nd = m_Nd/(l_Nd*rho_Nd) Q_Gd = m_Gd/(l_Gd*rho_Gd) Q = [Q_Dy, Q_Nd, Q_Gd] print('Q_real: ') print('Dy : ', Q_Dy) print('Nd : ', Q_Nd) print('Gd : ', Q_Gd) #ascii.write([m, l, rho, Q], 'build/Querschnitt.tex', format='latex') #------------- L L_Dy = 5 S_Dy = 2.5 J_Dy = 7.5 L_Nd = 6 S_Nd = 1.5 J_Nd = 4.5 L_Gd = 0 S_Gd = 3.5 J_Gd = 3.5 L = [L_Dy, L_Nd, L_Gd] S = [S_Dy, S_Nd, S_Gd] J = [J_Dy, J_Nd, J_Gd] #ascii.write([L, S, J], 'build/LSJ.tex', format='latex') #------------- Berechnung von L_spule n = 250 I = 135 * 1e-3 #mm F = 86.6 * 1e-6 #mm^2 L_spule = mu_0 * n**2 * F / I #------------- Berechnung von S_T g_J_Dy = (3 * J_Dy * (J_Dy + 1) + (S_Dy * (S_Dy + 1 ) - L_Dy * (L_Dy+ 1))) / (2 * J_Dy * (J_Dy + 1)) g_J_Nd = (3 * J_Nd * (J_Nd + 1) + (S_Nd * (S_Nd + 1 ) - L_Nd * (L_Nd + 1))) / (2 * J_Nd * (J_Nd + 1)) g_J_Gd = (3 * J_Gd * (J_Gd + 1) + (S_Gd * (S_Gd + 1 ) - L_Gd * (L_Gd + 1))) / (2 * J_Gd * (J_Gd + 1)) g_J = [g_J_Dy, g_J_Nd, g_J_Gd] ascii.write([L, S, J, g_J], 'build/LSJ.tex', format='latex') #------------- Berechnung der molaren Masse M_Dy = m_Dy / (6.022*10**23) M_Nd = m_Nd / (6.022*10**23) M_Gd = m_Gd / m_Gd / (6.022*10**23) print('Molare Massen: ') print('M_Dy: ', M_Dy) print('M_Nd: ', M_Nd) print('M_Gd: ', M_Gd) N_Dy = rho_Dy / M_Dy N_Nd = rho_Nd / M_Nd N_Gd = rho_Gd / M_Gd print('N: ') print('N_Dy: ', N_Dy) print('N_Nd: ', N_Nd) print('N_Gd: ', N_Gd) rho = [rho_Dy, rho_Nd, rho_Gd] M = [M_Dy, M_Nd, M_Gd] N = [N_Dy, N_Nd, N_Gd] #ascii.write([M, N], 'build/rho.tex', format='latex') mu_B = 1/2 * (const.e/const.m_e) * const.hbar k = const.k S_T_Dy = (mu_0 * mu_B**2 * g_J_Dy**2 * N_Dy *J_Dy*(J_Dy+1)) / (3*k*T) S_T_Nd = (mu_0 * mu_B**2 * g_J_Nd**2 * N_Nd *J_Nd*(J_Nd+1)) / (3*k*T) S_T_Gd = (mu_0 * mu_B**2 * g_J_Gd**2 * N_Gd *J_Gd*(J_Gd+1)) / (3*k*T) print('Suszebtibilität S_T von: ') print(' Dy_2O_3: ', np.mean(S_T_Dy), np.std(S_T_Dy)) print(' Nd_2O_3: ', np.mean(S_T_Nd), np.std(S_T_Nd)) print(' Gd_2O_3: ', np.mean(S_T_Gd), np.std(S_T_Gd)) S_T = [S_T_Dy, S_T_Nd, S_T_Gd] std_S_T = [np.std(S_T_Dy), np.std(S_T_Nd), np.std(S_T_Gd)] #ascii.write([S_T], 'build/Theoriewerte.,tex', format='latex') ST = unp.uarray(S_T, std_S_T) #------------- Berechnung S_U q = 100 #Güte U_Br = 0.55 * 1e-6 #V S_U_Dy = 4 * (F/Q_Dy) * (U_Br / Dy_U) S_U_Nd = 4 * (F/Q_Nd) * (U_Br / Nd_U) S_U_Gd = 4 * (F/Q_Gd) * (U_Br / Gd_U) S_U = [np.mean(S_U_Dy), np.mean(S_U_Nd), np.mean(S_U_Gd)] std_S_U = [np.std(S_U_Dy), np.std(S_U_Nd), np.std(S_U_Gd)] print('Suszebtibilität S_U von: ') print(' Dy_2O_3: ', np.mean(S_U_Dy), np.std(S_U_Dy)) print(' Nd_2O_3: ', np.mean(S_U_Nd), np.std(S_U_Nd)) print(' Gd_2O_3: ', np.mean(S_U_Gd), np.std(S_U_Gd)) SU = unp.uarray(S_U, std_S_U) #------------- Wiederstände R , dR R = 196.2 #* 5e-3 dR_Dy = abs(Dy_R - R) * 1e-3 dR_Nd = abs(Nd_R - R) * 1e-3 dR_Gd = abs(Gd_R - R) * 1e-3 print('dR in Ohm: ' ) print(dR_Dy) print(dR_Nd) print(dR_Gd) #------------- Berechnung S_R S_R_Dy = 2* (dR_Dy / R) * (F / Q_Dy) S_R_Nd = 2* (dR_Nd / R) * (F / Q_Nd) S_R_Gd = 2* (dR_Gd / R) * (F / Q_Gd) print('Suszebtibilität S_R von: ') print(' Dy_2O_3: ', np.mean(S_R_Dy), np.std(S_R_Dy)) print(' Nd_2O_3: ', np.mean(S_R_Nd), np.std(S_R_Nd)) print(' Gd_2O_3: ', np.mean(S_R_Gd), np.std(S_R_Gd)) S_R = [np.mean(S_R_Dy), np.mean(S_R_Nd), np.mean(S_R_Gd)] std_S_R = [np.std(S_R_Dy), np.std(S_R_Nd), np.std(S_R_Gd)] SR = unp.uarray(S_R, std_S_R) #---------Tabellen #ascii.write([U,f], 'build/Filterkurve.tex', format='latex') #ascii.write([S_U, std_S_U, S_R, std_S_R], 'build/susz.tex', format='latex') #--------------------Diskussion
mwindau/praktikum
v606/Rechnungen.py
Python
mit
5,124
var comments = {}; comments.sort = "best"; //best|top|new comments.comments = []; comments.flat = []; comments.getComments = function(id, callback){ request({ url: ("https://api.imgur.com/3/gallery/" + id + "/comments/" + comments.sort), headers: { "Authorization": authorization } }, callback); } comments.setComments = function(comment){ comments.comments = comment; for(var i = 0; i < comment.length; i++){ comments.addFlatComment(comment[i]); } } comments.addFlatComment = function(comment){ comments.flat.push(comment); for(var i = 0; i < comment.children.length; i++){ comments.addFlatComment(comment.children[i]); } }
mkaminsky11/imguru
js/comments.js
JavaScript
mit
677
#region Copyright // DotNetNuke® - http://www.dotnetnuke.com // Copyright (c) 2002-2017 // by DotNetNuke Corporation // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion namespace DotNetNuke.Modules.HtmlEditorManager.Views { using System; using System.Web.UI.WebControls; using DotNetNuke.Modules.HtmlEditorManager.ViewModels; using DotNetNuke.Web.Mvp; /// <summary> /// Interface for the Provider Configuration View /// </summary> [Obsolete("Deprecated in DNN 9.2.0. Replace WebFormsMvp and DotNetNuke.Web.Mvp with MVC or SPA patterns instead")] public interface IProviderConfigurationView : IModuleView<ProviderConfigurationViewModel> { /// <summary>Occurs when [save editor choice].</summary> event EventHandler<EditorEventArgs> SaveEditorChoice; /// <summary>Occurs when the editor changed.</summary> event EventHandler<EditorEventArgs> EditorChanged; /// <summary>Gets or sets the editor panel.</summary> /// <value>The editor panel.</value> PlaceHolder Editor { get; set; } void Refresh(); } }
janjonas/Dnn.Platform
DNN Platform/Modules/HtmlEditorManager/Views/IProviderConfigurationView.cs
C#
mit
2,197
angular.module('characterCreator') .directive('specialTable', ['coreService', 'SPECIALS', specialTable]); function specialTable(coreService, SPECIALS) { return { restrict: 'E', scope: { saveChanges: '=', isReady: '=', character: '=', }, templateUrl: 'partials/specialTable.html', link: link }; function link(scope, element, attrs) { scope.specials = SPECIALS; scope.specialValues = [ "strength", "perception", "endurance", "charisma", "intelligence", "agility", "luck" ]; scope.activeSpecialIndex = 0; scope.next = function() { if(scope.activeSpecialIndex + 1 < scope.specialValues.length) { scope.activeSpecialIndex++; } } scope.back = function() { if(scope.activeSpecialIndex - 1 >= 0) { scope.activeSpecialIndex--; } } } }
benjaminRomano/Fallout4CharacterCreation
app/directives/specialTable.js
JavaScript
mit
1,056
--- layout: post title: Miss Molly and Ginny Potter Double Dildo Live on MFC titleinfo: pornvd desc: Watch Miss Molly and Ginny Potter Double Dildo Live on MFC. Pornhub is the ultimate xxx porn and sex site. --- <iframe src="http://www.pornhub.com/embed/ph56d39203848fd" frameborder="0" width="630" height="338" scrolling="no"></iframe> <h2>Miss Molly and Ginny Potter Double Dildo Live on MFC</h2> <h3>Watch Miss Molly and Ginny Potter Double Dildo Live on MFC. Pornhub is the ultimate xxx porn and sex site.</h3>
pornvd/pornvd.github.io
_posts/2016-03-01-Miss-Molly-and-Ginny-Potter-Double-Dildo-Live-on-MFC.md
Markdown
mit
532
#include "staticelectricdatatest.h" #include "staticelectricdata.h" void StaticElectricDataTest::testNormalConstructor() { StaticElectricData e; QVERIFY(e.energyTax() == "0"); QVERIFY(e.transfer() == "0"); QVERIFY(e.transferTax() == "0"); QVERIFY(e.premium() == "0"); QVERIFY(e.premiumTax() == "0"); QVERIFY(e.switchDevice() == ""); QVERIFY(e.switchValue() == ""); QVERIFY(e.powerDevice() == ""); QVERIFY(e.powerValue() == ""); QVERIFY(e.area() == ""); } void StaticElectricDataTest::testSetConstructor() { StaticElectricData e("1.0", "2.0", "3.0", "4.0", "5.0", "device", "switch", "monitor", "power", "fi"); QVERIFY(e.energyTax() == "1.0"); QVERIFY(e.transfer() == "2.0"); QVERIFY(e.transferTax() == "3.0"); QVERIFY(e.premium() == "4.0"); QVERIFY(e.premiumTax() == "5.0"); QVERIFY(e.switchDevice() == "device"); QVERIFY(e.switchValue() == "switch"); QVERIFY(e.powerDevice() == "monitor"); QVERIFY(e.powerValue() == "power"); QVERIFY(e.area() == "fi"); } void StaticElectricDataTest::testCopyConstructor() { StaticElectricData e("1.0", "2.0", "3.0", "4.0", "5.0", "device", "switch", "monitor", "power", "fi"); StaticElectricData e2(e); QVERIFY(e2.energyTax() == "1.0"); QVERIFY(e2.transfer() == "2.0"); QVERIFY(e2.transferTax() == "3.0"); QVERIFY(e2.premium() == "4.0"); QVERIFY(e2.premiumTax() == "5.0"); QVERIFY(e2.switchDevice() == "device"); QVERIFY(e2.switchValue() == "switch"); QVERIFY(e2.powerDevice() == "monitor"); QVERIFY(e2.powerValue() == "power"); QVERIFY(e2.area() == "fi"); } void StaticElectricDataTest::testAssignmentOperator() { StaticElectricData e("1.0", "2.0", "3.0", "4.0", "5.0", "device", "switch", "monitor", "power", "fi"); StaticElectricData e2; e2 = e; QVERIFY(e2.energyTax() == "1.0"); QVERIFY(e2.transfer() == "2.0"); QVERIFY(e2.transferTax() == "3.0"); QVERIFY(e2.premium() == "4.0"); QVERIFY(e2.premiumTax() == "5.0"); QVERIFY(e2.switchDevice() == "device"); QVERIFY(e2.switchValue() == "switch"); QVERIFY(e2.powerDevice() == "monitor"); QVERIFY(e2.powerValue() == "power"); QVERIFY(e2.area() == "fi"); } void StaticElectricDataTest::testSetters() { StaticElectricData e; e.setEnergyTax("1.0"); e.setTransfer("2.0"); e.setTransferTax("3.0"); e.setPremium("4.0"); e.setPremiumTax("5.0"); e.setSwitchDevice("foo"); e.setSwitchValue("bar"); e.setPowerDevice("foobar"); e.setPowerValue("xyzzy"); e.setArea("se"); QVERIFY(e.energyTax() == "1.0"); QVERIFY(e.energyTaxDouble() == 1.0); QVERIFY(e.transfer() == "2.0"); QVERIFY(e.transferDouble() == 2.0); QVERIFY(e.transferTax() == "3.0"); QVERIFY(e.transferTaxDouble() == 3.0); QVERIFY(e.premium() == "4.0"); QVERIFY(e.premiumDouble() == 4.0); QVERIFY(e.premiumTax() == "5.0"); QVERIFY(e.premiumTaxDouble() == 5.0); QVERIFY(e.switchDevice() == "foo"); QVERIFY(e.switchValue() == "bar"); QVERIFY(e.powerDevice() == "foobar"); QVERIFY(e.powerValue() == "xyzzy"); QVERIFY(e.area() == "se"); }
hjunnila/vesta
lib/test/staticelectricdatatest.cpp
C++
mit
3,168
import openmc from tests.testing_harness import PyAPITestHarness class PeriodicTest(PyAPITestHarness): def _build_inputs(self): # Define materials water = openmc.Material(1) water.add_nuclide('H1', 2.0) water.add_nuclide('O16', 1.0) water.add_s_alpha_beta('c_H_in_H2O') water.set_density('g/cc', 1.0) fuel = openmc.Material(2) fuel.add_nuclide('U235', 1.0) fuel.set_density('g/cc', 4.5) materials = openmc.Materials((water, fuel)) materials.default_temperature = '294K' materials.export_to_xml() # Define geometry x_min = openmc.XPlane(1, x0=-5., boundary_type='periodic') x_max = openmc.XPlane(2, x0=5., boundary_type='periodic') x_max.periodic_surface = x_min y_min = openmc.YPlane(3, y0=-5., boundary_type='periodic') y_max = openmc.YPlane(4, y0=5., boundary_type='periodic') z_min = openmc.ZPlane(5, z0=-5., boundary_type='reflective') z_max = openmc.ZPlane(6, z0=5., boundary_type='reflective') z_cyl = openmc.ZCylinder(7, x0=-2.5, y0=2.5, r=2.0) outside_cyl = openmc.Cell(1, fill=water, region=( +x_min & -x_max & +y_min & -y_max & +z_min & -z_max & +z_cyl)) inside_cyl = openmc.Cell(2, fill=fuel, region=+z_min & -z_max & -z_cyl) root_universe = openmc.Universe(0, cells=(outside_cyl, inside_cyl)) geometry = openmc.Geometry() geometry.root_universe = root_universe geometry.export_to_xml() # Define settings settings = openmc.Settings() settings.particles = 1000 settings.batches = 4 settings.inactive = 0 settings.source = openmc.Source(space=openmc.stats.Box( *outside_cyl.region.bounding_box)) settings.export_to_xml() def test_periodic(): harness = PeriodicTest('statepoint.4.h5') harness.main()
wbinventor/openmc
tests/regression_tests/periodic/test.py
Python
mit
1,929
class MiteProject < MiteRsrc end
thomasklein/redmine2mite
app/models/mite_project.rb
Ruby
mit
32
package rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import gherkin.formatter.Formatter; import gherkin.formatter.model.*; import java.util.ArrayList; import org.junit.Test; import org.junit.runner.Description; import org.junit.runner.notification.RunNotifier; import cucumber.runtime.junit.JUnitReporter; public class RestJUnitReporterTest { private RestJUnitReporter jiraJUnitReporter; private Formatter formatter = mock(Formatter.class); private RestRuntime runtime = mock(RestRuntime.class); private RestExecutionUnitRunner executionUnitRunner = mock(RestExecutionUnitRunner.class); private RunNotifier runNotifier = mock(RunNotifier.class); private JUnitReporter junitReporter = mock(JUnitReporter.class); private boolean strict = true; @SuppressWarnings("unchecked") private ArrayList<Step> listOfSteps = mock(ArrayList.class); private Step aStep = mock(Step.class); private Description description = mock(Description.class); private Match match = mock(Match.class); private Scenario scenario = mock(Scenario.class); @Test public void whenExecutionUnitRunnerAssigned() { jiraJUnitReporter = new RestJUnitReporter(junitReporter, formatter, strict, runtime); assertTrue(jiraJUnitReporter.getExecutionUnitRunner() == null); jiraJUnitReporter.startExecutionUnit(executionUnitRunner, runNotifier); assertTrue(jiraJUnitReporter.getExecutionUnitRunner() != null); } @Test public void whenResultIsLogged_thenFeatureAndResultMapPopulated() { jiraJUnitReporter = new RestJUnitReporter(junitReporter, formatter, strict, runtime); Result result = new Result(Result.PASSED, 011L, "DUMMY_ARG"); jiraJUnitReporter.result(result); assertEquals(1, jiraJUnitReporter.getFeatureMap().size()); assertEquals(1, jiraJUnitReporter.getResultMap().size()); } @Test public void whenMatchIsCalled_thenCurrentStepIsAssigned() { String scenarioText = "When I cross the road(Scenario: Creating a mock2)"; jiraJUnitReporter = new RestJUnitReporter(junitReporter, formatter, strict, runtime); jiraJUnitReporter.startExecutionUnit(executionUnitRunner, runNotifier); when(executionUnitRunner.getRunnerSteps()).thenReturn(listOfSteps); when(listOfSteps.get(0)).thenReturn(aStep); when(listOfSteps.remove(0)).thenReturn(aStep); when(executionUnitRunner.describeChild(aStep)).thenReturn(description); when(description.toString()).thenReturn(scenarioText); when(aStep.getName()).thenReturn("NAME"); jiraJUnitReporter.startOfScenarioLifeCycle(scenario); jiraJUnitReporter.step(aStep); jiraJUnitReporter.match(match); String expected = removeBrackets(scenarioText); assertEquals("Current step has not been set correctly", expected, jiraJUnitReporter.getCurrentStep()); } private String removeBrackets(String s) { char[] charArray = s.toCharArray(); String sWithoutBrackets = ""; for (char ch : charArray) { if (ch == '(' || ch == ')') { ch = ' '; } sWithoutBrackets += ch; } return sWithoutBrackets; } }
LiamHayes1/rest-cucumber
src/test/java/rest/RestJUnitReporterTest.java
Java
mit
3,337
using UnityEngine; using System.Collections; namespace RPG { public class TriforceTracker : MonoBehaviour { public Player_Manager Player; public Sprite triforcePiece; void Start() { Player = GameObject.Find("Player").GetComponent<Player_Manager>(); } public void PlayerInteraction() { //call the players collectitem function Player.SendMessage("collectItem", triforcePiece); Player.triforceCount++; //the intial interaction of the Player causes his Attack and movement to stop working. This resets those values Player.canMove = true; Player.canAttack = true; Player.currentlyInteracting = false; Destroy(this.gameObject); return; } } }
mhueter/legend-of-z
Assets/Scripts/Dungeons/TriforceTracker.cs
C#
mit
773
package com.lothrazar.terrariabuttons.net; import com.lothrazar.terrariabuttons.util.UtilInventory; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class QuickStackPacket implements IMessage , IMessageHandler<QuickStackPacket, IMessage> { NBTTagCompound tags = new NBTTagCompound(); public QuickStackPacket(){} public QuickStackPacket(NBTTagCompound ptags) { tags = ptags; } @Override public void fromBytes(ByteBuf buf) { tags = ByteBufUtils.readTag(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeTag(buf, this.tags); } @Override public IMessage onMessage(QuickStackPacket message, MessageContext ctx) { EntityPlayer p = ctx.getServerHandler().playerEntity; if(p.openContainer == null || p.openContainer.getSlot(0) == null || p.openContainer.getSlot(0).inventory == null) { //TODO: use logger System.out.println("ERROR LOG: null container inventory"); } else { //a workaround since player does not reference the inventory, only the container //and Container has no get method IInventory openInventory = p.openContainer.getSlot(0).inventory; UtilInventory.sortFromPlayerToInventory(p.worldObj, openInventory, p); UtilInventory.updatePlayerContainerClient(p); } return null; } }
LothrazarMinecraftMods/TerrariaButtons
src/main/java/com/lothrazar/terrariabuttons/net/QuickStackPacket.java
Java
mit
1,678
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView from django.contrib import admin urlpatterns = patterns( "", url(r"^admin/", include(admin.site.urls)), url(r"^account/", include("account.urls")), url(r"^donate/", TemplateView.as_view(template_name='donation.html'), name='donation'), url(r"", include("submissions.urls")), ) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
interzoneboy/memorial-page
mysite/urls.py
Python
mit
549
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema, crypto = require('crypto'); /** * A Validation function for local strategy properties */ var validateLocalStrategyProperty = function(property) { return ((this.provider !== 'local' && !this.updated) || property.length); }; /** * A Validation function for local strategy password */ var validateLocalStrategyPassword = function(password) { return (this.provider !== 'local' || (password && password.length >= 6)); }; /** * User Schema */ var UserSchema = new Schema({ firstName: { type: String, trim: true, default: '', validate: [validateLocalStrategyProperty, 'กรุณากรอก ชื่อ ด้วยค่ะ'] }, lastName: { type: String, trim: true, default: '', validate: [validateLocalStrategyProperty, 'กรุณากรอก นามสกุล ด้วยค่ะ'] }, displayName: { type: String, trim: true }, email: { type: String, trim: true, index:{unique:true}, default: '', validate: [validateLocalStrategyProperty, 'กรุณากรอก Email ด้วยค่ะ'], match: [/.+\@.+\..+/, 'กรุณากรอก Email ให้ถูกต้องด้วยค่ะ'] }, username: { type: String, index:{unique:true}, required: 'กรุณากรอก Username ให้ถูกต้องด้วยค่ะ', trim: true }, password: { type: String, default: '', validate: [validateLocalStrategyPassword, 'กรุณากรอก Password 6 ตัวขึ้นไปด้วยค่ะ'] }, salt: { type: String }, provider: { type: String, required: 'Provider is required' }, providerData: {}, additionalProvidersData: {}, roles: { type: [{ type: String, enum: ['user', 'admin'] }], default: ['user'] }, updated: { type: Date }, created: { type: Date, default: Date.now }, /* For reset password */ resetPasswordToken: { type: String }, resetPasswordExpires: { type: Date } }); /** * Hook a pre save method to hash the password */ UserSchema.pre('save', function(next) { if (this.password && this.password.length > 6) { this.salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64'); this.password = this.hashPassword(this.password); } next(); }); /** * Create instance method for hashing a password */ UserSchema.methods.hashPassword = function(password) { if (this.salt && password) { return crypto.pbkdf2Sync(password, this.salt, 10000, 64).toString('base64'); } else { return password; } }; /** * Create instance method for authenticating user */ UserSchema.methods.authenticate = function(password) { return this.password === this.hashPassword(password); }; /** * Find possible not used username */ UserSchema.statics.findUniqueUsername = function(username, suffix, callback) { var _this = this; var possibleUsername = username + (suffix || ''); _this.findOne({ username: possibleUsername }, function(err, user) { if (!err) { if (!user) { callback(possibleUsername); } else { return _this.findUniqueUsername(username, (suffix || 0) + 1, callback); } } else { callback(null); } }); }; mongoose.model('User', UserSchema);
siriwut/gadgetboy
app/models/user.server.model.js
JavaScript
mit
3,412
#include "graphics/textureAtlas.h" #include "graphics/opengl.h" #include "textureManager.h" #include <algorithm> namespace sp { AtlasTexture::AtlasTexture(glm::ivec2 size) { texture_size = size; available_areas.push_back({{0, 0}, {size.x, size.y}}); gl_handle = 0; smooth = textureManager.isDefaultSmoothFiltering(); } AtlasTexture::~AtlasTexture() { if (gl_handle) glDeleteTextures(1, &gl_handle); } void AtlasTexture::bind() { if (gl_handle == 0) { glGenTextures(1, &gl_handle); glBindTexture(GL_TEXTURE_2D, gl_handle); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, smooth ? GL_LINEAR : GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, smooth ? GL_LINEAR : GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_size.x, texture_size.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); //Put 1 white pixel in the {1,1} corner, which we can use to draw solid things. glm::u8vec4 white{255,255,255,255}; glTexSubImage2D(GL_TEXTURE_2D, 0, texture_size.x - 1, texture_size.y - 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &white); } else { glBindTexture(GL_TEXTURE_2D, gl_handle); } if (!add_list.empty()) { for(auto& add_item : add_list) glTexSubImage2D(GL_TEXTURE_2D, 0, add_item.position.x, add_item.position.y, add_item.image.getSize().x, add_item.image.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, add_item.image.getPtr()); add_list.clear(); } } bool AtlasTexture::canAdd(const Image& image, int margin) { glm::ivec2 size = image.getSize() + glm::ivec2(margin * 2, margin * 2); for(int n=int(available_areas.size()) - 1; n >= 0; n--) { if (available_areas[n].size.x >= size.x && available_areas[n].size.y >= size.y) return true; } return false; } Rect AtlasTexture::add(Image&& image, int margin) { glm::ivec2 size = image.getSize() + glm::ivec2(margin * 2, margin * 2); for(int n=int(available_areas.size()) - 1; n >= 0; n--) { if (available_areas[n].size.x >= size.x && available_areas[n].size.y >= size.y) { //Suitable area found, grab it, cut it, and put it in a stew. RectInt full_area = available_areas[n]; available_areas.erase(available_areas.begin() + n); if (full_area.size.x <= full_area.size.y) { //Split horizontal addArea({{full_area.position.x + size.x, full_area.position.y}, {full_area.size.x - size.x, size.y}}); addArea({{full_area.position.x, full_area.position.y + size.y}, {full_area.size.x, full_area.size.y - size.y}}); } else { //Split vertical addArea({{full_area.position.x + size.x, full_area.position.y}, {full_area.size.x - size.x, full_area.size.y}}); addArea({{full_area.position.x, full_area.position.y + size.y}, {size.x, full_area.size.y - size.y}}); } if (image.getSize().x > 0 && image.getSize().y > 0) { add_list.emplace_back(); add_list.back().image = std::move(image); add_list.back().position.x = full_area.position.x + margin; add_list.back().position.y = full_area.position.y + margin; } return Rect( float(full_area.position.x + margin) / float(texture_size.x), float(full_area.position.y + margin) / float(texture_size.y), float(size.x - margin * 2) / float(texture_size.x), float(size.y - margin * 2) / float(texture_size.y)); } } return Rect(0, 0, -1, -1); } float AtlasTexture::usageRate() { int all_texture_volume = texture_size.x * texture_size.y; int unused_texture_volume = 0; for(auto& area : available_areas) unused_texture_volume += area.size.x * area.size.y; return float(all_texture_volume - unused_texture_volume) / float(all_texture_volume); } void AtlasTexture::addArea(RectInt area) { //Ignore really slim areas, they are never really used and use up a lot of room in the available_areas otherwise. if (area.size.x < 4 || area.size.y < 4) return; int area_volume = area.size.x * area.size.y; auto it = std::lower_bound(available_areas.begin(), available_areas.end(), area_volume, [](const RectInt& r, int volume) -> bool { return r.size.x * r.size.y > volume; }); available_areas.insert(it, area); } }//namespace sp
daid/SeriousProton
src/graphics/textureAtlas.cpp
C++
mit
4,748
#ifndef GRAPHICVERTEX_H #define GRAPHICVERTEX_H #include <QAbstractGraphicsShapeItem> #include "../structures/graphitemselectsignalemitter.h" class Vertex; class GraphicVertex : public QAbstractGraphicsShapeItem { public: explicit GraphicVertex(Vertex *parentVertex, QGraphicsItem *parent = nullptr); virtual ~GraphicVertex(); bool isFixedPos() const; void setFixedPos(bool value); void restoreDefaultColor(); static graphItemSelectSignalEmitter *selectSignalEmitterInstance(); void updateEdgePos(); void updateLinkedEdgePos(); void updatePosUsingForce(); static qreal radius(); Vertex *parentVertex() const; void removeFromScene(); bool isNeedUpdatePos() const; protected: void setEdgesSelect(bool value); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); QPainterPath shape() const; QVariant itemChange(GraphicsItemChange change, const QVariant &value); void mouseMoveEvent(QGraphicsSceneMouseEvent *event); private: void setNodeSelect(bool isSelect); Vertex *_parentVertex; bool _isFixedPos; static const qreal _circleRadius; // px static graphItemSelectSignalEmitter *_selectSignalEmitter; void vertexSelected(); void vertexMoved(); }; #endif // GRAPHICVERTEX_H
valsid/Graph
src/graph/graphicvertex.h
C
mit
1,354
// In every functions, the variable "entity" defines the entity who uses the script. /* Called on the creation of the entity */ function init(entity) {} /* Called when the entity get damages Parameters: from - The entity from who comes the damages amount - The amount of damages */ function onDamage(entity, from, amount) {} /* Called when the entity get healed Parameters: from - The entity from who comes the heals amount - The amount of heals */ function onHeal(entity, from, amount) {} /* Called when an entity enter the parent vision Parameters: entity2 - The entity who is in the vision */ function onEntityInVision(entity, entity2) {} /* Called on each loop Parameters: delta - The loop delta value (time passed in ms between each loop) */ function onUpdate(entity, delta) {} /* Called when an effect is added to the entity Parameters: effect - The effect added */ function onEffectAdded(entity, effect) {} /* Called when an effect is remove from the entity Parameters: effect - The effect removed */ function onEffectRemoved(entity, effect) {} /* Called when all effects are simultany cleared */ function onEffectsCleared(entity) {} /* Called when an entity taunt our entity Parameters: entity2 - The entity who taunted */ function onTaunt(entity, entity2) {} /* Called when a collision occures Parameters: entity2 - The collided entity */ function onCollision(entity, entity2) {}
AlexMog/MMO-Rulemasters-World
client/src/res/script_examples/monster_script.js
JavaScript
mit
1,456
## Welcome to GitHub Pages You can use the [editor on GitHub](https://github.com/davebeach/gc-comp-engine-website-CDN/edit/master/README.md) to maintain and preview the content for your website in Markdown files. Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. ### Markdown Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for ```markdown Syntax highlighted code block # Header 1 ## Header 2 ### Header 3 - Bulleted - List 1. Numbered 2. List **Bold** and _Italic_ and `Code` text [Link](url) and ![Image](src) ``` For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). ### Jekyll Themes Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/davebeach/gc-comp-engine-website-CDN/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file. ### Support or Contact Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out.
davebeach/gc-comp-engine-website-CDN
README.md
Markdown
mit
1,309
require 'active_support/concern' module Cacheable extend ActiveSupport::Concern included do def self.cached_find(uuid) Rails.cache.fetch([self.model_name.cache_key, uuid]) { puts self object = self.find uuid # raise Apollo::ResourceGone, "Attempting to access deleted #{object.class} with #{uuid}" if object.deleted raise Exception, "Attempting to access deleted #{object.class} with #{uuid}" if object.deleted object } end after_save :flush_cache def flush_cache Rails.cache.delete([self.class.model_name.cache_key, self.uuid]) end end end
DuCalixte/astro_blog
astro_serve/app/models/concerns/cachable.rb
Ruby
mit
637
<?php namespace App\Tests\Service; use App\Service\CircleCiClient; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; final class CircleCiClientTest extends TestCase { /** @var HttpClientInterface|MockObject */ private MockObject $httpClient; private CircleCiClient $circleCiClient; protected function setUp(): void { $router = $this->getMockBuilder(UrlGeneratorInterface::class) ->disableOriginalConstructor()->getMock(); $router ->method('generate') ->willReturn('fake-url-circleci-api'); $this->httpClient = $this->getMockBuilder(HttpClientInterface::class) ->disableOriginalConstructor()->getMock(); $this->circleCiClient = new CircleCiClient($router, $this->httpClient, 'fake-token'); } public function testGetBuilds(): void { $response = $this->getMockBuilder(ResponseInterface::class) ->disableOriginalConstructor()->getMock(); $response ->method('getContent') ->willReturn(\json_encode([['status' => 'success']])); $response ->method('getStatusCode') ->willReturn(200); $this->httpClient ->method('request') ->willReturn($response); $responseBuilds = $this->circleCiClient->getBuilds('pugx/badge-poser'); self::assertInstanceOf(ResponseInterface::class, $responseBuilds); self::assertEquals($responseBuilds->getStatusCode(), 200); $content = $responseBuilds->getContent(); self::assertNotEmpty($content); self::assertIsString($content); $contentToArray = \json_decode($content, true); self::assertIsArray($contentToArray); } }
PUGX/badge-poser
tests/Service/CircleCiClientTest.php
PHP
mit
1,940
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Software is Artistic Science</title> <meta name="description" content="" /> <meta name="HandheldFriendly" content="True" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="shortcut icon" href="//wesamhaboush.github.io/themes/ichi/favicon.ico"> <script type="text/javascript" src="//wesamhaboush.github.io/themes/ichi/assets/js/vendor/fastclick.js?v=1.0.0"></script> <script type="text/javascript" src="//wesamhaboush.github.io/themes/ichi/assets/js/vendor/modernizr.js?v=1.0.0"></script> <link rel="stylesheet" type="text/css" href="//wesamhaboush.github.io/themes/ichi/assets/css/normalize.css?v=1.0.0" /> <link rel="stylesheet" type="text/css" href="//wesamhaboush.github.io/themes/ichi/assets/css/foundation.min.css?v=1.0.0" /> <!--[if lte IE 8]> <link rel="stylesheet" type="text/css" href="//wesamhaboush.github.io/themes/ichi/assets/css/outdatedBrowser.min.css?v=1.0.0"> <![endif]--> <link rel="stylesheet" type="text/css" href="//wesamhaboush.github.io/themes/ichi/assets/fonts/foundation-icons/foundation-icons.css?v=1.0.0" /> <link rel="stylesheet" type="text/css" href="//wesamhaboush.github.io/themes/ichi/assets/css/styles.css?v=1.0.0" /> <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:300,700,400|Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic" /> <link rel="canonical" href="https://wesamhaboush.github.io" /> <meta name="generator" content="Ghost ?" /> <link rel="alternate" type="application/rss+xml" title="Software is Artistic Science" href="https://wesamhaboush.github.io/rss" /> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css"> </head> <body class="tag-template tag-static-logger home-template"> <div id="outdated"> <h6>Your browser is out-of-date!</h6> <p>Update your browser to view this website correctly. <a id="btnUpdate" href="http://outdatedbrowser.com/">Update my browser now</a></p> </div> <nav class="top-bar hide-for-large-up" data-topbar > <ul class="title-area"> <li class="name"> </li> <li class="home"><a class="fi-home" href="https://wesamhaboush.github.io"></a></li> <li class="toggle-topbar"><a href="#" id="trigger-overlay" class="fi-list"></a></li> </ul> <div class="overlay overlay-scale"> <button type="button" class="overlay-close">Close</button> <nav> <ul> <li><a href="https://wesamhaboush.github.io">Home</a></li> </ul> </nav> </div> </nav> <div class="row"> <div class="small-16 medium-16 large-4 columns right head-area" > <header class="site-head"> <div class="vertical"> <div class="site-head-content inner"> <ul class="side-nav blog-menu show-for-large-up"> <li><a class="fi-home" href="https://wesamhaboush.github.io"></a></li> <li><a class="fi-torso" href="https://wesamhaboush.github.io/about"></a></li> <li><a class="fi-mail" href="https://wesamhaboush.github.io/contact"></a></li> </ul> <h1 class="blog-title">Software is Artistic Science</h1> <hr> <p class="blog-description"></p> <div class="blog-network"> <!-- <a href="#" class="fi-social-pinterest"></a> <a href="#" class="fi-social-linkedin"></a> <a href="#" class="fi-social-behance"></a> <a href="#" class="fi-social-deviant-art"></a> <a href="#" class="fi-social-dribbble"></a> <a href="#" class="fi-social-flickr"></a> <a href="#" class="fi-social-github"></a> <a href="#" class="fi-social-skype"></a> <a href="#" class="fi-social-snapchat"></a> <a href="#" class="fi-social-steam"></a> <a href="#" class="fi-social-xbox"></a> <a href="#" class="fi-social-reddit"></a> --> <a href="https://github.com/wesamhaboush" class="fi-social-github"></a> </div> </div> </div> </header> </div> <div class="small-16 medium-16 large-12 columns main-column left"> <main class="content" role="main"> <header class="tag-archive-header"> <h1>static-logger</h1> </header> <article class="post tag-java tag-logger tag-copy-past-safe-logger tag-static-logger tag-slf4j tag-log4j"> <header class="post-header"> <span class="post-meta"><time datetime="2015-10-06">06 Oct 2015</time> </span> <h2 class="post-title"><a href="https://wesamhaboush.github.io/2015/10/06/CopyPaste-safe-Loggers.html">Copy/Paste-safe Loggers</a></h2> </header> <section class="post-excerpt"> <p>Loggers Problem Developers commonly create loggers for classes by copying logger creation lines from other classes. The process is so repetitive and error-prone that often they forget to update the line to reflect the actual class where the statement was pasted. This is compounded by the fact that IDEs normally auto-import the foreign class. We all saw classes that had the wrong logger like this:&hellip;</p> </section> <a class="button read-more right small" href="https://wesamhaboush.github.io/2015/10/06/CopyPaste-safe-Loggers.html">Read more</a> <aside class="tags fi-pricetag-multiple">Posted on <a href="https://wesamhaboush.github.io/tag/java">java</a>, <a href="https://wesamhaboush.github.io/tag/logger"> logger</a>, <a href="https://wesamhaboush.github.io/tag/copy-past-safe-logger"> copy past safe logger</a>, <a href="https://wesamhaboush.github.io/tag/static-logger"> static logger</a>, <a href="https://wesamhaboush.github.io/tag/slf4j"> slf4j</a>, <a href="https://wesamhaboush.github.io/tag/log4j"> log4j</a></aside> <div class="clearfix"></div> </article> <nav class="pagination" role="navigation"> <span class="page-number">Page 1 of 1</span> </nav> </main> </div> </div> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js?v="></script> <script type="text/javascript"> jQuery( document ).ready(function() { // change date with ago jQuery('ago.ago').each(function(){ var element = jQuery(this).parent(); element.html( moment(element.text()).fromNow()); }); }); hljs.initHighlightingOnLoad(); </script> <!--[if lte IE 8]> <script type="text/javascript" src="//wesamhaboush.github.io/themes/ichi/assets/js/outdatedBrowser.min.js?v=1.0.0"></script> <![endif]--> <script type="text/javascript" src="//wesamhaboush.github.io/themes/ichi/assets/js/min/built.js?v=1.0.0"></script> <script> $(document).foundation(); </script> </body> </html>
wesamhaboush/wesamhaboush.github.io
tag/static-logger/index.html
HTML
mit
7,274
using System; using System.Reflection; using Core.ViewOnly.Base; namespace Core.ViewOnly { /// <summary> /// IMapper provides a way to hook into PetaPoco's Database to POCO mapping mechanism to either /// customize or completely replace it. /// </summary> /// <remarks> /// To use this functionality, instantiate a class that implements IMapper and then pass it to /// PetaPoco through the static method Mappers.Register() /// </remarks> public interface IMapper { /// <summary> /// Get information about the view associated with a POCO class /// </summary> /// <param name="pocoType"></param> /// <returns>A ViewInfo instance</returns> /// <remarks> /// This method must return a valid ViewInfo. /// </remarks> ViewInfo GetViewInfo(Type pocoType); /// <summary> /// Get information about the column associated with a property of a POCO /// </summary> /// <param name="pocoProperty">The PropertyInfo of the property being queried</param> /// <returns>A reference to a ColumnInfo instance, or null to ignore this property</returns> /// <remarks> /// To create a ColumnInfo from a property's attributes, use PropertyInfo.FromProperty /// </remarks> ColumnInfo GetColumnInfo(PropertyInfo pocoProperty); /// <summary> /// Supply a function to convert a database value to the correct property value /// </summary> /// <param name="targetProperty">The target property</param> /// <param name="sourceType">The type of data returned by the DB</param> /// <returns>A Func that can do the conversion, or null for no conversion</returns> Func<object, object> GetFromDbConverter(PropertyInfo targetProperty, Type sourceType); /// <summary> /// Supply a function to convert a property value into a database value /// </summary> /// <param name="sourceProperty">The property to be converted</param> /// <returns>A Func that can do the conversion</returns> /// <remarks> /// This conversion is only used for converting values from POCO's that are /// being Inserted or Updated. /// Conversion is not available for parameter values passed directly to queries. /// </remarks> Func<object, object> GetToDbConverter(PropertyInfo sourceProperty); } }
sanelib/WebStarterKit
DotNetServer/src/Core/ViewOnly/IMapper.cs
C#
mit
2,518