Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ArrowInvalid
Message:      JSON parse error: Missing a closing quotation mark in string. in row 1113
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
                  dataset = json.load(f)
                File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
                  return loads(fp.read(),
                File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                  return _default_decoder.decode(s)
                File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
                  raise JSONDecodeError("Extra data", s, end)
              json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 9907)
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
                  for _, table in generator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 1113
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
<?php return [ /* |-------------------------------------------------------------------------- | Application Debug Mode |-------------------------------------------------------------------------- | | When your application is in debug mode, detailed error messages with | stack traces will be shown on every error that occurs within your | application. If disabled, a simple generic error page is shown. | */ 'debug' => env('APP_DEBUG', true), /* |-------------------------------------------------------------------------- | Application URL |-------------------------------------------------------------------------- | | This URL is used by the console to properly generate URLs when using | the Artisan command line tool. You should set this to the root of | your application so that it is used when running Artisan tasks. | */ 'url' => 'http://localhost/mistress/public/', /* |-------------------------------------------------------------------------- | Application Timezone |-------------------------------------------------------------------------- | | Here you may specify the default timezone for your application, which | will be used by the PHP date and date-time functions. We have gone | ahead and set this to a sensible default for you out of the box. | */ 'timezone' => 'UTC', /* |-------------------------------------------------------------------------- | Application Locale Configuration |-------------------------------------------------------------------------- | | The application locale determines the default locale that will be used | by the translation service provider. You are free to set this value | to any of the locales which will be supported by the application. | */ 'locale' => 'en', /* |-------------------------------------------------------------------------- | Application Fallback Locale |-------------------------------------------------------------------------- | | The fallback locale determines the locale to use when the current one | is not available. You may change the value to correspond to any of | the language folders that are provided through your application. | */ 'fallback_locale' => 'en', /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | This key is used by the Illuminate encrypter service and should be set | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | */ 'key' => env('APP_KEY', 'ThisIsATestOfTheEmergencyBroadc'), 'cipher' => MCRYPT_RIJNDAEL_128, /* |-------------------------------------------------------------------------- | Logging Configuration |-------------------------------------------------------------------------- | | Here you may configure the log settings for your application. Out of | the box, Laravel uses the Monolog PHP logging library. This gives | you a variety of powerful log handlers / formatters to utilize. | | Available Settings: "single", "daily", "syslog", "errorlog" | */ 'log' => 'daily', /* |-------------------------------------------------------------------------- | Autoloaded Service Providers |-------------------------------------------------------------------------- | | The service providers listed here will be automatically loaded on the | request to your application. Feel free to add your own services to | this array to grant expanded functionality to your applications. | */ 'providers' => [ /* * Laravel Framework Service Providers... */ 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', //'Illuminate\Html\HtmlServiceProvider', /* * Third Party Service Providers */ Collective\Html\HtmlServiceProvider::class, Laracasts\Flash\FlashServiceProvider::class, Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, Thomaswelton\LaravelGravatar\LaravelGravatarServiceProvider::class, Appzcoder\CrudGenerator\CrudGeneratorServiceProvider::class, /* * Application Service Providers... */ Mistress\Providers\AppServiceProvider::class, Mistress\Providers\BusServiceProvider::class, Mistress\Providers\ConfigServiceProvider::class, Mistress\Providers\EventServiceProvider::class, Mistress\Providers\RouteServiceProvider::class, ], /* |-------------------------------------------------------------------------- | Class Aliases |-------------------------------------------------------------------------- | | This array of class aliases will be registered when this application | is started. However, feel free to register as many as you wish as | the aliases are "lazy" loaded so they don't hinder performance. | */ 'aliases' => [ 'App' => 'Illuminate\Support\Facades\App', 'Artisan' => 'Illuminate\Support\Facades\Artisan', 'Auth' => 'Illuminate\Support\Facades\Auth', 'Blade' => 'Illuminate\Support\Facades\Blade', 'Bus' => 'Illuminate\Support\Facades\Bus', 'Cache' => 'Illuminate\Support\Facades\Cache', 'Config' => 'Illuminate\Support\Facades\Config', 'Cookie' => 'Illuminate\Support\Facades\Cookie', 'Crypt' => 'Illuminate\Support\Facades\Crypt', 'DB' => 'Illuminate\Support\Facades\DB', 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 'Event' => 'Illuminate\Support\Facades\Event', 'File' => 'Illuminate\Support\Facades\File', 'Hash' => 'Illuminate\Support\Facades\Hash', 'Input' => 'Illuminate\Support\Facades\Input', 'Inspiring' => 'Illuminate\Foundation\Inspiring', 'Lang' => 'Illuminate\Support\Facades\Lang', 'Log' => 'Illuminate\Support\Facades\Log', 'Mail' => 'Illuminate\Support\Facades\Mail', 'Password' => 'Illuminate\Support\Facades\Password', 'Queue' => 'Illuminate\Support\Facades\Queue', 'Redirect' => 'Illuminate\Support\Facades\Redirect', 'Redis' => 'Illuminate\Support\Facades\Redis', 'Request' => 'Illuminate\Support\Facades\Request', 'Response' => 'Illuminate\Support\Facades\Response', 'Route' => 'Illuminate\Support\Facades\Route', 'Schema' => 'Illuminate\Support\Facades\Schema', 'Session' => 'Illuminate\Support\Facades\Session', 'Storage' => 'Illuminate\Support\Facades\Storage', 'URL' => 'Illuminate\Support\Facades\URL', 'Validator' => 'Illuminate\Support\Facades\Validator', 'View' => 'Illuminate\Support\Facades\View', //'Form' => Illuminate\Html\FormFacade::class, //'Html' => Illuminate\Html\HtmlFacade::class, 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, 'Flash' => Laracasts\Flash\Flash::class, 'Gravatar' => Thomaswelton\LaravelGravatar\Facades\Gravatar::class, ], ];
{ "content_hash": "7750e8b8260533c42463712aeea49b8f", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 81, "avg_line_length": 46.447916666666664, "alnum_prop": 0.5254541376990357, "repo_name": "freyr69/mh", "id": "8dd487a1413f604f9a5f4c7eea5a56fb0d1a418a", "size": "8918", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/app.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "356" }, { "name": "CSS", "bytes": "52042" }, { "name": "JavaScript", "bytes": "541307" }, { "name": "PHP", "bytes": "568835" } ] }
/* Standard C headers */ #include <assert.h> #include <stddef.h> #include <stdlib.h> #include <string.h> /* POSIX headers */ #ifdef __ANDROID__ #include <malloc.h> #endif /* Windows headers */ #ifdef _WIN32 #include <malloc.h> #endif /* Internal library headers */ #include "threadpool-common.h" #include "threadpool-object.h" PTHREADPOOL_INTERNAL struct pthreadpool* pthreadpool_allocate( size_t threads_count) { assert(threads_count >= 1); const size_t threadpool_size = sizeof(struct pthreadpool) + threads_count * sizeof(struct thread_info); struct pthreadpool* threadpool = NULL; #if defined(__ANDROID__) /* * Android didn't get posix_memalign until API level 17 (Android 4.2). * Use (otherwise obsolete) memalign function on Android platform. */ threadpool = memalign(PTHREADPOOL_CACHELINE_SIZE, threadpool_size); if (threadpool == NULL) { return NULL; } #elif defined(_WIN32) threadpool = _aligned_malloc(threadpool_size, PTHREADPOOL_CACHELINE_SIZE); if (threadpool == NULL) { return NULL; } #else if (posix_memalign((void**) &threadpool, PTHREADPOOL_CACHELINE_SIZE, threadpool_size) != 0) { return NULL; } #endif memset(threadpool, 0, threadpool_size); return threadpool; } PTHREADPOOL_INTERNAL void pthreadpool_deallocate( struct pthreadpool* threadpool) { assert(threadpool != NULL); const size_t threadpool_size = sizeof(struct pthreadpool) + threadpool->threads_count.value * sizeof(struct thread_info); memset(threadpool, 0, threadpool_size); #ifdef _WIN32 _aligned_free(threadpool); #else free(threadpool); #endif }
{ "content_hash": "35d7c6c5b60cbe81c8b55409392583dc", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 122, "avg_line_length": 24.227272727272727, "alnum_prop": 0.7148217636022514, "repo_name": "Maratyszcza/pthreadpool", "id": "fc0d83e172293008692263d5237b9ac0fc487c15", "size": "1599", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/memory.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "264550" }, { "name": "C++", "bytes": "470944" }, { "name": "CMake", "bytes": "10983" }, { "name": "Makefile", "bytes": "544" }, { "name": "Python", "bytes": "1240" }, { "name": "Starlark", "bytes": "12596" } ] }
#ifndef NAVIGATIONAL_PARSER_H #define NAVIGATIONAL_PARSER_H #include "navigational_parser_types.hpp" #include <string> #include <istream> namespace csvp { namespace navigational { namespace parser { class navigational_parser { public: pattern parse(const std::string& input) const; pattern parse(std::istream& input) const; }; } } } #endif
{ "content_hash": "925c55bddb4241526823acc3c660d65a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 48, "avg_line_length": 14.625, "alnum_prop": 0.7435897435897436, "repo_name": "CSWR/annotatingCSV", "id": "f70fa318200476464ef51316f2d6b0ac1413fc42", "size": "559", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/parser/navigational_parser.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "120200" }, { "name": "CMake", "bytes": "2528" }, { "name": "Python", "bytes": "1578" }, { "name": "Shell", "bytes": "1413" } ] }
<?php /** * Settings extension for managing view-related settings. * * @author Time.ly Network, Inc. * @since 2.0 * @package Ai1EC * @subpackage Ai1EC.Model */ class Ai1ec_Settings_View extends Ai1ec_App { /** * @var string Name of settings option to use for views map. */ const SETTING_VIEWS_MAP = 'enabled_views'; /** * @var Ai1ec_Settings Instance */ protected $_settings = null; /** * Acquire Settings model instance for future reference. * * @return void */ protected function _initialize() { $this->_settings = $this->_registry->get( 'model.settings' ); } /** * Add a view if not set. * * @param array $view */ public function add( array $view ) { $enabled_views = $this->_get(); if ( isset( $enabled_views[$view['name']] ) ) { if ( $enabled_views[$view['name']]['longname'] === $view['longname'] ) { return; } $enabled_views[$view['name']]['longname'] = $view['longname']; } else { // Copy relevant settings to local view array; account for possible missing // mobile settings during upgrade (assign defaults). $enabled_views[$view['name']] = array( 'enabled' => $view['enabled'], 'default' => $view['default'], 'enabled_mobile' => isset( $view['enabled_mobile'] ) ? $view['enabled_mobile'] : $view['enabled'], 'default_mobile' => isset( $view['default_mobile'] ) ? $view['default_mobile'] : $view['default'], 'longname' => $view['longname'], ); } $this->_set( $enabled_views ); } /** * Remove a view. * * @param string $view */ public function remove( $view ) { $enabled_views = $this->_get(); if ( isset( $enabled_views[$view] ) ) { unset( $enabled_views[$view] ); $this->_set( $enabled_views ); } } /** * Retrieve all configured views. * * @return array Map of configured view aliases and their details. */ public function get_all() { return $this->_get(); } /** * Get name of view to be rendered for requested alias. * * @param string $view Name of view requested. * * @return string Name of view to be rendered. * * @throws Ai1ec_Settings_Exception If no views are configured. */ public function get_configured( $view ) { $enabled_views = $this->_get(); if ( empty( $enabled_views ) ) { throw new Ai1ec_Settings_Exception( 'No view is enabled' ); } if ( isset( $enabled_views[$view] ) && $enabled_views[$view]['enabled'] ) { return $view; } return $this->get_default(); } /** * Get default view to render. * * * @return */ public function get_default() { $enabled_views = $this->_get(); $default = null; // Check mobile settings first, if in mobile mode. if ( ! $this->_registry->get( 'compatibility.cli' )->is_cli() && wp_is_mobile() ) { foreach ( $enabled_views as $view => $details ) { if ( isset( $details['default_mobile'] ) && $details['default_mobile'] && $details['enabled_mobile'] ) { $default = $view; break; } } } // Either not in mobile mode or no mobile settings available; look up // desktop settings. if ( null === $default ) { foreach ( $enabled_views as $view => $details ) { if ( $details['default'] && $details['enabled'] ) { $default = $view; break; } } } // No enabled view found, but we need to pick one, so pick the first view. if ( null === $default ) { $default = (string)current( array_keys( $enabled_views ) ); } return $default; } /** * Retrieve views maps from storage. * * @return array Current views map. */ protected function _get() { return (array)$this->_settings->get( self::SETTING_VIEWS_MAP, array() ); } /** * Update views map. * * @param array $enabled_views Map of enabled views. * * @return bool Success. */ protected function _set( array $enabled_views ) { return $this->_settings->set( self::SETTING_VIEWS_MAP, $enabled_views ); } }
{ "content_hash": "ac119a7703a87e83f9bc982fa9f02aca", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 78, "avg_line_length": 24.023952095808383, "alnum_prop": 0.5869890329012961, "repo_name": "sedici/wpmu-istec", "id": "a4db94423d855c22c6a1ddd4d0379287213ac7d4", "size": "4012", "binary": false, "copies": "33", "ref": "refs/heads/master", "path": "wp-content/plugins/all-in-one-event-calendar/app/model/settings-view.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "616" }, { "name": "Batchfile", "bytes": "166" }, { "name": "CSS", "bytes": "3940197" }, { "name": "HTML", "bytes": "282386" }, { "name": "JavaScript", "bytes": "5863354" }, { "name": "PHP", "bytes": "17942125" }, { "name": "Shell", "bytes": "3301" } ] }
"""Plots the histogram of one of the trace keys.""" import argparse import logging import math import sys import matplotlib matplotlib.use('Agg') # pylint: disable=wrong-import-position import matplotlib.mlab import matplotlib.pyplot import numpy import scipy.stats from parse_trace import parse_trace def plot_histogram(trace, key, nbins, distribution_name, xmax): """Plots a trace.""" all_items = numpy.asarray([ i for pc in trace.values() for i in pc[key]]) distribution = getattr(scipy.stats, distribution_name) if nbins is None: # Use the Freedman-Diaconis estimate. nbins = int((numpy.max(all_items) - numpy.min(all_items)) / (2 * scipy.stats.iqr(all_items) * math.pow(len(all_items), -1/3))) logging.warning('Using %d bins as default for %d samples.', nbins, len(all_items)) fit = distribution(*distribution.fit(all_items)) matplotlib.pyplot.style.use('bmh') _, axis = matplotlib.pyplot.subplots(1, 1) data, bins, _ = axis.hist(all_items, nbins, density=True, label='Histogram for key "%s"' % key) axis.plot(bins, fit.pdf(bins), 'r--', linewidth=1, label='Best %s fit for key "%s"' % (distribution_name, key)) axis.set_ylim([0.0, max(data)]) if xmax is not None: axis.set_xlim([0.0, xmax]) matplotlib.pyplot.xlabel('Interval duration (s)') matplotlib.pyplot.ylabel('Probability') axis.grid(True, which='both') axis.legend(loc='best', frameon=False) matplotlib.pyplot.savefig('histogram.png') def main(): """Just parses arguments and moves forward.""" parser = argparse.ArgumentParser() parser.add_argument('--trace', required=True, dest='trace_file', help='path to the trace file to analyse') parser.add_argument('--key', required=True, dest='key', help='key in the trace to process') parser.add_argument('--bins', dest='nbins', type=int, default=None, help='number of histogram hins to have') parser.add_argument('--distribution_to_fit', dest='distribution_to_fit', default='norm', help='which distribution to fit') parser.add_argument('--xmax', dest='xmax', type=int, default=None, help='max for the x axis on the plots') args = parser.parse_args() try: plot_histogram(parse_trace(args.trace_file), args.key, args.nbins, args.distribution_to_fit, args.xmax) except KeyError: print('Invalid key: %s' % args.key) return 1 if __name__ == '__main__': sys.exit(main())
{ "content_hash": "5f248640fb5cc9586f277e29c34aea1d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 74, "avg_line_length": 35.4, "alnum_prop": 0.5829802259887006, "repo_name": "m3drano/power-simulation", "id": "d84d110624af0ce0ad0d6a203b743e7400cfcc57", "size": "3433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/plot_histogram.py", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "888" }, { "name": "Python", "bytes": "101496" } ] }
package org.xmpp.packet; import org.dom4j.Element; import java.util.Iterator; /** * Presence packet. Presence packets are used to express an entity's current * network availability and to notify other entities of that availability. * Presence packets are also used to negotiate and manage subscriptions to the * presence of other entities.<p> * * A presence optionally has a {@link Type}. * * @author Matt Tucker */ public class Presence extends Packet { /** * Constructs a new Presence. */ public Presence() { this.element = docFactory.createDocument().addElement("presence"); } /** * Constructs a new Presence with the specified type. * * @param type the presence type. */ public Presence(Presence.Type type) { this(); setType(type); } /** * Constructs a new Presence using an existing Element. This is useful * for parsing incoming presence Elements into Presence objects. * * @param element the presence Element. */ public Presence(Element element) { super(element); } /** * Constructs a new Presence using an existing Element. This is useful * for parsing incoming Presence Elements into Presence objects. Stringprep validation * on the TO address can be disabled. The FROM address will not be validated since the * server is the one that sets that value. * * @param element the Presence Element. * @param skipValidation true if stringprep should not be applied to the TO address. */ public Presence(Element element, boolean skipValidation) { super(element, skipValidation); } /** * Constructs a new Presence that is a copy of an existing Presence. * * @param presence the presence packet. * @see #createCopy() */ private Presence(Presence presence) { Element elementCopy = presence.element.createCopy(); docFactory.createDocument().add(elementCopy); this.element = elementCopy; // Copy cached JIDs (for performance reasons) this.toJID = presence.toJID; this.fromJID = presence.fromJID; } /** * Returns true if the presence type is "available". This is a * convenience method that is equivalent to: * * <pre>getType() == null</pre> * */ public boolean isAvailable() { return getType() == null; } /** * Returns the type of this presence. If the presence is "available", the * type will be <tt>null</tt> (in XMPP, no value for the type attribute is * defined as available). * * @return the presence type or <tt>null</tt> if "available". * @see Type */ public Type getType() { String type = element.attributeValue("type"); if (type == null) { return null; } else { return Type.valueOf(type); } } /** * Sets the type of this presence. * * @param type the presence type. * @see Type */ public void setType(Type type) { element.addAttribute("type", type==null?null:type.toString()); } /** * Returns the presence "show" value, which specifies a particular availability * status. If the &lt;show&gt; element is not present, this method will return * <tt>null</tt>. The show value can only be set if the presence type is "avaialble". * A <tt>null</tt> show value is used to represent "available", which is the * default. * * @return the presence show value.. * @see Show */ public Show getShow() { String show = element.elementText("show"); if (show == null) { return null; } else { return Show.valueOf(show); } } /** * Sets the presence "show" value, which specifies a particular availability * status. The show value can only be set if the presence type is "available". * A <tt>null</tt> show value is used to represent "available", which is the * default. * * @param show the presence show value. * @throws IllegalArgumentException if the presence type is not available. * @see Show */ public void setShow(Show show) { Element showElement = element.element("show"); // If show is null, clear the subject. if (show == null) { if (showElement != null) { element.remove(showElement); } return; } if (showElement == null) { if (!isAvailable()) { throw new IllegalArgumentException("Cannot set 'show' if 'type' attribute is set."); } showElement = element.addElement("show"); } showElement.setText(show.toString()); } /** * Returns the status of this presence packet, a natural-language description * of availability status. * * @return the status. */ public String getStatus() { return element.elementText("status"); } /** * Sets the status of this presence packet, a natural-language description * of availability status. * * @param status the status. */ public void setStatus(String status) { Element statusElement = element.element("status"); // If subject is null, clear the subject. if (status == null) { if (statusElement != null) { element.remove(statusElement); } return; } if (statusElement == null) { statusElement = element.addElement("status"); } statusElement.setText(status); } /** * Returns the priority. The valid priority range is -128 through 128. * If no priority element exists in the packet, this method will return * the default value of 0. * * @return the priority. */ public int getPriority() { String priority = element.elementText("priority"); if (priority == null) { return 0; } else { try { return Integer.parseInt(priority); } catch (Exception e) { return 0; } } } /** * Sets the priority. The valid priority range is -128 through 128. * * @param priority the priority. * @throws IllegalArgumentException if the priority is less than -128 or greater * than 128. */ public void setPriority(int priority) { if (priority < -128 || priority > 128) { throw new IllegalArgumentException("Priority value of " + priority + " is outside the valid range of -128 through 128"); } Element priorityElement = element.element("priority"); if (priorityElement == null) { priorityElement = element.addElement("priority"); } priorityElement.setText(Integer.toString(priority)); } /** * Returns the first child element of this packet that matches the * given name and namespace. If no matching element is found, * <tt>null</tt> will be returned. This is a convenience method to avoid * manipulating this underlying packet's Element instance directly.<p> * * Child elements in extended namespaces are used to extend the features * of XMPP. Examples include a "user is typing" indicator and invitations to * group chat rooms. Although any valid XML can be included in a child element * in an extended namespace, many common features have been standardized * as <a href="http://www.jabber.org/jeps">Jabber Enhancement Proposals</a> * (JEPs). * * @param name the element name. * @param namespace the element namespace. * @return the first matching child element, or <tt>null</tt> if there * is no matching child element. */ public Element getChildElement(String name, String namespace) { for (Iterator i=element.elementIterator(name); i.hasNext(); ) { Element element = (Element)i.next(); if (element.getNamespaceURI().equals(namespace)) { return element; } } return null; } /** * Adds a new child element to this packet with the given name and * namespace. The newly created Element is returned. This is a * convenience method to avoid manipulating this underlying packet's * Element instance directly.<p> * * Child elements in extended namespaces are used to extend the features * of XMPP. Examples include a "user is typing" indicator and invitations to * group chat rooms. Although any valid XML can be included in a child element * in an extended namespace, many common features have been standardized * as <a href="http://www.jabber.org/jeps">Jabber Enhancement Proposals</a> * (JEPs). * * @param name the element name. * @param namespace the element namespace. * @return the newly created child element. */ public Element addChildElement(String name, String namespace) { return element.addElement(name, namespace); } /** * Returns a deep copy of this Presence. * * @return a deep copy of this Presence. */ public Presence createCopy() { return new Presence(this); } /** * Represents the type of a presence packet. Note: the presence is assumed * to be "available" when the type attribute of the packet is <tt>null</tt>. * The valid types are: * * <ul> * <li>{@link #unavailable Presence.Type.unavailable} -- signals that the * entity is no longer available for communication. * <li>{@link #subscribe Presence.Type.subscribe} -- the sender wishes to * subscribe to the recipient's presence. * <li>{@link #subscribed Presence.Type.subscribed} -- the sender has allowed * the recipient to receive their presence. * <li>{@link #unsubscribe Presence.Type.unsubscribe} -- the sender is * unsubscribing from another entity's presence. * <li>{@link #unsubscribed Presence.Type.unsubcribed} -- the subscription * request has been denied or a previously-granted subscription has been cancelled. * <li>{@link #probe Presence.Type.probe} -- a request for an entity's current * presence; SHOULD be generated only by a server on behalf of a user. * <li>{@link #error Presence.Type.error} -- an error has occurred regarding * processing or delivery of a previously-sent presence stanza. * </ul> */ public enum Type { /** * Typically short text message used in line-by-line chat interfaces. */ unavailable, /** * The sender wishes to subscribe to the recipient's presence. */ subscribe, /** * The sender has allowed the recipient to receive their presence. */ subscribed, /** * The sender is unsubscribing from another entity's presence. */ unsubscribe, /** * The subscription request has been denied or a previously-granted * subscription has been cancelled. */ unsubscribed, /** * A request for an entity's current presence; SHOULD be * generated only by a server on behalf of a user. */ probe, /** * An error has occurred regarding processing or delivery * of a previously-sent presence stanza. */ error; } /** * Represents the presence "show" value. Note: a <tt>null</tt> "show" value is the * default, which means "available". Valid values are: * * <ul> * <li>{@link #chat Presence.Show.chat} -- the entity or resource is actively * interested in chatting. * <li>{@link #away Presence.Show.away} -- the entity or resource is * temporarily away. * <li>{@link #dnd Presence.Show.dnd} -- the entity or resource is busy * (dnd = "Do Not Disturb"). * <li>{@link #xa Presence.Show.xa} -- the entity or resource is away for an * extended period (xa = "eXtended Away"). * </ul> */ public enum Show { /** * The entity or resource is actively interested in chatting. */ chat, /** * The entity or resource is temporarily away. */ away, /** * The entity or resource is away for an extended period (xa = "eXtended Away"). */ xa, /** * The entity or resource is busy (dnd = "Do Not Disturb"). */ dnd; } }
{ "content_hash": "a8c378c0ddcd5c17c077b439f7ca5ab6", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 100, "avg_line_length": 32.8248730964467, "alnum_prop": 0.5940617026212016, "repo_name": "disrvptor/org.jivesoftware-whack", "id": "a6d38c36af1499e55c040036d15e7d81e161b712", "size": "13646", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/xmpp/packet/Presence.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "634" }, { "name": "Java", "bytes": "455424" } ] }
<?xml version="1.0"?> <!-- ~ Copyright (c) 2014 Evolveum ~ ~ 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <name>midPoint Security - api</name> <groupId>com.evolveum.midpoint.repo</groupId> <artifactId>security-api</artifactId> <packaging>jar</packaging> <parent> <artifactId>repo</artifactId> <groupId>com.evolveum.midpoint</groupId> <version>3.3-SNAPSHOT</version> </parent> <scm> <connection>https://github.com/Evolveum/midpoint.git</connection> <developerConnection>git@github.com:Evolveum/midpoint.git</developerConnection> <url>https://fisheye.evolveum.com/browse/midPoint</url> </scm> <dependencies> <dependency> <groupId>com.evolveum.midpoint.infra</groupId> <artifactId>common</artifactId> <version>3.3-SNAPSHOT</version> </dependency> <dependency> <groupId>com.evolveum.midpoint.tools</groupId> <artifactId>test-ng</artifactId> <version>3.3-SNAPSHOT</version> <scope>test</scope> </dependency> </dependencies> </project>
{ "content_hash": "f920b20c6e3e33744a22f57b5f1dd8f9", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 204, "avg_line_length": 37.787234042553195, "alnum_prop": 0.713963963963964, "repo_name": "gureronder/midpoint", "id": "0cbc5cdddaf11272517ff952e6ba9a290e8b3bf1", "size": "1776", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "repo/security-api/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "176525" }, { "name": "Groovy", "bytes": "10361" }, { "name": "HTML", "bytes": "450709" }, { "name": "Java", "bytes": "19619257" }, { "name": "JavaScript", "bytes": "70636" }, { "name": "PLSQL", "bytes": "2171" }, { "name": "PLpgSQL", "bytes": "3307" }, { "name": "SQLPL", "bytes": "4091" }, { "name": "Shell", "bytes": "3606" } ] }
from datetime import time, datetime from tempfile import NamedTemporaryFile import os import os.path import shutil # 3rd party imports from nose.tools import eq_, raises from openpyxl.workbook import Workbook from openpyxl.writer import dump_worksheet from openpyxl.cell import get_column_letter from openpyxl.reader.excel import load_workbook from openpyxl.writer.strings import StringTableBuilder from openpyxl.shared.compat import xrange from openpyxl.shared.exc import WorkbookAlreadySaved def _get_test_filename(): test_file = NamedTemporaryFile(mode='w', prefix='openpyxl.', suffix='.xlsx', delete=False) test_file.close() return test_file.name def test_dump_sheet_title(): test_filename = _get_test_filename() wb = Workbook(optimized_write=True) ws = wb.create_sheet(title='Test1') wb.save(test_filename) wb2 = load_workbook(test_filename) ws = wb2.get_sheet_by_name('Test1') eq_('Test1', ws.title) def test_dump_sheet(): test_filename = _get_test_filename() wb = Workbook(optimized_write=True) ws = wb.create_sheet() letters = [get_column_letter(x + 1) for x in xrange(20)] expected_rows = [] for row in xrange(20): expected_rows.append(['%s%d' % (letter, row + 1) for letter in letters]) for row in xrange(20): expected_rows.append([(row + 1) for letter in letters]) for row in xrange(10): expected_rows.append([datetime(2010, ((x % 12) + 1), row + 1) for x in range(len(letters))]) for row in xrange(20): expected_rows.append(['=%s%d' % (letter, row + 1) for letter in letters]) for row in expected_rows: ws.append(row) wb.save(test_filename) wb2 = load_workbook(test_filename) ws = wb2.worksheets[0] for ex_row, ws_row in zip(expected_rows[:-20], ws.rows): for ex_cell, ws_cell in zip(ex_row, ws_row): eq_(ex_cell, ws_cell.value) os.remove(test_filename) def test_table_builder(): sb = StringTableBuilder() result = {'a':0, 'b':1, 'c':2, 'd':3} for letter in sorted(result.keys()): for x in range(5): sb.add(letter) table = dict(sb.get_table()) for key, idx in result.items(): eq_(idx, table[key]) def test_open_too_many_files(): test_filename = _get_test_filename() wb = Workbook(optimized_write=True) for i in range(200): # over 200 worksheets should raise an OSError ('too many open files') wb.create_sheet() wb.save(test_filename) os.remove(test_filename) def test_create_temp_file(): f = dump_worksheet.create_temporary_file() if not os.path.isfile(f): raise Exception("The file %s does not exist" % f) @raises(WorkbookAlreadySaved) def test_dump_twice(): test_filename = _get_test_filename() wb = Workbook(optimized_write=True) ws = wb.create_sheet() ws.append(['hello']) wb.save(test_filename) os.remove(test_filename) wb.save(test_filename) @raises(WorkbookAlreadySaved) def test_append_after_save(): test_filename = _get_test_filename() wb = Workbook(optimized_write=True) ws = wb.create_sheet() ws.append(['hello']) wb.save(test_filename) os.remove(test_filename) ws.append(['hello'])
{ "content_hash": "d1a7c20d4c4e754d7d3d64ca8b015cad", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 100, "avg_line_length": 20.9171974522293, "alnum_prop": 0.6507308160779537, "repo_name": "benpruitt/customarrayformatter", "id": "84592824507dbca17040592d0ee1742c8acc2491", "size": "4531", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "openpyxl/tests/test_dump.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "554753" } ] }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (version 1.7.0_03) on Wed May 01 12:49:30 CEST 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>net.sourceforge.pmd.lang.java.rule.logging Class Hierarchy (PMD 5.0.4 API)</title> <meta name="date" content="2013-05-01"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="net.sourceforge.pmd.lang.java.rule.logging Class Hierarchy (PMD 5.0.4 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/junit/package-tree.html">Prev</a></li> <li><a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/migrating/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?net/sourceforge/pmd/lang/java/rule/logging/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package net.sourceforge.pmd.lang.java.rule.logging</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="strong">Object</span></a> <ul> <li type="circle">net.sourceforge.pmd.<a href="../../../../../../../net/sourceforge/pmd/AbstractPropertySource.html" title="class in net.sourceforge.pmd"><span class="strong">AbstractPropertySource</span></a> (implements net.sourceforge.pmd.<a href="../../../../../../../net/sourceforge/pmd/PropertySource.html" title="interface in net.sourceforge.pmd">PropertySource</a>) <ul> <li type="circle">net.sourceforge.pmd.lang.rule.<a href="../../../../../../../net/sourceforge/pmd/lang/rule/AbstractRule.html" title="class in net.sourceforge.pmd.lang.rule"><span class="strong">AbstractRule</span></a> (implements net.sourceforge.pmd.<a href="../../../../../../../net/sourceforge/pmd/Rule.html" title="interface in net.sourceforge.pmd">Rule</a>) <ul> <li type="circle">net.sourceforge.pmd.lang.java.rule.<a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html" title="class in net.sourceforge.pmd.lang.java.rule"><span class="strong">AbstractJavaRule</span></a> (implements net.sourceforge.pmd.lang.rule.<a href="../../../../../../../net/sourceforge/pmd/lang/rule/ImmutableLanguage.html" title="interface in net.sourceforge.pmd.lang.rule">ImmutableLanguage</a>, net.sourceforge.pmd.lang.java.ast.<a href="../../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParserVisitor.html" title="interface in net.sourceforge.pmd.lang.java.ast">JavaParserVisitor</a>) <ul> <li type="circle">net.sourceforge.pmd.lang.java.rule.logging.<a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/logging/MoreThanOneLoggerRule.html" title="class in net.sourceforge.pmd.lang.java.rule.logging"><span class="strong">MoreThanOneLoggerRule</span></a></li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/junit/package-tree.html">Prev</a></li> <li><a href="../../../../../../../net/sourceforge/pmd/lang/java/rule/migrating/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?net/sourceforge/pmd/lang/java/rule/logging/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2002-2013 <a href="http://pmd.sourceforge.net/">InfoEther</a>. All Rights Reserved.</small></p> </body> </html>
{ "content_hash": "c3012b47bf104abc864aef1a0aab38d8", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 641, "avg_line_length": 46.556338028169016, "alnum_prop": 0.6283466949024353, "repo_name": "jmagas/RedditDailyProgrammer", "id": "4ccde34302ab617821574cbe54c26becd9aac850", "size": "6611", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/pmd-bin-5.0.4/docs/apidocs/net/sourceforge/pmd/lang/java/rule/logging/package-tree.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49573" }, { "name": "Java", "bytes": "542603" }, { "name": "JavaScript", "bytes": "7987" }, { "name": "Perl", "bytes": "1836" }, { "name": "XSLT", "bytes": "114364" } ] }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="@color/bright_foreground_disabled_material_dark"/> <item android:color="@color/bright_foreground_material_dark"/> </selector> <!-- From: file:/C:/Users/Jacques/AndroidStudioProjects/TP-Formation-Android/5%20-%20Service%20tiers/3%20-%20TP%20GooglePlus/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/color/abc_primary_text_disable_only_material_dark.xml -->
{ "content_hash": "4b78f8f22075a510619aef2fc89d9853", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 263, "avg_line_length": 56.61904761904762, "alnum_prop": 0.7426408746846089, "repo_name": "jacquesgiraudel/TP-Formation-Android", "id": "ea7329874ec5a2cd8653babfd5a44695cb3d5d3c", "size": "1189", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "5 - Service tiers/3 - TP GooglePlus/app/build/intermediates/res/debug/color/abc_primary_text_disable_only_material_dark.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1142" }, { "name": "HTML", "bytes": "6856" }, { "name": "Java", "bytes": "6493986" }, { "name": "Makefile", "bytes": "1349" } ] }
package org.apache.lens.cube.parse; import static org.apache.lens.cube.error.LensCubeErrorCode.SYNTAX_ERROR; import static org.apache.hadoop.hive.ql.parse.HiveParser.*; import static org.apache.hadoop.hive.ql.parse.HiveParser.Number; import java.io.IOException; import java.lang.reflect.Field; import java.util.*; import java.util.regex.Pattern; import org.apache.lens.server.api.error.LensException; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.Context; import org.apache.hadoop.hive.ql.exec.FunctionRegistry; import org.apache.hadoop.hive.ql.lib.Node; import org.apache.hadoop.hive.ql.parse.*; import org.antlr.runtime.tree.Tree; import com.google.common.base.Optional; import lombok.extern.slf4j.Slf4j; @Slf4j public final class HQLParser { private HQLParser() { } public static final Pattern P_WSPACE = Pattern.compile("\\s+"); public interface ASTNodeVisitor { void visit(TreeNode node) throws LensException; } public static class TreeNode { final TreeNode parent; final ASTNode node; public TreeNode(TreeNode parent, ASTNode node) { this.parent = parent; this.node = node; } public TreeNode getParent() { return parent; } public ASTNode getNode() { return node; } } public static final Set<Integer> BINARY_OPERATORS; public static final Set<Integer> ARITHMETIC_OPERATORS; public static final Set<Integer> UNARY_OPERATORS; public static final Set<Integer> PRIMITIVE_TYPES; static { HashSet<Integer> ops = new HashSet<Integer>(); ops.add(DOT); ops.add(KW_AND); ops.add(KW_OR); ops.add(EQUAL); ops.add(EQUAL_NS); ops.add(NOTEQUAL); ops.add(GREATERTHAN); ops.add(GREATERTHANOREQUALTO); ops.add(LESSTHAN); ops.add(LESSTHANOREQUALTO); ops.add(PLUS); ops.add(MINUS); ops.add(STAR); ops.add(DIVIDE); ops.add(MOD); ops.add(KW_LIKE); ops.add(KW_RLIKE); ops.add(KW_REGEXP); ops.add(AMPERSAND); ops.add(BITWISEOR); ops.add(BITWISEXOR); BINARY_OPERATORS = Collections.unmodifiableSet(ops); ARITHMETIC_OPERATORS = new HashSet<Integer>(); ARITHMETIC_OPERATORS.add(PLUS); ARITHMETIC_OPERATORS.add(MINUS); ARITHMETIC_OPERATORS.add(STAR); ARITHMETIC_OPERATORS.add(DIVIDE); ARITHMETIC_OPERATORS.add(MOD); HashSet<Integer> unaryOps = new HashSet<Integer>(); unaryOps.add(KW_NOT); unaryOps.add(TILDE); UNARY_OPERATORS = Collections.unmodifiableSet(unaryOps); HashSet<Integer> primitiveTypes = new HashSet<Integer>(); primitiveTypes.add(TOK_TINYINT); primitiveTypes.add(TOK_SMALLINT); primitiveTypes.add(TOK_INT); primitiveTypes.add(TOK_BIGINT); primitiveTypes.add(TOK_BOOLEAN); primitiveTypes.add(TOK_FLOAT); primitiveTypes.add(TOK_DOUBLE); primitiveTypes.add(TOK_DATE); primitiveTypes.add(TOK_DATETIME); primitiveTypes.add(TOK_TIMESTAMP); primitiveTypes.add(TOK_STRING); primitiveTypes.add(TOK_BINARY); primitiveTypes.add(TOK_DECIMAL); primitiveTypes.add(TOK_VARCHAR); primitiveTypes.add(TOK_CHAR); PRIMITIVE_TYPES = Collections.unmodifiableSet(primitiveTypes); } public static boolean isArithmeticOp(int tokenType) { return ARITHMETIC_OPERATORS.contains(tokenType); } public static ASTNode parseHQL(String query, HiveConf conf) throws LensException { ParseDriver driver = new ParseDriver(); ASTNode tree = null; Context ctx = null; try { ctx = new Context(conf); tree = driver.parse(query, ctx); tree = ParseUtils.findRootNonNullToken(tree); } catch (ParseException e) { throw new LensException(SYNTAX_ERROR.getLensErrorInfo(), e, e.getMessage()); } catch (IOException e) { throw new RuntimeException(e); } finally { if (ctx != null) { try { ctx.clear(); } catch (IOException e) { // ignoring exception in clear } } } return tree; } public static ASTNode parseExpr(String expr) throws ParseException { ParseDriver driver = new ParseDriver(); ASTNode tree = driver.parseExpression(expr); return ParseUtils.findRootNonNullToken(tree); } public static void printAST(ASTNode node) { try { printAST(getHiveTokenMapping(), node, 0, 0); } catch (Exception e) { log.error("Error in printing AST.", e); } System.out.println(); } /** * Debug function for printing query AST to stdout * * @param node * @param level */ public static void printAST(Map<Integer, String> tokenMapping, ASTNode node, int level, int child) { if (node == null || node.isNil()) { return; } for (int i = 0; i < level; i++) { System.out.print(" "); } System.out.print(node.getText() + " [" + tokenMapping.get(node.getToken().getType()) + "]"); System.out.print(" (l" + level + "c" + child + ")"); if (node.getChildCount() > 0) { System.out.println(" {"); for (int i = 0; i < node.getChildCount(); i++) { Tree tree = node.getChild(i); if (tree instanceof ASTNode) { printAST(tokenMapping, (ASTNode) tree, level + 1, i + 1); } else { System.out.println("NON ASTNode"); } System.out.println(); } for (int i = 0; i < level; i++) { System.out.print(" "); } System.out.print("}"); } else { System.out.print('$'); } } public static Map<Integer, String> getHiveTokenMapping() throws Exception { Map<Integer, String> mapping = new HashMap<Integer, String>(); for (Field f : HiveParser.class.getFields()) { if (f.getType() == int.class) { Integer tokenId = f.getInt(null); String token = f.getName(); mapping.put(tokenId, token); } } return mapping; } /** * Find a node in the tree rooted at root, given the path of type of tokens from the root's children to the desired * node * * @param root * @param path starts at the level of root's children * @return */ public static ASTNode findNodeByPath(ASTNode root, int... path) { for (int i = 0; i < path.length; i++) { int type = path[i]; boolean hasChildWithType = false; for (int j = 0; j < root.getChildCount(); j++) { ASTNode node = (ASTNode) root.getChild(j); if (node.getToken().getType() == type) { hasChildWithType = true; root = node; // If this is the last type in path, return this node if (i == path.length - 1) { return root; } else { // Go to next level break; } } else { // Go to next sibling. continue; } } if (!hasChildWithType) { // No path from this level break; } } return null; } public static ASTNode copyAST(ASTNode original) { ASTNode copy = new ASTNode(original); // Leverage constructor if (original.getChildren() != null) { for (Object o : original.getChildren()) { ASTNode childCopy = copyAST((ASTNode) o); childCopy.setParent(copy); copy.addChild(childCopy); } } return copy; } /** * Breadth first traversal of AST * * @param root * @param visitor * @throws LensException */ public static void bft(ASTNode root, ASTNodeVisitor visitor) throws LensException { if (root == null) { throw new NullPointerException("Root cannot be null"); } if (visitor == null) { throw new NullPointerException("Visitor cannot be null"); } Queue<TreeNode> queue = new LinkedList<TreeNode>(); queue.add(new TreeNode(null, root)); while (!queue.isEmpty()) { TreeNode node = queue.poll(); visitor.visit(node); ASTNode astNode = node.getNode(); for (int i = 0; i < astNode.getChildCount(); i++) { queue.offer(new TreeNode(node, (ASTNode) astNode.getChild(i))); } } } static boolean hasSpaces(String text) { if (P_WSPACE.matcher(text).find()) { return true; } return false; } /** * Recursively reconstruct query string given a query AST * * @param root * @param buf preallocated builder where the reconstructed string will be written */ public static void toInfixString(ASTNode root, StringBuilder buf) { if (root == null) { return; } int rootType = root.getToken().getType(); String rootText = root.getText(); // Operand, print contents if (Identifier == rootType || Number == rootType || StringLiteral == rootType || KW_TRUE == rootType || KW_FALSE == rootType || KW_FORMATTED == rootType || KW_EXTENDED == rootType || KW_DEPENDENCY == rootType) { // StringLiterals should not be lower cased. if (StringLiteral == rootType) { buf.append(' ').append(rootText).append(' '); } else if (KW_TRUE == rootType) { buf.append(" true "); } else if (KW_FALSE == rootType) { buf.append(" false "); } else if (Identifier == rootType && TOK_SELEXPR == ((ASTNode) root.getParent()).getToken().getType() && hasSpaces(rootText)) { // If column alias contains spaces, enclose in back quotes buf.append(" as `").append(rootText).append("` "); } else if (Identifier == rootType && TOK_FUNCTIONSTAR == ((ASTNode) root.getParent()).getToken().getType()) { // count(*) or count(someTab.*): Don't append space after the identifier buf.append(" ").append(rootText == null ? "" : rootText.toLowerCase()); } else { buf.append(" ").append(rootText == null ? "" : rootText.toLowerCase()).append(" "); } } else if (TOK_ALLCOLREF == rootType) { if (root.getChildCount() > 0) { for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } buf.append("."); } buf.append(" * "); } else if (TOK_FUNCTIONSTAR == rootType) { if (root.getChildCount() > 0) { for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } buf.append("(*) "); } else if (UNARY_OPERATORS.contains(Integer.valueOf(rootType))) { if (KW_NOT == rootType) { // Check if this is actually NOT IN if (!(findNodeByPath(root, TOK_FUNCTION, KW_IN) != null)) { buf.append(" not "); } } else if (TILDE == rootType) { buf.append(" ~ "); } for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } else if (BINARY_OPERATORS.contains(Integer.valueOf(root.getToken().getType()))) { buf.append("("); if (MINUS == rootType && root.getChildCount() == 1) { // If minus has only one child, then it's a unary operator. // Add Operator name first buf.append(' ').append(rootText.toLowerCase()).append(' '); // Operand toInfixString((ASTNode) root.getChild(0), buf); } else { // Left operand toInfixString((ASTNode) root.getChild(0), buf); // Operator name if (root.getToken().getType() != DOT) { buf.append(' ').append(rootText.toLowerCase()).append(' '); } else { buf.append(rootText.toLowerCase()); } // Right operand toInfixString((ASTNode) root.getChild(1), buf); } buf.append(")"); } else if (LSQUARE == rootType) { // square brackets for array and map types toInfixString((ASTNode) root.getChild(0), buf); buf.append("["); toInfixString((ASTNode) root.getChild(1), buf); buf.append("]"); } else if (PRIMITIVE_TYPES.contains(rootType)) { if (rootType == TOK_TINYINT) { buf.append("tinyint"); } else if (rootType == TOK_SMALLINT) { buf.append("smallint"); } else if (rootType == TOK_INT) { buf.append("int"); } else if (rootType == TOK_BIGINT) { buf.append("bigint"); } else if (rootType == TOK_BOOLEAN) { buf.append("boolean"); } else if (rootType == TOK_FLOAT) { buf.append("float"); } else if (rootType == TOK_DOUBLE) { buf.append("double"); } else if (rootType == TOK_DATE) { buf.append("date"); } else if (rootType == TOK_DATETIME) { buf.append("datetime"); } else if (rootType == TOK_TIMESTAMP) { buf.append("timestamp"); } else if (rootType == TOK_STRING) { buf.append("string"); } else if (rootType == TOK_BINARY) { buf.append("binary"); } else if (rootType == TOK_DECIMAL) { buf.append("decimal"); if (root.getChildCount() >= 1) { buf.append("(").append(root.getChild(0).getText()); if (root.getChildCount() == 2) { buf.append(",").append(root.getChild(1).getText()); } buf.append(")"); } } else if (rootType == TOK_VARCHAR) { buf.append("varchar"); if (root.getChildCount() >= 1) { buf.append("(").append(root.getChild(0).getText()).append(")"); } } else if (rootType == TOK_CHAR) { buf.append("char"); if (root.getChildCount() >= 1) { buf.append("(").append(root.getChild(0).getText()).append(")"); } } else { buf.append(rootText); } } else if (TOK_FUNCTION == root.getToken().getType()) { // Handle UDFs, conditional operators. functionString(root, buf); } else if (TOK_FUNCTIONDI == rootType) { // Distinct is a different case. String fname = ((ASTNode) root.getChild(0)).getText(); buf.append(fname.toLowerCase()).append("( distinct "); // Arguments to distinct separated by comma for (int i = 1; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); if (i != root.getChildCount() - 1) { buf.append(", "); } } buf.append(")"); } else if (TOK_TABSORTCOLNAMEDESC == rootType || TOK_TABSORTCOLNAMEASC == rootType) { // buf.append("("); for (int i = 0; i < root.getChildCount(); i++) { StringBuilder orderByCol = new StringBuilder(); toInfixString((ASTNode) root.getChild(i), orderByCol); String colStr = orderByCol.toString().trim(); if (colStr.startsWith("(") && colStr.endsWith(")")) { colStr = colStr.substring(1, colStr.length() - 1); } buf.append(colStr); buf.append(" "); } if (TOK_TABSORTCOLNAMEDESC == rootType) { buf.append(" desc "); } else if (TOK_TABSORTCOLNAMEASC == rootType) { buf.append(" asc "); } // buf.append(")"); } else if (TOK_SELECT == rootType || TOK_ORDERBY == rootType || TOK_GROUPBY == rootType) { for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); if (i != root.getChildCount() - 1) { buf.append(", "); } } } else if (TOK_SELECTDI == rootType) { buf.append(" distinct "); for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); if (i != root.getChildCount() - 1) { buf.append(", "); } } } else if (TOK_DIR == rootType) { buf.append(" directory "); for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } else if (TOK_LOCAL_DIR == rootType) { buf.append(" local directory "); for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } else if (TOK_TAB == rootType) { buf.append(" table "); for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } else { if (root.getChildCount() > 0) { for (int i = 0; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); } } else { // for other types which are not handled above buf.append(rootText); } } } // Get string representation of a function node in query AST private static void functionString(ASTNode root, StringBuilder buf) { // special handling for CASE udf if (findNodeByPath(root, KW_CASE) != null) { buf.append(" case "); toInfixString((ASTNode) root.getChild(1), buf); // each of the conditions ArrayList<Node> caseChildren = root.getChildren(); int from = 2; int nchildren = caseChildren.size(); int to = nchildren % 2 == 1 ? nchildren - 1 : nchildren; for (int i = from; i < to; i += 2) { buf.append(" when "); toInfixString((ASTNode) caseChildren.get(i), buf); buf.append(" then "); toInfixString((ASTNode) caseChildren.get(i + 1), buf); } // check if there is an ELSE node if (nchildren % 2 == 1) { buf.append(" else "); toInfixString((ASTNode) caseChildren.get(nchildren - 1), buf); } buf.append(" end "); } else if (findNodeByPath(root, KW_WHEN) != null) { // 2nd form of case statement buf.append(" case "); // each of the conditions ArrayList<Node> caseChildren = root.getChildren(); int from = 1; int nchildren = caseChildren.size(); int to = nchildren % 2 == 1 ? nchildren : nchildren - 1; for (int i = from; i < to; i += 2) { buf.append(" when "); toInfixString((ASTNode) caseChildren.get(i), buf); buf.append(" then "); toInfixString((ASTNode) caseChildren.get(i + 1), buf); } // check if there is an ELSE node if (nchildren % 2 == 0) { buf.append(" else "); toInfixString((ASTNode) caseChildren.get(nchildren - 1), buf); } buf.append(" end "); } else if (findNodeByPath(root, TOK_ISNULL) != null) { // IS NULL operator toInfixString((ASTNode) root.getChild(1), buf); buf.append(" is null "); } else if (findNodeByPath(root, TOK_ISNOTNULL) != null) { // IS NOT NULL operator toInfixString((ASTNode) root.getChild(1), buf); buf.append(" is not null "); } else if (((ASTNode) root.getChild(0)).getToken().getType() == Identifier && ((ASTNode) root.getChild(0)).getToken().getText().equalsIgnoreCase("between")) { // Handle between and not in between ASTNode tokTrue = findNodeByPath(root, KW_TRUE); ASTNode tokFalse = findNodeByPath(root, KW_FALSE); if (tokTrue != null) { // NOT BETWEEN toInfixString((ASTNode) root.getChild(2), buf); buf.append(" not between "); toInfixString((ASTNode) root.getChild(3), buf); buf.append(" and "); toInfixString((ASTNode) root.getChild(4), buf); } else if (tokFalse != null) { // BETWEEN toInfixString((ASTNode) root.getChild(2), buf); buf.append(" between "); toInfixString((ASTNode) root.getChild(3), buf); buf.append(" and "); toInfixString((ASTNode) root.getChild(4), buf); } } else if (findNodeByPath(root, KW_IN) != null) { // IN operator toInfixString((ASTNode) root.getChild(1), buf); // check if this is NOT In ASTNode rootParent = (ASTNode) root.getParent(); if (rootParent != null && rootParent.getToken().getType() == KW_NOT) { buf.append(" not "); } buf.append(" in ("); for (int i = 2; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); if (i < root.getChildCount() - 1) { buf.append(" , "); } } buf.append(")"); } else if (findNodeByPath(root, KW_CAST) != null) { buf.append("cast"); toInfixString((ASTNode) root.getChild(1), buf); buf.append(" as "); toInfixString((ASTNode) root.getChild(0), buf); } else { int rootType = ((ASTNode) root.getChild(0)).getToken().getType(); if (PRIMITIVE_TYPES.contains(rootType)) { // cast expression maps to the following ast // KW_CAST LPAREN expression KW_AS primitiveType RPAREN -> ^(TOK_FUNCTION primitiveType expression) buf.append("cast("); toInfixString((ASTNode) root.getChild(1), buf); buf.append(" as "); toInfixString((ASTNode) root.getChild(0), buf); buf.append(")"); } else { // Normal UDF String fname = ((ASTNode) root.getChild(0)).getText(); // Function name buf.append(fname.toLowerCase()).append("("); // Arguments separated by comma for (int i = 1; i < root.getChildCount(); i++) { toInfixString((ASTNode) root.getChild(i), buf); if (i != root.getChildCount() - 1) { buf.append(", "); } } buf.append(")"); } } } public static void main(String[] args) throws Exception { ASTNode ast = parseHQL("select * from default_table ", new HiveConf()); printAST(getHiveTokenMapping(), ast, 0, 0); } public static String getString(ASTNode tree) { StringBuilder buf = new StringBuilder(); toInfixString(tree, buf); return buf.toString(); } public static String getColName(ASTNode node) { String colname = null; int nodeType = node.getToken().getType(); if (nodeType == HiveParser.TOK_TABLE_OR_COL) { colname = ((ASTNode) node.getChild(0)).getText(); } else { // node in 'alias.column' format ASTNode colIdent = (ASTNode) node.getChild(1); colname = colIdent.getText(); } return colname; } public static boolean isAggregateAST(ASTNode node) { int exprTokenType = node.getToken().getType(); if (exprTokenType == HiveParser.TOK_FUNCTION || exprTokenType == HiveParser.TOK_FUNCTIONDI || exprTokenType == HiveParser.TOK_FUNCTIONSTAR) { assert (node.getChildCount() != 0); if (node.getChild(0).getType() == HiveParser.Identifier) { String functionName = BaseSemanticAnalyzer.unescapeIdentifier(node.getChild(0).getText()); if (FunctionRegistry.getGenericUDAFResolver(functionName) != null) { return true; } } } return false; } /** * @param node an ASTNode * @return true when input node is a SELECT AST Node. Otherwise, false. */ public static boolean isSelectASTNode(final ASTNode node) { Optional<Integer> astNodeType = getASTNodeType(node); if (astNodeType.isPresent()) { return astNodeType.get() == HiveParser.TOK_SELECT; } return false; } /** * @param node an ASTNode * @return When node is null or token inside node is null, then Optional.absent is returned. Otherwise, an integer * representing ASTNodeType is returned. */ private static Optional<Integer> getASTNodeType(final ASTNode node) { Optional<Integer> astNodeType = Optional.absent(); if (node != null && node.getToken() != null) { astNodeType = Optional.of(node.getToken().getType()); } return astNodeType; } public static boolean hasAggregate(ASTNode node) { int nodeType = node.getToken().getType(); if (nodeType == HiveParser.TOK_TABLE_OR_COL || nodeType == HiveParser.DOT) { return false; } else { if (HQLParser.isAggregateAST(node)) { return true; } for (int i = 0; i < node.getChildCount(); i++) { if (hasAggregate((ASTNode) node.getChild(i))) { return true; } } return false; } } public static boolean equalsAST(ASTNode n1, ASTNode n2) { if (n1 == null && n2 != null) { return false; } if (n1 != null && n2 == null) { return false; } if (n1 == null) { return true; } if (n1.getToken().getType() != n2.getToken().getType()) { return false; } // Compare text. For literals, comparison is case sensitive if ((n1.getToken().getType() == StringLiteral && !n1.getText().equals(n2.getText())) || !n1.getText().equalsIgnoreCase(n2.getText())) { return false; } // Compare children if (n1.getChildCount() != n2.getChildCount()) { return false; } for (int i = 0; i < n1.getChildCount(); i++) { if (!equalsAST((ASTNode) n1.getChild(i), (ASTNode) n2.getChild(i))) { return false; } } return true; } }
{ "content_hash": "a6da64b7d434ee39ad3fcc8a67d4a383", "timestamp": "", "source": "github", "line_count": 790, "max_line_length": 117, "avg_line_length": 31.131645569620254, "alnum_prop": 0.5870537529478734, "repo_name": "adeelmahmood/lens", "id": "1964e3205230804a733fe9354ba00a2d83fbf166", "size": "25402", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lens-cube/src/main/java/org/apache/lens/cube/parse/HQLParser.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "10377" }, { "name": "Java", "bytes": "4422819" }, { "name": "JavaScript", "bytes": "282078" }, { "name": "Shell", "bytes": "14016" } ] }
package com.asakusafw.testdriver.rule; import java.text.MessageFormat; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asakusafw.testdriver.core.PropertyName; /** * Condition of property. * @param <T> upper bound type of the property * @since 0.2.0 */ public class PropertyCondition<T> { static final Logger LOG = LoggerFactory.getLogger(PropertyCondition.class); private final PropertyName name; private final Class<? extends T> type; private final List<? extends ValuePredicate<? super T>> predicates; /** * Creates a new instance. * @param name the property name * @param type the property type * @param predicates the value predicates * @throws IllegalArgumentException if some parameters were {@code null} */ public PropertyCondition( PropertyName name, Class<? extends T> type, List<? extends ValuePredicate<? super T>> predicates) { if (name == null) { throw new IllegalArgumentException("name must not be null"); //$NON-NLS-1$ } if (type == null) { throw new IllegalArgumentException("type must not be null"); //$NON-NLS-1$ } if (predicates == null) { throw new IllegalArgumentException("predicates must not be null"); //$NON-NLS-1$ } if (predicates.isEmpty()) { throw new IllegalArgumentException("predicates must not be empty"); //$NON-NLS-1$ } this.name = name; this.type = type; this.predicates = predicates; } /** * Returns the target property name. * @return the target property name */ public PropertyName getPropertyName() { return name; } /** * Returns {@code true} iff exists a predicate accepts the pair. * @param expected the expected value * @param actual the actual value * @return {@code true} iff exists a predicate accepts the pair */ public boolean accepts(Object expected, Object actual) { T e = type.cast(expected); T a = type.cast(actual); for (ValuePredicate<? super T> predicate : predicates) { try { if (predicate.accepts(e, a)) { return true; } } catch (IllegalArgumentException ex) { // this means "ERROR" in ternary, continue checking rest conditions if (LOG.isTraceEnabled()) { LOG.trace(MessageFormat.format( "Error occurred while evaluating predicate: " //$NON-NLS-1$ + "predicate={0}, expected={1}, actual={2}", //$NON-NLS-1$ predicate, e, a), ex); } } } return false; } /** * Returns an expected value as readable text. * @param expected the expected value (nullable) * @param actual the actual value (nullable) * @return readable text */ public String describeExpected(Object expected, Object actual) { T e = type.cast(expected); T a = type.cast(actual); StringBuilder buf = new StringBuilder(); boolean sawDescription = false; for (ValuePredicate<? super T> pred : predicates) { String description = pred.describeExpected(e, a); if (description == null) { continue; } if (sawDescription) { buf.append(Messages.getString("PropertyCondition.messageOrDescription")); //$NON-NLS-1$ } sawDescription = true; buf.append(MessageFormat.format( Messages.getString("PropertyCondition.messageQuotedDescription"), //$NON-NLS-1$ description)); } if (sawDescription) { return buf.toString(); } else { return Messages.getString("PropertyCondition.messageUnsupportedData"); //$NON-NLS-1$ } } }
{ "content_hash": "e3c41adeae439e3f385e00c9fec1c75f", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 103, "avg_line_length": 33.710743801652896, "alnum_prop": 0.5748958077960284, "repo_name": "asakusafw/asakusafw", "id": "c92415882ae46368d6a8e7e36cbadcce635cc278", "size": "4691", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "testing-project/asakusa-test-moderator/src/main/java/com/asakusafw/testdriver/rule/PropertyCondition.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "31" }, { "name": "CSS", "bytes": "650" }, { "name": "Groovy", "bytes": "277016" }, { "name": "Java", "bytes": "12812573" }, { "name": "Lex", "bytes": "12506" }, { "name": "Shell", "bytes": "10149" } ] }
SYNONYM #### According to Index Fungorum #### Published in null #### Original name Nephroma helveticum Ach. ### Remarks null
{ "content_hash": "58c09f7102d2ac1f106ce107cd207d47", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 24, "avg_line_length": 9.846153846153847, "alnum_prop": 0.703125, "repo_name": "mdoering/backbone", "id": "9eeae6a7592833574b7737b03a65f2b74e6c2f69", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Nephromataceae/Nephroma/Nephroma helveticum/ Syn. Peltigera helvetica/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
using System; using System.ComponentModel; namespace Azure.Communication.ShortCodes.Models { /// <summary> The cloud that the identifier belongs to. </summary> internal readonly partial struct CommunicationCloudEnvironmentModel : IEquatable<CommunicationCloudEnvironmentModel> { private readonly string _value; /// <summary> Initializes a new instance of <see cref="CommunicationCloudEnvironmentModel"/>. </summary> /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> public CommunicationCloudEnvironmentModel(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } private const string PublicValue = "public"; private const string DodValue = "dod"; private const string GcchValue = "gcch"; /// <summary> public. </summary> public static CommunicationCloudEnvironmentModel Public { get; } = new CommunicationCloudEnvironmentModel(PublicValue); /// <summary> dod. </summary> public static CommunicationCloudEnvironmentModel Dod { get; } = new CommunicationCloudEnvironmentModel(DodValue); /// <summary> gcch. </summary> public static CommunicationCloudEnvironmentModel Gcch { get; } = new CommunicationCloudEnvironmentModel(GcchValue); /// <summary> Determines if two <see cref="CommunicationCloudEnvironmentModel"/> values are the same. </summary> public static bool operator ==(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => left.Equals(right); /// <summary> Determines if two <see cref="CommunicationCloudEnvironmentModel"/> values are not the same. </summary> public static bool operator !=(CommunicationCloudEnvironmentModel left, CommunicationCloudEnvironmentModel right) => !left.Equals(right); /// <summary> Converts a string to a <see cref="CommunicationCloudEnvironmentModel"/>. </summary> public static implicit operator CommunicationCloudEnvironmentModel(string value) => new CommunicationCloudEnvironmentModel(value); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CommunicationCloudEnvironmentModel other && Equals(other); /// <inheritdoc /> public bool Equals(CommunicationCloudEnvironmentModel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; /// <inheritdoc /> public override string ToString() => _value; } }
{ "content_hash": "1dbe5fab33cc4bc9583e2b17f3c77039", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 153, "avg_line_length": 58.638297872340424, "alnum_prop": 0.7115384615384616, "repo_name": "Azure/azure-sdk-for-net", "id": "158f9f7cd74635e1d51f5f543830ea946c7c65d4", "size": "2894", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/communication/Azure.Communication.ShortCodes/src/Generated/Models/CommunicationCloudEnvironmentModel.cs", "mode": "33188", "license": "mit", "language": [] }
var React = require('react'); var ReactDOM = require('react-dom'); var TestUtils = require('react-addons-test-utils'); var mocha = require('mocha'); var expect = require('chai').expect; var mockStore = require('../../utils/mockStore'); var mockRequire = require('mockrequire'); var utils = require('../../utils/utils'); var sinon = require('sinon'); var postCalled = false; var DepVars = mockRequire('../../../server/client/containers/RunAdHocExperiment/DepVars', { './DepVar': utils.mockDivComponent('depvar'), 'jquery': (function(){ var $ = function() { return { serializeArray: function() {}, serializeJSON: function() { return {}; } }; }; $.post = function(route, data, cb) { try { cb([{ _id: 'ABCDEFG', valid: true, value: 3, indVarStates: {} }]); } catch(e) { } postCalled = true; }; return $; })(), 'jquery-serializejson': {} }, {jsx: true}); var index = require('../index.js')(); describe('The DepVars sample component', function () { var form, server; beforeEach(function () { var props = {}; var obj = require('./DepVarsSampleData.json'); props.store = mockStore(obj); props.params = {}; props.params.expid = '562ebfa6a3b7183b57d3ed41'; props.params.sampleid = 'exampleSampleId'; form = TestUtils.renderIntoDocument(React.createElement(DepVars, props), 'root'); }); it('should render a depVar for each depVarId', function () { var vars = TestUtils.scryRenderedDOMComponentsWithClass(form, 'depvar'); expect(vars.length).to.eql(1); }); it('should render an input field for each indDepVar', function () { var inputs = TestUtils.scryRenderedDOMComponentsWithTag(form, 'input'); expect(inputs.length).to.eql(2); // One indvar, one checkbox }); it('should post the created sample', function () { var button = TestUtils.findRenderedDOMComponentWithTag(form, 'button'); TestUtils.Simulate.submit(button); expect(postCalled).to.equal(true); }); xit('should add the sample to the state', function (done) { }); });
{ "content_hash": "d47d0f3c557974e186507f9cd1226e46", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 91, "avg_line_length": 26.825, "alnum_prop": 0.6230195712954334, "repo_name": "marcusbuffett/agnition", "id": "fc8b45d9a334c36012d0ae6bf4a9960d706c6c63", "size": "2146", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "specs/clientspecs/runexperiment/DepVars.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8653" }, { "name": "HTML", "bytes": "536" }, { "name": "JavaScript", "bytes": "240904" }, { "name": "Makefile", "bytes": "415" } ] }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "1b9846d130dbf9748de679676617d841", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "f60bee8ea570d40c6a10f04351da84e793ef3403", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Pteridophyta/Polypodiopsida/Gleicheniales/Gleicheniaceae/Sticherus/Sticherus pinnatus/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
FactoryBot.define do factory :<%= file_name %>, class: <%= namespace %>::<%= class_name %> do tenant { Hippo::Tenant.current } end end
{ "content_hash": "0cab8b19fe8ec87d67e11c46b8d1937d", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 76, "avg_line_length": 25.333333333333332, "alnum_prop": 0.5789473684210527, "repo_name": "argosity/hippo", "id": "737d22f3ed186de83724d542a0a8ede93616dac9", "size": "152", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "templates/spec/factories/model.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "99576" }, { "name": "CoffeeScript", "bytes": "41408" }, { "name": "Emacs Lisp", "bytes": "245" }, { "name": "HTML", "bytes": "8110" }, { "name": "JavaScript", "bytes": "417236" }, { "name": "Liquid", "bytes": "539" }, { "name": "Ruby", "bytes": "278833" } ] }
angular. module('phonecatApp'). config(['$locationProvider', '$routeProvider', function config($locationProvider: angular.ILocationProvider, $routeProvider: angular.route.IRouteProvider) { $locationProvider.hashPrefix('!'); $routeProvider. when('/phones', { template: '<phone-list></phone-list>' }). when('/phones/:phoneId', { template: '<phone-detail></phone-detail>' }). otherwise('/phones'); } ]);
{ "content_hash": "6809d66a09fe9705c2920b24c31ace54", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 67, "avg_line_length": 31.625, "alnum_prop": 0.5711462450592886, "repo_name": "akbasu/Angular-PhoneCat", "id": "5668e457c204366c61914a17eb4e28324834b5f3", "size": "506", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/app.config.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "347" }, { "name": "CSS", "bytes": "2388" }, { "name": "HTML", "bytes": "5609" }, { "name": "JavaScript", "bytes": "15992" }, { "name": "Shell", "bytes": "5043" }, { "name": "TypeScript", "bytes": "6468" } ] }
const Router = require('express').Router; const prometheusClient = require('prom-client'); const log = require('../../support/log'); const router = new Router(); const aggregatorRegistry = new prometheusClient.AggregatorRegistry(); router.get('/', (req, res) => { aggregatorRegistry.clusterMetrics((err, metrics) => { if (err) { log.error(err); res.send(`Error: ${err}`); res.status(500); return; } res.set('Content-Type', aggregatorRegistry.contentType); res.send(metrics); }); }); module.exports = router;
{ "content_hash": "547ddbba4d8a8dd7c9933c6c9a5fc7ef", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 26.428571428571427, "alnum_prop": 0.6468468468468469, "repo_name": "backstage/functions", "id": "3bd3f7ed6551b30a42f7366dd4c8ed0cbb0db5a5", "size": "555", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/http/routers/MetricsRouter.js", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "178" }, { "name": "JavaScript", "bytes": "159140" }, { "name": "Makefile", "bytes": "2289" } ] }
package com.ibm.ecm.extension.aspera; import com.ibm.ecm.extension.PluginLogger; import com.ibm.ecm.extension.PluginResponseUtil; import com.ibm.ecm.extension.PluginService; import com.ibm.ecm.extension.PluginServiceCallbacks; import com.ibm.ecm.extension.aspera.faspex.FaspexClient; import com.ibm.ecm.extension.aspera.packageaction.PackageAction; import com.ibm.ecm.json.JSONResponse; import com.ibm.json.java.JSONArtifact; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * The service to manage packages. */ public class PackageActionService extends PluginService { private static final String ID = "package"; private static final String execute = "execute"; PackageActionService() { super(); } /** * Returns the Id of the service. * * @return The Id */ @Override public String getId() { return ID; } /** * Provides services to list and get details of packages, and stop packages being sent. * * @param callbacks The PluginServiceCallbacks object provided by the ICN API * @param request The HttpServletRequest object provided by the ICN API * @param response The HttpServletResponse object provided by the ICN API */ @Override public void execute(final PluginServiceCallbacks callbacks, final HttpServletRequest request, final HttpServletResponse response) { final PluginLogger logger = callbacks.getLogger(); logger.logEntry(this, execute); final JSONResponse responseJson = new JSONResponse(); final String actionType = request.getParameter("actionType"); logger.logDebug(this, execute, "action type: " + actionType); final String packageId = request.getParameter("packageId"); logger.logDebug(this, execute, "package id: " + packageId); try { final FaspexClient client = FaspexClient.getInstance(callbacks); final String[] myPackageIds = client.getTransfers().getExistentPackageIds(Util.getUserRecentPackageIds(callbacks)); Util.saveUserRecentPackageIds(callbacks, myPackageIds); final boolean adminUser = callbacks.isApplicationAdminUser(request, null, null); final PackageAction action = PackageAction.getPackageAction(client, actionType, packageId, myPackageIds, adminUser, logger); final JSONArtifact json = action.handleAction(); logger.logDebug(this, execute, "json: " + json); if (PackageAction.PackageActionType.isMultiple(actionType)) { responseJson.put("packages", json); } else { responseJson.put("pkg", json); } if (PackageAction.PackageActionType.stop.equals(actionType)) { responseJson.put("stopped", client.getTransfers().isTransferStopped(packageId)); } } catch (final RuntimeException e) { // NOPMD - log and continue writing the JSON response logger.logError(this, execute, e); } PluginResponseUtil.writeJSONResponse(request, response, responseJson, callbacks, ID); logger.logExit(this, execute); } }
{ "content_hash": "9cc04b6b369b97c64a2e2079f0819d1d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 132, "avg_line_length": 36.2875, "alnum_prop": 0.7626593179469514, "repo_name": "ibm-ecm/ibm-navigator-aspera-sample", "id": "da5b10fdbebdda1502daf3c70acc907bcf21a4e9", "size": "3116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/ibm/ecm/extension/aspera/PackageActionService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1831" }, { "name": "HTML", "bytes": "6197" }, { "name": "Java", "bytes": "137661" }, { "name": "JavaScript", "bytes": "214245" } ] }
 #pragma once #include <aws/chime-sdk-meetings/ChimeSDKMeetings_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ChimeSDKMeetings { namespace Model { /** * <p>A key-value pair that you define.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/chime-sdk-meetings-2021-07-15/Tag">AWS * API Reference</a></p> */ class AWS_CHIMESDKMEETINGS_API Tag { public: Tag(); Tag(Aws::Utils::Json::JsonView jsonValue); Tag& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The tag's key.</p> */ inline const Aws::String& GetKey() const{ return m_key; } /** * <p>The tag's key.</p> */ inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; } /** * <p>The tag's key.</p> */ inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; } /** * <p>The tag's key.</p> */ inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); } /** * <p>The tag's key.</p> */ inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); } /** * <p>The tag's key.</p> */ inline Tag& WithKey(const Aws::String& value) { SetKey(value); return *this;} /** * <p>The tag's key.</p> */ inline Tag& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;} /** * <p>The tag's key.</p> */ inline Tag& WithKey(const char* value) { SetKey(value); return *this;} /** * <p>The tag's value.</p> */ inline const Aws::String& GetValue() const{ return m_value; } /** * <p>The tag's value.</p> */ inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; } /** * <p>The tag's value.</p> */ inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; } /** * <p>The tag's value.</p> */ inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); } /** * <p>The tag's value.</p> */ inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); } /** * <p>The tag's value.</p> */ inline Tag& WithValue(const Aws::String& value) { SetValue(value); return *this;} /** * <p>The tag's value.</p> */ inline Tag& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;} /** * <p>The tag's value.</p> */ inline Tag& WithValue(const char* value) { SetValue(value); return *this;} private: Aws::String m_key; bool m_keyHasBeenSet = false; Aws::String m_value; bool m_valueHasBeenSet = false; }; } // namespace Model } // namespace ChimeSDKMeetings } // namespace Aws
{ "content_hash": "ae08c07ba58549b5190e2d9e3367259d", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 103, "avg_line_length": 23.635658914728683, "alnum_prop": 0.581502131846507, "repo_name": "aws/aws-sdk-cpp", "id": "e170b6d3bb12af70e2ad2e0ddfa80935e21f5492", "size": "3168", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "aws-cpp-sdk-chime-sdk-meetings/include/aws/chime-sdk-meetings/model/Tag.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "309797" }, { "name": "C++", "bytes": "476866144" }, { "name": "CMake", "bytes": "1245180" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "8056" }, { "name": "Java", "bytes": "413602" }, { "name": "Python", "bytes": "79245" }, { "name": "Shell", "bytes": "9246" } ] }
/* * $Id: UnicodeRangeFactory.hpp 568078 2007-08-21 11:43:25Z amassari $ */ #if !defined(UNICODERANGEFACTORY_HPP) #define UNICODERANGEFACTORY_HPP // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include <xercesc/util/regx/RangeFactory.hpp> XERCES_CPP_NAMESPACE_BEGIN class XMLUTIL_EXPORT UnicodeRangeFactory: public RangeFactory { public: // ----------------------------------------------------------------------- // Constructors and operators // ----------------------------------------------------------------------- UnicodeRangeFactory(); ~UnicodeRangeFactory(); // ----------------------------------------------------------------------- // Initialization methods // ----------------------------------------------------------------------- void initializeKeywordMap(RangeTokenMap *rangeTokMap = 0); protected: // ----------------------------------------------------------------------- // Private Helper methods // ----------------------------------------------------------------------- void buildRanges(RangeTokenMap *rangeTokMap = 0); private: // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- UnicodeRangeFactory(const UnicodeRangeFactory&); UnicodeRangeFactory& operator=(const UnicodeRangeFactory&); // ----------------------------------------------------------------------- // Helper methods // ----------------------------------------------------------------------- unsigned short getUniCategory(const unsigned short type); }; XERCES_CPP_NAMESPACE_END #endif /** * End file UnicodeRangeFactory.hpp */
{ "content_hash": "19af7114b9d814aabcd6d9c6b5b3073c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 34.57142857142857, "alnum_prop": 0.3600206611570248, "repo_name": "ksmyth/xerces-c", "id": "cf324b021dc77d76802ecfcad33a07e20d80dd53", "size": "2755", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/xercesc/util/regx/UnicodeRangeFactory.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "4944" }, { "name": "Batchfile", "bytes": "580" }, { "name": "C", "bytes": "252322" }, { "name": "C++", "bytes": "13006245" }, { "name": "HTML", "bytes": "16836" }, { "name": "Makefile", "bytes": "982416" }, { "name": "Perl", "bytes": "73028" }, { "name": "Rebol", "bytes": "1011" }, { "name": "Shell", "bytes": "54757" } ] }
/* line 6, ../scss/load.scss */ #contain { width: 300px; height: 100px; position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; opacity: 0; animation: fadeIn 1s 1; animation-fill-mode: forwards; } /* line 17, ../scss/load.scss */ .wrap { animation: translate 1000ms infinite ease-in-out alternate, zindex 2000ms infinite ease-in-out; position: absolute; } /* line 22, ../scss/load.scss */ .part { width: 100px; height: 100px; background: radial-gradient(circle at 0 0, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.1) 65%, rgba(0, 0, 0, 0.1)); background-color: #E3746B; border-radius: 50%; animation: scale 1000ms infinite ease-in-out alternate; animation-delay: -500ms; transform: scale(0.5); } /* line 34, ../scss/load.scss */ .part:after { content: ''; width: 100px; height: 10px; background: #eee; position: absolute; top: 130px; border-radius: 50%; } /* line 44, ../scss/load.scss */ #wrap2 { animation-delay: -1000ms; } /* line 48, ../scss/load.scss */ #part2 { background-color: #397BF9; animation-delay: -1500ms; } /* line 53, ../scss/load.scss */ #wrap3 { animation-delay: -1500ms; } /* line 57, ../scss/load.scss */ #part3 { background-color: #F4B400; animation-delay: -2000ms; } /* line 62, ../scss/load.scss */ #wrap4 { animation-delay: -2500ms; } /* line 66, ../scss/load.scss */ #part4 { background-color: #0F9D58; animation-delay: -3000ms; } @keyframes translate { 100% { transform: translateX(200px); } } @keyframes scale { 100% { transform: scale(1); } } @keyframes zindex { 25% { z-index: 1; } 75% { z-index: -1; } } @keyframes fadeIn { 100% { opacity: 1; } } /* Utils */ /* line 3, ../scss/utils.scss */ .white { color: white; } /* line 7, ../scss/utils.scss */ .padded { padding: 10px; } /* line 11, ../scss/utils.scss */ .padded-md { padding: 20px; } /* line 15, ../scss/utils.scss */ .padded-lg { padding: 30px; } /* line 19, ../scss/utils.scss */ .padded-left { padding-left: 30px; } /* line 23, ../scss/utils.scss */ .table { margin-bottom: 0px !important; } /* line 27, ../scss/utils.scss */ .text-justify { text-align: justify; } /* Circular Images */ /* line 32, ../scss/utils.scss */ .circular-img { width: 200px; height: 200px; border-radius: 100px; -webkit-border-radius: 100px; -moz-border-radius: 100px; } /* Circular Images */ /* line 41, ../scss/utils.scss */ .circular-img-sm { width: 150px; height: 150px; border-radius: 75px; -webkit-border-radius: 75px; -moz-border-radius: 75px; position: relative; } /* line 52, ../scss/utils.scss */ .circular-img-xs { width: 50px; height: 50px; border-radius: 25px; -webkit-border-radius: 25px; -moz-border-radius: 25px; } /* line 1, ../scss/home.scss */ #home table { margin-left: 40px; } /* line 5, ../scss/home.scss */ #home iframe { width: 560px; height: 315px; } @media only screen and (min-width: 768px) { /* line 11, ../scss/home.scss */ #home { width: 100%; height: 100%; background: transparent right no-repeat; background-size: contain; background-image: url(../assets/images/logo.png); } /* line 19, ../scss/home.scss */ #home table td { padding: 30px; } /* line 23, ../scss/home.scss */ #home iframe { width: 600px; height: 337px; } } @media only screen and (min-width: 768px) and (max-height: 768px) { /* line 32, ../scss/home.scss */ #home table td { padding: 20px; } } @media only screen and (min-width: 1280px) { /* line 38, ../scss/home.scss */ #home table { margin-left: 100px; } } /* line 43, ../scss/home.scss */ #home .liens-video-photo { font-size: 2em; color: white; } /* line 47, ../scss/home.scss */ #home .liens-video-photo i { margin-right: 20px; } /* line 51, ../scss/home.scss */ #home .liens-video-photo i.fa-camera { color: #0c9a54; } /* line 55, ../scss/home.scss */ #home .liens-video-photo i.fa-youtube { color: #da483c; } /* line 2, ../scss/devfest_content.scss */ #devfest-content { height: auto !important; padding-bottom: 20px; padding-top: 80px; } /* line 11, ../scss/devfest_content.scss */ .img-sessions { background: url(../assets/images/2013/glass_200.jpg) no-repeat; background-size: contain; margin: auto; } /* line 17, ../scss/devfest_content.scss */ .img-codelabs { background: url(../assets/images/2013/hall_200.jpg) no-repeat; background-size: contain; margin: auto; } /* line 23, ../scss/devfest_content.scss */ .img-demos { background: url(../assets/images/2013/oculus_200.jpg) no-repeat; background-size: contain; margin: auto; } /* line 1, ../scss/speakers.scss */ #speakers { height: auto !important; } /* line 7, ../scss/speakers.scss */ #speakers .circular-img-sm:hover:after { content: ''; top: 0; position: absolute; left: 0; width: 150px; height: 150px; background: rgba(0, 0, 0, 0.4); border-radius: 75px; } /* line 19, ../scss/speakers.scss */ #speakers .speaker-title { line-height: 21px; height: 42px; } /* line 25, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a { position: absolute; width: 75px; height: 75px; display: block; z-index: 2; color: #DDD; } /* line 33, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a i { line-height: 75px; width: 75px; text-align: center; } /* line 40, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_1_1, #speakers .circular-img-sm:hover a.social_1_2, #speakers .circular-img-sm:hover a.social_2_2, #speakers .circular-img-sm:hover a.social_1_3, #speakers .circular-img-sm:hover a.social_2_3, #speakers .circular-img-sm:hover a.social_3_3, #speakers .circular-img-sm:hover a.social_1_4, #speakers .circular-img-sm:hover a.social_2_4, #speakers .circular-img-sm:hover a.social_3_4, #speakers .circular-img-sm:hover a.social_4_4 { margin-top: -37.5px; margin-left: -37.5px; } /* line 48, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_1_1, #speakers .circular-img-sm:hover a.social_1_2, #speakers .circular-img-sm:hover a.social_2_2 { top: 50%; } /* line 52, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_1_1, #speakers .circular-img-sm:hover a.social_3_3 { left: 50%; } /* line 56, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_1_3, #speakers .circular-img-sm:hover a.social_2_3, #speakers .circular-img-sm:hover a.social_1_4, #speakers .circular-img-sm:hover a.social_2_4 { top: 25%; } /* line 61, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_3_3, #speakers .circular-img-sm:hover a.social_3_4, #speakers .circular-img-sm:hover a.social_4_4 { top: 75%; } /* line 67, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_1_2, #speakers .circular-img-sm:hover a.social_1_3, #speakers .circular-img-sm:hover a.social_1_4, #speakers .circular-img-sm:hover a.social_3_4 { left: 25%; } /* line 71, ../scss/speakers.scss */ #speakers .circular-img-sm:hover a.social_2_2, #speakers .circular-img-sm:hover a.social_2_3, #speakers .circular-img-sm:hover a.social_2_4, #speakers .circular-img-sm:hover a.social_4_4 { left: 75%; } /* line 77, ../scss/speakers.scss */ #speakers .circular-img-sm { margin-bottom: 10px; } /* line 80, ../scss/speakers.scss */ #speakers .circular-img-sm a { display: none; } /* line 86, ../scss/speakers.scss */ .img-alopez { background: url(../assets/images/speakers/alopez.jpg) no-repeat; background-size: contain; margin: auto; } /* line 92, ../scss/speakers.scss */ .img-arichard { background: url(../assets/images/speakers/arichard.jpg) no-repeat; background-size: contain; margin: auto; } /* line 98, ../scss/speakers.scss */ .img-bdorsey { background: url(../assets/images/speakers/bdorsey.jpg) no-repeat; background-size: contain; margin: auto; } /* line 104, ../scss/speakers.scss */ .img-cbossard { background: url(../assets/images/speakers/cbossard.jpg) no-repeat; background-size: contain; margin: auto; } /* line 110, ../scss/speakers.scss */ .img-cmottier { background: url(../assets/images/speakers/cmottier.jpeg) no-repeat; background-size: contain; margin: auto; } /* line 116, ../scss/speakers.scss */ .img-cquilici { background: url(../assets/images/speakers/cquilici.jpg) no-repeat; background-size: contain; margin: auto; } /* line 124, ../scss/speakers.scss */ .img-dgageot { background: url(../assets/images/speakers/dgageot.jpg) no-repeat; background-size: contain; margin: auto; } /* line 130, ../scss/speakers.scss */ .img-dlecan { background: url(../assets/images/speakers/dlecan.jpg) no-repeat; background-size: contain; margin: auto; } /* line 136, ../scss/speakers.scss */ .img-elezmy { background: url(../assets/images/speakers/elezmy.jpg) no-repeat; background-size: contain; margin: auto; } /* line 142, ../scss/speakers.scss */ .img-fharper { background: url(../assets/images/speakers/fharper.jpg) no-repeat; background-size: contain; margin: auto; } /* line 148, ../scss/speakers.scss */ .img-fherrou { background: url(../assets/images/speakers/fherrou.jpg) no-repeat; background-size: contain; margin: auto; } /* line 154, ../scss/speakers.scss */ .img-fnoel { background: url(../assets/images/speakers/fnoel.jpg) no-repeat; background-size: contain; margin: auto; } /* line 160, ../scss/speakers.scss */ .img-ftrichet { background: url(../assets/images/speakers/ftrichet.jpeg) no-repeat; background-size: contain; margin: auto; } /* line 166, ../scss/speakers.scss */ .img-gfaux { background: url(../assets/images/speakers/gfaux.jpg) no-repeat; background-size: contain; margin: auto; } /* line 172, ../scss/speakers.scss */ .img-ggirou { background: url(../assets/images/speakers/ggirou.jpg) no-repeat; background-size: contain; margin: auto; } /* line 178, ../scss/speakers.scss */ .img-gmenvielle { background: url(../assets/images/speakers/gmenvielle.jpg) no-repeat; background-size: contain; margin: auto; } /* line 184, ../scss/speakers.scss */ .img-hgonzalez { background: url(../assets/images/speakers/hgonzalez.jpg) no-repeat; background-size: contain; margin: auto; } /* line 190, ../scss/speakers.scss */ .img-jabrahamson { background: url(../assets/images/speakers/jabrahamson.jpg) no-repeat; background-size: contain; margin: auto; } /* line 196, ../scss/speakers.scss */ .img-jdramaix { background: url(../assets/images/speakers/jdramaix.jpg) no-repeat; background-size: contain; margin: auto; } /* line 202, ../scss/speakers.scss */ .img-jdubois { background: url(../assets/images/speakers/jdubois.jpeg) no-repeat; background-size: contain; margin: auto; } /* line 208, ../scss/speakers.scss */ .img-jferraioli { background: url(../assets/images/speakers/jferraioli.jpg) no-repeat; background-size: contain; margin: auto; } /* line 214, ../scss/speakers.scss */ .img-jmouton { background: url(../assets/images/speakers/jmouton.jpg) no-repeat; background-size: contain; margin: auto; } /* line 220, ../scss/speakers.scss */ .img-jpalies { background: url(../assets/images/speakers/jpalies.jpg) no-repeat; background-size: contain; margin: auto; } /* line 226, ../scss/speakers.scss */ .img-lchampenois { background: url(../assets/images/speakers/lchampenois.jpg) no-repeat; background-size: contain; margin: auto; } /* line 232, ../scss/speakers.scss */ .img-mbelmokhtar { background: url(../assets/images/speakers/mbelmokhtar.jpg) no-repeat; background-size: contain; margin: auto; } /* line 238, ../scss/speakers.scss */ .img-mboillod { background: url(../assets/images/speakers/mboillod.jpg) no-repeat; background-size: contain; margin: auto; } /* line 244, ../scss/speakers.scss */ .img-mgorner { background: url(../assets/images/speakers/mgorner.jpg) no-repeat; background-size: contain; margin: auto; } /* line 250, ../scss/speakers.scss */ .img-nfrancois { background: url(../assets/images/speakers/nfrancois.jpg) no-repeat; background-size: contain; margin: auto; } /* line 256, ../scss/speakers.scss */ .img-ngarnier { background: url(../assets/images/speakers/ngarnier.jpeg) no-repeat; background-size: contain; margin: auto; } /* line 262, ../scss/speakers.scss */ .img-nlebot { background: url(../assets/images/speakers/nlebot.jpg) no-repeat; background-size: contain; margin: auto; } /* line 268, ../scss/speakers.scss */ .img-pcans { background: url(../assets/images/speakers/pcans.jpg) no-repeat; background-size: contain; margin: auto; } /* line 274, ../scss/speakers.scss */ .img-preliquet { background: url(../assets/images/speakers/preliquet.jpg) no-repeat; background-size: contain; margin: auto; } /* line 280, ../scss/speakers.scss */ .img-rchardonneau { background: url(../assets/images/speakers/rchardonneau.jpg) no-repeat; background-size: contain; margin: auto; } /* line 286, ../scss/speakers.scss */ .img-rguilloux { background: url(../assets/images/speakers/rguilloux.jpg) no-repeat; background-size: contain; margin: auto; } /* line 292, ../scss/speakers.scss */ .img-rmenetrier { background: url(../assets/images/speakers/rmenetrier.jpg) no-repeat; background-size: contain; margin: auto; } /* line 298, ../scss/speakers.scss */ .img-roddet { background: url(../assets/images/speakers/roddet.jpeg) no-repeat; background-size: contain; margin: auto; } /* line 304, ../scss/speakers.scss */ .img-swalter { background: url(../assets/images/speakers/swalter.jpg) no-repeat; background-size: contain; margin: auto; } /* line 310, ../scss/speakers.scss */ .img-tgrall { background: url(../assets/images/speakers/tgrall.jpg) no-repeat; background-size: contain; margin: auto; } /* line 316, ../scss/speakers.scss */ .img-xhallade { background: url(../assets/images/speakers/xhallade.jpg) no-repeat; background-size: contain; margin: auto; } /* line 322, ../scss/speakers.scss */ .img-tbd { background: url(../assets/images/speakers/unknown.png) no-repeat; background-size: contain; margin: auto; } /* line 1, ../scss/what_is_devfest.scss */ #what-is-devfest { height: auto !important; } /* line 1, ../scss/sponsors.scss */ #sponsors { height: auto !important; padding-bottom: 40px; } /* line 6, ../scss/sponsors.scss */ .img-sponsor { display: block; height: auto; max-width: 100%; margin: auto; padding-bottom: 20px; } /* line 14, ../scss/sponsors.scss */ .img-sponsor.platinium { max-width: 300px; max-height: 150px; } /* line 19, ../scss/sponsors.scss */ .img-sponsor.gold { max-width: 250px; max-height: 130px; } /* line 24, ../scss/sponsors.scss */ .img-sponsor.silver { max-width: 200px; max-height: 100px; } /* line 29, ../scss/sponsors.scss */ .img-sponsor.partner { max-width: 200px; max-height: 100px; } /* line 34, ../scss/sponsors.scss */ .empty-sponsor { background-color: #CCC; margin: auto; padding-top: 40px; width: 100px; height: 100px; border-radius: 50px; -webkit-border-radius: 50px; -moz-border-radius: 50px; } /* line 1, ../scss/sponsoring.scss */ #sponsoring { height: auto !important; } /* line 1, ../scss/carousel.scss */ #caroussel { height: auto !important; } /* line 1, ../scss/pratique.scss */ #pratique { height: auto !important; padding-bottom: 40px; } /* line 1, ../scss/contacts.scss */ #contacts { height: auto !important; background-color: #444; } /* line 1, ../scss/presse.scss */ #presse { height: auto !important; color: #999; } /* line 6, ../scss/presse.scss */ #presse h1 { color: white; } /* line 1, ../scss/cfp.scss */ #cfp { height: auto !important; color: #999; } /* line 6, ../scss/cfp.scss */ #cfp h1 { color: white; } /* line 13, ../scss/cfp.scss */ .cfp-speaker { background-image: url(../assets/images/2013/photo_cfp_ludovic.jpg); background-repeat: no-repeat; overflow: hidden; width: 100%; height: 600px; } @media only screen and (max-width: 768px) { /* line 3, ../scss/devfest_phone.scss */ #home h1 { font-size: 2em; } /* line 7, ../scss/devfest_phone.scss */ #home table td { padding: 20px; } /* line 11, ../scss/devfest_phone.scss */ #video-phone { height: auto !important; } } /* line 18, ../scss/agenda.scss */ #agenda { height: auto !important; } /* line 21, ../scss/agenda.scss */ #agenda h1 { color: white; } /* line 26, ../scss/agenda.scss */ #header-agenda-copy { background: #444; position: fixed; top: 60px; width: 100%; } /* line 32, ../scss/agenda.scss */ #header-agenda-copy .header-agenda .border { -moz-box-shadow: #000 0px 2px 10px; -webkit-box-shadow: #000 0px 2px 10px; box-shadow: #000 0px 2px 10px; } /* line 39, ../scss/agenda.scss */ #agenda, #header-agenda-to-copy, #header-agenda-copy { color: #999; /*.row .to-hide.popup-resume{ opacity: 0; @include transition-delay(0ms); @include transition-duration(0ms); } .row .popup-resume{ position: absolute; opacity: 1; left: 50%; top:100px; width: 800px; margin-left: -300px; color: #333; background: rgba(220,220,220,0.95); padding: 30px; z-index: 100; @include box-shadow(black 1px 1px 10px); @include transition-property(opacity); @include transition-delay(500ms); @include transition-duration(100ms); p:first-child{ font-weight:bold; } } .row .animated-expand.expand ~ .popup-resume{ display: none; } .row .animated-expand:not(.expand):hover{ @include transition-property(border-top-width); @include transition-duration(100ms); @include transition-timing-function(ease-in); border-top-width: $size-border-hover !important; }*/ } /* line 44, ../scss/agenda.scss */ #agenda .text-hour, #header-agenda-to-copy .text-hour, #header-agenda-copy .text-hour { font-size: 25pt; } /* line 48, ../scss/agenda.scss */ #agenda .text-thin, #agenda .text-hour, #header-agenda-to-copy .text-thin, #header-agenda-to-copy .text-hour, #header-agenda-copy .text-thin, #header-agenda-copy .text-hour { font-family: 'RobotoThin', Arial, sans-serif; } /* line 52, ../scss/agenda.scss */ #agenda .row, #header-agenda-to-copy .row, #header-agenda-copy .row { margin-bottom: 10px; } /* line 56, ../scss/agenda.scss */ #agenda .row:after, #header-agenda-to-copy .row:after, #header-agenda-copy .row:after { content: ''; position: relative; top: 5px; left: 50%; margin-left: -30%; width: 60%; height: 1px; } /* line 67, ../scss/agenda.scss */ #agenda .row:first-child:after, #agenda .row:last-child:after, #header-agenda-to-copy .row:first-child:after, #header-agenda-to-copy .row:last-child:after, #header-agenda-copy .row:first-child:after, #header-agenda-copy .row:last-child:after { height: 0; } /* line 71, ../scss/agenda.scss */ #agenda .row.header-agenda, #header-agenda-to-copy .row.header-agenda, #header-agenda-copy .row.header-agenda { margin-bottom: 5px; } /* line 75, ../scss/agenda.scss */ #agenda .header-agenda .border:not(.col-lg-offset-1), #agenda .header-agenda .border:not(.col-sm-offset-1), #header-agenda-to-copy .header-agenda .border:not(.col-lg-offset-1), #header-agenda-to-copy .header-agenda .border:not(.col-sm-offset-1), #header-agenda-copy .header-agenda .border:not(.col-lg-offset-1), #header-agenda-copy .header-agenda .border:not(.col-sm-offset-1) { margin-left: 10px; } /* line 80, ../scss/agenda.scss */ #agenda .row .border, #header-agenda-to-copy .row .border, #header-agenda-copy .row .border { background: #f2f2f2; } /* line 83, ../scss/agenda.scss */ #agenda .row .border .lead, #header-agenda-to-copy .row .border .lead, #header-agenda-copy .row .border .lead { padding-top: 10px; margin-bottom: 10px; } /* line 89, ../scss/agenda.scss */ #agenda .row .border.red-gdg, #header-agenda-to-copy .row .border.red-gdg, #header-agenda-copy .row .border.red-gdg { color: white; background: #da483c; } /* line 93, ../scss/agenda.scss */ #agenda .row .border.green-gdg, #header-agenda-to-copy .row .border.green-gdg, #header-agenda-copy .row .border.green-gdg { color: white; background: #0c9a54; } /* line 97, ../scss/agenda.scss */ #agenda .row .border.yellow-gdg, #header-agenda-to-copy .row .border.yellow-gdg, #header-agenda-copy .row .border.yellow-gdg { color: white; background: #f7c63d; } /* line 101, ../scss/agenda.scss */ #agenda .row .border.blue-gdg, #header-agenda-to-copy .row .border.blue-gdg, #header-agenda-copy .row .border.blue-gdg { color: white; background: #6388c5; } /* line 106, ../scss/agenda.scss */ #agenda .row .border-hour, #header-agenda-to-copy .row .border-hour, #header-agenda-copy .row .border-hour { /*border-right: thin solid $color-border; border-left-width: 0px; -webkit-border-image: -webkit-gradient(linear, left top, left bottom, stop(0%, rgba(0,0,0,0)), stop(50%, $color-border) , stop(100%, rgba(0,0,0,0))) 1 100%; -moz-border-image: -moz-linear-gradient(top ,rgba(0,0,0,0) 0%, $color-border 50%, rgba(0,0,0,0) 100%) 1 100%; -o-border-image: -o-linear-gradient(top ,rgba(0,0,0,0) 0%, $color-border 50%, rgba(0,0,0,0) 100%) 1 100%; -ms-border-image: -ms-linear-gradient(top ,rgba(0,0,0,0) 0%, $color-border 50%, rgba(0,0,0,0) 100%) 1 100%; border-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, $color-border 50%, rgba(0,0,0,0) 100%) 1 100%;*/ } /* line 116, ../scss/agenda.scss */ #agenda .col-xs-9.col-lg-2.padded.animated-expand, #agenda .col-xs-9.col-sm-2.padded.animated-expand, #header-agenda-to-copy .col-xs-9.col-lg-2.padded.animated-expand, #header-agenda-to-copy .col-xs-9.col-sm-2.padded.animated-expand, #header-agenda-copy .col-xs-9.col-lg-2.padded.animated-expand, #header-agenda-copy .col-xs-9.col-sm-2.padded.animated-expand { margin-left: 10px; } /* line 122, ../scss/agenda.scss */ #agenda .row .animated-expand:hover, #header-agenda-to-copy .row .animated-expand:hover, #header-agenda-copy .row .animated-expand:hover { cursor: pointer; } /* line 126, ../scss/agenda.scss */ #agenda .row, #header-agenda-to-copy .row, #header-agenda-copy .row { position: relative; } /* line 130, ../scss/agenda.scss */ #agenda .row .animated-expand .favorites, #header-agenda-to-copy .row .animated-expand .favorites, #header-agenda-copy .row .animated-expand .favorites { position: absolute; top: 0; right: 0; margin: 10px; margin-right: 0px; } /* line 138, ../scss/agenda.scss */ #agenda .row .animated-expand .conf-video, #header-agenda-to-copy .row .animated-expand .conf-video, #header-agenda-copy .row .animated-expand .conf-video { position: absolute; top: 25px; right: 0; } /* line 144, ../scss/agenda.scss */ #agenda .row .animated-expand .conf-slides, #header-agenda-to-copy .row .animated-expand .conf-slides, #header-agenda-copy .row .animated-expand .conf-slides { position: absolute; top: 45px; right: 0; } /* line 150, ../scss/agenda.scss */ #agenda .row .animated-expand.green-gdg .favorites, #agenda .row .animated-expand.green-gdg .conf-video a, #agenda .row .animated-expand.green-gdg .conf-slides a, #header-agenda-to-copy .row .animated-expand.green-gdg .favorites, #header-agenda-to-copy .row .animated-expand.green-gdg .conf-video a, #header-agenda-to-copy .row .animated-expand.green-gdg .conf-slides a, #header-agenda-copy .row .animated-expand.green-gdg .favorites, #header-agenda-copy .row .animated-expand.green-gdg .conf-video a, #header-agenda-copy .row .animated-expand.green-gdg .conf-slides a { color: #0c9a54; } /* line 156, ../scss/agenda.scss */ #agenda .row .animated-expand.yellow-gdg .favorites, #agenda .row .animated-expand.yellow-gdg .conf-video a, #agenda .row .animated-expand.yellow-gdg .conf-slides a, #header-agenda-to-copy .row .animated-expand.yellow-gdg .favorites, #header-agenda-to-copy .row .animated-expand.yellow-gdg .conf-video a, #header-agenda-to-copy .row .animated-expand.yellow-gdg .conf-slides a, #header-agenda-copy .row .animated-expand.yellow-gdg .favorites, #header-agenda-copy .row .animated-expand.yellow-gdg .conf-video a, #header-agenda-copy .row .animated-expand.yellow-gdg .conf-slides a { color: #f7c63d; } /* line 162, ../scss/agenda.scss */ #agenda .row .animated-expand.red-gdg .favorites, #agenda .row .animated-expand.red-gdg .conf-video a, #agenda .row .animated-expand.red-gdg .conf-slides a, #header-agenda-to-copy .row .animated-expand.red-gdg .favorites, #header-agenda-to-copy .row .animated-expand.red-gdg .conf-video a, #header-agenda-to-copy .row .animated-expand.red-gdg .conf-slides a, #header-agenda-copy .row .animated-expand.red-gdg .favorites, #header-agenda-copy .row .animated-expand.red-gdg .conf-video a, #header-agenda-copy .row .animated-expand.red-gdg .conf-slides a { color: #da483c; } /* line 168, ../scss/agenda.scss */ #agenda .row .animated-expand.blue-gdg .favorites, #agenda .row .animated-expand.blue-gdg .conf-video a .row .animated-expand.blue-gdg .conf-slides a, #header-agenda-to-copy .row .animated-expand.blue-gdg .favorites, #header-agenda-to-copy .row .animated-expand.blue-gdg .conf-video a .row .animated-expand.blue-gdg .conf-slides a, #header-agenda-copy .row .animated-expand.blue-gdg .favorites, #header-agenda-copy .row .animated-expand.blue-gdg .conf-video a .row .animated-expand.blue-gdg .conf-slides a { color: #6388c5; } /* line 212, ../scss/agenda.scss */ #agenda .row .animated-expand .anchor-session, #header-agenda-to-copy .row .animated-expand .anchor-session, #header-agenda-copy .row .animated-expand .anchor-session { position: relative; visibility: hidden; display: block; height: 160px; margin-top: -160px; } /* line 222, ../scss/agenda.scss */ #agenda .row .border-hour .white-gdg, #header-agenda-to-copy .row .border-hour .white-gdg, #header-agenda-copy .row .border-hour .white-gdg { border-top: 3px #f2f2f2 solid; } /* line 225, ../scss/agenda.scss */ #agenda .row .grey-gdg, #header-agenda-to-copy .row .grey-gdg, #header-agenda-copy .row .grey-gdg { margin-left: 10px; border-top: 3px #999 solid; } /* line 229, ../scss/agenda.scss */ #agenda .row .grey-gdg:after, #header-agenda-to-copy .row .grey-gdg:after, #header-agenda-copy .row .grey-gdg:after { content: ''; width: 30px; top: -3px; right: -30px; position: absolute; border-top: 3px #999 solid; } /* line 238, ../scss/agenda.scss */ #agenda .row .animated-expand.green-gdg, #header-agenda-to-copy .row .animated-expand.green-gdg, #header-agenda-copy .row .animated-expand.green-gdg { border-top: 3px #0c9a54 solid; } /* line 241, ../scss/agenda.scss */ #agenda .row .animated-expand.yellow-gdg, #header-agenda-to-copy .row .animated-expand.yellow-gdg, #header-agenda-copy .row .animated-expand.yellow-gdg { border-top: 3px #f7c63d solid; } /* line 244, ../scss/agenda.scss */ #agenda .row .animated-expand.blue-gdg, #header-agenda-to-copy .row .animated-expand.blue-gdg, #header-agenda-copy .row .animated-expand.blue-gdg { border-top: 3px #6388c5 solid; } /* line 247, ../scss/agenda.scss */ #agenda .row .animated-expand.red-gdg, #header-agenda-to-copy .row .animated-expand.red-gdg, #header-agenda-copy .row .animated-expand.red-gdg { border-top: 3px #da483c solid; } /* line 252, ../scss/agenda.scss */ #agenda .row .col-lg-2 .title-conf-parent, #agenda .row .col-sm-2 .title-conf-parent, #header-agenda-to-copy .row .col-lg-2 .title-conf-parent, #header-agenda-to-copy .row .col-sm-2 .title-conf-parent, #header-agenda-copy .row .col-lg-2 .title-conf-parent, #header-agenda-copy .row .col-sm-2 .title-conf-parent { height: 6.0em; margin-bottom: 10px; position: relative; } /* line 260, ../scss/agenda.scss */ #agenda .row .animated-expand.expand .resume-light, #header-agenda-to-copy .row .animated-expand.expand .resume-light, #header-agenda-copy .row .animated-expand.expand .resume-light { display: none; } /* line 264, ../scss/agenda.scss */ #agenda .row .animated-expand.col-lg-2 .resume, #agenda .row .animated-expand.col-sm-2 .resume, #header-agenda-to-copy .row .animated-expand.col-lg-2 .resume, #header-agenda-to-copy .row .animated-expand.col-sm-2 .resume, #header-agenda-copy .row .animated-expand.col-lg-2 .resume, #header-agenda-copy .row .animated-expand.col-sm-2 .resume { display: none; } /* line 270, ../scss/agenda.scss */ #agenda .row .title-conf, #header-agenda-to-copy .row .title-conf, #header-agenda-copy .row .title-conf { font-size: 1.2em; line-height: 1.2em; font-weight: bold; padding-right: 10px; } /* line 277, ../scss/agenda.scss */ #agenda .row .col-lg-2 .title-conf, #agenda .row .col-sm-2 .title-conf, #header-agenda-to-copy .row .col-lg-2 .title-conf, #header-agenda-to-copy .row .col-sm-2 .title-conf, #header-agenda-copy .row .col-lg-2 .title-conf, #header-agenda-copy .row .col-sm-2 .title-conf { font-size: 1.2em; line-height: 1.2em; height: 6.0em; } /* line 285, ../scss/agenda.scss */ #agenda .row .animated-expand.to-hide, #header-agenda-to-copy .row .animated-expand.to-hide, #header-agenda-copy .row .animated-expand.to-hide { display: none !important; } /* line 289, ../scss/agenda.scss */ #agenda .row .animated-expand.expand, #header-agenda-to-copy .row .animated-expand.expand, #header-agenda-copy .row .animated-expand.expand { margin-left: 10px; border-top-width: 3px; } /* line 294, ../scss/agenda.scss */ #agenda .row .animated-expand.expand:after, #header-agenda-to-copy .row .animated-expand.expand:after, #header-agenda-copy .row .animated-expand.expand:after { content: ''; width: 30px; top: -3px; right: -30px; position: absolute; border-top: 3px #999 solid; } /* line 303, ../scss/agenda.scss */ #agenda .row .animated-expand.green-gdg:after, #header-agenda-to-copy .row .animated-expand.green-gdg:after, #header-agenda-copy .row .animated-expand.green-gdg:after { border-top-color: #0c9a54; } /* line 306, ../scss/agenda.scss */ #agenda .row .animated-expand.yellow-gdg:after, #header-agenda-to-copy .row .animated-expand.yellow-gdg:after, #header-agenda-copy .row .animated-expand.yellow-gdg:after { border-top-color: #f7c63d; } /* line 309, ../scss/agenda.scss */ #agenda .row .animated-expand.blue-gdg:after, #header-agenda-to-copy .row .animated-expand.blue-gdg:after, #header-agenda-copy .row .animated-expand.blue-gdg:after { border-top-color: #6388c5; } /* line 312, ../scss/agenda.scss */ #agenda .row .animated-expand.red-gdg:after, #header-agenda-to-copy .row .animated-expand.red-gdg:after, #header-agenda-copy .row .animated-expand.red-gdg:after { border-top-color: #da483c; } /* line 316, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker, #header-agenda-to-copy .row .conf-speakers .speaker, #header-agenda-copy .row .conf-speakers .speaker { margin: 5px; display: inline-block; } /* line 320, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker a, #header-agenda-to-copy .row .conf-speakers .speaker a, #header-agenda-copy .row .conf-speakers .speaker a { color: inherit; } /* line 323, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker a:link, #agenda .row .conf-speakers .speaker a:visited, #agenda .row .conf-speakers .speaker a:hover, #agenda .row .conf-speakers .speaker a:active, #header-agenda-to-copy .row .conf-speakers .speaker a:link, #header-agenda-to-copy .row .conf-speakers .speaker a:visited, #header-agenda-to-copy .row .conf-speakers .speaker a:hover, #header-agenda-to-copy .row .conf-speakers .speaker a:active, #header-agenda-copy .row .conf-speakers .speaker a:link, #header-agenda-copy .row .conf-speakers .speaker a:visited, #header-agenda-copy .row .conf-speakers .speaker a:hover, #header-agenda-copy .row .conf-speakers .speaker a:active { text-decoration: none; } /* line 328, ../scss/agenda.scss */ #agenda .row .conf-speakers, #header-agenda-to-copy .row .conf-speakers, #header-agenda-copy .row .conf-speakers { margin-bottom: 10px; } /* line 331, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker, #header-agenda-to-copy .row .conf-speakers .speaker, #header-agenda-copy .row .conf-speakers .speaker { position: relative; width: 100%; } /* line 336, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker-img, #header-agenda-to-copy .row .conf-speakers .speaker-img, #header-agenda-copy .row .conf-speakers .speaker-img { margin: 0; } /* line 343, ../scss/agenda.scss */ #agenda .row .conf-speakers .speaker-name, #header-agenda-to-copy .row .conf-speakers .speaker-name, #header-agenda-copy .row .conf-speakers .speaker-name { text-align: center; text-overflow: ellipsis; position: absolute; left: 55px; top: 15px; } /* line 352, ../scss/agenda.scss */ #agenda .row .conf-room, #header-agenda-to-copy .row .conf-room, #header-agenda-copy .row .conf-room { text-align: left; display: inline-block; margin-bottom: 10px; } /* line 358, ../scss/agenda.scss */ #agenda .row .col-lg-2 .conf-dificulty, #agenda .row .col-lg-2 .conf-lang, #agenda .row .col-sm-2 .conf-dificulty, #agenda .row .col-sm-2 .conf-lang, #header-agenda-to-copy .row .col-lg-2 .conf-dificulty, #header-agenda-to-copy .row .col-lg-2 .conf-lang, #header-agenda-to-copy .row .col-sm-2 .conf-dificulty, #header-agenda-to-copy .row .col-sm-2 .conf-lang, #header-agenda-copy .row .col-lg-2 .conf-dificulty, #header-agenda-copy .row .col-lg-2 .conf-lang, #header-agenda-copy .row .col-sm-2 .conf-dificulty, #header-agenda-copy .row .col-sm-2 .conf-lang { display: none; } /* line 363, ../scss/agenda.scss */ #agenda .row .col-lg-8 .conf-dificulty, #agenda .row .col-lg-8 .conf-lang, #agenda .row .col-sm-8 .conf-dificulty, #agenda .row .col-sm-8 .conf-lang, #header-agenda-to-copy .row .col-lg-8 .conf-dificulty, #header-agenda-to-copy .row .col-lg-8 .conf-lang, #header-agenda-to-copy .row .col-sm-8 .conf-dificulty, #header-agenda-to-copy .row .col-sm-8 .conf-lang, #header-agenda-copy .row .col-lg-8 .conf-dificulty, #header-agenda-copy .row .col-lg-8 .conf-lang, #header-agenda-copy .row .col-sm-8 .conf-dificulty, #header-agenda-copy .row .col-sm-8 .conf-lang { display: inline-block; } @media only screen and (max-width: 768px) { /* line 374, ../scss/agenda.scss */ #agenda .row .animated-expand.col-lg-2 .resume-light, #agenda .row .animated-expand.col-sm-2 .resume-light { display: none; } /* line 379, ../scss/agenda.scss */ #agenda .row .animated-expand.col-lg-2 .resume, #agenda .row .animated-expand.col-sm-2 .resume { display: block; } /* line 384, ../scss/agenda.scss */ #agenda .row .anchor-session-mobile { position: relative; visibility: hidden; display: block; height: 145px; margin-top: -145px; } /* line 395, ../scss/agenda.scss */ #header-agenda-copy .header-agenda .border { -moz-box-shadow: #000 0px 0px 0px; -webkit-box-shadow: #000 0px 0px 0px; box-shadow: #000 0px 0px 0px; } /* line 403, ../scss/agenda.scss */ #agenda .row .lead, #header-agenda-to-copy .row .lead, #header-agenda-copy .row .lead { font-size: 1em; } /* line 407, ../scss/agenda.scss */ #agenda .header-agenda .border:not(.col-lg-offset-1), #agenda .header-agenda .border:not(.col-sm-offset-1), #header-agenda-to-copy .header-agenda .border:not(.col-lg-offset-1), #header-agenda-to-copy .header-agenda .border:not(.col-sm-offset-1), #header-agenda-copy .header-agenda .border:not(.col-lg-offset-1), #header-agenda-copy .header-agenda .border:not(.col-sm-offset-1) { margin-left: 0px; cursor: hand; } /* line 413, ../scss/agenda.scss */ #agenda .header-agenda .border.select, #header-agenda-to-copy .header-agenda .border.select, #header-agenda-copy .header-agenda .border.select { z-index: 100; -moz-box-shadow: #000 0px 2px 10px inset; -webkit-box-shadow: #000 0px 2px 10px inset; box-shadow: #000 0px 2px 10px inset; } /* line 419, ../scss/agenda.scss */ #agenda .row .col-lg-2 .title-conf.to-long:after, #agenda .row .col-lg-2 .title-conf.to-long:before, #agenda .row .col-sm-2 .title-conf.to-long:after, #agenda .row .col-sm-2 .title-conf.to-long:before, #header-agenda-to-copy .row .col-lg-2 .title-conf.to-long:after, #header-agenda-to-copy .row .col-lg-2 .title-conf.to-long:before, #header-agenda-to-copy .row .col-sm-2 .title-conf.to-long:after, #header-agenda-to-copy .row .col-sm-2 .title-conf.to-long:before, #header-agenda-copy .row .col-lg-2 .title-conf.to-long:after, #header-agenda-copy .row .col-lg-2 .title-conf.to-long:before, #header-agenda-copy .row .col-sm-2 .title-conf.to-long:after, #header-agenda-copy .row .col-sm-2 .title-conf.to-long:before { content: none; width: 0; height: 0; } /* line 427, ../scss/agenda.scss */ #agenda .row .col-lg-2 .title-conf.to-long, #agenda .row .col-sm-2 .title-conf.to-long, #header-agenda-to-copy .row .col-lg-2 .title-conf.to-long, #header-agenda-to-copy .row .col-sm-2 .title-conf.to-long, #header-agenda-copy .row .col-lg-2 .title-conf.to-long, #header-agenda-copy .row .col-sm-2 .title-conf.to-long { max-height: 15em; text-overflow: none; overflow: none; } /* line 434, ../scss/agenda.scss */ #agenda .row .col-lg-2 .conf-dificulty, #agenda .row .col-lg-2 .conf-lang, #agenda .row .col-sm-2 .conf-dificulty, #agenda .row .col-sm-2 .conf-lang, #header-agenda-to-copy .row .col-lg-2 .conf-dificulty, #header-agenda-to-copy .row .col-lg-2 .conf-lang, #header-agenda-to-copy .row .col-sm-2 .conf-dificulty, #header-agenda-to-copy .row .col-sm-2 .conf-lang, #header-agenda-copy .row .col-lg-2 .conf-dificulty, #header-agenda-copy .row .col-lg-2 .conf-lang, #header-agenda-copy .row .col-sm-2 .conf-dificulty, #header-agenda-copy .row .col-sm-2 .conf-lang { display: inline-block; } } /* Default */ /* line 21, ../scss/devfest.scss */ body { overflow: hidden !important; background-color: #f2f2f2; } /* line 26, ../scss/devfest.scss */ h1 { font-family: 'RobotoThin', Arial, sans-serif; font-size: 3.5em; } /* Sections */ /* line 34, ../scss/devfest.scss */ .footer { font-size: 0.9em; color: #999; } /* line 39, ../scss/devfest.scss */ .footer h4 { color: white; font-weight: normal; font-size: 1.2em; } /* line 45, ../scss/devfest.scss */ .footer a { color: #AAA; } /* line 50, ../scss/devfest.scss */ .footer hr { border-color: #AAA; } /* line 54, ../scss/devfest.scss */ .controlArrow.prev { border-color: transparent #444 transparent transparent; } /* line 58, ../scss/devfest.scss */ .controlArrow.next { border-color: transparent transparent transparent #444; } /* Section transition image */ /* line 64, ../scss/devfest.scss */ .section-transition { height: 400px !important; } /* line 68, ../scss/devfest.scss */ .section-img { background: transparent center no-repeat; background-size: cover; } /* line 73, ../scss/devfest.scss */ .section-menu { padding-top: 60px; } /* line 77, ../scss/devfest.scss */ .bg-t1 { background-image: url(../assets/images/2013/angular_highres.jpg); } /* line 81, ../scss/devfest.scss */ .bg-t2 { background-image: url(../assets/images/2013/cyril_highres.jpg); } /* line 85, ../scss/devfest.scss */ .bg-t3 { background-image: url(../assets/images/2013/team_highres.jpg); } @media only screen and (max-width: 768px) { /* line 91, ../scss/devfest.scss */ .bg-t1 { background-image: url(../assets/images/2013/angular.jpg); } /* line 95, ../scss/devfest.scss */ .bg-t2 { background-image: url(../assets/images/2013/cyril.jpg); } /* line 99, ../scss/devfest.scss */ .bg-t3 { background-image: url(../assets/images/2013/team.jpg); } } @media only screen and (max-width: 1300px) { /* line 107, ../scss/devfest.scss */ .bg-t1 { background-image: url(../assets/images/2013/angular_midres.jpg); } /* line 111, ../scss/devfest.scss */ .bg-t2 { background-image: url(../assets/images/2013/cyril_midres.jpg); } /* line 115, ../scss/devfest.scss */ .bg-t3 { background-image: url(../assets/images/2013/team_midres.jpg); } } /* Misc */ /* line 123, ../scss/devfest.scss */ .more-info { position: absolute; bottom: 0; left: 0; padding: 10px; } /* line 132, ../scss/devfest.scss */ #unsupport-div { padding: 20px; position: absolute; width: 100%; height: 100%; } /* line 139, ../scss/devfest.scss */ #unsupport-div p { margin-left: 20px; font-weight: 600; } /* Menu */ /* line 146, ../scss/devfest.scss */ #menu { -moz-transition-property: opacity; -o-transition-property: opacity; -webkit-transition-property: opacity; transition-property: opacity; -moz-transition-timing-function: ease-in; -o-transition-timing-function: ease-in; -webkit-transition-timing-function: ease-in; transition-timing-function: ease-in; -moz-transition-duration: 500ms; -o-transition-duration: 500ms; -webkit-transition-duration: 500ms; transition-duration: 500ms; opacity: 0; } /* line 153, ../scss/devfest.scss */ #menu.show { opacity: 1; } /* line 158, ../scss/devfest.scss */ #menu.navbar-default .navbar-nav > .active > a { background-color: inherit; background-image: inherit; background-repeat: inherit; box-shadow: inherit; -ms-box-shadow: inherit; -webkit-box-shadow: inherit; -o-box-shadow: inherit; -moz-box-shadow: inherit; } @media only screen and (min-width: 769px) { /* line 170, ../scss/devfest.scss */ #menu li[data-menuanchor='nav-contacts'] { padding-right: 30px; } /* line 175, ../scss/devfest.scss */ #menu.navbar-default .navbar-nav > .active > a:after { content: ''; height: 3px; background-color: #a94442; width: 90%; position: absolute; bottom: -5px; left: 50%; margin-left: -45%; } /* line 186, ../scss/devfest.scss */ #menu ul, #menu ul li { height: 60px; line-height: 60px; } /* line 191, ../scss/devfest.scss */ #menu ul li a { padding-top: 20px; } }
{ "content_hash": "675e90e6b0629bd45db277aa78bc5739", "timestamp": "", "source": "github", "line_count": 1390, "max_line_length": 666, "avg_line_length": 30.15179856115108, "alnum_prop": 0.6710410154851948, "repo_name": "GDG-Nantes/devFestSite-2014", "id": "ca2b951d781bcd0a42910a64afc2989f4ce331d8", "size": "41911", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "css/devfest.css", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "115824" }, { "name": "JavaScript", "bytes": "26035" } ] }
<?php /** * Garp_Validate_Identical * class description * @author Harmen Janssen | grrr.nl * @version 1 * @package Garp * @subpackage Validate */ class Garp_Validate_Identical extends Zend_Validate_Identical { /** * Overwritten to support nested tokens, from input fields in subforms (such * as credentials[pwd]. */ public function isValid($value, $context = null) { $this->_setValue((string) $value); $token = $this->getToken(); $pos = strrpos($token, '['); if ($pos !== false) { $token = rtrim($token, ']'); $token = substr($token, $pos+1); } if (($context !== null) && isset($context) && array_key_exists($token, $context)) { $token = $context[$token]; } if ($token === null) { $this->_error(self::MISSING_TOKEN); return false; } $strict = $this->getStrict(); if (($strict && ($value !== $token)) || (!$strict && ($value != $token))) { $this->_error(self::NOT_SAME); return false; } return true; } }
{ "content_hash": "7bac82ad3d0b6f66ae7bc089cf96a029", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 91, "avg_line_length": 25.642857142857142, "alnum_prop": 0.5376044568245125, "repo_name": "grrr-amsterdam/golem", "id": "b06e193805622b6848c3e6b492834e8b0780c7b2", "size": "1077", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "garp/library/Garp/Validate/Identical.php", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "3597" }, { "name": "Batchfile", "bytes": "1346" }, { "name": "C", "bytes": "487796" }, { "name": "CSS", "bytes": "861487" }, { "name": "Groff", "bytes": "60910" }, { "name": "HTML", "bytes": "508444" }, { "name": "Java", "bytes": "14870" }, { "name": "JavaScript", "bytes": "14957256" }, { "name": "Makefile", "bytes": "16052" }, { "name": "PHP", "bytes": "24147818" }, { "name": "Perl", "bytes": "50950" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "550" }, { "name": "Shell", "bytes": "28271" } ] }
package krasa.mavenhelper.model; import java.util.ArrayList; import java.util.List; public class Goals extends DomainObject { private List<Goal> goals = new ArrayList<Goal>(); public Goals() { } public Goals(List<Goal> goals) { this.goals = goals; } public List<Goal> getGoals() { return goals; } public void setGoals(List<Goal> goals) { this.goals = goals; } public List<String> asStrings() { return getStrings(goals); } public boolean remove(Goal o) { return goals.remove(o); } public boolean add(Goal o) { return goals.add(o); } public List<String> getGoalsAsStrings() { return getStrings(goals); } private List<String> getStrings(final List<Goal> goals1) { List<String> strings = new ArrayList<String>(); for (Goal goal : goals1) { strings.add(goal.getCommandLine()); } return strings; } public void add(String s) { goals.add(new Goal(s)); } public int size() { return goals.size(); } public boolean remove(Object goal) { return goals.remove(goal); } }
{ "content_hash": "3065e75647a4f012a8a523f87f8cfe06", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 59, "avg_line_length": 17.406779661016948, "alnum_prop": 0.6796494644595911, "repo_name": "fengyie007/MavenHelper", "id": "3f587d352c43260b3aac02f87706c171256174bb", "size": "1027", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/krasa/mavenhelper/model/Goals.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "235754" } ] }
class GeocoderService attr_reader :location, :location_name, :results, :country, :city def initialize(location) @location = location @location_name = location.name @results = Geocoder.search(location_name) if results.first @country = results.first.country puts results.first @city = results.first.formatted_address if results.first end end def geocode_location found_city = City.find_or_create_by_name(city) found_country = Country.find_or_create_by_name(country) location.city = found_city found_city.country = found_country found_city.save! end end
{ "content_hash": "550538722ebbcc828a9d79b93398ee6d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 27, "alnum_prop": 0.7004830917874396, "repo_name": "JohnKellyFerguson/octomaps", "id": "4dd4900abbd7bf71523425f024bc9f2755d0c454", "size": "621", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "services/geocoder_service.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16760" }, { "name": "JavaScript", "bytes": "6045" }, { "name": "Ruby", "bytes": "67959" }, { "name": "Shell", "bytes": "1774" } ] }
// Copyright (c) 2006 Dustin Sallings <dustin@spy.net> package net.spy.stat; import net.spy.SpyObject; /** * Base class for all stats. */ public abstract class Stat extends SpyObject { private String name=null; /** * Get an instance of Stat. */ public Stat() { super(); } /** * Get the name of this stat. */ public String getName() { return(name); } /** * Set the name of this stat. * * @param to */ public void setName(String to) { this.name=to; } /** * getName()=getStat() */ @Override public String toString() { return getName() + "=" + getStat(); } /** * Get the current value of this stat as a String. */ public abstract String getStat(); }
{ "content_hash": "1e93ce4b6aa5d4d4c7194553289d9784", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 55, "avg_line_length": 16.24, "alnum_prop": 0.5283251231527094, "repo_name": "dustin/spyjar", "id": "4f9a3253e8c6e727823129ebadb88ebe79169c0f", "size": "812", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/java/net/spy/stat/Stat.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "770120" } ] }
using Newtonsoft.Json; namespace JsonFluentMap { /// <summary> /// The base settings /// </summary> public static class JsonMapSettings { /// <summary> /// Base settings /// </summary> public static JsonSerializerSettings BaseSettings { get; set; } = new JsonSerializerSettings(); } }
{ "content_hash": "40e201c7a43471acf7dab43a00b6b29b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 22.125, "alnum_prop": 0.5790960451977402, "repo_name": "PagueVeloz/JsonFluentMap", "id": "078705f30b129315c74d35acd91ac1dea6a07824", "size": "356", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/JsonFluentMap/JsonMapSettings.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "24014" }, { "name": "PowerShell", "bytes": "4750" }, { "name": "Shell", "bytes": "3417" } ] }
'use strict'; var util = require('util'); var yeoman = require('yeoman-generator'); var getDirCount = require('../helpers/get-dir-count'); var path = require('path'); var pistacheoConf; try { pistacheoConf = require(path.join(process.cwd(), './pistacheo.conf')); var directories = pistacheoConf.directories; } catch(e) { return; // Do Nothing } var APIGenerator = module.exports = function APIGenerator() { // By calling `NamedBase` here, we get the argument to the subgenerator call // as `this.name`. yeoman.generators.NamedBase.apply(this, arguments); var fileJSON = this.config.get('config'); // options this.jsFramework = fileJSON.jsFramework; this.testFramework = fileJSON.testFramework; this.useTesting = fileJSON.useTesting; this.useServerTesting = fileJSON.useServerTesting; this.dbOption = fileJSON.dbOption; }; util.inherits(APIGenerator, yeoman.generators.NamedBase); // Prompts APIGenerator.prototype.ask = function ask() { if (this.dbOption === 'none' || !this.dbOption) { this.log('This subgenerator is only used for Applications using a database.'); this.log('It seems as though you are not using a database.'); this.log('Operation aborted.'); this.abort = true; return; } // var self = this; var done = this.async(); var prompts = [{ name: 'apiFile', message: 'Where would you like to create api files?', default: path.join(directories.source, 'api') }]; this.prompt(prompts, function(answers) { this.apiFile = path.join( answers.apiFile, this._.slugify(this.name.toLowerCase()), this._.slugify(this.name.toLowerCase()) ); this.testFile = path.join( answers.apiFile, this._.slugify(this.name.toLowerCase()), '__tests__', this._.slugify(this.name.toLowerCase()) ); // Get root directory this.rootDir = getDirCount(this.apiFile); // Get source directory this.sourceDir = getDirCount(this.testFile.replace(directories.source + '/', '')); done(); }.bind(this)); }; // Create files APIGenerator.prototype.files = function files() { if (this.abort) { return; } this.template('api.js', this.apiFile + '.js'); if (this.dbOption === 'mongodb') { this.template('mongodb/api.controller.js', this.apiFile + '.controller.js'); this.template('mongodb/api.model.js', this.apiFile + '.model.js'); } // Default to SQL database else { this.template('sql/api.controller.js', this.apiFile + '.controller.js'); this.template('sql/api.model.js', this.apiFile + '.model.js'); } if (this.useServerTesting) { this.template('api.spec.js', this.testFile + '.spec.js'); } };
{ "content_hash": "8fa9375d27826d370bff19257e498ee8", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 86, "avg_line_length": 26.98, "alnum_prop": 0.6582653817642699, "repo_name": "larsonjj/generator-pistacheo", "id": "82e33e6a8732683046c055e41289d85dcf06effd", "size": "2698", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "75" }, { "name": "CSS", "bytes": "2770" }, { "name": "HTML", "bytes": "1491" }, { "name": "JavaScript", "bytes": "102937" }, { "name": "Shell", "bytes": "74" } ] }
// TypeScript Version: 2.0 /// <reference types="@stdlib/types"/> import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter'; // Define a union type representing both iterable and non-iterable iterators: type Iterator = Iter | IterableIterator; /** * Returns an iterator which iteratively computes the inverse hyperbolic cotangent. * * ## Notes * * - The domain of inverse hyperbolic cotangent is restricted to `(-inf,-1]` and `[1,inf)`. If an iterated value is outside of the domain, the returned iterator returns `NaN`. * - If an environment supports `Symbol.iterator` **and** a provided iterator is iterable, the returned iterator is iterable. * * @param iterator - input iterator * @returns iterator * * @example * var uniform = require( `@stdlib/random/iter/uniform` ); * * var iter = iterAcoth( uniform( 1.0, 10.0 ) ); * * var r = iter.next().value; * // returns <number> * * r = iter.next().value; * // returns <number> * * r = iter.next().value; * // returns <number> * * // ... */ declare function iterAcoth( iterator: Iterator ): Iterator; // EXPORTS // export = iterAcoth;
{ "content_hash": "fe5e414cf63b904c7163f50860f1d1ec", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 176, "avg_line_length": 25.227272727272727, "alnum_prop": 0.6873873873873874, "repo_name": "stdlib-js/stdlib", "id": "b6995162fa6e143935c0d08672e780896e7f7a67", "size": "1725", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "lib/node_modules/@stdlib/math/iter/special/acoth/docs/types/index.d.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "21739" }, { "name": "C", "bytes": "15336495" }, { "name": "C++", "bytes": "1349482" }, { "name": "CSS", "bytes": "58039" }, { "name": "Fortran", "bytes": "198059" }, { "name": "HTML", "bytes": "56181" }, { "name": "Handlebars", "bytes": "16114" }, { "name": "JavaScript", "bytes": "85975525" }, { "name": "Julia", "bytes": "1508654" }, { "name": "Makefile", "bytes": "4806816" }, { "name": "Python", "bytes": "3343697" }, { "name": "R", "bytes": "576612" }, { "name": "Shell", "bytes": "559315" }, { "name": "TypeScript", "bytes": "19309407" }, { "name": "WebAssembly", "bytes": "5980" } ] }
package api // PrivateHostAPI 専有ホストAPI type PrivateHostAPI struct { *baseAPI } // NewPrivateHostAPI 専有ホストAPI作成 func NewPrivateHostAPI(client *Client) *PrivateHostAPI { return &PrivateHostAPI{ &baseAPI{ client: client, FuncGetResourceURL: func() string { return "privatehost" }, }, } }
{ "content_hash": "c789b5181fbc059a7b307132bd515ccf", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 56, "avg_line_length": 17.055555555555557, "alnum_prop": 0.7198697068403909, "repo_name": "aantono/traefik", "id": "18bef306df2a4c2d65e8261bd53cd574b2bf920f", "size": "331", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "vendor/github.com/sacloud/libsacloud/api/private_host.go", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6125" }, { "name": "Dockerfile", "bytes": "2177" }, { "name": "Go", "bytes": "2719834" }, { "name": "HTML", "bytes": "66069" }, { "name": "JavaScript", "bytes": "1684" }, { "name": "Makefile", "bytes": "5040" }, { "name": "Shell", "bytes": "24893" }, { "name": "TypeScript", "bytes": "27416" } ] }
import datetime import uuid import importlib from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authorization import ACLAuthorizationPolicy from pyramid.config import Configurator from pyramid.renderers import JSON from pyramid.security import NO_PERMISSION_REQUIRED from channelstream import patched_json as json from channelstream.wsgi_views.wsgi_security import APIFactory def datetime_adapter(obj, request): return obj.isoformat() def uuid_adapter(obj, request): return str(obj) def make_app(server_config): config = Configurator( settings=server_config, root_factory=APIFactory, default_permission="access" ) config.include("pyramid_jinja2") module_, class_ = server_config["signature_checker"].rsplit(".", maxsplit=1) signature_checker_cls = getattr(importlib.import_module(module_), class_) config.registry.signature_checker = signature_checker_cls(server_config["secret"]) authn_policy = AuthTktAuthenticationPolicy( server_config["cookie_secret"], max_age=2592000 ) authz_policy = ACLAuthorizationPolicy() config.set_authentication_policy(authn_policy) config.set_authorization_policy(authz_policy) json_renderer = JSON(serializer=json.dumps, indent=4) json_renderer.add_adapter(datetime.datetime, datetime_adapter) json_renderer.add_adapter(uuid.UUID, uuid_adapter) config.add_renderer("json", json_renderer) config.add_subscriber( "channelstream.subscribers.handle_new_request", "pyramid.events.NewRequest" ) config.add_request_method("channelstream.utils.handle_cors", "handle_cors") config.include("channelstream.wsgi_views") config.scan("channelstream.wsgi_views.server") config.scan("channelstream.wsgi_views.error_handlers") config.scan("channelstream.events") config.include("pyramid_apispec.views") config.pyramid_apispec_add_explorer( spec_route_name="openapi_spec", script_generator="channelstream.utils:swagger_ui_script_template", permission="admin", route_args={ "factory": "channelstream.wsgi_views.wsgi_security:AdminAuthFactory" }, ) app = config.make_wsgi_app() return app
{ "content_hash": "9ce89f538e6d2cfe2a9b76f09839687f", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 86, "avg_line_length": 35.38095238095238, "alnum_prop": 0.7366532077164648, "repo_name": "AppEnlight/channelstream", "id": "3af579f0067e57ade46e4412500c4da566c0c211", "size": "2229", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "channelstream/wsgi_app.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "3442" }, { "name": "JavaScript", "bytes": "322450" }, { "name": "Python", "bytes": "121294" } ] }
 using System; using KeepYourPlantsAlive.Models; namespace KeepYourPlantsAlive.Common { public class PlantListItem : IPlantListItem { private Plant plant; public String Name { get { return plant.Name; } } public System.Windows.Media.ImageSource PictureSource { get { if (plant.Picture != null) return plant.Picture; return null; } } public PlantListItem(Plant plant) { this.plant = plant; } } }
{ "content_hash": "341ed5de1140ecbc11cfd809217c7a01", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 61, "avg_line_length": 18.428571428571427, "alnum_prop": 0.47131782945736433, "repo_name": "kamilk/PlantSaver", "id": "3f48d01562e635c1c112f8f03be5f52d17962e78", "size": "1043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "KeepYourPlantsAlive/Common/PlantListItem.cs", "mode": "33261", "license": "mit", "language": [ { "name": "C#", "bytes": "32214" } ] }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // A mini-zygote specifically for Native Client. #include "components/nacl/loader/nacl_helper_linux.h" #include <errno.h> #include <fcntl.h> #include <signal.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> #include <memory> #include <string> #include <utility> #include <vector> #include "base/at_exit.h" #include "base/command_line.h" #include "base/files/scoped_file.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/posix/eintr_wrapper.h" #include "base/posix/global_descriptors.h" #include "base/posix/unix_domain_socket_linux.h" #include "base/process/kill.h" #include "base/process/process_handle.h" #include "base/rand_util.h" #include "build/build_config.h" #include "components/nacl/common/nacl_switches.h" #include "components/nacl/loader/sandbox_linux/nacl_sandbox_linux.h" #include "content/public/common/content_descriptors.h" #include "content/public/common/mojo_channel_switches.h" #include "content/public/common/send_zygote_child_ping_linux.h" #include "content/public/common/zygote_fork_delegate_linux.h" #include "ipc/ipc_descriptors.h" #include "mojo/edk/embedder/embedder.h" #include "sandbox/linux/services/credentials.h" #include "sandbox/linux/services/namespace_sandbox.h" #if defined(OS_NACL_NONSFI) #include "components/nacl/loader/nonsfi/nonsfi_listener.h" #include "native_client/src/public/nonsfi/irt_exception_handling.h" #else #include <link.h> #include "components/nacl/loader/nacl_listener.h" #endif namespace { struct NaClLoaderSystemInfo { size_t prereserved_sandbox_size; long number_of_cores; }; #if defined(OS_NACL_NONSFI) // Replace |file_descriptor| with the reading end of a closed pipe. void ReplaceFDWithDummy(int file_descriptor) { // Make sure that file_descriptor is an open descriptor. PCHECK(-1 != fcntl(file_descriptor, F_GETFD, 0)); int pipefd[2]; PCHECK(0 == pipe(pipefd)); PCHECK(-1 != dup2(pipefd[0], file_descriptor)); PCHECK(0 == IGNORE_EINTR(close(pipefd[0]))); PCHECK(0 == IGNORE_EINTR(close(pipefd[1]))); } #endif // The child must mimic the behavior of zygote_main_linux.cc on the child // side of the fork. See zygote_main_linux.cc:HandleForkRequest from // if (!child) { void BecomeNaClLoader(base::ScopedFD browser_fd, const NaClLoaderSystemInfo& system_info, bool uses_nonsfi_mode, nacl::NaClSandbox* nacl_sandbox) { DCHECK(nacl_sandbox); VLOG(1) << "NaCl loader: setting up IPC descriptor"; // Close or shutdown IPC channels that we don't need anymore. PCHECK(0 == IGNORE_EINTR(close(kNaClZygoteDescriptor))); #if defined(OS_NACL_NONSFI) // In Non-SFI mode, it's important to close any non-expected IPC channels. CHECK(uses_nonsfi_mode); // The low-level kSandboxIPCChannel is used by renderers and NaCl for // various operations. See the LinuxSandbox::METHOD_* methods. NaCl uses // LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT in SFI mode, so this // should only be closed in Non-SFI mode. // This file descriptor is insidiously used by a number of APIs. Closing it // could lead to difficult to debug issues. Instead of closing it, replace // it with a dummy. const int sandbox_ipc_channel = base::GlobalDescriptors::kBaseDescriptor + kSandboxIPCChannel; ReplaceFDWithDummy(sandbox_ipc_channel); // Install crash signal handlers before disallowing system calls. nonsfi_initialize_signal_handler(); #else CHECK(!uses_nonsfi_mode); #endif // Always ignore SIGPIPE, for consistency with other Chrome processes and // because some IPC code, such as sync_socket_posix.cc, requires this. // We do this before seccomp-bpf is initialized. PCHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR); // Finish layer-1 sandbox initialization and initialize the layer-2 sandbox. CHECK(!nacl_sandbox->HasOpenDirectory()); nacl_sandbox->InitializeLayerTwoSandbox(uses_nonsfi_mode); nacl_sandbox->SealLayerOneSandbox(); nacl_sandbox->CheckSandboxingStateWithPolicy(); base::GlobalDescriptors::GetInstance()->Set(kMojoIPCChannel, browser_fd.release()); // The Mojo EDK must be initialized before using IPC. mojo::edk::Init(); base::MessageLoopForIO main_message_loop; #if defined(OS_NACL_NONSFI) CHECK(uses_nonsfi_mode); nacl::nonsfi::NonSfiListener listener; listener.Listen(); #else CHECK(!uses_nonsfi_mode); NaClListener listener; listener.set_prereserved_sandbox_size(system_info.prereserved_sandbox_size); listener.set_number_of_cores(system_info.number_of_cores); listener.Listen(); #endif _exit(0); } // Start the NaCl loader in a child created by the NaCl loader Zygote. void ChildNaClLoaderInit(std::vector<base::ScopedFD> child_fds, const NaClLoaderSystemInfo& system_info, bool uses_nonsfi_mode, nacl::NaClSandbox* nacl_sandbox, const std::string& channel_id) { DCHECK(child_fds.size() > std::max(content::ZygoteForkDelegate::kPIDOracleFDIndex, content::ZygoteForkDelegate::kBrowserFDIndex)); // Ping the PID oracle socket. CHECK(content::SendZygoteChildPing( child_fds[content::ZygoteForkDelegate::kPIDOracleFDIndex].get())); base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kServiceRequestChannelToken, channel_id); // Save the browser socket and close the rest. base::ScopedFD browser_fd( std::move(child_fds[content::ZygoteForkDelegate::kBrowserFDIndex])); child_fds.clear(); BecomeNaClLoader(std::move(browser_fd), system_info, uses_nonsfi_mode, nacl_sandbox); _exit(1); } // Handle a fork request from the Zygote. // Some of this code was lifted from // content/browser/zygote_main_linux.cc:ForkWithRealPid() bool HandleForkRequest(std::vector<base::ScopedFD> child_fds, const NaClLoaderSystemInfo& system_info, nacl::NaClSandbox* nacl_sandbox, base::PickleIterator* input_iter, base::Pickle* output_pickle) { bool uses_nonsfi_mode; if (!input_iter->ReadBool(&uses_nonsfi_mode)) { LOG(ERROR) << "Could not read uses_nonsfi_mode status"; return false; } std::string channel_id; if (!input_iter->ReadString(&channel_id)) { LOG(ERROR) << "Could not read channel_id string"; return false; } if (content::ZygoteForkDelegate::kNumPassedFDs != child_fds.size()) { LOG(ERROR) << "nacl_helper: unexpected number of fds, got " << child_fds.size(); return false; } VLOG(1) << "nacl_helper: forking"; pid_t child_pid; if (sandbox::NamespaceSandbox::InNewUserNamespace()) { child_pid = sandbox::NamespaceSandbox::ForkInNewPidNamespace( /*drop_capabilities_in_child=*/true); } else { child_pid = sandbox::Credentials::ForkAndDropCapabilitiesInChild(); } if (child_pid < 0) { PLOG(ERROR) << "*** fork() failed."; } if (child_pid == 0) { // Install termiantion signal handlers for nonsfi NaCl. The SFI NaCl runtime // will install signal handlers for SIGINT, SIGTERM, etc. so we do not need // to install termination signal handlers ourselves (in fact, it will crash // if signal handlers for these are present). if (uses_nonsfi_mode && getpid() == 1) { // Note that nonsfi NaCl may override some of these signal handlers, which // is fine. sandbox::NamespaceSandbox::InstallDefaultTerminationSignalHandlers(); } ChildNaClLoaderInit(std::move(child_fds), system_info, uses_nonsfi_mode, nacl_sandbox, channel_id); NOTREACHED(); } // I am the parent. // First, close the dummy_fd so the sandbox won't find me when // looking for the child's pid in /proc. Also close other fds. child_fds.clear(); VLOG(1) << "nacl_helper: child_pid is " << child_pid; // Now send child_pid (eventually -1 if fork failed) to the Chrome Zygote. output_pickle->WriteInt(child_pid); return true; } bool HandleGetTerminationStatusRequest(base::PickleIterator* input_iter, base::Pickle* output_pickle) { pid_t child_to_wait; if (!input_iter->ReadInt(&child_to_wait)) { LOG(ERROR) << "Could not read pid to wait for"; return false; } bool known_dead; if (!input_iter->ReadBool(&known_dead)) { LOG(ERROR) << "Could not read known_dead status"; return false; } // TODO(jln): With NaCl, known_dead seems to never be set to true (unless // called from the Zygote's kZygoteCommandReap command). This means that we // will sometimes detect the process as still running when it's not. Fix // this! int exit_code; base::TerminationStatus status; if (known_dead) status = base::GetKnownDeadTerminationStatus(child_to_wait, &exit_code); else status = base::GetTerminationStatus(child_to_wait, &exit_code); output_pickle->WriteInt(static_cast<int>(status)); output_pickle->WriteInt(exit_code); return true; } // Honor a command |command_type|. Eventual command parameters are // available in |input_iter| and eventual file descriptors attached to // the command are in |attached_fds|. // Reply to the command on |reply_fds|. bool HonorRequestAndReply(int reply_fd, int command_type, std::vector<base::ScopedFD> attached_fds, const NaClLoaderSystemInfo& system_info, nacl::NaClSandbox* nacl_sandbox, base::PickleIterator* input_iter) { base::Pickle write_pickle; bool have_to_reply = false; // Commands must write anything to send back to |write_pickle|. switch (command_type) { case nacl::kNaClForkRequest: have_to_reply = HandleForkRequest(std::move(attached_fds), system_info, nacl_sandbox, input_iter, &write_pickle); break; case nacl::kNaClGetTerminationStatusRequest: have_to_reply = HandleGetTerminationStatusRequest(input_iter, &write_pickle); break; default: LOG(ERROR) << "Unsupported command from Zygote"; return false; } if (!have_to_reply) return false; const std::vector<int> empty; // We never send file descriptors back. if (!base::UnixDomainSocket::SendMsg(reply_fd, write_pickle.data(), write_pickle.size(), empty)) { LOG(ERROR) << "*** send() to zygote failed"; return false; } return true; } // Read a request from the Zygote from |zygote_ipc_fd| and handle it. // Die on EOF from |zygote_ipc_fd|. bool HandleZygoteRequest(int zygote_ipc_fd, const NaClLoaderSystemInfo& system_info, nacl::NaClSandbox* nacl_sandbox) { std::vector<base::ScopedFD> fds; char buf[kNaClMaxIPCMessageLength]; const ssize_t msglen = base::UnixDomainSocket::RecvMsg(zygote_ipc_fd, &buf, sizeof(buf), &fds); // If the Zygote has started handling requests, we should be sandboxed via // the setuid sandbox. if (!nacl_sandbox->layer_one_enabled()) { LOG(ERROR) << "NaCl helper process running without a sandbox!\n" << "Most likely you need to configure your SUID sandbox " << "correctly"; } if (msglen == 0 || (msglen == -1 && errno == ECONNRESET)) { // EOF from the browser. Goodbye! _exit(0); } if (msglen < 0) { PLOG(ERROR) << "nacl_helper: receive from zygote failed"; return false; } base::Pickle read_pickle(buf, msglen); base::PickleIterator read_iter(read_pickle); int command_type; if (!read_iter.ReadInt(&command_type)) { LOG(ERROR) << "Unable to read command from Zygote"; return false; } return HonorRequestAndReply(zygote_ipc_fd, command_type, std::move(fds), system_info, nacl_sandbox, &read_iter); } #if !defined(OS_NACL_NONSFI) static const char kNaClHelperReservedAtZero[] = "reserved_at_zero"; static const char kNaClHelperRDebug[] = "r_debug"; // Since we were started by nacl_helper_bootstrap rather than in the // usual way, the debugger cannot figure out where our executable // or the dynamic linker or the shared libraries are in memory, // so it won't find any symbols. But we can fake it out to find us. // // The zygote passes --r_debug=0xXXXXXXXXXXXXXXXX. // nacl_helper_bootstrap replaces the Xs with the address of its _r_debug // structure. The debugger will look for that symbol by name to // discover the addresses of key dynamic linker data structures. // Since all it knows about is the original main executable, which // is the bootstrap program, it finds the symbol defined there. The // dynamic linker's structure is somewhere else, but it is filled in // after initialization. The parts that really matter to the // debugger never change. So we just copy the contents of the // dynamic linker's structure into the address provided by the option. // Hereafter, if someone attaches a debugger (or examines a core dump), // the debugger will find all the symbols in the normal way. // // Non-SFI mode does not use nacl_helper_bootstrap, so it doesn't need to // process the --r_debug option. static void CheckRDebug(char* argv0) { std::string r_debug_switch_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( kNaClHelperRDebug); if (!r_debug_switch_value.empty()) { char* endp; uintptr_t r_debug_addr = strtoul(r_debug_switch_value.c_str(), &endp, 0); if (r_debug_addr != 0 && *endp == '\0') { r_debug* bootstrap_r_debug = reinterpret_cast<r_debug*>(r_debug_addr); *bootstrap_r_debug = _r_debug; // Since the main executable (the bootstrap program) does not // have a dynamic section, the debugger will not skip the // first element of the link_map list as it usually would for // an executable or PIE that was loaded normally. But the // dynamic linker has set l_name for the PIE to "" as is // normal for the main executable. So the debugger doesn't // know which file it is. Fill in the actual file name, which // came in as our argv[0]. link_map* l = _r_debug.r_map; if (l->l_name[0] == '\0') l->l_name = argv0; } } } // The zygote passes --reserved_at_zero=0xXXXXXXXXXXXXXXXX. // nacl_helper_bootstrap replaces the Xs with the amount of prereserved // sandbox memory. // // CheckReservedAtZero parses the value of the argument reserved_at_zero // and returns the amount of prereserved sandbox memory. static size_t CheckReservedAtZero() { size_t prereserved_sandbox_size = 0; std::string reserved_at_zero_switch_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( kNaClHelperReservedAtZero); if (!reserved_at_zero_switch_value.empty()) { char* endp; prereserved_sandbox_size = strtoul(reserved_at_zero_switch_value.c_str(), &endp, 0); if (*endp != '\0') LOG(ERROR) << "Could not parse reserved_at_zero argument value of " << reserved_at_zero_switch_value; } return prereserved_sandbox_size; } #endif } // namespace #if defined(ADDRESS_SANITIZER) // Do not install the SIGSEGV handler in ASan. This should make the NaCl // platform qualification test pass. // detect_odr_violation=0: http://crbug.com/376306 static const char kAsanDefaultOptionsNaCl[] = "handle_segv=0:detect_odr_violation=0"; // Override the default ASan options for the NaCl helper. // __asan_default_options should not be instrumented, because it is called // before ASan is initialized. extern "C" __attribute__((no_sanitize_address)) // The function isn't referenced from the executable itself. Make sure it isn't // stripped by the linker. __attribute__((used)) __attribute__((visibility("default"))) const char* __asan_default_options() { return kAsanDefaultOptionsNaCl; } #endif int main(int argc, char* argv[]) { base::CommandLine::Init(argc, argv); base::AtExitManager exit_manager; base::RandUint64(); // acquire /dev/urandom fd before sandbox is raised const NaClLoaderSystemInfo system_info = { #if !defined(OS_NACL_NONSFI) // These are not used by nacl_helper_nonsfi. CheckReservedAtZero(), sysconf(_SC_NPROCESSORS_ONLN) #endif }; #if !defined(OS_NACL_NONSFI) CheckRDebug(argv[0]); #endif std::unique_ptr<nacl::NaClSandbox> nacl_sandbox(new nacl::NaClSandbox); // Make sure that the early initialization did not start any spurious // threads. #if !defined(THREAD_SANITIZER) CHECK(nacl_sandbox->IsSingleThreaded()); #endif const bool is_init_process = 1 == getpid(); nacl_sandbox->InitializeLayerOneSandbox(); CHECK_EQ(is_init_process, nacl_sandbox->layer_one_enabled()); const std::vector<int> empty; // Send the zygote a message to let it know we are ready to help if (!base::UnixDomainSocket::SendMsg(kNaClZygoteDescriptor, kNaClHelperStartupAck, sizeof(kNaClHelperStartupAck), empty)) { LOG(ERROR) << "*** send() to zygote failed"; } // Now handle requests from the Zygote. while (true) { bool request_handled = HandleZygoteRequest( kNaClZygoteDescriptor, system_info, nacl_sandbox.get()); // Do not turn this into a CHECK() without thinking about robustness // against malicious IPC requests. DCHECK(request_handled); } NOTREACHED(); }
{ "content_hash": "fdcace7084a895c6983c1c1c060d9b6e", "timestamp": "", "source": "github", "line_count": 476, "max_line_length": 80, "avg_line_length": 37.25840336134454, "alnum_prop": 0.6823230899351564, "repo_name": "google-ar/WebARonARCore", "id": "df24f6d6181b5c03e8d9d4b95b8191e98f0d1d44", "size": "17735", "binary": false, "copies": "2", "ref": "refs/heads/webarcore_57.0.2987.5", "path": "components/nacl/loader/nacl_helper_linux.cc", "mode": "33188", "license": "apache-2.0", "language": [] }
package com.amazonaws.http.conn.ssl; import java.net.Socket; import com.amazonaws.http.conn.ssl.privileged.PrivilegedMasterSecretValidator; import com.amazonaws.util.JavaVersionParser; import com.amazonaws.util.JavaVersionParser.JavaVersion; public class MasterSecretValidators { // Versions that the SKIP-TLS bug has been fixed in for each affected major version private static final JavaVersion FIXED_JAVA_6 = new JavaVersion(1, 6, 0, 91); private static final JavaVersion FIXED_JAVA_7 = new JavaVersion(1, 7, 0, 51); private static final JavaVersion FIXED_JAVA_8 = new JavaVersion(1, 8, 0, 31); /** * Interface to validate the master secret of a SSL session */ public interface MasterSecretValidator { /** * @param socket * SSLSocket containing master secret * @return True if master secret is considered valid, false otherwise */ public boolean isMasterSecretValid(final Socket socket); } /** * The implementation of {@link MasterSecretValidator} depends on the JVM version. Certain JVMs * are affected by a serious bug that could allow a malicious MITM to negotiate a null master * secret. Non-affected JVMs return a dummy implementation that always returns true * * @see http://www.oracle.com/technetwork/topics/security/cpujan2015-1972971.html * @see https://access.redhat.com/security/cve/CVE-2014-6593 * @return The correct implementation of {@link MasterSecretValidator} */ public static MasterSecretValidator getMasterSecretValidator() { return getMasterSecretValidator(JavaVersionParser.getCurrentJavaVersion()); } /** * @param javaVersion * Current Java version * @return An appropriate {@link MasterSecretValidator} per the Java version in use */ public static MasterSecretValidator getMasterSecretValidator(JavaVersion javaVersion) { switch (javaVersion.getKnownVersion()) { case JAVA_6: if (javaVersion.compareTo(FIXED_JAVA_6) < 0) { return new PrivilegedMasterSecretValidator(); } break; case JAVA_7: if (javaVersion.compareTo(FIXED_JAVA_7) < 0) { return new PrivilegedMasterSecretValidator(); } break; case JAVA_8: if (javaVersion.compareTo(FIXED_JAVA_8) < 0) { return new PrivilegedMasterSecretValidator(); } break; default: break; } return new NoOpMasterSecretValidator(); } /** * Dummy implementation of {@link MasterSecretValidator} that always returns true. For JVMs that * aren't affected by the SKIP-TLS bug */ public static class NoOpMasterSecretValidator implements MasterSecretValidator { @Override public boolean isMasterSecretValid(Socket socket) { return true; } } }
{ "content_hash": "2aaaf4299aabb5d535e26f153c457a77", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 100, "avg_line_length": 35.34117647058824, "alnum_prop": 0.6591211717709721, "repo_name": "aws/aws-sdk-java", "id": "846a848317ccaa68f16c3da29774b24facfefaf6", "size": "3588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-core/src/main/java/com/amazonaws/http/conn/ssl/MasterSecretValidators.java", "mode": "33188", "license": "apache-2.0", "language": [] }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "479173c46d0d33f51afdfdbb7729723a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "3944f4f3dc8288b96c81f5b6b22fa59c05741d28", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Campanulaceae/Cyanea/Cyanea floribunda/ Syn. Cyanea densiflora/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
<?php namespace Pitpit\Component\MongoFilesystem\Tests; use Symfony\Component\Filesystem\Filesystem; use Pitpit\Component\MongoFilesystem\Finder\Finder; use Symfony\Component\Finder\Finder as BaseFinder; use Pitpit\Component\MongoFilesystem\Tests\MongoGridTestHelper; use Pitpit\Component\MongoFilesystem\SplFileInfo; class FinderTest extends \PHPUnit_Framework_TestCase { /** * @var string */ private $workspace = null; /** * @var boolean */ protected $legacy; protected function getFinder() { if ($this->legacy) { return new BaseFinder(); } else { return new Finder(); } } protected function setUp() { $this->legacy = isset($_SERVER['LEGACY_TESTS']) ? (bool) $_SERVER['LEGACY_TESTS'] : false; $this->workspace = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid(); $fs = new Filesystem(); $fs->mkdir($this->workspace.'/bar'); $fs->touch($this->workspace.'/foo.txt'); $fs->touch($this->workspace.'/bar/foo.txt'); $fs->touch($this->workspace.'/bar/.hidden'); if (!$this->legacy) { MongoGridTestHelper::getGridFS()->storeBytes('', array('filename' => $this->workspace, 'type' => 'dir')); MongoGridTestHelper::getGridFS()->storeBytes('', array('filename' => $this->workspace.'/bar', 'type' => 'dir')); MongoGridTestHelper::getGridFS()->storeFile($this->workspace.'/foo.txt', array('type' => 'file')); MongoGridTestHelper::getGridFS()->storeFile($this->workspace.'/bar/foo.txt', array('type' => 'file')); MongoGridTestHelper::getGridFS()->storeFile($this->workspace.'/bar/.hidden', array('type' => 'file')); $fs->remove($this->workspace); } } protected function tearDown() { if ($this->legacy) { $fs = new Filesystem(); $fs->remove($this->workspace); } } protected function assertFileIterator($filenames, $iterator) { $files = array(); foreach ($iterator as $file) { $files[] = $file->getPathname(); } $this->assertEquals($filenames, $files); } public function testIn() { $finder = $this->getFinder(); $finder->in($this->workspace); $this->assertFileIterator(array( $this->workspace.'/bar', $this->workspace.'/bar/foo.txt', $this->workspace.'/foo.txt' ), $finder->getIterator()); } public function testDepth() { $finder = $this->getFinder(); $finder->in($this->workspace)->depth(0); $this->assertFileIterator(array( $this->workspace.'/bar', $this->workspace.'/foo.txt', ), $finder->getIterator()); $finder = $this->getFinder(); $finder->in($this->workspace)->depth(1); $this->assertFileIterator(array( $this->workspace.'/bar/foo.txt' ), $finder->getIterator()); } public function testignoreDotFiles() { $finder = $this->getFinder(); $finder->in($this->workspace)->ignoreDotFiles(true); $this->assertFileIterator(array( $this->workspace.'/bar', $this->workspace.'/bar/foo.txt', $this->workspace.'/foo.txt', ), $finder->getIterator()); } }
{ "content_hash": "07f9fbbd2f2f2da797758539ea8c6275", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 124, "avg_line_length": 30.196428571428573, "alnum_prop": 0.5653459491425192, "repo_name": "pitpit/php-mongo-filesystem", "id": "c379c0ef08bf5bd4aa2b8ce13eb86a71d06a6c14", "size": "3382", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tests/Finder/FinderTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "72831" } ] }
End of preview.

No dataset card yet

Downloads last month
4