text stringlengths 2 1.04M | meta dict |
|---|---|
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(640, 480)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 640, 27))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menu_File = QtGui.QMenu(self.menubar)
self.menu_File.setObjectName(_fromUtf8("menu_File"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.closeAction = QtGui.QAction(MainWindow)
self.closeAction.setObjectName(_fromUtf8("closeAction"))
self.newAction = QtGui.QAction(MainWindow)
self.newAction.setObjectName(_fromUtf8("newFile"))
self.openAction = QtGui.QAction(MainWindow)
self.openAction.setObjectName(_fromUtf8("openFile"))
self.saveAction = QtGui.QAction(MainWindow)
self.saveAction.setObjectName(_fromUtf8("saveFile"))
self.menu_File.addAction(self.newAction)
self.menu_File.addAction(self.openAction)
self.menu_File.addAction(self.saveAction)
self.menu_File.addAction(self.closeAction)
self.menubar.addAction(self.menu_File.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "Блокнот", None))
self.menu_File.setTitle(_translate("MainWindow", "&File", None))
self.closeAction.setText(_translate("MainWindow", "Close", None))
self.closeAction.setToolTip(_translate("MainWindow", "Close Notepad", None))
self.closeAction.setStatusTip(_translate("MainWindow", "Close app", None))
self.closeAction.setShortcut(_translate("MainWindow", "Ctrl+Q", None))
self.newAction.setText(_translate("MainWindow", "New", None))
self.newAction.setToolTip(_translate("MainWindow", "Create New File", None))
self.newAction.setStatusTip(_translate("MainWindow", "Create New File", None))
self.newAction.setShortcut(_translate("MainWindow", "Ctrl+N", None))
self.openAction.setText(_translate("MainWindow", "Open", None))
self.openAction.setToolTip(_translate("MainWindow", "Open a File", None))
self.openAction.setStatusTip(_translate("MainWindow", "Open a File", None))
self.openAction.setShortcut(_translate("MainWindow", "Ctrl+O", None))
self.saveAction.setText(_translate("MainWindow", "Save", None))
self.saveAction.setToolTip(_translate("MainWindow", "Save a File", None))
self.saveAction.setStatusTip(_translate("MainWindow", "Save a File", None))
self.saveAction.setShortcut(_translate("MainWindow", "Ctrl+S", None))
| {
"content_hash": "e556aac48c3c17672cf4263ae2a42eac",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 86,
"avg_line_length": 51.57971014492754,
"alnum_prop": 0.6962629952233773,
"repo_name": "janusnic/21v-pyqt",
"id": "94a751f21588e5ab1b06afb97f68478556a38061",
"size": "3796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "unit_04/Notepad/design3.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "525972"
},
{
"name": "SQLPL",
"bytes": "150"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="kernel.root_dir">C:/wamp/www/opmV1.0/app</parameter>
<parameter key="kernel.environment">dev</parameter>
<parameter key="kernel.debug">true</parameter>
<parameter key="kernel.name">app</parameter>
<parameter key="kernel.cache_dir">C:/wamp/www/opmV1.0/app/cache/dev</parameter>
<parameter key="kernel.logs_dir">C:/wamp/www/opmV1.0/app/logs</parameter>
<parameter key="kernel.bundles" type="collection">
<parameter key="FrameworkBundle">Symfony\Bundle\FrameworkBundle\FrameworkBundle</parameter>
<parameter key="SecurityBundle">Symfony\Bundle\SecurityBundle\SecurityBundle</parameter>
<parameter key="TwigBundle">Symfony\Bundle\TwigBundle\TwigBundle</parameter>
<parameter key="MonologBundle">Symfony\Bundle\MonologBundle\MonologBundle</parameter>
<parameter key="SwiftmailerBundle">Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle</parameter>
<parameter key="DoctrineBundle">Symfony\Bundle\DoctrineBundle\DoctrineBundle</parameter>
<parameter key="AsseticBundle">Symfony\Bundle\AsseticBundle\AsseticBundle</parameter>
<parameter key="SensioFrameworkExtraBundle">Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle</parameter>
<parameter key="JMSSecurityExtraBundle">JMS\SecurityExtraBundle\JMSSecurityExtraBundle</parameter>
<parameter key="OpmTestBundle">Opm\TestBundle\OpmTestBundle</parameter>
<parameter key="WhiteOctoberPagerfantaBundle">WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle</parameter>
<parameter key="FOSUserBundle">FOS\UserBundle\FOSUserBundle</parameter>
<parameter key="OpmUtilisateurBundle">Opm\UtilisateurBundle\OpmUtilisateurBundle</parameter>
<parameter key="OpmImputationBundle">Opm\ImputationBundle\OpmImputationBundle</parameter>
<parameter key="AcmeDemoBundle">Acme\DemoBundle\AcmeDemoBundle</parameter>
<parameter key="WebProfilerBundle">Symfony\Bundle\WebProfilerBundle\WebProfilerBundle</parameter>
<parameter key="SensioDistributionBundle">Sensio\Bundle\DistributionBundle\SensioDistributionBundle</parameter>
<parameter key="SensioGeneratorBundle">Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle</parameter>
<parameter key="CoreSphereConsoleBundle">CoreSphere\ConsoleBundle\CoreSphereConsoleBundle</parameter>
</parameter>
<parameter key="kernel.charset">UTF-8</parameter>
<parameter key="kernel.container_class">appDevDebugProjectContainer</parameter>
<parameter key="database_driver">oci8</parameter>
<parameter key="database_host">192.168.26.41</parameter>
<parameter key="database_port">1521</parameter>
<parameter key="database_name">devdb</parameter>
<parameter key="database_user">opm_dev</parameter>
<parameter key="database_password">opm</parameter>
<parameter key="mailer_transport">smtp</parameter>
<parameter key="mailer_host">smtp.gmail.com</parameter>
<parameter key="mailer_user">benammarhaithem@gmail.com </parameter>
<parameter key="mailer_password">29051986haithi</parameter>
<parameter key="mailer_port">465</parameter>
<parameter key="locale">fr</parameter>
<parameter key="secret">39e9e2c38638da6ad0bed341eed2d896</parameter>
<parameter key="router_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\RouterListener</parameter>
<parameter key="controller_resolver.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver</parameter>
<parameter key="controller_name_converter.class">Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser</parameter>
<parameter key="response_listener.class">Symfony\Component\HttpKernel\EventListener\ResponseListener</parameter>
<parameter key="event_dispatcher.class">Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher</parameter>
<parameter key="http_kernel.class">Symfony\Bundle\FrameworkBundle\HttpKernel</parameter>
<parameter key="filesystem.class">Symfony\Component\Filesystem\Filesystem</parameter>
<parameter key="cache_warmer.class">Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate</parameter>
<parameter key="file_locator.class">Symfony\Component\HttpKernel\Config\FileLocator</parameter>
<parameter key="translator.class">Symfony\Bundle\FrameworkBundle\Translation\Translator</parameter>
<parameter key="translator.identity.class">Symfony\Component\Translation\IdentityTranslator</parameter>
<parameter key="translator.selector.class">Symfony\Component\Translation\MessageSelector</parameter>
<parameter key="translation.loader.php.class">Symfony\Component\Translation\Loader\PhpFileLoader</parameter>
<parameter key="translation.loader.yml.class">Symfony\Component\Translation\Loader\YamlFileLoader</parameter>
<parameter key="translation.loader.xliff.class">Symfony\Component\Translation\Loader\XliffFileLoader</parameter>
<parameter key="debug.event_dispatcher.class">Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher</parameter>
<parameter key="debug.container.dump">C:/wamp/www/opmV1.0/app/cache/dev/appDevDebugProjectContainer.xml</parameter>
<parameter key="kernel.secret">39e9e2c38638da6ad0bed341eed2d896</parameter>
<parameter key="kernel.trust_proxy_headers">false</parameter>
<parameter key="session.class">Symfony\Component\HttpFoundation\Session</parameter>
<parameter key="session.storage.native.class">Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage</parameter>
<parameter key="session.storage.filesystem.class">Symfony\Component\HttpFoundation\SessionStorage\FilesystemSessionStorage</parameter>
<parameter key="session_listener.class">Symfony\Bundle\FrameworkBundle\EventListener\SessionListener</parameter>
<parameter key="session.default_locale">fr</parameter>
<parameter key="session.storage.options" type="collection"/>
<parameter key="form.extension.class">Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension</parameter>
<parameter key="form.factory.class">Symfony\Component\Form\FormFactory</parameter>
<parameter key="form.type_guesser.validator.class">Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser</parameter>
<parameter key="form.csrf_provider.class">Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider</parameter>
<parameter key="form.type_extension.csrf.enabled">true</parameter>
<parameter key="form.type_extension.csrf.field_name">_token</parameter>
<parameter key="validator.class">Symfony\Component\Validator\Validator</parameter>
<parameter key="validator.mapping.class_metadata_factory.class">Symfony\Component\Validator\Mapping\ClassMetadataFactory</parameter>
<parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>
<parameter key="validator.mapping.cache.prefix"></parameter>
<parameter key="validator.mapping.loader.loader_chain.class">Symfony\Component\Validator\Mapping\Loader\LoaderChain</parameter>
<parameter key="validator.mapping.loader.static_method_loader.class">Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader</parameter>
<parameter key="validator.mapping.loader.annotation_loader.class">Symfony\Component\Validator\Mapping\Loader\AnnotationLoader</parameter>
<parameter key="validator.mapping.loader.xml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader</parameter>
<parameter key="validator.mapping.loader.yaml_files_loader.class">Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader</parameter>
<parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter>
<parameter key="validator.mapping.loader.xml_files_loader.mapping_files" type="collection">
<parameter>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</parameter>
<parameter>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle\Resources\config\validation.xml</parameter>
</parameter>
<parameter key="validator.mapping.loader.yaml_files_loader.mapping_files" type="collection"/>
<parameter key="profiler.class">Symfony\Component\HttpKernel\Profiler\Profiler</parameter>
<parameter key="profiler_listener.class">Symfony\Component\HttpKernel\EventListener\ProfilerListener</parameter>
<parameter key="data_collector.config.class">Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector</parameter>
<parameter key="data_collector.request.class">Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector</parameter>
<parameter key="data_collector.exception.class">Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector</parameter>
<parameter key="data_collector.events.class">Symfony\Component\HttpKernel\DataCollector\EventDataCollector</parameter>
<parameter key="data_collector.logger.class">Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector</parameter>
<parameter key="data_collector.timer.class">Symfony\Bundle\FrameworkBundle\DataCollector\TimerDataCollector</parameter>
<parameter key="data_collector.memory.class">Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector</parameter>
<parameter key="profiler_listener.only_exceptions">false</parameter>
<parameter key="profiler_listener.only_master_requests">false</parameter>
<parameter key="profiler.storage.dsn">sqlite:C:/wamp/www/opmV1.0/app/cache/dev/profiler.db</parameter>
<parameter key="profiler.storage.username"></parameter>
<parameter key="profiler.storage.password"></parameter>
<parameter key="profiler.storage.lifetime">86400</parameter>
<parameter key="router.class">Symfony\Bundle\FrameworkBundle\Routing\Router</parameter>
<parameter key="routing.loader.class">Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader</parameter>
<parameter key="routing.resolver.class">Symfony\Component\Config\Loader\LoaderResolver</parameter>
<parameter key="routing.loader.xml.class">Symfony\Component\Routing\Loader\XmlFileLoader</parameter>
<parameter key="routing.loader.yml.class">Symfony\Component\Routing\Loader\YamlFileLoader</parameter>
<parameter key="routing.loader.php.class">Symfony\Component\Routing\Loader\PhpFileLoader</parameter>
<parameter key="router.options.generator_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
<parameter key="router.options.generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</parameter>
<parameter key="router.options.generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</parameter>
<parameter key="router.options.matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
<parameter key="router.options.matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</parameter>
<parameter key="router.options.matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</parameter>
<parameter key="router.cache_warmer.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer</parameter>
<parameter key="router.options.matcher.cache_class">appdevUrlMatcher</parameter>
<parameter key="router.options.generator.cache_class">appdevUrlGenerator</parameter>
<parameter key="router.resource">C:/wamp/www/opmV1.0/app/config/routing_dev.yml</parameter>
<parameter key="request_listener.http_port">80</parameter>
<parameter key="request_listener.https_port">443</parameter>
<parameter key="templating.engine.delegating.class">Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine</parameter>
<parameter key="templating.name_parser.class">Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser</parameter>
<parameter key="templating.cache_warmer.template_paths.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer</parameter>
<parameter key="templating.locator.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator</parameter>
<parameter key="templating.loader.filesystem.class">Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader</parameter>
<parameter key="templating.loader.cache.class">Symfony\Component\Templating\Loader\CacheLoader</parameter>
<parameter key="templating.loader.chain.class">Symfony\Component\Templating\Loader\ChainLoader</parameter>
<parameter key="templating.finder.class">Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder</parameter>
<parameter key="templating.engine.php.class">Symfony\Bundle\FrameworkBundle\Templating\PhpEngine</parameter>
<parameter key="templating.helper.slots.class">Symfony\Component\Templating\Helper\SlotsHelper</parameter>
<parameter key="templating.helper.assets.class">Symfony\Component\Templating\Helper\CoreAssetsHelper</parameter>
<parameter key="templating.helper.actions.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper</parameter>
<parameter key="templating.helper.router.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper</parameter>
<parameter key="templating.helper.request.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper</parameter>
<parameter key="templating.helper.session.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper</parameter>
<parameter key="templating.helper.code.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper</parameter>
<parameter key="templating.helper.translator.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper</parameter>
<parameter key="templating.helper.form.class">Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper</parameter>
<parameter key="templating.globals.class">Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables</parameter>
<parameter key="templating.asset.path_package.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage</parameter>
<parameter key="templating.asset.url_package.class">Symfony\Component\Templating\Asset\UrlPackage</parameter>
<parameter key="templating.asset.package_factory.class">Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory</parameter>
<parameter key="templating.helper.code.file_link_format">null</parameter>
<parameter key="templating.helper.form.resources" type="collection">
<parameter>FrameworkBundle:Form</parameter>
</parameter>
<parameter key="templating.debugger.class">Symfony\Bundle\FrameworkBundle\Templating\Debugger</parameter>
<parameter key="templating.loader.cache.path">null</parameter>
<parameter key="templating.engines" type="collection">
<parameter>twig</parameter>
</parameter>
<parameter key="annotations.reader.class">Doctrine\Common\Annotations\AnnotationReader</parameter>
<parameter key="annotations.cached_reader.class">Doctrine\Common\Annotations\CachedReader</parameter>
<parameter key="annotations.file_cache_reader.class">Doctrine\Common\Annotations\FileCacheReader</parameter>
<parameter key="security.context.class">Symfony\Component\Security\Core\SecurityContext</parameter>
<parameter key="security.user_checker.class">Symfony\Component\Security\Core\User\UserChecker</parameter>
<parameter key="security.encoder_factory.generic.class">Symfony\Component\Security\Core\Encoder\EncoderFactory</parameter>
<parameter key="security.encoder.digest.class">Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder</parameter>
<parameter key="security.encoder.plain.class">Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder</parameter>
<parameter key="security.user.provider.entity.class">Symfony\Bridge\Doctrine\Security\User\EntityUserProvider</parameter>
<parameter key="security.user.provider.in_memory.class">Symfony\Component\Security\Core\User\InMemoryUserProvider</parameter>
<parameter key="security.user.provider.in_memory.user.class">Symfony\Component\Security\Core\User\User</parameter>
<parameter key="security.user.provider.chain.class">Symfony\Component\Security\Core\User\ChainUserProvider</parameter>
<parameter key="security.authentication.trust_resolver.class">Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver</parameter>
<parameter key="security.authentication.trust_resolver.anonymous_class">Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</parameter>
<parameter key="security.authentication.trust_resolver.rememberme_class">Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</parameter>
<parameter key="security.authentication.manager.class">Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager</parameter>
<parameter key="security.authentication.session_strategy.class">Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy</parameter>
<parameter key="security.access.decision_manager.class">Symfony\Component\Security\Core\Authorization\AccessDecisionManager</parameter>
<parameter key="security.access.simple_role_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleVoter</parameter>
<parameter key="security.access.authenticated_voter.class">Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter</parameter>
<parameter key="security.access.role_hierarchy_voter.class">Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter</parameter>
<parameter key="security.firewall.class">Symfony\Component\Security\Http\Firewall</parameter>
<parameter key="security.firewall.map.class">Symfony\Bundle\SecurityBundle\Security\FirewallMap</parameter>
<parameter key="security.firewall.context.class">Symfony\Bundle\SecurityBundle\Security\FirewallContext</parameter>
<parameter key="security.matcher.class">Symfony\Component\HttpFoundation\RequestMatcher</parameter>
<parameter key="security.role_hierarchy.class">Symfony\Component\Security\Core\Role\RoleHierarchy</parameter>
<parameter key="security.http_utils.class">Symfony\Component\Security\Http\HttpUtils</parameter>
<parameter key="security.authentication.retry_entry_point.class">Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint</parameter>
<parameter key="security.channel_listener.class">Symfony\Component\Security\Http\Firewall\ChannelListener</parameter>
<parameter key="security.authentication.form_entry_point.class">Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.form.class">Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener</parameter>
<parameter key="security.authentication.listener.basic.class">Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener</parameter>
<parameter key="security.authentication.basic_entry_point.class">Symfony\Component\Security\Http\EntryPoint\BasicAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.digest.class">Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener</parameter>
<parameter key="security.authentication.digest_entry_point.class">Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint</parameter>
<parameter key="security.authentication.listener.x509.class">Symfony\Component\Security\Http\Firewall\X509AuthenticationListener</parameter>
<parameter key="security.authentication.listener.anonymous.class">Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener</parameter>
<parameter key="security.authentication.switchuser_listener.class">Symfony\Component\Security\Http\Firewall\SwitchUserListener</parameter>
<parameter key="security.logout_listener.class">Symfony\Component\Security\Http\Firewall\LogoutListener</parameter>
<parameter key="security.logout.handler.session.class">Symfony\Component\Security\Http\Logout\SessionLogoutHandler</parameter>
<parameter key="security.logout.handler.cookie_clearing.class">Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler</parameter>
<parameter key="security.access_listener.class">Symfony\Component\Security\Http\Firewall\AccessListener</parameter>
<parameter key="security.access_map.class">Symfony\Component\Security\Http\AccessMap</parameter>
<parameter key="security.exception_listener.class">Symfony\Component\Security\Http\Firewall\ExceptionListener</parameter>
<parameter key="security.context_listener.class">Symfony\Component\Security\Http\Firewall\ContextListener</parameter>
<parameter key="security.authentication.provider.dao.class">Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider</parameter>
<parameter key="security.authentication.provider.pre_authenticated.class">Symfony\Component\Security\Core\Authentication\Provider\PreAuthenticatedAuthenticationProvider</parameter>
<parameter key="security.authentication.provider.anonymous.class">Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider</parameter>
<parameter key="security.authentication.provider.rememberme.class">Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider</parameter>
<parameter key="security.authentication.listener.rememberme.class">Symfony\Component\Security\Http\Firewall\RememberMeListener</parameter>
<parameter key="security.rememberme.token.provider.in_memory.class">Symfony\Component\Security\Core\Authentication\RememberMe\InMemoryTokenProvider</parameter>
<parameter key="security.authentication.rememberme.services.persistent.class">Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices</parameter>
<parameter key="security.authentication.rememberme.services.simplehash.class">Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices</parameter>
<parameter key="security.rememberme.response_listener.class">Symfony\Bundle\SecurityBundle\EventListener\ResponseListener</parameter>
<parameter key="templating.helper.security.class">Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper</parameter>
<parameter key="data_collector.security.class">Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector</parameter>
<parameter key="security.access.denied_url">null</parameter>
<parameter key="security.authentication.session_strategy.strategy">migrate</parameter>
<parameter key="security.access.always_authenticate_before_granting">false</parameter>
<parameter key="security.authentication.hide_user_not_found">true</parameter>
<parameter key="security.role_hierarchy.roles" type="collection">
<parameter key="ROLE_ADMIN" type="collection">
<parameter>ROLE_USER</parameter>
</parameter>
<parameter key="ROLE_SUPERADMIN" type="collection">
<parameter>ROLE_ADMIN</parameter>
</parameter>
<parameter key="ROLE_DEV" type="collection">
<parameter>ROLE_DEV</parameter>
</parameter>
</parameter>
<parameter key="twig.class">Twig_Environment</parameter>
<parameter key="twig.loader.class">Symfony\Bundle\TwigBundle\Loader\FilesystemLoader</parameter>
<parameter key="templating.engine.twig.class">Symfony\Bundle\TwigBundle\TwigEngine</parameter>
<parameter key="twig.cache_warmer.class">Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer</parameter>
<parameter key="twig.extension.trans.class">Symfony\Bridge\Twig\Extension\TranslationExtension</parameter>
<parameter key="twig.extension.assets.class">Symfony\Bundle\TwigBundle\Extension\AssetsExtension</parameter>
<parameter key="twig.extension.actions.class">Symfony\Bundle\TwigBundle\Extension\ActionsExtension</parameter>
<parameter key="twig.extension.code.class">Symfony\Bundle\TwigBundle\Extension\CodeExtension</parameter>
<parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter>
<parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter>
<parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter>
<parameter key="twig.exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter>
<parameter key="twig.exception_listener.controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</parameter>
<parameter key="twig.form.resources" type="collection">
<parameter>form_div_layout.html.twig</parameter>
</parameter>
<parameter key="twig.options" type="collection">
<parameter key="debug">true</parameter>
<parameter key="strict_variables">true</parameter>
<parameter key="exception_controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</parameter>
<parameter key="cache">C:/wamp/www/opmV1.0/app/cache/dev/twig</parameter>
<parameter key="charset">UTF-8</parameter>
</parameter>
<parameter key="monolog.logger.class">Symfony\Bridge\Monolog\Logger</parameter>
<parameter key="monolog.handler.stream.class">Monolog\Handler\StreamHandler</parameter>
<parameter key="monolog.handler.fingers_crossed.class">Monolog\Handler\FingersCrossedHandler</parameter>
<parameter key="monolog.handler.group.class">Monolog\Handler\GroupHandler</parameter>
<parameter key="monolog.handler.buffer.class">Monolog\Handler\BufferHandler</parameter>
<parameter key="monolog.handler.rotating_file.class">Monolog\Handler\RotatingFileHandler</parameter>
<parameter key="monolog.handler.syslog.class">Monolog\Handler\SyslogHandler</parameter>
<parameter key="monolog.handler.null.class">Monolog\Handler\NullHandler</parameter>
<parameter key="monolog.handler.test.class">Monolog\Handler\TestHandler</parameter>
<parameter key="monolog.handler.firephp.class">Symfony\Bridge\Monolog\Handler\FirePHPHandler</parameter>
<parameter key="monolog.handler.debug.class">Symfony\Bridge\Monolog\Handler\DebugHandler</parameter>
<parameter key="monolog.handler.swift_mailer.class">Monolog\Handler\SwiftMailerHandler</parameter>
<parameter key="monolog.handler.native_mailer.class">Monolog\Handler\NativeMailerHandler</parameter>
<parameter key="swiftmailer.class">Swift_Mailer</parameter>
<parameter key="swiftmailer.transport.sendmail.class">Swift_Transport_SendmailTransport</parameter>
<parameter key="swiftmailer.transport.mail.class">Swift_Transport_MailTransport</parameter>
<parameter key="swiftmailer.transport.failover.class">Swift_Transport_FailoverTransport</parameter>
<parameter key="swiftmailer.plugin.redirecting.class">Swift_Plugins_RedirectingPlugin</parameter>
<parameter key="swiftmailer.plugin.impersonate.class">Swift_Plugins_ImpersonatePlugin</parameter>
<parameter key="swiftmailer.plugin.messagelogger.class">Symfony\Bundle\SwiftmailerBundle\Logger\MessageLogger</parameter>
<parameter key="swiftmailer.plugin.antiflood.class">Swift_Plugins_AntiFloodPlugin</parameter>
<parameter key="swiftmailer.plugin.antiflood.threshold">99</parameter>
<parameter key="swiftmailer.plugin.antiflood.sleep">0</parameter>
<parameter key="swiftmailer.data_collector.class">Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector</parameter>
<parameter key="swiftmailer.transport.smtp.class">Swift_Transport_EsmtpTransport</parameter>
<parameter key="swiftmailer.transport.smtp.encryption">ssl</parameter>
<parameter key="swiftmailer.transport.smtp.port">465</parameter>
<parameter key="swiftmailer.transport.smtp.host">smtp.gmail.com</parameter>
<parameter key="swiftmailer.transport.smtp.username">benammarhaithem@gmail.com </parameter>
<parameter key="swiftmailer.transport.smtp.password">29051986haithi</parameter>
<parameter key="swiftmailer.transport.smtp.auth_mode">login</parameter>
<parameter key="swiftmailer.spool.enabled">false</parameter>
<parameter key="swiftmailer.sender_address">null</parameter>
<parameter key="swiftmailer.single_address">null</parameter>
<parameter key="doctrine.dbal.logger.debug.class">Doctrine\DBAL\Logging\DebugStack</parameter>
<parameter key="doctrine.dbal.logger.class">Symfony\Bridge\Doctrine\Logger\DbalLogger</parameter>
<parameter key="doctrine.dbal.configuration.class">Doctrine\DBAL\Configuration</parameter>
<parameter key="doctrine.data_collector.class">Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector</parameter>
<parameter key="doctrine.dbal.connection.event_manager.class">Doctrine\Common\EventManager</parameter>
<parameter key="doctrine.dbal.connection_factory.class">Symfony\Bundle\DoctrineBundle\ConnectionFactory</parameter>
<parameter key="doctrine.dbal.events.mysql_session_init.class">Doctrine\DBAL\Event\Listeners\MysqlSessionInit</parameter>
<parameter key="doctrine.dbal.events.oracle_session_init.class">Doctrine\DBAL\Event\Listeners\OracleSessionInit</parameter>
<parameter key="doctrine.class">Symfony\Bundle\DoctrineBundle\Registry</parameter>
<parameter key="doctrine.entity_managers" type="collection">
<parameter key="default">doctrine.orm.default_entity_manager</parameter>
</parameter>
<parameter key="doctrine.default_entity_manager">default</parameter>
<parameter key="doctrine.dbal.connection_factory.types" type="collection"/>
<parameter key="doctrine.connections" type="collection">
<parameter key="default">doctrine.dbal.default_connection</parameter>
</parameter>
<parameter key="doctrine.default_connection">default</parameter>
<parameter key="doctrine.orm.configuration.class">Doctrine\ORM\Configuration</parameter>
<parameter key="doctrine.orm.entity_manager.class">Doctrine\ORM\EntityManager</parameter>
<parameter key="doctrine.orm.cache.array.class">Doctrine\Common\Cache\ArrayCache</parameter>
<parameter key="doctrine.orm.cache.apc.class">Doctrine\Common\Cache\ApcCache</parameter>
<parameter key="doctrine.orm.cache.memcache.class">Doctrine\Common\Cache\MemcacheCache</parameter>
<parameter key="doctrine.orm.cache.memcache_host">localhost</parameter>
<parameter key="doctrine.orm.cache.memcache_port">11211</parameter>
<parameter key="doctrine.orm.cache.memcache_instance.class">Memcache</parameter>
<parameter key="doctrine.orm.cache.xcache.class">Doctrine\Common\Cache\XcacheCache</parameter>
<parameter key="doctrine.orm.metadata.driver_chain.class">Doctrine\ORM\Mapping\Driver\DriverChain</parameter>
<parameter key="doctrine.orm.metadata.annotation.class">Doctrine\ORM\Mapping\Driver\AnnotationDriver</parameter>
<parameter key="doctrine.orm.metadata.annotation_reader.class">Symfony\Bridge\Doctrine\Annotations\IndexedReader</parameter>
<parameter key="doctrine.orm.metadata.xml.class">Symfony\Bridge\Doctrine\Mapping\Driver\XmlDriver</parameter>
<parameter key="doctrine.orm.metadata.yml.class">Symfony\Bridge\Doctrine\Mapping\Driver\YamlDriver</parameter>
<parameter key="doctrine.orm.metadata.php.class">Doctrine\ORM\Mapping\Driver\PHPDriver</parameter>
<parameter key="doctrine.orm.metadata.staticphp.class">Doctrine\ORM\Mapping\Driver\StaticPHPDriver</parameter>
<parameter key="doctrine.orm.proxy_cache_warmer.class">Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer</parameter>
<parameter key="form.type_guesser.doctrine.class">Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser</parameter>
<parameter key="doctrine.orm.validator.unique.class">Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator</parameter>
<parameter key="doctrine.orm.validator_initializer.class">Symfony\Bridge\Doctrine\Validator\EntityInitializer</parameter>
<parameter key="doctrine.orm.auto_generate_proxy_classes">true</parameter>
<parameter key="doctrine.orm.proxy_dir">C:/wamp/www/opmV1.0/app/cache/dev/doctrine/orm/Proxies</parameter>
<parameter key="doctrine.orm.proxy_namespace">Proxies</parameter>
<parameter key="assetic.asset_factory.class">Symfony\Bundle\AsseticBundle\Factory\AssetFactory</parameter>
<parameter key="assetic.asset_manager.class">Assetic\Factory\LazyAssetManager</parameter>
<parameter key="assetic.asset_manager_cache_warmer.class">Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer</parameter>
<parameter key="assetic.cached_formula_loader.class">Assetic\Factory\Loader\CachedFormulaLoader</parameter>
<parameter key="assetic.config_cache.class">Assetic\Cache\ConfigCache</parameter>
<parameter key="assetic.config_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader</parameter>
<parameter key="assetic.config_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource</parameter>
<parameter key="assetic.coalescing_directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource</parameter>
<parameter key="assetic.directory_resource.class">Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource</parameter>
<parameter key="assetic.filter_manager.class">Symfony\Bundle\AsseticBundle\FilterManager</parameter>
<parameter key="assetic.worker.ensure_filter.class">Assetic\Factory\Worker\EnsureFilterWorker</parameter>
<parameter key="assetic.node.paths" type="collection"/>
<parameter key="assetic.cache_dir">C:/wamp/www/opmV1.0/app/cache/dev/assetic</parameter>
<parameter key="assetic.bundles" type="collection">
<parameter>FrameworkBundle</parameter>
<parameter>SecurityBundle</parameter>
<parameter>TwigBundle</parameter>
<parameter>MonologBundle</parameter>
<parameter>SwiftmailerBundle</parameter>
<parameter>DoctrineBundle</parameter>
<parameter>AsseticBundle</parameter>
<parameter>SensioFrameworkExtraBundle</parameter>
<parameter>JMSSecurityExtraBundle</parameter>
<parameter>OpmTestBundle</parameter>
<parameter>WhiteOctoberPagerfantaBundle</parameter>
<parameter>FOSUserBundle</parameter>
<parameter>OpmUtilisateurBundle</parameter>
<parameter>OpmImputationBundle</parameter>
<parameter>AcmeDemoBundle</parameter>
<parameter>WebProfilerBundle</parameter>
<parameter>SensioDistributionBundle</parameter>
<parameter>SensioGeneratorBundle</parameter>
<parameter>CoreSphereConsoleBundle</parameter>
</parameter>
<parameter key="assetic.twig_extension.class">Symfony\Bundle\AsseticBundle\Twig\AsseticExtension</parameter>
<parameter key="assetic.twig_formula_loader.class">Assetic\Extension\Twig\TwigFormulaLoader</parameter>
<parameter key="assetic.helper.dynamic.class">Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper</parameter>
<parameter key="assetic.helper.static.class">Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper</parameter>
<parameter key="assetic.php_formula_loader.class">Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader</parameter>
<parameter key="assetic.debug">true</parameter>
<parameter key="assetic.use_controller">true</parameter>
<parameter key="assetic.enable_profiler">false</parameter>
<parameter key="assetic.read_from">C:/wamp/www/opmV1.0/app/../web</parameter>
<parameter key="assetic.write_to">C:/wamp/www/opmV1.0/app/../web</parameter>
<parameter key="assetic.java.bin">C:\WINDOWS\system32\java.EXE</parameter>
<parameter key="assetic.node.bin">/usr/bin/node</parameter>
<parameter key="assetic.ruby.bin">/usr/bin/ruby</parameter>
<parameter key="assetic.sass.bin">/usr/bin/sass</parameter>
<parameter key="assetic.filter.cssrewrite.class">Assetic\Filter\CssRewriteFilter</parameter>
<parameter key="assetic.twig_extension.functions" type="collection"/>
<parameter key="assetic.controller.class">Symfony\Bundle\AsseticBundle\Controller\AsseticController</parameter>
<parameter key="assetic.routing_loader.class">Symfony\Bundle\AsseticBundle\Routing\AsseticLoader</parameter>
<parameter key="assetic.cache.class">Assetic\Cache\FilesystemCache</parameter>
<parameter key="assetic.use_controller_worker.class">Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker</parameter>
<parameter key="assetic.request_listener.class">Symfony\Bundle\AsseticBundle\EventListener\RequestListener</parameter>
<parameter key="sensio_framework_extra.controller.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_dir.class">Symfony\Component\Routing\Loader\AnnotationDirectoryLoader</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_file.class">Symfony\Component\Routing\Loader\AnnotationFileLoader</parameter>
<parameter key="sensio_framework_extra.routing.loader.annot_class.class">Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader</parameter>
<parameter key="sensio_framework_extra.converter.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener</parameter>
<parameter key="sensio_framework_extra.converter.manager.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager</parameter>
<parameter key="sensio_framework_extra.converter.doctrine.class">Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter</parameter>
<parameter key="sensio_framework_extra.view.listener.class">Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener</parameter>
<parameter key="security.secured_services" type="collection"/>
<parameter key="security.access.method_interceptor.class">JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor</parameter>
<parameter key="security.access.run_as_manager.class">JMS\SecurityExtraBundle\Security\Authorization\RunAsManager</parameter>
<parameter key="security.authentication.provider.run_as.class">JMS\SecurityExtraBundle\Security\Authentication\Provider\RunAsAuthenticationProvider</parameter>
<parameter key="security.run_as.key">RunAsToken</parameter>
<parameter key="security.run_as.role_prefix">ROLE_</parameter>
<parameter key="security.access.after_invocation_manager.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager</parameter>
<parameter key="security.access.after_invocation.acl_provider.class">JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AclAfterInvocationProvider</parameter>
<parameter key="security.extra.controller_listener.class">JMS\SecurityExtraBundle\Controller\ControllerListener</parameter>
<parameter key="security.access.iddqd_voter.class">JMS\SecurityExtraBundle\Security\Authorization\Voter\IddqdVoter</parameter>
<parameter key="security.extra.secure_all_services">false</parameter>
<parameter key="white_october_pagerfanta.view_factory.class">Pagerfanta\View\ViewFactory</parameter>
<parameter key="fos_user.validator.password.class">FOS\UserBundle\Validator\PasswordValidator</parameter>
<parameter key="fos_user.validator.unique.class">FOS\UserBundle\Validator\UniqueValidator</parameter>
<parameter key="fos_user.security.interactive_login_listener.class">FOS\UserBundle\Security\InteractiveLoginListener</parameter>
<parameter key="fos_user.security.login_manager.class">FOS\UserBundle\Security\LoginManager</parameter>
<parameter key="fos_user.resetting.email.template">FOSUserBundle:Resetting:email.txt.twig</parameter>
<parameter key="fos_user.registration.confirmation.template">FOSUserBundle:Registration:email.txt.twig</parameter>
<parameter key="fos_user.firewall_name">main</parameter>
<parameter key="fos_user.model_manager_name">null</parameter>
<parameter key="fos_user.model.user.class">Opm\UtilisateurBundle\Entity\Utilisateur</parameter>
<parameter key="fos_user.template.engine">twig</parameter>
<parameter key="fos_user.template.theme">FOSUserBundle::form.html.twig</parameter>
<parameter key="fos_user.profile.form.type">fos_user_profile</parameter>
<parameter key="fos_user.profile.form.name">fos_user_profile_form</parameter>
<parameter key="fos_user.profile.form.validation_groups" type="collection">
<parameter>Profile</parameter>
<parameter>Default</parameter>
</parameter>
<parameter key="fos_user.registration.confirmation.from_email" type="collection">
<parameter key="webmaster@example.com">webmaster</parameter>
</parameter>
<parameter key="fos_user.registration.confirmation.enabled">false</parameter>
<parameter key="fos_user.registration.form.type">fos_user_registration</parameter>
<parameter key="fos_user.registration.form.name">fos_user_registration_form</parameter>
<parameter key="fos_user.registration.form.validation_groups" type="collection">
<parameter>Registration</parameter>
<parameter>Default</parameter>
</parameter>
<parameter key="fos_user.change_password.form.type">fos_user_change_password</parameter>
<parameter key="fos_user.change_password.form.name">fos_user_change_password_form</parameter>
<parameter key="fos_user.change_password.form.validation_groups" type="collection">
<parameter>ChangePassword</parameter>
<parameter>Default</parameter>
</parameter>
<parameter key="fos_user.resetting.email.from_email" type="collection">
<parameter key="webmaster@example.com">webmaster</parameter>
</parameter>
<parameter key="fos_user.resetting.token_ttl">86400</parameter>
<parameter key="fos_user.resetting.form.type">fos_user_resetting</parameter>
<parameter key="fos_user.resetting.form.name">fos_user_resetting_form</parameter>
<parameter key="fos_user.resetting.form.validation_groups" type="collection">
<parameter>ResetPassword</parameter>
<parameter>Default</parameter>
</parameter>
<parameter key="web_profiler.debug_toolbar.class">Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener</parameter>
<parameter key="web_profiler.debug_toolbar.intercept_redirects">false</parameter>
<parameter key="web_profiler.debug_toolbar.mode">2</parameter>
<parameter key="sensio.distribution.webconfigurator.class">Sensio\Bundle\DistributionBundle\Configurator\Configurator</parameter>
<parameter key="data_collector.templates" type="collection">
<parameter key="data_collector.config" type="collection">
<parameter>config</parameter>
<parameter>WebProfilerBundle:Collector:config</parameter>
</parameter>
<parameter key="data_collector.request" type="collection">
<parameter>request</parameter>
<parameter>WebProfilerBundle:Collector:request</parameter>
</parameter>
<parameter key="data_collector.exception" type="collection">
<parameter>exception</parameter>
<parameter>WebProfilerBundle:Collector:exception</parameter>
</parameter>
<parameter key="data_collector.events" type="collection">
<parameter>events</parameter>
<parameter>WebProfilerBundle:Collector:events</parameter>
</parameter>
<parameter key="data_collector.logger" type="collection">
<parameter>logger</parameter>
<parameter>WebProfilerBundle:Collector:logger</parameter>
</parameter>
<parameter key="data_collector.timer" type="collection">
<parameter>timer</parameter>
<parameter>WebProfilerBundle:Collector:timer</parameter>
</parameter>
<parameter key="data_collector.memory" type="collection">
<parameter>memory</parameter>
<parameter>WebProfilerBundle:Collector:memory</parameter>
</parameter>
<parameter key="data_collector.security" type="collection">
<parameter>security</parameter>
<parameter>SecurityBundle:Collector:security</parameter>
</parameter>
<parameter key="swiftmailer.data_collector" type="collection">
<parameter>swiftmailer</parameter>
<parameter>SwiftmailerBundle:Collector:swiftmailer</parameter>
</parameter>
<parameter key="data_collector.doctrine" type="collection">
<parameter>db</parameter>
<parameter>DoctrineBundle:Collector:db</parameter>
</parameter>
</parameter>
</parameters>
<services>
<service id="controller_name_converter" class="Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser" public="false">
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="kernel"/>
</service>
<service id="router_listener" class="Symfony\Bundle\FrameworkBundle\EventListener\RouterListener">
<tag name="kernel.event_listener" event="kernel.request" method="onEarlyKernelRequest" priority="255"/>
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest"/>
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="router"/>
<argument>80</argument>
<argument>443</argument>
<argument type="service" id="monolog.logger.request"/>
</service>
<service id="response_listener" class="Symfony\Component\HttpKernel\EventListener\ResponseListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
<argument>UTF-8</argument>
</service>
<service id="event_dispatcher" class="Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher">
<tag name="monolog.logger" channel="event"/>
<argument type="service" id="service_container"/>
<argument type="service" id="monolog.logger.event"/>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>router_listener</argument>
<argument>onEarlyKernelRequest</argument>
</argument>
<argument>255</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>router_listener</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>response_listener</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>session_listener</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>128</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>profiler_listener</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>-100</argument>
</call>
<call method="addListenerService">
<argument>kernel.exception</argument>
<argument type="collection">
<argument>profiler_listener</argument>
<argument>onKernelException</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>profiler_listener</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>1024</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>data_collector.request</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>security.firewall</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>64</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>security.rememberme.response_listener</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.exception</argument>
<argument type="collection">
<argument>twig.exception_listener</argument>
<argument>onKernelException</argument>
</argument>
<argument>-128</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>monolog.handler.firephp</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.request</argument>
<argument type="collection">
<argument>assetic.request_listener</argument>
<argument>onKernelRequest</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.controller.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.converter.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>sensio_framework_extra.view.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.view</argument>
<argument type="collection">
<argument>sensio_framework_extra.view.listener</argument>
<argument>onKernelView</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>sensio_framework_extra.cache.listener</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>security.extra.controller_listener</argument>
<argument>onCoreController</argument>
</argument>
<argument>-255</argument>
</call>
<call method="addListenerService">
<argument>security.interactive_login</argument>
<argument type="collection">
<argument>fos_user.security.interactive_login_listener</argument>
<argument>onSecurityInteractiveLogin</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.controller</argument>
<argument type="collection">
<argument>acme.demo.listener</argument>
<argument>onKernelController</argument>
</argument>
<argument>0</argument>
</call>
<call method="addListenerService">
<argument>kernel.response</argument>
<argument type="collection">
<argument>web_profiler.debug_toolbar</argument>
<argument>onKernelResponse</argument>
</argument>
<argument>-128</argument>
</call>
</service>
<service id="http_kernel" class="Symfony\Bundle\FrameworkBundle\HttpKernel">
<argument type="service" id="event_dispatcher"/>
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver" public="false">
<tag name="monolog.logger" channel="request"/>
<argument type="service" id="service_container"/>
<argument type="service" id="controller_name_converter"/>
<argument type="service" id="monolog.logger.request"/>
</service>
</argument>
</service>
<service id="cache_warmer" class="Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate">
<argument type="collection">
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplatePathsCacheWarmer" public="false">
<tag name="kernel.cache_warmer" priority="20"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="templating.name_parser"/>
<argument>C:/wamp/www/opmV1.0/app/Resources</argument>
</service>
</argument>
<argument type="service" id="templating.locator"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer" public="false">
<tag name="kernel.cache_warmer" priority="10"/>
<argument type="service" id="service_container"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\RouterCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="router"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinder" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="templating.name_parser"/>
<argument>C:/wamp/www/opmV1.0/app/Resources</argument>
</service>
</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer" public="false">
<tag name="kernel.cache_warmer"/>
<argument type="service" id="doctrine"/>
</service>
</argument>
</argument>
</service>
<service id="request" scope="request"/>
<service id="service_container"/>
<service id="kernel"/>
<service id="filesystem" class="Symfony\Component\Filesystem\Filesystem"/>
<service id="file_locator" class="Symfony\Component\HttpKernel\Config\FileLocator">
<argument type="service" id="kernel"/>
<argument>C:/wamp/www/opmV1.0/app/Resources</argument>
</service>
<service id="translator.default" class="Symfony\Bundle\FrameworkBundle\Translation\Translator">
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Component\Translation\MessageSelector" public="false"/>
</argument>
<argument type="collection">
<argument key="translation.loader.php">php</argument>
<argument key="translation.loader.yml">yml</argument>
<argument key="translation.loader.xliff">xliff</argument>
</argument>
<argument type="collection">
<argument key="cache_dir">C:/wamp/www/opmV1.0/app/cache/dev/translations</argument>
<argument key="debug">true</argument>
</argument>
<argument type="service" id="session"/>
<call method="setFallbackLocale">
<argument>fr</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.ca.xliff</argument>
<argument>ca</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.cs.xliff</argument>
<argument>cs</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.da.xliff</argument>
<argument>da</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.de.xliff</argument>
<argument>de</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.es.xliff</argument>
<argument>es</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.et.xliff</argument>
<argument>et</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.eu.xliff</argument>
<argument>eu</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.fa.xliff</argument>
<argument>fa</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.fi.xliff</argument>
<argument>fi</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.fr.xliff</argument>
<argument>fr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.he.xliff</argument>
<argument>he</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.hr.xliff</argument>
<argument>hr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.hu.xliff</argument>
<argument>hu</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.hy.xliff</argument>
<argument>hy</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.id.xliff</argument>
<argument>id</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.it.xliff</argument>
<argument>it</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.ja.xliff</argument>
<argument>ja</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.lb.xliff</argument>
<argument>lb</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.lt.xliff</argument>
<argument>lt</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.mn.xliff</argument>
<argument>mn</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.nl.xliff</argument>
<argument>nl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.pl.xliff</argument>
<argument>pl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.pt_BR.xliff</argument>
<argument>pt_BR</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.pt_PT.xliff</argument>
<argument>pt_PT</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.ro.xliff</argument>
<argument>ro</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.ru.xliff</argument>
<argument>ru</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.sk.xliff</argument>
<argument>sk</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.sl.xliff</argument>
<argument>sl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.sr.xliff</argument>
<argument>sr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.sv.xliff</argument>
<argument>sv</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.uk.xliff</argument>
<argument>uk</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/translations\validators.zh_CN.xliff</argument>
<argument>zh_CN</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.ar.xliff</argument>
<argument>ar</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.ca.xliff</argument>
<argument>ca</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.da.xliff</argument>
<argument>da</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.de.xliff</argument>
<argument>de</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.en.xliff</argument>
<argument>en</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.es.xliff</argument>
<argument>es</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.fr.xliff</argument>
<argument>fr</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.nl.xliff</argument>
<argument>nl</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.pl.xliff</argument>
<argument>pl</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.pt.xliff</argument>
<argument>pt</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.ru.xliff</argument>
<argument>ru</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.sr_Cyrl.xliff</argument>
<argument>sr_Cyrl</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/translations\pagerfanta.sr_Latn.xliff</argument>
<argument>sr_Latn</argument>
<argument>pagerfanta</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.bg.yml</argument>
<argument>bg</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.ca.yml</argument>
<argument>ca</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.cs.yml</argument>
<argument>cs</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.da.yml</argument>
<argument>da</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.de.yml</argument>
<argument>de</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.en.yml</argument>
<argument>en</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.es.yml</argument>
<argument>es</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.et.yml</argument>
<argument>et</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.fr.yml</argument>
<argument>fr</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.hr.yml</argument>
<argument>hr</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.hu.yml</argument>
<argument>hu</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.it.yml</argument>
<argument>it</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.ja.yml</argument>
<argument>ja</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.lb.yml</argument>
<argument>lb</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.nl.yml</argument>
<argument>nl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.pl.yml</argument>
<argument>pl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.pt_BR.yml</argument>
<argument>pt_BR</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.pt_PT.yml</argument>
<argument>pt_PT</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.ro.yml</argument>
<argument>ro</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.ru.yml</argument>
<argument>ru</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.sk.yml</argument>
<argument>sk</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.sl.yml</argument>
<argument>sl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\FOSUserBundle.sv.yml</argument>
<argument>sv</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.bg.yml</argument>
<argument>bg</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.de.yml</argument>
<argument>de</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.en.yml</argument>
<argument>en</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.es.yml</argument>
<argument>es</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.fr.yml</argument>
<argument>fr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.hr.yml</argument>
<argument>hr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.it.yml</argument>
<argument>it</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.ja.yml</argument>
<argument>ja</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.nl.yml</argument>
<argument>nl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.pl.yml</argument>
<argument>pl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.pt_BR.yml</argument>
<argument>pt_BR</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.ru.yml</argument>
<argument>ru</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.sk.yml</argument>
<argument>sk</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/translations\validators.sl.yml</argument>
<argument>sl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.bg.yml</argument>
<argument>bg</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.ca.yml</argument>
<argument>ca</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.cs.yml</argument>
<argument>cs</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.da.yml</argument>
<argument>da</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.de.yml</argument>
<argument>de</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.en.yml</argument>
<argument>en</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.es.yml</argument>
<argument>es</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.et.yml</argument>
<argument>et</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.fr.yml</argument>
<argument>fr</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.hr.yml</argument>
<argument>hr</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.hu.yml</argument>
<argument>hu</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.it.yml</argument>
<argument>it</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.ja.yml</argument>
<argument>ja</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.lb.yml</argument>
<argument>lb</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.nl.yml</argument>
<argument>nl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.pl.yml</argument>
<argument>pl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.pt_BR.yml</argument>
<argument>pt_BR</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.pt_PT.yml</argument>
<argument>pt_PT</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.ro.yml</argument>
<argument>ro</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.ru.yml</argument>
<argument>ru</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.sk.yml</argument>
<argument>sk</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.sl.yml</argument>
<argument>sl</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\FOSUserBundle.sv.yml</argument>
<argument>sv</argument>
<argument>FOSUserBundle</argument>
</call>
<call method="addResource">
<argument>xliff</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\messages.fr.xliff</argument>
<argument>fr</argument>
<argument>messages</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.bg.yml</argument>
<argument>bg</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.de.yml</argument>
<argument>de</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.en.yml</argument>
<argument>en</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.es.yml</argument>
<argument>es</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.fr.yml</argument>
<argument>fr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.hr.yml</argument>
<argument>hr</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.it.yml</argument>
<argument>it</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.ja.yml</argument>
<argument>ja</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.nl.yml</argument>
<argument>nl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.pl.yml</argument>
<argument>pl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.pt_BR.yml</argument>
<argument>pt_BR</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.ru.yml</argument>
<argument>ru</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.sk.yml</argument>
<argument>sk</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/translations\validators.sl.yml</argument>
<argument>sl</argument>
<argument>validators</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\CoreSphere\ConsoleBundle/Resources/translations\messages.de.yml</argument>
<argument>de</argument>
<argument>messages</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\CoreSphere\ConsoleBundle/Resources/translations\messages.en.yml</argument>
<argument>en</argument>
<argument>messages</argument>
</call>
<call method="addResource">
<argument>yml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\CoreSphere\ConsoleBundle/Resources/translations\messages.fr.yml</argument>
<argument>fr</argument>
<argument>messages</argument>
</call>
</service>
<service id="translation.loader.php" class="Symfony\Component\Translation\Loader\PhpFileLoader">
<tag name="translation.loader" alias="php"/>
</service>
<service id="translation.loader.yml" class="Symfony\Component\Translation\Loader\YamlFileLoader">
<tag name="translation.loader" alias="yml"/>
</service>
<service id="translation.loader.xliff" class="Symfony\Component\Translation\Loader\XliffFileLoader">
<tag name="translation.loader" alias="xliff"/>
</service>
<service id="session" class="Symfony\Component\HttpFoundation\Session">
<argument type="service" id="session.storage"/>
<argument>fr</argument>
</service>
<service id="session_listener" class="Symfony\Bundle\FrameworkBundle\EventListener\SessionListener">
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="128"/>
<argument type="service" id="service_container"/>
<argument>true</argument>
</service>
<service id="form.factory" class="Symfony\Component\Form\FormFactory">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="field">form.type.field</argument>
<argument key="form">form.type.form</argument>
<argument key="birthday">form.type.birthday</argument>
<argument key="checkbox">form.type.checkbox</argument>
<argument key="choice">form.type.choice</argument>
<argument key="collection">form.type.collection</argument>
<argument key="country">form.type.country</argument>
<argument key="date">form.type.date</argument>
<argument key="datetime">form.type.datetime</argument>
<argument key="email">form.type.email</argument>
<argument key="file">form.type.file</argument>
<argument key="hidden">form.type.hidden</argument>
<argument key="integer">form.type.integer</argument>
<argument key="language">form.type.language</argument>
<argument key="locale">form.type.locale</argument>
<argument key="money">form.type.money</argument>
<argument key="number">form.type.number</argument>
<argument key="password">form.type.password</argument>
<argument key="percent">form.type.percent</argument>
<argument key="radio">form.type.radio</argument>
<argument key="repeated">form.type.repeated</argument>
<argument key="search">form.type.search</argument>
<argument key="textarea">form.type.textarea</argument>
<argument key="text">form.type.text</argument>
<argument key="time">form.type.time</argument>
<argument key="timezone">form.type.timezone</argument>
<argument key="url">form.type.url</argument>
<argument key="csrf">form.type.csrf</argument>
<argument key="entity">form.type.entity</argument>
<argument key="fos_user_username">fos_user.username_form_type</argument>
<argument key="fos_user_profile">fos_user.profile.form.type</argument>
<argument key="fos_user_registration">fos_user.registration.form.type</argument>
<argument key="fos_user_change_password">fos_user.change_password.form.type</argument>
<argument key="fos_user_resetting">fos_user.resetting.form.type</argument>
</argument>
<argument type="collection">
<argument key="field" type="collection">
<argument>form.type_extension.field</argument>
</argument>
<argument key="form" type="collection">
<argument>form.type_extension.csrf</argument>
</argument>
</argument>
<argument type="collection">
<argument>form.type_guesser.validator</argument>
<argument>form.type_guesser.doctrine</argument>
</argument>
</service>
</argument>
</argument>
</service>
<service id="form.type_guesser.validator" class="Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser">
<tag name="form.type_guesser"/>
<argument type="service" id="validator.mapping.class_metadata_factory"/>
</service>
<service id="form.type.field" class="Symfony\Component\Form\Extension\Core\Type\FieldType">
<tag name="form.type" alias="field"/>
<argument type="service" id="validator"/>
</service>
<service id="form.type.form" class="Symfony\Component\Form\Extension\Core\Type\FormType">
<tag name="form.type" alias="form"/>
</service>
<service id="form.type.birthday" class="Symfony\Component\Form\Extension\Core\Type\BirthdayType">
<tag name="form.type" alias="birthday"/>
</service>
<service id="form.type.checkbox" class="Symfony\Component\Form\Extension\Core\Type\CheckboxType">
<tag name="form.type" alias="checkbox"/>
</service>
<service id="form.type.choice" class="Symfony\Component\Form\Extension\Core\Type\ChoiceType">
<tag name="form.type" alias="choice"/>
</service>
<service id="form.type.collection" class="Symfony\Component\Form\Extension\Core\Type\CollectionType">
<tag name="form.type" alias="collection"/>
</service>
<service id="form.type.country" class="Symfony\Component\Form\Extension\Core\Type\CountryType">
<tag name="form.type" alias="country"/>
</service>
<service id="form.type.date" class="Symfony\Component\Form\Extension\Core\Type\DateType">
<tag name="form.type" alias="date"/>
</service>
<service id="form.type.datetime" class="Symfony\Component\Form\Extension\Core\Type\DateTimeType">
<tag name="form.type" alias="datetime"/>
</service>
<service id="form.type.email" class="Symfony\Component\Form\Extension\Core\Type\EmailType">
<tag name="form.type" alias="email"/>
</service>
<service id="form.type.file" class="Symfony\Component\Form\Extension\Core\Type\FileType">
<tag name="form.type" alias="file"/>
</service>
<service id="form.type.hidden" class="Symfony\Component\Form\Extension\Core\Type\HiddenType">
<tag name="form.type" alias="hidden"/>
</service>
<service id="form.type.integer" class="Symfony\Component\Form\Extension\Core\Type\IntegerType">
<tag name="form.type" alias="integer"/>
</service>
<service id="form.type.language" class="Symfony\Component\Form\Extension\Core\Type\LanguageType">
<tag name="form.type" alias="language"/>
</service>
<service id="form.type.locale" class="Symfony\Component\Form\Extension\Core\Type\LocaleType">
<tag name="form.type" alias="locale"/>
</service>
<service id="form.type.money" class="Symfony\Component\Form\Extension\Core\Type\MoneyType">
<tag name="form.type" alias="money"/>
</service>
<service id="form.type.number" class="Symfony\Component\Form\Extension\Core\Type\NumberType">
<tag name="form.type" alias="number"/>
</service>
<service id="form.type.password" class="Symfony\Component\Form\Extension\Core\Type\PasswordType">
<tag name="form.type" alias="password"/>
</service>
<service id="form.type.percent" class="Symfony\Component\Form\Extension\Core\Type\PercentType">
<tag name="form.type" alias="percent"/>
</service>
<service id="form.type.radio" class="Symfony\Component\Form\Extension\Core\Type\RadioType">
<tag name="form.type" alias="radio"/>
</service>
<service id="form.type.repeated" class="Symfony\Component\Form\Extension\Core\Type\RepeatedType">
<tag name="form.type" alias="repeated"/>
</service>
<service id="form.type.search" class="Symfony\Component\Form\Extension\Core\Type\SearchType">
<tag name="form.type" alias="search"/>
</service>
<service id="form.type.textarea" class="Symfony\Component\Form\Extension\Core\Type\TextareaType">
<tag name="form.type" alias="textarea"/>
</service>
<service id="form.type.text" class="Symfony\Component\Form\Extension\Core\Type\TextType">
<tag name="form.type" alias="text"/>
</service>
<service id="form.type.time" class="Symfony\Component\Form\Extension\Core\Type\TimeType">
<tag name="form.type" alias="time"/>
</service>
<service id="form.type.timezone" class="Symfony\Component\Form\Extension\Core\Type\TimezoneType">
<tag name="form.type" alias="timezone"/>
</service>
<service id="form.type.url" class="Symfony\Component\Form\Extension\Core\Type\UrlType">
<tag name="form.type" alias="url"/>
</service>
<service id="form.type_extension.field" class="Symfony\Component\Form\Extension\Validator\Type\FieldTypeValidatorExtension">
<tag name="form.type_extension" alias="field"/>
<argument type="service" id="validator"/>
</service>
<service id="form.csrf_provider" class="Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider">
<argument type="service" id="session"/>
<argument>39e9e2c38638da6ad0bed341eed2d896</argument>
</service>
<service id="form.type.csrf" class="Symfony\Component\Form\Extension\Csrf\Type\CsrfType">
<tag name="form.type" alias="csrf"/>
<argument type="service" id="form.csrf_provider"/>
</service>
<service id="form.type_extension.csrf" class="Symfony\Component\Form\Extension\Csrf\Type\FormTypeCsrfExtension">
<tag name="form.type_extension" alias="form"/>
<argument>true</argument>
<argument>_token</argument>
</service>
<service id="validator" class="Symfony\Component\Validator\Validator">
<argument type="service" id="validator.mapping.class_metadata_factory"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="doctrine.orm.validator.unique">doctrine.orm.validator.unique</argument>
<argument key="fos_user.validator.unique">fos_user.validator.unique</argument>
<argument key="fos_user.validator.password">fos_user.validator.password</argument>
</argument>
</service>
</argument>
<argument type="collection">
<argument type="service" id="doctrine.orm.validator_initializer"/>
</argument>
</service>
<service id="validator.mapping.class_metadata_factory" class="Symfony\Component\Validator\Mapping\ClassMetadataFactory" public="false">
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\LoaderChain" public="false">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\AnnotationLoader" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader" public="false"/>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader" public="false">
<argument type="collection">
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Component\Form/Resources/config/validation.xml</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle\Resources\config\validation.xml</argument>
</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader" public="false">
<argument type="collection"/>
</service>
</argument>
</argument>
</service>
</argument>
<argument>null</argument>
</service>
<service id="profiler" class="Symfony\Component\HttpKernel\Profiler\Profiler">
<tag name="monolog.logger" channel="profiler"/>
<argument type="service">
<service class="Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage" public="false">
<argument>sqlite:C:/wamp/www/opmV1.0/app/cache/dev/profiler.db</argument>
<argument></argument>
<argument></argument>
<argument>86400</argument>
</service>
</argument>
<argument type="service" id="monolog.logger.profiler"/>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:config" id="config" priority="255"/>
<argument type="service" id="kernel"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service" id="data_collector.request"/>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:exception" id="exception" priority="255"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\EventDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:events" id="events" priority="255"/>
<call method="setEventDispatcher">
<argument type="service" id="event_dispatcher"/>
</call>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:logger" id="logger" priority="255"/>
<tag name="monolog.logger" channel="profiler"/>
<argument type="service" id="monolog.logger.profiler"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\DataCollector\TimerDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:timer" id="timer" priority="255"/>
<argument type="service" id="kernel"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpKernel\DataCollector\MemoryDataCollector" public="false">
<tag name="data_collector" template="WebProfilerBundle:Collector:memory" id="memory" priority="255"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector" public="false">
<tag name="data_collector" template="SecurityBundle:Collector:security" id="security"/>
<argument type="service" id="security.context"/>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector" public="false">
<tag name="data_collector" template="SwiftmailerBundle:Collector:swiftmailer" id="swiftmailer"/>
<argument type="service" id="service_container"/>
<argument>false</argument>
</service>
</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector" public="false">
<tag name="data_collector" template="DoctrineBundle:Collector:db" id="db"/>
<argument type="service" id="doctrine"/>
<argument type="service" id="doctrine.dbal.logger"/>
</service>
</argument>
</call>
</service>
<service id="profiler_listener" class="Symfony\Component\HttpKernel\EventListener\ProfilerListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-100"/>
<tag name="kernel.event_listener" event="kernel.exception" method="onKernelException"/>
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="1024"/>
<argument type="service" id="profiler"/>
<argument>null</argument>
<argument>false</argument>
<argument>false</argument>
</service>
<service id="data_collector.request" class="Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<tag name="data_collector" template="WebProfilerBundle:Collector:request" id="request" priority="255"/>
</service>
<service id="routing.loader" class="Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader">
<tag name="monolog.logger" channel="router"/>
<argument type="service" id="controller_name_converter"/>
<argument type="service" id="monolog.logger.router"/>
<argument type="service">
<service class="Symfony\Component\Config\Loader\LoaderResolver" public="false">
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\XmlFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\YamlFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\PhpFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Routing\AsseticLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="assetic.asset_manager"/>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\AnnotationDirectoryLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Symfony\Component\Routing\Loader\AnnotationFileLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="file_locator"/>
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</service>
</argument>
</call>
<call method="addLoader">
<argument type="service">
<service class="Sensio\Bundle\FrameworkExtraBundle\Routing\AnnotatedRouteControllerLoader" public="false">
<tag name="routing.loader"/>
<argument type="service" id="annotation_reader"/>
</service>
</argument>
</call>
</service>
</argument>
</service>
<service id="templating.name_parser" class="Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser">
<argument type="service" id="kernel"/>
</service>
<service id="templating.locator" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator" public="false">
<argument type="service" id="file_locator"/>
<argument>C:/wamp/www/opmV1.0/app/cache/dev</argument>
</service>
<service id="templating.helper.slots" class="Symfony\Component\Templating\Helper\SlotsHelper">
<tag name="templating.helper" alias="slots"/>
</service>
<service id="templating.helper.assets" class="Symfony\Component\Templating\Helper\CoreAssetsHelper" scope="request">
<tag name="templating.helper" alias="assets"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PathPackage" scope="request" public="false">
<argument type="service" id="request"/>
<argument>null</argument>
<argument>null</argument>
</service>
</argument>
<argument type="collection"/>
</service>
<service id="templating.asset.package_factory" class="Symfony\Bundle\FrameworkBundle\Templating\Asset\PackageFactory">
<argument type="service" id="service_container"/>
</service>
<service id="templating.helper.request" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RequestHelper">
<tag name="templating.helper" alias="request"/>
<argument type="service" id="request"/>
</service>
<service id="templating.helper.session" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper">
<tag name="templating.helper" alias="session"/>
<argument type="service" id="request"/>
</service>
<service id="templating.helper.router" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\RouterHelper">
<tag name="templating.helper" alias="router"/>
<argument type="service" id="router"/>
</service>
<service id="templating.helper.actions" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper">
<tag name="templating.helper" alias="actions"/>
<argument type="service" id="http_kernel"/>
</service>
<service id="templating.helper.code" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\CodeHelper">
<tag name="templating.helper" alias="code"/>
<argument>null</argument>
<argument>C:/wamp/www/opmV1.0/app</argument>
<argument>UTF-8</argument>
</service>
<service id="templating.helper.translator" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper">
<tag name="templating.helper" alias="translator"/>
<argument type="service" id="translator.default"/>
</service>
<service id="templating.helper.form" class="Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper">
<tag name="templating.helper" alias="form"/>
<argument type="service">
<service class="Symfony\Bundle\FrameworkBundle\Templating\PhpEngine" public="false">
<argument type="service" id="templating.name_parser"/>
<argument type="service" id="service_container"/>
<argument type="service" id="templating.loader"/>
<argument type="service" id="templating.globals"/>
<call method="setCharset">
<argument>UTF-8</argument>
</call>
<call method="setHelpers">
<argument type="collection">
<argument key="slots">templating.helper.slots</argument>
<argument key="assets">templating.helper.assets</argument>
<argument key="request">templating.helper.request</argument>
<argument key="session">templating.helper.session</argument>
<argument key="router">templating.helper.router</argument>
<argument key="actions">templating.helper.actions</argument>
<argument key="code">templating.helper.code</argument>
<argument key="translator">templating.helper.translator</argument>
<argument key="form">templating.helper.form</argument>
<argument key="security">templating.helper.security</argument>
<argument key="assetic">assetic.helper.dynamic</argument>
</argument>
</call>
</service>
</argument>
<argument type="collection">
<argument>FrameworkBundle:Form</argument>
</argument>
</service>
<service id="templating.globals" class="Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables">
<argument type="service" id="service_container"/>
</service>
<service id="security.context" class="Symfony\Component\Security\Core\SecurityContext">
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="security.access.decision_manager"/>
<argument>false</argument>
</service>
<service id="security.authentication.manager" class="Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager" public="false">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider" public="false">
<argument type="service" id="fos_user.user_manager"/>
<argument type="service" id="security.user_checker"/>
<argument>main</argument>
<argument type="service" id="security.encoder_factory"/>
<argument>true</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider" public="false">
<argument>5124a5fe30e61</argument>
</service>
</argument>
</argument>
</service>
<service id="security.authentication.trust_resolver" class="Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver" public="false">
<argument>Symfony\Component\Security\Core\Authentication\Token\AnonymousToken</argument>
<argument>Symfony\Component\Security\Core\Authentication\Token\RememberMeToken</argument>
</service>
<service id="security.authentication.session_strategy" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy" public="false">
<argument>migrate</argument>
</service>
<service id="security.user_checker" class="Symfony\Component\Security\Core\User\UserChecker" public="false"/>
<service id="security.access.decision_manager" class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager" public="false">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter" public="false">
<tag name="security.voter" priority="245"/>
<argument type="service">
<service class="Symfony\Component\Security\Core\Role\RoleHierarchy" public="false">
<argument type="collection">
<argument key="ROLE_ADMIN" type="collection">
<argument>ROLE_USER</argument>
</argument>
<argument key="ROLE_SUPERADMIN" type="collection">
<argument>ROLE_ADMIN</argument>
</argument>
<argument key="ROLE_DEV" type="collection">
<argument>ROLE_DEV</argument>
</argument>
</argument>
</service>
</argument>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter" public="false">
<tag name="security.voter" priority="250"/>
<argument type="service" id="security.authentication.trust_resolver"/>
</service>
</argument>
</argument>
<argument>affirmative</argument>
<argument>false</argument>
<argument>true</argument>
</service>
<service id="security.firewall" class="Symfony\Component\Security\Http\Firewall">
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="64"/>
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\Security\FirewallMap" public="false">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="security.firewall.map.context.main" type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>.*</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument type="service" id="event_dispatcher"/>
</service>
<service id="security.rememberme.response_listener" class="Symfony\Bundle\SecurityBundle\EventListener\ResponseListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
</service>
<service id="templating.helper.security" class="Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper">
<tag name="templating.helper" alias="security"/>
<argument type="service" id="security.context"/>
</service>
<service id="security.firewall.map.context.main" class="Symfony\Bundle\SecurityBundle\Security\FirewallContext">
<argument type="collection">
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ChannelListener" public="false">
<tag name="monolog.logger" channel="security"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\AccessMap" public="false">
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/js/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/images/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/css/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/login</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/register</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/resetting</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/logout</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/user/ajax.*</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/admin/</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_ADMIN</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/user.*</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_USER</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/console/</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_DEV</argument>
</argument>
<argument>null</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint" public="false">
<argument>80</argument>
<argument>443</argument>
</service>
</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ContextListener" public="false">
<argument type="service" id="security.context"/>
<argument type="collection">
<argument type="service" id="fos_user.user_manager"/>
</argument>
<argument>main</argument>
<argument type="service" id="monolog.logger.security"/>
<argument type="service" id="event_dispatcher"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\LogoutListener" public="false">
<argument type="service" id="security.context"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
</service>
</argument>
<argument>/logout</argument>
<argument>/login</argument>
<argument>null</argument>
<call method="addHandler">
<argument type="service">
<service class="Symfony\Component\Security\Http\Logout\SessionLogoutHandler" public="false"/>
</argument>
</call>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\UsernamePasswordFormAuthenticationListener" public="false">
<tag name="security.remember_me_aware" id="main" provider="security.user.provider.concrete.fos_userbundle"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="security.authentication.session_strategy"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
</service>
</argument>
<argument>main</argument>
<argument type="collection">
<argument key="check_path">/user</argument>
<argument key="login_path">/login</argument>
<argument key="use_forward">false</argument>
<argument key="default_target_path">/user</argument>
<argument key="failure_path">/login</argument>
<argument key="always_use_default_target_path">false</argument>
<argument key="target_path_parameter">_target_path</argument>
<argument key="use_referer">false</argument>
<argument key="failure_forward">false</argument>
<argument key="username_parameter">_username</argument>
<argument key="password_parameter">_password</argument>
<argument key="csrf_parameter">_csrf_token</argument>
<argument key="intention">authenticate</argument>
<argument key="post_only">true</argument>
</argument>
<argument>null</argument>
<argument>null</argument>
<argument type="service" id="monolog.logger.security"/>
<argument type="service" id="event_dispatcher"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener" public="false">
<argument type="service" id="security.context"/>
<argument>5124a5fe30e61</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\AccessListener" public="false">
<tag name="monolog.logger" channel="security"/>
<argument type="service" id="security.context"/>
<argument type="service" id="security.access.decision_manager"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\AccessMap" public="false">
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/js/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/images/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/css/</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/login</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/register</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/resetting</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/logout</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/user/ajax.*</argument>
</service>
</argument>
<argument type="collection">
<argument>IS_AUTHENTICATED_ANONYMOUSLY</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/admin/</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_ADMIN</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/user.*</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_USER</argument>
</argument>
<argument>null</argument>
</call>
<call method="add">
<argument type="service">
<service class="Symfony\Component\HttpFoundation\RequestMatcher" public="false">
<argument>^/console/</argument>
</service>
</argument>
<argument type="collection">
<argument>ROLE_DEV</argument>
</argument>
<argument>null</argument>
</call>
</service>
</argument>
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\Firewall\ExceptionListener" public="false">
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.trust_resolver"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
</service>
</argument>
<argument type="service">
<service class="Symfony\Component\Security\Http\EntryPoint\FormAuthenticationEntryPoint" public="false">
<argument type="service" id="http_kernel"/>
<argument type="service">
<service class="Symfony\Component\Security\Http\HttpUtils" public="false">
<argument type="service" id="router"/>
</service>
</argument>
<argument>/login</argument>
<argument>false</argument>
</service>
</argument>
<argument>null</argument>
<argument>null</argument>
<argument type="service" id="monolog.logger.security"/>
</service>
</argument>
</service>
<service id="twig" class="Twig_Environment">
<argument type="service" id="twig.loader"/>
<argument type="collection">
<argument key="debug">true</argument>
<argument key="strict_variables">true</argument>
<argument key="exception_controller">Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</argument>
<argument key="cache">C:/wamp/www/opmV1.0/app/cache/dev/twig</argument>
<argument key="charset">UTF-8</argument>
</argument>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\SecurityBundle\Twig\Extension\SecurityExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="security.context"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\TranslationExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="translator.default"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\Extension\AssetsExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\Extension\ActionsExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\TwigBundle\Extension\CodeExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\RoutingExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="router"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false">
<tag name="twig.extension"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bridge\Twig\Extension\FormExtension" public="false">
<tag name="twig.extension"/>
<argument type="collection">
<argument>form_div_layout.html.twig</argument>
</argument>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Twig\AsseticExtension" public="false">
<tag name="twig.extension"/>
<tag name="assetic.templating.twig"/>
<argument type="service" id="assetic.asset_factory"/>
<argument>true</argument>
<argument type="collection"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service">
<service class="WhiteOctober\PagerfantaBundle\Twig\PagerfantaExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="service_container"/>
</service>
</argument>
</call>
<call method="addExtension">
<argument type="service" id="twig.extension.acme.demo"/>
</call>
</service>
<service id="twig.loader" class="Symfony\Bundle\TwigBundle\Loader\FilesystemLoader">
<argument type="service" id="templating.locator"/>
<argument type="service" id="templating.name_parser"/>
<call method="addPath">
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bridge\Twig/Resources/views/Form</argument>
</call>
</service>
<service id="twig.exception_listener" class="Symfony\Component\HttpKernel\EventListener\ExceptionListener">
<tag name="kernel.event_listener" event="kernel.exception" method="onKernelException" priority="-128"/>
<tag name="monolog.logger" channel="request"/>
<argument>Symfony\Bundle\TwigBundle\Controller\ExceptionController::showAction</argument>
<argument type="service" id="monolog.logger.request"/>
</service>
<service id="monolog.handler.main" class="Monolog\Handler\StreamHandler">
<argument>C:/wamp/www/opmV1.0/app/logs/dev.log</argument>
<argument>100</argument>
<argument>true</argument>
</service>
<service id="monolog.handler.firephp" class="Symfony\Bridge\Monolog\Handler\FirePHPHandler">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
<argument>200</argument>
<argument>true</argument>
</service>
<service id="swiftmailer.plugin.messagelogger" class="Symfony\Bundle\SwiftmailerBundle\Logger\MessageLogger">
<tag name="swiftmailer.plugin"/>
</service>
<service id="doctrine.dbal.logger" class="Symfony\Bridge\Doctrine\Logger\DbalLogger" public="false">
<tag name="monolog.logger" channel="doctrine"/>
<argument type="service" id="monolog.logger.doctrine"/>
</service>
<service id="doctrine.dbal.connection_factory" class="Symfony\Bundle\DoctrineBundle\ConnectionFactory">
<argument type="collection"/>
</service>
<service id="doctrine" class="Symfony\Bundle\DoctrineBundle\Registry">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="default">doctrine.dbal.default_connection</argument>
</argument>
<argument type="collection">
<argument key="default">doctrine.orm.default_entity_manager</argument>
</argument>
<argument>default</argument>
<argument>default</argument>
</service>
<service id="doctrine.dbal.default_connection" class="stdClass" factory-method="createConnection" factory-service="doctrine.dbal.connection_factory">
<argument type="collection">
<argument key="dbname">devdb</argument>
<argument key="host">192.168.26.41</argument>
<argument key="port">1521</argument>
<argument key="user">opm_dev</argument>
<argument key="password">opm</argument>
<argument key="driver">oci8</argument>
<argument key="charset">UTF8</argument>
<argument key="driverOptions" type="collection"/>
</argument>
<argument type="service">
<service class="Doctrine\DBAL\Configuration" public="false">
<call method="setSQLLogger">
<argument type="service" id="doctrine.dbal.logger"/>
</call>
</service>
</argument>
<argument type="service">
<service class="Doctrine\Common\EventManager" public="false"/>
</argument>
<argument type="collection"/>
</service>
<service id="form.type_guesser.doctrine" class="Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser">
<tag name="form.type_guesser"/>
<argument type="service" id="doctrine"/>
</service>
<service id="form.type.entity" class="Symfony\Bridge\Doctrine\Form\Type\EntityType">
<tag name="form.type" alias="entity"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.validator.unique" class="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator">
<tag name="validator.constraint_validator" alias="doctrine.orm.validator.unique"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.validator_initializer" class="Symfony\Bridge\Doctrine\Validator\EntityInitializer">
<tag name="validator.initializer"/>
<argument type="service" id="doctrine"/>
</service>
<service id="doctrine.orm.default_entity_manager" class="Doctrine\ORM\EntityManager" factory-method="create">
<argument type="service" id="doctrine.dbal.default_connection"/>
<argument type="service">
<service class="Doctrine\ORM\Configuration" public="false">
<call method="setEntityNamespaces">
<argument type="collection">
<argument key="OpmTestBundle">Opm\TestBundle\Entity</argument>
<argument key="FOSUserBundle">FOS\UserBundle\Entity</argument>
<argument key="OpmUtilisateurBundle">Opm\UtilisateurBundle\Entity</argument>
<argument key="OpmImputationBundle">Opm\ImputationBundle\Entity</argument>
</argument>
</call>
<call method="setMetadataCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_2ebe95884e051561a73c62a70ee61d9c</argument>
</call>
</service>
</argument>
</call>
<call method="setQueryCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_2ebe95884e051561a73c62a70ee61d9c</argument>
</call>
</service>
</argument>
</call>
<call method="setResultCacheImpl">
<argument type="service">
<service class="Doctrine\Common\Cache\ArrayCache" public="false">
<call method="setNamespace">
<argument>sf2orm_default_2ebe95884e051561a73c62a70ee61d9c</argument>
</call>
</service>
</argument>
</call>
<call method="setMetadataDriverImpl">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\DriverChain" public="false">
<call method="addDriver">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\AnnotationDriver" public="false">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\Annotations\IndexedReader" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
<argument type="collection">
<argument>C:\wamp\www\opmV1.0\src\Opm\TestBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\ImputationBundle\Entity</argument>
</argument>
</service>
</argument>
<argument>Opm\TestBundle\Entity</argument>
</call>
<call method="addDriver">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\AnnotationDriver" public="false">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\Annotations\IndexedReader" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
<argument type="collection">
<argument>C:\wamp\www\opmV1.0\src\Opm\TestBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\ImputationBundle\Entity</argument>
</argument>
</service>
</argument>
<argument>Opm\UtilisateurBundle\Entity</argument>
</call>
<call method="addDriver">
<argument type="service">
<service class="Doctrine\ORM\Mapping\Driver\AnnotationDriver" public="false">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\Annotations\IndexedReader" public="false">
<argument type="service" id="annotation_reader"/>
</service>
</argument>
<argument type="collection">
<argument>C:\wamp\www\opmV1.0\src\Opm\TestBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle\Entity</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\ImputationBundle\Entity</argument>
</argument>
</service>
</argument>
<argument>Opm\ImputationBundle\Entity</argument>
</call>
<call method="addDriver">
<argument type="service">
<service class="Symfony\Bridge\Doctrine\Mapping\Driver\XmlDriver" public="false">
<argument type="collection">
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle\Resources\config\doctrine</argument>
</argument>
<call method="setNamespacePrefixes">
<argument type="collection">
<argument key="C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle\Resources\config\doctrine">FOS\UserBundle\Entity</argument>
</argument>
</call>
<call method="setGlobalBasename">
<argument>mapping</argument>
</call>
</service>
</argument>
<argument>FOS\UserBundle\Entity</argument>
</call>
</service>
</argument>
</call>
<call method="setProxyDir">
<argument>C:/wamp/www/opmV1.0/app/cache/dev/doctrine/orm/Proxies</argument>
</call>
<call method="setProxyNamespace">
<argument>Proxies</argument>
</call>
<call method="setAutoGenerateProxyClasses">
<argument>true</argument>
</call>
<call method="setClassMetadataFactoryName">
<argument>Doctrine\ORM\Mapping\ClassMetadataFactory</argument>
</call>
</service>
</argument>
</service>
<service id="assetic.filter_manager" class="Symfony\Bundle\AsseticBundle\FilterManager">
<argument type="service" id="service_container"/>
<argument type="collection">
<argument key="cssrewrite">assetic.filter.cssrewrite</argument>
</argument>
</service>
<service id="assetic.asset_manager" class="Assetic\Factory\LazyAssetManager">
<argument type="service" id="assetic.asset_factory"/>
<argument type="collection">
<argument key="twig" type="service">
<service class="Assetic\Factory\Loader\CachedFormulaLoader" public="false">
<tag name="assetic.formula_loader" alias="twig"/>
<tag name="assetic.templating.twig"/>
<argument type="service">
<service class="Assetic\Extension\Twig\TwigFormulaLoader" public="false">
<tag name="assetic.templating.twig"/>
<argument type="service" id="twig"/>
</service>
</argument>
<argument type="service">
<service class="Assetic\Cache\ConfigCache" public="false">
<argument>C:/wamp/www/opmV1.0/app/cache/dev/assetic/config</argument>
</service>
</argument>
<argument>true</argument>
</service>
</argument>
</argument>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>FrameworkBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/FrameworkBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>FrameworkBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SecurityBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/SecurityBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SecurityBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\SecurityBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>TwigBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/TwigBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>TwigBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\TwigBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>MonologBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/MonologBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>MonologBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\MonologBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SwiftmailerBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/SwiftmailerBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SwiftmailerBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\SwiftmailerBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>DoctrineBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/DoctrineBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>DoctrineBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\DoctrineBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>AsseticBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/AsseticBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>AsseticBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\Symfony\Bundle\AsseticBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioFrameworkExtraBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/SensioFrameworkExtraBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioFrameworkExtraBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\Sensio\Bundle\FrameworkExtraBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>JMSSecurityExtraBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/JMSSecurityExtraBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>JMSSecurityExtraBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\JMS\SecurityExtraBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmTestBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/OpmTestBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmTestBundle</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\TestBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>WhiteOctoberPagerfantaBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/WhiteOctoberPagerfantaBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>WhiteOctoberPagerfantaBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\WhiteOctober\PagerfantaBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>FOSUserBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/FOSUserBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>FOSUserBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\FOS\UserBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmUtilisateurBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/OpmUtilisateurBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmUtilisateurBundle</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\UtilisateurBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmImputationBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/OpmImputationBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>OpmImputationBundle</argument>
<argument>C:\wamp\www\opmV1.0\src\Opm\ImputationBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>AcmeDemoBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/AcmeDemoBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>AcmeDemoBundle</argument>
<argument>C:\wamp\www\opmV1.0\src\Acme\DemoBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>WebProfilerBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/WebProfilerBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>WebProfilerBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\symfony\src\Symfony\Bundle\WebProfilerBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioDistributionBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/SensioDistributionBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioDistributionBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\Sensio\Bundle\DistributionBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioGeneratorBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/SensioGeneratorBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>SensioGeneratorBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\Sensio\Bundle\GeneratorBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\CoalescingDirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="collection">
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>CoreSphereConsoleBundle</argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/CoreSphereConsoleBundle/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument type="service">
<service class="%assetic.directory_resource.class%" public="false">
<argument type="service" id="templating.loader"/>
<argument>CoreSphereConsoleBundle</argument>
<argument>C:\wamp\www\opmV1.0\vendor\bundles\CoreSphere\ConsoleBundle/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
</argument>
</service>
</argument>
<argument>twig</argument>
</call>
<call method="addResource">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Resource\DirectoryResource" public="false">
<tag name="assetic.templating.twig"/>
<tag name="assetic.formula_resource" loader="twig"/>
<argument type="service" id="templating.loader"/>
<argument></argument>
<argument>C:/wamp/www/opmV1.0/app/Resources/views</argument>
<argument>/\.[^.]+\.twig$/</argument>
</service>
</argument>
<argument>twig</argument>
</call>
</service>
<service id="assetic.asset_factory" class="Symfony\Bundle\AsseticBundle\Factory\AssetFactory" public="false">
<argument type="service" id="kernel"/>
<argument type="service" id="service_container"/>
<argument type="service">
<service class="Symfony\Component\DependencyInjection\ParameterBag\ParameterBag" public="false">
<argument type="service">
<service class="stdClass" factory-method="getDefaultParameters" factory-service="service_container" public="false"/>
</argument>
</service>
</argument>
<argument>C:/wamp/www/opmV1.0/app/../web</argument>
<argument>true</argument>
<call method="addWorker">
<argument type="service">
<service class="Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker" public="false">
<tag name="assetic.factory_worker"/>
</service>
</argument>
</call>
</service>
<service id="assetic.filter.cssrewrite" class="Assetic\Filter\CssRewriteFilter">
<tag name="assetic.filter" alias="cssrewrite"/>
</service>
<service id="assetic.controller" class="Symfony\Bundle\AsseticBundle\Controller\AsseticController" scope="prototype">
<argument type="service" id="request"/>
<argument type="service" id="assetic.asset_manager"/>
<argument type="service" id="assetic.cache"/>
<argument>false</argument>
<argument type="service" id="profiler"/>
</service>
<service id="assetic.cache" class="Assetic\Cache\FilesystemCache" public="false">
<argument>C:/wamp/www/opmV1.0/app/cache/dev/assetic/assets</argument>
</service>
<service id="assetic.request_listener" class="Symfony\Bundle\AsseticBundle\EventListener\RequestListener">
<tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest"/>
</service>
<service id="sensio_framework_extra.controller.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="annotation_reader"/>
</service>
<service id="sensio_framework_extra.converter.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="sensio_framework_extra.converter.manager"/>
</service>
<service id="sensio_framework_extra.converter.manager" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager">
<call method="add">
<argument type="service" id="sensio_framework_extra.converter.doctrine.orm"/>
<argument>0</argument>
</call>
</service>
<service id="sensio_framework_extra.converter.doctrine.orm" class="Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter">
<tag name="request.param_converter"/>
<argument type="service" id="doctrine"/>
</service>
<service id="sensio_framework_extra.view.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<tag name="kernel.event_listener" event="kernel.view" method="onKernelView"/>
<argument type="service" id="service_container"/>
</service>
<service id="sensio_framework_extra.cache.listener" class="Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse"/>
</service>
<service id="security.access.method_interceptor" class="JMS\SecurityExtraBundle\Security\Authorization\Interception\MethodSecurityInterceptor">
<argument type="service" id="security.context"/>
<argument type="service" id="security.authentication.manager"/>
<argument type="service" id="security.access.decision_manager"/>
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\AfterInvocation\AfterInvocationManager" public="false">
<argument type="collection"/>
</service>
</argument>
<argument type="service">
<service class="JMS\SecurityExtraBundle\Security\Authorization\RunAsManager" public="false">
<argument>RunAsToken</argument>
<argument>ROLE_</argument>
</service>
</argument>
<argument type="service" id="logger"/>
</service>
<service id="security.extra.controller_listener" class="JMS\SecurityExtraBundle\Controller\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onCoreController" priority="-255"/>
<argument type="service" id="service_container"/>
<argument type="service" id="annotation_reader"/>
</service>
<service id="white_october_pagerfanta.view_factory" class="Pagerfanta\View\ViewFactory">
<argument type="collection"/>
<call method="add">
<argument type="collection">
<argument key="default" type="service">
<service class="Pagerfanta\View\DefaultView" public="false">
<tag name="pagerfanta.view" alias="default"/>
</service>
</argument>
<argument key="default_translated" type="service">
<service class="WhiteOctober\PagerfantaBundle\View\DefaultTranslatedView" public="false">
<tag name="pagerfanta.view" alias="default_translated"/>
<argument type="service">
<service class="Pagerfanta\View\DefaultView" public="false">
<tag name="pagerfanta.view" alias="default"/>
</service>
</argument>
<argument type="service" id="translator.default"/>
</service>
</argument>
<argument key="twitter_bootstrap" type="service">
<service class="Pagerfanta\View\TwitterBootstrapView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap"/>
</service>
</argument>
<argument key="twitter_bootstrap_translated" type="service">
<service class="WhiteOctober\PagerfantaBundle\View\TwitterBootstrapTranslatedView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap_translated"/>
<argument type="service">
<service class="Pagerfanta\View\TwitterBootstrapView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap"/>
</service>
</argument>
<argument type="service" id="translator.default"/>
</service>
</argument>
</argument>
</call>
</service>
<service id="fos_user.validator.unique" class="FOS\UserBundle\Validator\UniqueValidator">
<tag name="validator.constraint_validator" alias="fos_user.validator.unique"/>
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="fos_user.validator.password" class="FOS\UserBundle\Validator\PasswordValidator">
<tag name="validator.constraint_validator" alias="fos_user.validator.password"/>
<call method="setEncoderFactory">
<argument type="service" id="security.encoder_factory"/>
</call>
</service>
<service id="fos_user.security.interactive_login_listener" class="FOS\UserBundle\Security\InteractiveLoginListener">
<tag name="kernel.event_listener" event="security.interactive_login" method="onSecurityInteractiveLogin"/>
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="fos_user.security.login_manager" class="FOS\UserBundle\Security\LoginManager">
<argument type="service" id="security.context"/>
<argument type="service" id="security.user_checker"/>
<argument type="service" id="security.authentication.session_strategy"/>
<argument type="service" id="service_container"/>
</service>
<service id="fos_user.util.user_manipulator" class="FOS\UserBundle\Util\UserManipulator">
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="fos_user.username_form_type" class="FOS\UserBundle\Form\Type\UsernameFormType">
<tag name="form.type" alias="fos_user_username"/>
<argument type="service">
<service class="FOS\UserBundle\Form\DataTransformer\UserToUsernameTransformer" public="false">
<argument type="service" id="fos_user.user_manager"/>
</service>
</argument>
</service>
<service id="fos_user.profile.form" class="Symfony\Component\Form\Form" factory-method="createNamed" factory-service="form.factory">
<argument>fos_user_profile</argument>
<argument>fos_user_profile_form</argument>
<argument></argument>
<argument type="collection">
<argument key="validation_groups" type="collection">
<argument>Profile</argument>
<argument>Default</argument>
</argument>
</argument>
</service>
<service id="fos_user.profile.form.type" class="FOS\UserBundle\Form\Type\ProfileFormType">
<tag name="form.type" alias="fos_user_profile"/>
<argument>Opm\UtilisateurBundle\Entity\Utilisateur</argument>
</service>
<service id="fos_user.registration.form" class="Symfony\Component\Form\Form" factory-method="createNamed" factory-service="form.factory">
<argument>fos_user_registration</argument>
<argument>fos_user_registration_form</argument>
<argument></argument>
<argument type="collection">
<argument key="validation_groups" type="collection">
<argument>Registration</argument>
<argument>Default</argument>
</argument>
</argument>
</service>
<service id="fos_user.registration.form.type" class="FOS\UserBundle\Form\Type\RegistrationFormType">
<tag name="form.type" alias="fos_user_registration"/>
<argument>Opm\UtilisateurBundle\Entity\Utilisateur</argument>
</service>
<service id="fos_user.change_password.form" class="Symfony\Component\Form\Form" factory-method="createNamed" factory-service="form.factory">
<argument>fos_user_change_password</argument>
<argument>fos_user_change_password_form</argument>
<argument></argument>
<argument type="collection">
<argument key="validation_groups" type="collection">
<argument>ChangePassword</argument>
<argument>Default</argument>
</argument>
</argument>
</service>
<service id="fos_user.change_password.form.type" class="FOS\UserBundle\Form\Type\ChangePasswordFormType">
<tag name="form.type" alias="fos_user_change_password"/>
</service>
<service id="fos_user.change_password.form.handler.default" class="FOS\UserBundle\Form\Handler\ChangePasswordFormHandler" scope="request">
<argument type="service" id="fos_user.change_password.form"/>
<argument type="service" id="request"/>
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="fos_user.resetting.form" class="Symfony\Component\Form\Form" factory-method="createNamed" factory-service="form.factory">
<argument>fos_user_resetting</argument>
<argument>fos_user_resetting_form</argument>
<argument></argument>
<argument type="collection">
<argument key="validation_groups" type="collection">
<argument>ResetPassword</argument>
<argument>Default</argument>
</argument>
</argument>
</service>
<service id="fos_user.resetting.form.type" class="FOS\UserBundle\Form\Type\ResettingFormType">
<tag name="form.type" alias="fos_user_resetting"/>
</service>
<service id="twig.extension.acme.demo" class="Acme\DemoBundle\Twig\Extension\DemoExtension" public="false">
<tag name="twig.extension"/>
<argument type="service" id="twig.loader"/>
</service>
<service id="acme.demo.listener" class="Acme\DemoBundle\ControllerListener">
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController"/>
<argument type="service" id="twig.extension.acme.demo"/>
</service>
<service id="web_profiler.debug_toolbar" class="Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener">
<tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="-128"/>
<argument type="service" id="templating"/>
<argument>false</argument>
<argument>2</argument>
</service>
<service id="sensio.distribution.webconfigurator" class="Sensio\Bundle\DistributionBundle\Configurator\Configurator">
<argument>C:/wamp/www/opmV1.0/app</argument>
</service>
<service id="monolog.logger.request" class="Symfony\Bridge\Monolog\Logger">
<argument>request</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.event" class="Symfony\Bridge\Monolog\Logger">
<argument>event</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.profiler" class="Symfony\Bridge\Monolog\Logger">
<argument>profiler</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.router" class="Symfony\Bridge\Monolog\Logger">
<argument>router</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.templating" class="Symfony\Bridge\Monolog\Logger">
<argument>templating</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.security" class="Symfony\Bridge\Monolog\Logger">
<argument>security</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.logger.doctrine" class="Symfony\Bridge\Monolog\Logger">
<argument>doctrine</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="monolog.handler.debug" class="Symfony\Bridge\Monolog\Handler\DebugHandler">
<argument>100</argument>
<argument>true</argument>
</service>
<service id="session.storage" class="Symfony\Component\HttpFoundation\SessionStorage\NativeSessionStorage">
<argument type="collection"/>
</service>
<service id="router" class="Symfony\Bundle\FrameworkBundle\Routing\Router">
<argument type="service" id="service_container"/>
<argument>C:/wamp/www/opmV1.0/app/config/routing_dev.yml</argument>
<argument type="collection">
<argument key="cache_dir">C:/wamp/www/opmV1.0/app/cache/dev</argument>
<argument key="debug">true</argument>
<argument key="generator_class">Symfony\Component\Routing\Generator\UrlGenerator</argument>
<argument key="generator_base_class">Symfony\Component\Routing\Generator\UrlGenerator</argument>
<argument key="generator_dumper_class">Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper</argument>
<argument key="generator_cache_class">appdevUrlGenerator</argument>
<argument key="matcher_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument>
<argument key="matcher_base_class">Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher</argument>
<argument key="matcher_dumper_class">Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper</argument>
<argument key="matcher_cache_class">appdevUrlMatcher</argument>
</argument>
</service>
<service id="templating.loader" class="Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader">
<argument type="service" id="templating.locator"/>
</service>
<service id="templating" class="Symfony\Bundle\TwigBundle\TwigEngine">
<argument type="service" id="twig"/>
<argument type="service" id="templating.name_parser"/>
<argument type="service" id="templating.globals"/>
</service>
<service id="annotation_reader" class="Doctrine\Common\Annotations\FileCacheReader">
<argument type="service">
<service class="Doctrine\Common\Annotations\AnnotationReader" public="false"/>
</argument>
<argument>C:/wamp/www/opmV1.0/app/cache/dev/annotations</argument>
<argument>true</argument>
</service>
<service id="security.encoder_factory" class="Symfony\Component\Security\Core\Encoder\EncoderFactory">
<argument type="collection">
<argument key="FOS\UserBundle\Model\UserInterface" type="collection">
<argument key="class">%security.encoder.digest.class%</argument>
<argument key="arguments" type="collection">
<argument>sha512</argument>
<argument>true</argument>
<argument>5000</argument>
</argument>
</argument>
</argument>
</service>
<service id="logger" class="Symfony\Bridge\Monolog\Logger">
<argument>app</argument>
<call method="pushHandler">
<argument type="service" id="monolog.handler.main"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.firephp"/>
</call>
<call method="pushHandler">
<argument type="service" id="monolog.handler.debug"/>
</call>
</service>
<service id="swiftmailer.transport" class="Swift_Transport_EsmtpTransport">
<argument type="service">
<service class="Swift_Transport_StreamBuffer" public="false">
<argument type="service">
<service class="Swift_StreamFilters_StringReplacementFilterFactory" public="false"/>
</argument>
</service>
</argument>
<argument type="collection">
<argument type="service">
<service class="Swift_Transport_Esmtp_AuthHandler" public="false">
<argument type="collection">
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_CramMd5Authenticator" public="false"/>
</argument>
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_LoginAuthenticator" public="false"/>
</argument>
<argument type="service">
<service class="Swift_Transport_Esmtp_Auth_PlainAuthenticator" public="false"/>
</argument>
</argument>
</service>
</argument>
</argument>
<argument type="service">
<service class="Swift_Events_SimpleEventDispatcher" public="false"/>
</argument>
<call method="setHost">
<argument>smtp.gmail.com</argument>
</call>
<call method="setPort">
<argument>465</argument>
</call>
<call method="setEncryption">
<argument>ssl</argument>
</call>
<call method="setUsername">
<argument>benammarhaithem@gmail.com </argument>
</call>
<call method="setPassword">
<argument>29051986haithi</argument>
</call>
<call method="setAuthMode">
<argument>login</argument>
</call>
<call method="registerPlugin">
<argument type="service" id="swiftmailer.plugin.messagelogger"/>
</call>
</service>
<service id="mailer" class="Swift_Mailer">
<argument type="service" id="swiftmailer.transport"/>
</service>
<service id="fos_user.mailer" class="FOS\UserBundle\Mailer\Mailer">
<argument type="service" id="mailer"/>
<argument type="service" id="router"/>
<argument type="service" id="templating"/>
<argument type="collection">
<argument key="confirmation.template">FOSUserBundle:Registration:email.txt.twig</argument>
<argument key="resetting.template">FOSUserBundle:Resetting:email.txt.twig</argument>
<argument key="from_email" type="collection">
<argument key="confirmation" type="collection">
<argument key="webmaster@example.com">webmaster</argument>
</argument>
<argument key="resetting" type="collection">
<argument key="webmaster@example.com">webmaster</argument>
</argument>
</argument>
</argument>
</service>
<service id="fos_user.util.email_canonicalizer" class="FOS\UserBundle\Util\Canonicalizer"/>
<service id="fos_user.user_manager" class="FOS\UserBundle\Entity\UserManager">
<argument type="service" id="security.encoder_factory"/>
<argument type="service" id="fos_user.util.email_canonicalizer"/>
<argument type="service" id="fos_user.util.email_canonicalizer"/>
<argument type="service">
<service class="Doctrine\ORM\EntityManager" factory-method="getEntityManager" factory-service="doctrine" public="false">
<argument>null</argument>
</service>
</argument>
<argument>Opm\UtilisateurBundle\Entity\Utilisateur</argument>
</service>
<service id="fos_user.profile.form.handler" class="FOS\UserBundle\Form\Handler\ProfileFormHandler" scope="request">
<argument type="service" id="fos_user.profile.form"/>
<argument type="service" id="request"/>
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="fos_user.registration.form.handler" class="FOS\UserBundle\Form\Handler\RegistrationFormHandler" scope="request">
<argument type="service" id="fos_user.registration.form"/>
<argument type="service" id="request"/>
<argument type="service" id="fos_user.user_manager"/>
<argument type="service" id="fos_user.mailer"/>
</service>
<service id="fos_user.resetting.form.handler" class="FOS\UserBundle\Form\Handler\ResettingFormHandler" scope="request">
<argument type="service" id="fos_user.resetting.form"/>
<argument type="service" id="request"/>
<argument type="service" id="fos_user.user_manager"/>
</service>
<service id="debug.event_dispatcher" alias="event_dispatcher"/>
<service id="translator" alias="translator.default"/>
<service id="database_connection" alias="doctrine.dbal.default_connection"/>
<service id="doctrine.orm.entity_manager" alias="doctrine.orm.default_entity_manager"/>
<service id="fos_user.util.username_canonicalizer" alias="fos_user.util.email_canonicalizer"/>
<service id="fos_user.change_password.form.handler" alias="fos_user.change_password.form.handler.default"/>
</services>
</container>
| {
"content_hash": "6bc12aeb2f2aed84d94144147de0e9e5",
"timestamp": "",
"source": "github",
"line_count": 3810,
"max_line_length": 228,
"avg_line_length": 54.570603674540685,
"alnum_prop": 0.6543907577171331,
"repo_name": "oxia-Opm/opm_dev",
"id": "e2feb6743ff8331b07eb69422c294df0a26c9622",
"size": "207914",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/appDevDebugProjectContainer.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "917524"
},
{
"name": "PHP",
"bytes": "57493"
}
],
"symlink_target": ""
} |
'use strict';
var should = require('should'),
request = require('supertest'),
app = require('../../server'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Vegetable = mongoose.model('Vegetable'),
agent = request.agent(app);
/**
* Globals
*/
var credentials, user, vegetable;
/**
* Vegetable routes tests
*/
describe('Vegetable CRUD tests', function() {
beforeEach(function(done) {
// Create user credentials
credentials = {
username: 'username',
password: 'password'
};
// Create a new user
user = new User({
firstName: 'Full',
lastName: 'Name',
displayName: 'Full Name',
email: 'test@test.com',
username: credentials.username,
password: credentials.password,
provider: 'local'
});
// Save a user to the test db and create new Vegetable
user.save(function() {
vegetable = {
name: 'Vegetable Name'
};
done();
});
});
it('should be able to save Vegetable instance if logged in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Vegetable
agent.post('/vegetables')
.send(vegetable)
.expect(200)
.end(function(vegetableSaveErr, vegetableSaveRes) {
// Handle Vegetable save error
if (vegetableSaveErr) done(vegetableSaveErr);
// Get a list of Vegetables
agent.get('/vegetables')
.end(function(vegetablesGetErr, vegetablesGetRes) {
// Handle Vegetable save error
if (vegetablesGetErr) done(vegetablesGetErr);
// Get Vegetables list
var vegetables = vegetablesGetRes.body;
// Set assertions
(vegetables[0].user._id).should.equal(userId);
(vegetables[0].name).should.match('Vegetable Name');
// Call the assertion callback
done();
});
});
});
});
it('should not be able to save Vegetable instance if not logged in', function(done) {
agent.post('/vegetables')
.send(vegetable)
.expect(401)
.end(function(vegetableSaveErr, vegetableSaveRes) {
// Call the assertion callback
done(vegetableSaveErr);
});
});
it('should not be able to save Vegetable instance if no name is provided', function(done) {
// Invalidate name field
vegetable.name = '';
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Vegetable
agent.post('/vegetables')
.send(vegetable)
.expect(400)
.end(function(vegetableSaveErr, vegetableSaveRes) {
// Set message assertion
(vegetableSaveRes.body.message).should.match('Please fill Vegetable name');
// Handle Vegetable save error
done(vegetableSaveErr);
});
});
});
it('should be able to update Vegetable instance if signed in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Vegetable
agent.post('/vegetables')
.send(vegetable)
.expect(200)
.end(function(vegetableSaveErr, vegetableSaveRes) {
// Handle Vegetable save error
if (vegetableSaveErr) done(vegetableSaveErr);
// Update Vegetable name
vegetable.name = 'WHY YOU GOTTA BE SO MEAN?';
// Update existing Vegetable
agent.put('/vegetables/' + vegetableSaveRes.body._id)
.send(vegetable)
.expect(200)
.end(function(vegetableUpdateErr, vegetableUpdateRes) {
// Handle Vegetable update error
if (vegetableUpdateErr) done(vegetableUpdateErr);
// Set assertions
(vegetableUpdateRes.body._id).should.equal(vegetableSaveRes.body._id);
(vegetableUpdateRes.body.name).should.match('WHY YOU GOTTA BE SO MEAN?');
// Call the assertion callback
done();
});
});
});
});
it('should be able to get a list of Vegetables if not signed in', function(done) {
// Create new Vegetable model instance
var vegetableObj = new Vegetable(vegetable);
// Save the Vegetable
vegetableObj.save(function() {
// Request Vegetables
request(app).get('/vegetables')
.end(function(req, res) {
// Set assertion
res.body.should.be.an.Array.with.lengthOf(1);
// Call the assertion callback
done();
});
});
});
it('should be able to get a single Vegetable if not signed in', function(done) {
// Create new Vegetable model instance
var vegetableObj = new Vegetable(vegetable);
// Save the Vegetable
vegetableObj.save(function() {
request(app).get('/vegetables/' + vegetableObj._id)
.end(function(req, res) {
// Set assertion
res.body.should.be.an.Object.with.property('name', vegetable.name);
// Call the assertion callback
done();
});
});
});
it('should be able to delete Vegetable instance if signed in', function(done) {
agent.post('/auth/signin')
.send(credentials)
.expect(200)
.end(function(signinErr, signinRes) {
// Handle signin error
if (signinErr) done(signinErr);
// Get the userId
var userId = user.id;
// Save a new Vegetable
agent.post('/vegetables')
.send(vegetable)
.expect(200)
.end(function(vegetableSaveErr, vegetableSaveRes) {
// Handle Vegetable save error
if (vegetableSaveErr) done(vegetableSaveErr);
// Delete existing Vegetable
agent.delete('/vegetables/' + vegetableSaveRes.body._id)
.send(vegetable)
.expect(200)
.end(function(vegetableDeleteErr, vegetableDeleteRes) {
// Handle Vegetable error error
if (vegetableDeleteErr) done(vegetableDeleteErr);
// Set assertions
(vegetableDeleteRes.body._id).should.equal(vegetableSaveRes.body._id);
// Call the assertion callback
done();
});
});
});
});
it('should not be able to delete Vegetable instance if not signed in', function(done) {
// Set Vegetable user
vegetable.user = user;
// Create new Vegetable model instance
var vegetableObj = new Vegetable(vegetable);
// Save the Vegetable
vegetableObj.save(function() {
// Try deleting Vegetable
request(app).delete('/vegetables/' + vegetableObj._id)
.expect(401)
.end(function(vegetableDeleteErr, vegetableDeleteRes) {
// Set message assertion
(vegetableDeleteRes.body.message).should.match('User is not logged in');
// Handle Vegetable error error
done(vegetableDeleteErr);
});
});
});
afterEach(function(done) {
User.remove().exec();
Vegetable.remove().exec();
done();
});
}); | {
"content_hash": "ad3379bc3a3df6de3b21e8a459440a5d",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 92,
"avg_line_length": 25.865671641791046,
"alnum_prop": 0.6429601846508944,
"repo_name": "gehlotchirag/MeherWeb",
"id": "6536bd02cb9705c687a7e67e0183fcf6914801a2",
"size": "6932",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/tests/vegetable.server.routes.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "500"
},
{
"name": "HTML",
"bytes": "171145"
},
{
"name": "JavaScript",
"bytes": "702193"
},
{
"name": "Shell",
"bytes": "414"
}
],
"symlink_target": ""
} |
FROM composer/composer
MAINTAINER Julien Breux <julien.breux@gmail.com>
# Run some Debian packages installation.
ENV PACKAGES="php-pear curl"
RUN apt-get update && \
apt-get install -yq --no-install-recommends $PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Run xdebug installation.
RUN curl -L http://pecl.php.net/get/xdebug-2.5.0.tgz >> /usr/src/php/ext/xdebug.tgz && \
tar -xf /usr/src/php/ext/xdebug.tgz -C /usr/src/php/ext/ && \
rm /usr/src/php/ext/xdebug.tgz && \
docker-php-ext-install xdebug-2.5.0 && \
docker-php-ext-install pcntl && \
docker-php-ext-install exif && \
php -m
# Goto temporary directory.
WORKDIR /tmp
# Run composer and phpunit installation.
RUN composer selfupdate && \
composer require "phpunit/phpunit:~5.0.7" --prefer-source --no-interaction && \
ln -s /tmp/vendor/bin/phpunit /usr/local/bin/phpunit
# Set up the application directory.
VOLUME ["/app"]
WORKDIR /app
# Set up the command arguments.
ENTRYPOINT ["/usr/local/bin/phpunit"]
CMD ["--help"]
| {
"content_hash": "a723ff4ffbf9097f4ba11fad9adb34bf",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 88,
"avg_line_length": 30.735294117647058,
"alnum_prop": 0.6794258373205742,
"repo_name": "JulienBreux/phpunit-docker",
"id": "5ae1b71f84da33bae4025a631d4090740c124215",
"size": "1073",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "5.0.7/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "50061"
},
{
"name": "Liquid",
"bytes": "2993"
},
{
"name": "Makefile",
"bytes": "5534"
},
{
"name": "PHP",
"bytes": "641"
},
{
"name": "Ruby",
"bytes": "5701"
}
],
"symlink_target": ""
} |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.11.0-rc1-master-ffbcff3
*/
.md-virtual-repeat-container {
box-sizing: border-box;
display: block;
margin: 0;
overflow: hidden;
padding: 0;
position: relative; }
.md-virtual-repeat-container .md-virtual-repeat-scroller {
bottom: 0;
box-sizing: border-box;
left: 0;
margin: 0;
overflow-x: hidden;
padding: 0;
position: absolute;
right: 0;
top: 0; }
.md-virtual-repeat-container .md-virtual-repeat-sizer {
box-sizing: border-box;
height: 1px;
display: inline-block;
margin: 0;
padding: 0;
width: 1px; }
.md-virtual-repeat-container .md-virtual-repeat-offsetter {
box-sizing: border-box;
left: 0;
margin: 0;
padding: 0;
position: absolute;
right: 16px;
top: 0; }
.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller {
overflow-x: auto;
overflow-y: hidden; }
.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter {
bottom: 16px;
right: auto;
white-space: nowrap; }
| {
"content_hash": "d01756ebc1c2dfe4d2c9101ab109dcfa",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 24.347826086956523,
"alnum_prop": 0.6553571428571429,
"repo_name": "hitesh97/bower-material",
"id": "e352a06a9a519d9a9936d4d12a5a35292adb474b",
"size": "1120",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "modules/closure/virtualRepeat/virtualRepeat.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "915501"
},
{
"name": "JavaScript",
"bytes": "1504509"
}
],
"symlink_target": ""
} |
module.exports = {
hex: require('./hex'),
hexFullToRgb: require('./hexFullToRgb'),
hexShort: require('./hexShort'),
hsla: require('./hsla'),
named: require('./named'),
rgba: require('./rgba')
};
| {
"content_hash": "d47e9d8f6f4650565d978b73a01a69b3",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 25.875,
"alnum_prop": 0.6135265700483091,
"repo_name": "ParkSungmi/ButterflyEffect-server",
"id": "963387de022918aec08ab1451e0ae045858716ad",
"size": "207",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/cmnjs/color/regExp/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "111"
},
{
"name": "HTML",
"bytes": "275"
},
{
"name": "JavaScript",
"bytes": "26543"
}
],
"symlink_target": ""
} |
package org.apache.servicecomb.registry.config;
import java.util.Map;
import org.apache.commons.configuration.Configuration;
import org.apache.servicecomb.config.BootStrapProperties;
public final class InstancePropertiesLoader extends AbstractPropertiesLoader {
public static final InstancePropertiesLoader INSTANCE = new InstancePropertiesLoader();
private InstancePropertiesLoader() {
}
@Override
protected Map<String, String> readProperties(Configuration configuration) {
return BootStrapProperties.readServiceInstanceProperties(configuration);
}
@Override
protected String readPropertiesExtendedClass(Configuration configuration) {
return BootStrapProperties.readServiceInstanceExtendedClass(configuration);
}
}
| {
"content_hash": "134ebd57f30a436a2fabd6be74afe66b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 89,
"avg_line_length": 27.85185185185185,
"alnum_prop": 0.824468085106383,
"repo_name": "ServiceComb/java-chassis",
"id": "99ac20c4f377cd77e560222c90c4458281c9228e",
"size": "1553",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "foundations/foundation-registry/src/main/java/org/apache/servicecomb/registry/config/InstancePropertiesLoader.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2679862"
},
{
"name": "Protocol Buffer",
"bytes": "359"
},
{
"name": "Python",
"bytes": "1681"
}
],
"symlink_target": ""
} |
export * from './ConverterService';
export * from './decorator/Property';
export * from './decorator/PropertyInherited';
export * from './PropertyRegistry';
export * from './interface/IConverter';
| {
"content_hash": "ebe97248ebf9628527580144b512b221",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 46,
"avg_line_length": 39.4,
"alnum_prop": 0.7309644670050761,
"repo_name": "loon-project/loon",
"id": "d9dcda91f55d0119723d911ac2297985c90787ad",
"size": "198",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/converter/index.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "TypeScript",
"bytes": "86544"
}
],
"symlink_target": ""
} |
/* String text, identifier text and identifier node allocator. Strings
allocated by ggc_alloc_string are stored in an obstack which is
never shrunk. Identifiers are uniquely stored in a hash table.
We use cpplib's hash table implementation. libiberty's
hashtab.c is not used because it requires 100% average space
overhead per string, which is unacceptable. Also, this algorithm
is faster. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "ggc.h"
#include "tree.h"
#include "symtab.h"
#include "cpplib.h"
/* The "" allocated string. */
const char empty_string[] = "";
/* Character strings, each containing a single decimal digit.
Written this way to save space. */
const char digit_vector[] = {
'0', 0, '1', 0, '2', 0, '3', 0, '4', 0,
'5', 0, '6', 0, '7', 0, '8', 0, '9', 0
};
struct ht *ident_hash;
static struct obstack string_stack;
static hashnode alloc_node (hash_table *);
static int mark_ident (struct cpp_reader *, hashnode, const void *);
static void *
stringpool_ggc_alloc (size_t x)
{
return ggc_alloc (x);
}
/* Initialize the string pool. */
void
init_stringpool (void)
{
/* Create with 16K (2^14) entries. */
ident_hash = ht_create (14);
ident_hash->alloc_node = alloc_node;
ident_hash->alloc_subobject = stringpool_ggc_alloc;
gcc_obstack_init (&string_stack);
}
/* Allocate a hash node. */
static hashnode
alloc_node (hash_table *table ATTRIBUTE_UNUSED)
{
return GCC_IDENT_TO_HT_IDENT (make_node (IDENTIFIER_NODE));
}
/* Allocate and return a string constant of length LENGTH, containing
CONTENTS. If LENGTH is -1, CONTENTS is assumed to be a
nul-terminated string, and the length is calculated using strlen.
If the same string constant has been allocated before, that copy is
returned this time too. */
const char *
ggc_alloc_string (const char *contents, int length)
{
if (length == -1)
length = strlen (contents);
if (length == 0)
return empty_string;
if (length == 1 && ISDIGIT (contents[0]))
return digit_string (contents[0] - '0');
obstack_grow0 (&string_stack, contents, length);
return XOBFINISH (&string_stack, const char *);
}
/* Return an IDENTIFIER_NODE whose name is TEXT (a null-terminated string).
If an identifier with that name has previously been referred to,
the same node is returned this time. */
#undef get_identifier
tree
get_identifier (const char *text)
{
hashnode ht_node = ht_lookup (ident_hash,
(const unsigned char *) text,
strlen (text), HT_ALLOC);
/* ht_node can't be NULL here. */
return HT_IDENT_TO_GCC_IDENT (ht_node);
}
/* Identical to get_identifier, except that the length is assumed
known. */
tree
get_identifier_with_length (const char *text, size_t length)
{
hashnode ht_node = ht_lookup (ident_hash,
(const unsigned char *) text,
length, HT_ALLOC);
/* ht_node can't be NULL here. */
return HT_IDENT_TO_GCC_IDENT (ht_node);
}
/* If an identifier with the name TEXT (a null-terminated string) has
previously been referred to, return that node; otherwise return
NULL_TREE. */
tree
maybe_get_identifier (const char *text)
{
hashnode ht_node;
ht_node = ht_lookup (ident_hash, (const unsigned char *) text,
strlen (text), HT_NO_INSERT);
if (ht_node)
return HT_IDENT_TO_GCC_IDENT (ht_node);
return NULL_TREE;
}
/* Report some basic statistics about the string pool. */
void
stringpool_statistics (void)
{
ht_dump_statistics (ident_hash);
}
/* Mark an identifier for GC. */
static int
mark_ident (struct cpp_reader *pfile ATTRIBUTE_UNUSED, hashnode h,
const void *v ATTRIBUTE_UNUSED)
{
gt_ggc_m_9tree_node (HT_IDENT_TO_GCC_IDENT (h));
return 1;
}
/* Mark the trees hanging off the identifier node for GGC. These are
handled specially (not using gengtype) because of the special
treatment for strings. */
void
ggc_mark_stringpool (void)
{
ht_forall (ident_hash, mark_ident, NULL);
}
/* Strings are _not_ GCed, but this routine exists so that a separate
roots table isn't needed for the few global variables that refer
to strings. */
void
gt_ggc_m_S (void *x ATTRIBUTE_UNUSED)
{
}
/* Pointer-walking routine for strings (not very interesting, since
strings don't contain pointers). */
void
gt_pch_p_S (void *obj ATTRIBUTE_UNUSED, void *x ATTRIBUTE_UNUSED,
gt_pointer_operator op ATTRIBUTE_UNUSED,
void *cookie ATTRIBUTE_UNUSED)
{
}
/* PCH pointer-walking routine for strings. */
void
gt_pch_n_S (const void *x)
{
gt_pch_note_object ((void *)x, (void *)x, >_pch_p_S,
gt_types_enum_last);
}
/* Handle saving and restoring the string pool for PCH. */
/* SPD is saved in the PCH file and holds the information needed
to restore the string pool. */
struct string_pool_data GTY(())
{
struct ht_identifier * *
GTY((length ("%h.nslots"),
nested_ptr (union tree_node, "%h ? GCC_IDENT_TO_HT_IDENT (%h) : NULL",
"%h ? HT_IDENT_TO_GCC_IDENT (%h) : NULL")))
entries;
unsigned int nslots;
unsigned int nelements;
};
static GTY(()) struct string_pool_data * spd;
/* Save the stringpool data in SPD. */
void
gt_pch_save_stringpool (void)
{
spd = ggc_alloc (sizeof (*spd));
spd->nslots = ident_hash->nslots;
spd->nelements = ident_hash->nelements;
spd->entries = ggc_alloc (sizeof (spd->entries[0]) * spd->nslots);
memcpy (spd->entries, ident_hash->entries,
spd->nslots * sizeof (spd->entries[0]));
}
/* Return the stringpool to its state before gt_pch_save_stringpool
was called. */
void
gt_pch_fixup_stringpool (void)
{
}
/* A PCH file has been restored, which loaded SPD; fill the real hash table
from SPD. */
void
gt_pch_restore_stringpool (void)
{
ht_load (ident_hash, spd->entries, spd->nslots, spd->nelements, false);
spd = NULL;
}
#include "gt-stringpool.h"
| {
"content_hash": "79c621d2b179ae9f1cac15a96b79ed2b",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 75,
"avg_line_length": 24.696202531645568,
"alnum_prop": 0.6787971980181103,
"repo_name": "shaotuanchen/sunflower_exp",
"id": "d2e1ad3c32d39d8bbad9e419002da38ddcc02e19",
"size": "6592",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "tools/source/gcc-4.2.4/gcc/stringpool.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "459993"
},
{
"name": "Awk",
"bytes": "6562"
},
{
"name": "Batchfile",
"bytes": "9028"
},
{
"name": "C",
"bytes": "50326113"
},
{
"name": "C++",
"bytes": "2040239"
},
{
"name": "CSS",
"bytes": "2355"
},
{
"name": "Clarion",
"bytes": "2484"
},
{
"name": "Coq",
"bytes": "61440"
},
{
"name": "DIGITAL Command Language",
"bytes": "69150"
},
{
"name": "Emacs Lisp",
"bytes": "186910"
},
{
"name": "Fortran",
"bytes": "5364"
},
{
"name": "HTML",
"bytes": "2171356"
},
{
"name": "JavaScript",
"bytes": "27164"
},
{
"name": "Logos",
"bytes": "159114"
},
{
"name": "M",
"bytes": "109006"
},
{
"name": "M4",
"bytes": "100614"
},
{
"name": "Makefile",
"bytes": "5409865"
},
{
"name": "Mercury",
"bytes": "702"
},
{
"name": "Module Management System",
"bytes": "56956"
},
{
"name": "OCaml",
"bytes": "253115"
},
{
"name": "Objective-C",
"bytes": "57800"
},
{
"name": "Papyrus",
"bytes": "3298"
},
{
"name": "Perl",
"bytes": "70992"
},
{
"name": "Perl 6",
"bytes": "693"
},
{
"name": "PostScript",
"bytes": "3440120"
},
{
"name": "Python",
"bytes": "40729"
},
{
"name": "Redcode",
"bytes": "1140"
},
{
"name": "Roff",
"bytes": "3794721"
},
{
"name": "SAS",
"bytes": "56770"
},
{
"name": "SRecode Template",
"bytes": "540157"
},
{
"name": "Shell",
"bytes": "1560436"
},
{
"name": "Smalltalk",
"bytes": "10124"
},
{
"name": "Standard ML",
"bytes": "1212"
},
{
"name": "TeX",
"bytes": "385584"
},
{
"name": "WebAssembly",
"bytes": "52904"
},
{
"name": "Yacc",
"bytes": "510934"
}
],
"symlink_target": ""
} |
package org.jbromo.common.invocation;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.List;
import org.jbromo.common.test.common.ConstructorUtil;
import org.junit.Assert;
import org.junit.Test;
import lombok.Getter;
import lombok.Setter;
/**
* Test for the ParameterizedType util class.
* @author qjafcunuas
*/
public class ParameterizedTypeUtilTest {
/**
* Define a class.
*/
private abstract class AbstractObject<O> {
/**
* Define a string collections.
*/
@Getter
@Setter
private Collection<String> strings;
}
/**
* Define a class.
*/
private abstract class AbstractObjectObject<O, P> extends AbstractObject<O> {
}
/**
* Define an object.
*/
private class MyObject extends AbstractObject<Integer> {
};
/**
* Define an object.
*/
private class MyObjectObject extends AbstractObjectObject<Integer, String> {
}
/**
* Test constructor.
*/
@Test
public void constructor() {
ConstructorUtil.executePrivate(ParameterizedTypeUtil.class);
}
/**
* Test the getClass(object,position) method.
*/
@Test
public void testGetClassObjectPosition() {
AbstractObject<?> obj = new MyObject();
Assert.assertTrue(Integer.class.equals(ParameterizedTypeUtil.getClass(obj, 0)));
Assert.assertNull(ParameterizedTypeUtil.getClass(obj, 10));
obj = new MyObjectObject();
Assert.assertTrue(Integer.class.equals(ParameterizedTypeUtil.getClass(obj, 0)));
Assert.assertTrue(String.class.equals(ParameterizedTypeUtil.getClass(obj, 1)));
}
/**
* Test the getClass(object,class,position) method.
*/
@Test
public void testGetClassObjectClassPosition() {
AbstractObject<?> obj = new MyObject();
Assert.assertTrue(Integer.class.equals(ParameterizedTypeUtil.getClass(obj, AbstractObject.class, 0)));
obj = new MyObjectObject();
Assert.assertTrue(Integer.class.equals(ParameterizedTypeUtil.getClass(obj, AbstractObjectObject.class, 0)));
Assert.assertTrue(String.class.equals(ParameterizedTypeUtil.getClass(obj, AbstractObjectObject.class, 1)));
}
/**
* Test the getGenericType method.
*/
@Test
public void testGetGenericType() {
final Field field = InvocationUtil.getField(MyObject.class, "strings");
Assert.assertNotNull(field);
final List<Class<?>> list = ParameterizedTypeUtil.getGenericType(field);
Assert.assertNotNull(list);
Assert.assertTrue(list.size() == 1);
Assert.assertTrue(list.contains(String.class));
Assert.assertTrue(ParameterizedTypeUtil.getGenericType(field, 0).equals(String.class));
}
}
| {
"content_hash": "b2f8048a20980bdf9072bde650c41fa0",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 116,
"avg_line_length": 27.861386138613863,
"alnum_prop": 0.6638237384506042,
"repo_name": "qjafcunuas/jbromo",
"id": "25d232a558a61fb296e22d01dba103d9d4424557",
"size": "3943",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jbromo-lib/src/test/java/org/jbromo/common/invocation/ParameterizedTypeUtilTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22922"
},
{
"name": "HTML",
"bytes": "203299"
},
{
"name": "Java",
"bytes": "1881945"
},
{
"name": "JavaScript",
"bytes": "33051"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:fitsSystemWindows="true"
tools:context=".activity.ChatActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<ImageView
android:id="@+id/img_avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/avatar" />
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
| {
"content_hash": "f6a8968b33d5d84982d118c7817073ab",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 107,
"avg_line_length": 38,
"alnum_prop": 0.6304824561403509,
"repo_name": "CooLoongWu/CoolChat",
"id": "d0d546abee1556d7f8e9d8cea1b02a3248fe90f7",
"size": "1824",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/activity_test.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "321056"
}
],
"symlink_target": ""
} |
<?php
namespace Acl\View\Helper;
use Zend\View\Helper\AbstractHelper;
use Acl\Resource\AbstractResource;
class ResourceOptions extends AbstractHelper
{
/**
* @return string
*/
public function __invoke()
{
return $this;
}
/**
* @param AbstractResource[] $resources
* @return string
*/
public function checkboxes($resources)
{
$html = '<div class="resource-block">'.PHP_EOL;
foreach($resources as $resource){
$html.='<div class="resource-option"><input type="checkbox" name="resource[]" value="'.$resource->getResourceId().'">';
$html.='<span class="resource-name">'.$resource->getName().'</span>';
$html.=' - <span class="resource-description">'.$resource->getDescription().'</span>';
if($resource->hasChildren()){
$html.=$this->checkboxes($resource->getChildren());
}
$html.='</div>'.PHP_EOL;
}
$html.='</div>';
return $html;
}
} | {
"content_hash": "da7bc15583433467eeb8b8e7d9ab8f19",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 131,
"avg_line_length": 26.358974358974358,
"alnum_prop": 0.556420233463035,
"repo_name": "kkucera/rentalmgr",
"id": "5614cb6dc318f6194fe7fe75cd11d6a4c9dffb45",
"size": "1164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "module/Acl/src/View/Helper/ResourceOptions.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "CSS",
"bytes": "152410"
},
{
"name": "JavaScript",
"bytes": "2117950"
},
{
"name": "PHP",
"bytes": "398630"
},
{
"name": "Perl",
"bytes": "711"
},
{
"name": "Shell",
"bytes": "7411"
}
],
"symlink_target": ""
} |
//// [subSubClassCanAccessProtectedConstructor.ts]
class Base {
protected constructor() { }
public instance1 = new Base(); // allowed
}
class Subclass extends Base {
public instance1_1 = new Base(); // allowed
public instance1_2 = new Subclass(); // allowed
}
class SubclassOfSubclass extends Subclass {
public instance2_1 = new Base(); // allowed
public instance2_2 = new Subclass(); // allowed
public instance2_3 = new SubclassOfSubclass(); // allowed
}
//// [subSubClassCanAccessProtectedConstructor.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var Base = /** @class */ (function () {
function Base() {
this.instance1 = new Base(); // allowed
}
return Base;
}());
var Subclass = /** @class */ (function (_super) {
__extends(Subclass, _super);
function Subclass() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.instance1_1 = new Base(); // allowed
_this.instance1_2 = new Subclass(); // allowed
return _this;
}
return Subclass;
}(Base));
var SubclassOfSubclass = /** @class */ (function (_super) {
__extends(SubclassOfSubclass, _super);
function SubclassOfSubclass() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.instance2_1 = new Base(); // allowed
_this.instance2_2 = new Subclass(); // allowed
_this.instance2_3 = new SubclassOfSubclass(); // allowed
return _this;
}
return SubclassOfSubclass;
}(Subclass));
| {
"content_hash": "ff7ad5ebc094104b8ff06b4f5d50547c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 93,
"avg_line_length": 35.94915254237288,
"alnum_prop": 0.5752003771805752,
"repo_name": "alexeagle/TypeScript",
"id": "11201f069e5b67626e72ca2965ded9559d2438c0",
"size": "2121",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "3710"
},
{
"name": "JavaScript",
"bytes": "175"
},
{
"name": "PowerShell",
"bytes": "2855"
},
{
"name": "Shell",
"bytes": "47"
},
{
"name": "TypeScript",
"bytes": "91618587"
}
],
"symlink_target": ""
} |
using System;
using UnityEngine;
#if true
namespace WasdEditorCamera
{
// Popup list created by Eric Haines
// ComboBox Extended by Hyungseok Seo.(Jerry) sdragoon@nate.com
// Scrollview added by Luis Anton http://playmedusa.com Though it may need some tweaks!
//
// -----------------------------------------------
// This code working like ComboBox Control.
// I just changed some part of code,
// because I want to seperate ComboBox button and List.
// ( You can see the result of this code from Description's last picture )
// -----------------------------------------------
//
// === usage ======================================
//
// public class SomeClass : MonoBehaviour
// {
// GUIContent[] comboBoxList;
// private ComboBox comboBoxControl = new ComboBox();
// private GUIStyle listStyle = new GUIStyle();
//
// private void Start()
// {
// comboBoxList = new GUIContent[5];
// comboBoxList[0] = new GUIContent("Thing 1");
// comboBoxList[1] = new GUIContent("Thing 2");
// comboBoxList[2] = new GUIContent("Thing 3");
// comboBoxList[3] = new GUIContent("Thing 4");
// comboBoxList[4] = new GUIContent("Thing 5");
//
// listStyle.normal.textColor = Color.white;
// listStyle.onHover.background =
// listStyle.hover.background = new Texture2D(2, 2);
// listStyle.padding.left =
// listStyle.padding.right =
// listStyle.padding.top =
// listStyle.padding.bottom = 4;
// }
//
// private void OnGUI ()
// {
// int selectedItemIndex = comboBoxControl.GetSelectedItemIndex();
// selectedItemIndex = comboBoxControl.List(
// new Rect(50, 100, 100, 20), comboBoxList[selectedItemIndex].text, comboBoxList, listStyle );
// GUI.Label( new Rect(50, 70, 400, 21),
// "You picked " + comboBoxList[selectedItemIndex].text + "!" );
// }
// }
//
// =================================================
using UnityEngine;
public class ComboBox
{
private static bool forceToUnShow = false;
private static int useControlID = -1;
private bool isClickedComboButton = false;
private Vector2 scrollViewVector = Vector2.zero;
private int selectedItemIndex = 0;
private static ComboBox current = null;
public int List( Rect rect, string buttonText, GUIContent[] listContent, GUIStyle listStyle )
{
return List( rect, new GUIContent( buttonText ), listContent, "button", "box", listStyle );
}
public int List( Rect rect, GUIContent buttonContent, GUIContent[] listContent, GUIStyle listStyle )
{
return List( rect, buttonContent, listContent, "button", "box", listStyle);
}
public int List( Rect rect, string buttonText, GUIContent[] listContent, GUIStyle buttonStyle, GUIStyle boxStyle, GUIStyle listStyle )
{
return List( rect, new GUIContent( buttonText ), listContent, buttonStyle, boxStyle, listStyle );
}
public int List( Rect rect, GUIContent buttonContent, GUIContent[] listContent,
GUIStyle buttonStyle, GUIStyle boxStyle, GUIStyle listStyle )
{
if (current != null) {
if (current != this)
return selectedItemIndex;
}
if( forceToUnShow )
{
forceToUnShow = false;
isClickedComboButton = false;
}
bool done = false;
int controlID = GUIUtility.GetControlID( FocusType.Passive );
switch( Event.current.GetTypeForControl(controlID) )
{
case EventType.mouseUp:
{
if( isClickedComboButton )
{
done = true;
}
}
break;
}
if (GUI.Button (rect, buttonContent, buttonStyle)) {
if (current != null) {
if (current != this)
return selectedItemIndex;
} else
current = this;
if (useControlID == -1) {
useControlID = controlID;
//isClickedComboButton = false;
}
if (useControlID != controlID) {
forceToUnShow = true;
useControlID = controlID;
}
isClickedComboButton = true;
}
if( isClickedComboButton )
{
float items_height = listStyle.CalcHeight(listContent[0], 1.0f) * (listContent.Length + 5);
Rect listRect = new Rect( rect.x, rect.y + listStyle.CalcHeight(listContent[0], 1.0f), rect.width, items_height);
//GUILayout.BeginArea (listRect, listStyle);
scrollViewVector = GUI.BeginScrollView (new Rect (rect.x, rect.y + rect.height, rect.width * 1.4f, 200), scrollViewVector,
new Rect (rect.x, rect.y, rect.width, items_height + rect.height), false, false);
//GUI.color = new Color (1.0f, 1.0f, 1.0f, 0.5f); //0.5 is half opacity
// Texture2D myListBackGround = UtilModule.Instance.GetTexture(UtilModule.E_TEXTURE.black);
// GUI.DrawTexture(listRect, myListBackGround);
//var listColors = new Color32[2 * 2];
//for (int ii =0; ii<4;ii++) listColors[ii] = Color.black;
//boxStyle.normal.background.SetPixels32 (listColors);
//boxStyle.normal.background.Apply();
GUI.Box( new Rect(rect.x, rect.y, rect.width, items_height + rect.height) , "", boxStyle );
//GUI.color = Color.white;
//GUILayout.EndArea();
int newSelectedItemIndex = GUI.SelectionGrid( listRect, selectedItemIndex, listContent, 1, listStyle );
if( newSelectedItemIndex != selectedItemIndex ) {
selectedItemIndex = newSelectedItemIndex;
done = true;
}
GUI.EndScrollView();
}
if (done) {
isClickedComboButton = false;
forceToUnShow = false;
useControlID = -1;
current = null;
}
return GetSelectedItemIndex();
}
public int GetSelectedItemIndex()
{
return selectedItemIndex;
}
public void SetSelectedItemIndex(string str, GUIContent[] listContent)
{
for (int i = 0; i < listContent.Length; i++) {
if (listContent [i].text == str) {
selectedItemIndex = i;
return;
}
}
selectedItemIndex = 0;
}
}
}
#endif | {
"content_hash": "44f3065dd225cb3b0e8347b68a0fcbb0",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 136,
"avg_line_length": 30.34673366834171,
"alnum_prop": 0.6120218579234973,
"repo_name": "Kerbas-ad-astra/WasdEditorCameraContinued",
"id": "ed3e83945377db2edea2dc83d3b9d16153920453",
"size": "6041",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ComboBox.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2477"
},
{
"name": "C#",
"bytes": "141225"
}
],
"symlink_target": ""
} |
namespace Envoy {
namespace Extensions {
namespace NetworkFilters {
namespace Common {
namespace Redis {
class RedisCommandStats {
public:
RedisCommandStats(Stats::SymbolTable& symbol_table, const std::string& prefix);
// TODO (@FAYiEKcbD0XFqF2QK2E4viAHg8rMm2VbjYKdjTg): Use Singleton to manage a single
// RedisCommandStats on the client factory so that it can be used for proxy filter, discovery and
// health check.
static std::shared_ptr<RedisCommandStats>
createRedisCommandStats(Stats::SymbolTable& symbol_table) {
return std::make_shared<Common::Redis::RedisCommandStats>(symbol_table, "upstream_commands");
}
Stats::TimespanPtr createCommandTimer(Stats::Scope& scope, Stats::StatName command,
Envoy::TimeSource& time_source);
Stats::TimespanPtr createAggregateTimer(Stats::Scope& scope, Envoy::TimeSource& time_source);
Stats::StatName getCommandFromRequest(const RespValue& request);
void updateStatsTotal(Stats::Scope& scope, Stats::StatName command);
void updateStats(Stats::Scope& scope, Stats::StatName command, const bool success);
Stats::StatName getUnusedStatName() { return unused_metric_; }
private:
Stats::SymbolTable& symbol_table_;
Stats::StatNameSetPtr stat_name_set_;
const Stats::StatName prefix_;
const Stats::StatName upstream_rq_time_;
const Stats::StatName latency_;
const Stats::StatName total_;
const Stats::StatName success_;
const Stats::StatName failure_;
const Stats::StatName unused_metric_;
const Stats::StatName null_metric_;
const Stats::StatName unknown_metric_;
};
using RedisCommandStatsSharedPtr = std::shared_ptr<RedisCommandStats>;
} // namespace Redis
} // namespace Common
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy
| {
"content_hash": "5f1ceeeef1d498484ec48d6783713ad5",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 99,
"avg_line_length": 38.97826086956522,
"alnum_prop": 0.7479085331846068,
"repo_name": "envoyproxy/envoy",
"id": "f4ce6b51929173a341f7cd0fc1cfc598aec613e2",
"size": "2023",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "source/extensions/filters/network/common/redis/redis_command_stats.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "439"
},
{
"name": "C",
"bytes": "54172"
},
{
"name": "C++",
"bytes": "36279350"
},
{
"name": "CSS",
"bytes": "884"
},
{
"name": "Dockerfile",
"bytes": "891"
},
{
"name": "Emacs Lisp",
"bytes": "966"
},
{
"name": "Go",
"bytes": "558"
},
{
"name": "HTML",
"bytes": "582"
},
{
"name": "Java",
"bytes": "1309139"
},
{
"name": "JavaScript",
"bytes": "76"
},
{
"name": "Jinja",
"bytes": "46306"
},
{
"name": "Kotlin",
"bytes": "311319"
},
{
"name": "Makefile",
"bytes": "303"
},
{
"name": "NASL",
"bytes": "327095"
},
{
"name": "Objective-C",
"bytes": "95941"
},
{
"name": "PureBasic",
"bytes": "472"
},
{
"name": "Python",
"bytes": "630897"
},
{
"name": "Ruby",
"bytes": "47"
},
{
"name": "Rust",
"bytes": "38041"
},
{
"name": "Shell",
"bytes": "194810"
},
{
"name": "Smarty",
"bytes": "3528"
},
{
"name": "Starlark",
"bytes": "2229814"
},
{
"name": "Swift",
"bytes": "307285"
},
{
"name": "Thrift",
"bytes": "748"
}
],
"symlink_target": ""
} |
import sys, requests
# Get the public IP
pubIP = requests.get('http://169.254.169.254/latest/meta-data/public-ipv4')
url_base = 'http://'+pubIP.text+'/timeseries/'
for i in range(100):
requests.get(url_base+str(i))
| {
"content_hash": "0d8f8e84c68da625e747879a103ef208",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "slac207/cs207project",
"id": "6e04075b8d4d4e3a65ce9753ec7b7b0a37844e1b",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "provisioners/files/burn_in.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1416"
},
{
"name": "HTML",
"bytes": "4380"
},
{
"name": "JavaScript",
"bytes": "135139"
},
{
"name": "Jupyter Notebook",
"bytes": "59899"
},
{
"name": "Python",
"bytes": "274063"
},
{
"name": "Shell",
"bytes": "10378"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Wed Dec 10 00:37:02 EST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>org.apache.solr.morphlines.solr (Solr 4.10.3 API)</title>
<meta name="date" content="2014-12-10">
<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="org.apache.solr.morphlines.solr (Solr 4.10.3 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="../../../../../org/apache/solr/morphlines/solr/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Package</li>
<li>Next Package</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/morphlines/solr/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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 title="Package" class="title">Package org.apache.solr.morphlines.solr</h1>
<div class="docSummary">
<div class="block">Morphlines Solr related code.</div>
</div>
<p>See: <a href="#package_description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/DocumentLoader.html" title="interface in org.apache.solr.morphlines.solr">DocumentLoader</a></td>
<td class="colLast">
<div class="block">A vehicle to load a list of Solr documents into some kind of destination,
such as a SolrServer or MapReduce RecordWriter.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/GenerateSolrSequenceKeyBuilder.html" title="class in org.apache.solr.morphlines.solr">GenerateSolrSequenceKeyBuilder</a></td>
<td class="colLast">
<div class="block">A command that assigns a record unique key that is the concatenation of the given
<code>baseIdField</code> record field, followed by a running count of the record number within
the current session.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/LoadSolrBuilder.html" title="class in org.apache.solr.morphlines.solr">LoadSolrBuilder</a></td>
<td class="colLast">
<div class="block">A command that loads a record into a SolrServer or MapReduce SolrOutputFormat.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/SanitizeUnknownSolrFieldsBuilder.html" title="class in org.apache.solr.morphlines.solr">SanitizeUnknownSolrFieldsBuilder</a></td>
<td class="colLast">
<div class="block">Command that sanitizes record fields that are unknown to Solr schema.xml by either deleting them
(renameToPrefix is absent or a zero length string), or by moving them to a field prefixed with
the given renameToPrefix (e.g.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/SolrLocator.html" title="class in org.apache.solr.morphlines.solr">SolrLocator</a></td>
<td class="colLast">
<div class="block">Set of configuration parameters that identify the location and schema of a Solr server or
SolrCloud; Based on this information this class can return the schema and a corresponding
<a href="../../../../../org/apache/solr/morphlines/solr/DocumentLoader.html" title="interface in org.apache.solr.morphlines.solr"><code>DocumentLoader</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/SolrMorphlineContext.html" title="class in org.apache.solr.morphlines.solr">SolrMorphlineContext</a></td>
<td class="colLast">
<div class="block">A context that is specific to Solr.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/SolrMorphlineContext.Builder.html" title="class in org.apache.solr.morphlines.solr">SolrMorphlineContext.Builder</a></td>
<td class="colLast">
<div class="block">Helper to construct a <a href="../../../../../org/apache/solr/morphlines/solr/SolrMorphlineContext.html" title="class in org.apache.solr.morphlines.solr"><code>SolrMorphlineContext</code></a> instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/SolrServerDocumentLoader.html" title="class in org.apache.solr.morphlines.solr">SolrServerDocumentLoader</a></td>
<td class="colLast">
<div class="block">A vehicle to load a list of Solr documents into a local or remote <a href="../../../../../../solr-solrj/org/apache/solr/client/solrj/SolrServer.html?is-external=true" title="class or interface in org.apache.solr.client.solrj"><code>SolrServer</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/solr/morphlines/solr/TokenizeTextBuilder.html" title="class in org.apache.solr.morphlines.solr">TokenizeTextBuilder</a></td>
<td class="colLast">
<div class="block">A command that uses the embedded Solr/Lucene Analyzer library to generate tokens from a text
string, without sending data to a Solr server.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package_description">
<!-- -->
</a>
<h2 title="Package org.apache.solr.morphlines.solr Description">Package org.apache.solr.morphlines.solr Description</h2>
<div class="block">Morphlines Solr related code.</div>
</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="../../../../../org/apache/solr/morphlines/solr/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Package</li>
<li>Next Package</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/morphlines/solr/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
<i>Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
| {
"content_hash": "4812de6b3dd557ca8913b7c55fa20253",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 279,
"avg_line_length": 43.757709251101325,
"alnum_prop": 0.6442162488674117,
"repo_name": "71D3R/datos",
"id": "7f9b8f090fbcf2a188154b975da9f5e6acda53b6",
"size": "9933",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "solr-4.10.3/docs/solr-morphlines-core/org/apache/solr/morphlines/solr/package-summary.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "13815"
},
{
"name": "CSS",
"bytes": "351198"
},
{
"name": "HTML",
"bytes": "48540758"
},
{
"name": "JavaScript",
"bytes": "1245473"
},
{
"name": "Shell",
"bytes": "104672"
},
{
"name": "XSLT",
"bytes": "383925"
}
],
"symlink_target": ""
} |
'use strict';
const BlendWrapper = function (dataUri) {
this.dataUri = dataUri;
this.rootUri = '';
};
BlendWrapper.prototype.ImportMesh = function (sceneLoader, meshesNames, scene, onsuccess, progressCallBack, onerror) {
return sceneLoader.ImportMesh(meshesNames, this.rootUri, this.dataUri, scene, onsuccess, progressCallBack, onerror);
};
BlendWrapper.prototype.Load = function (sceneLoader, engine, onsuccess, progressCallBack, onerror) {
return sceneLoader.Load(this.rootUri, this.dataUri, engine, onsuccess, progressCallBack, onerror);
};
BlendWrapper.prototype.Append = function (sceneLoader, scene, onsuccess, progressCallBack, onerror) {
return sceneLoader.Append(this.rootUri, this.dataUri, scene, onsuccess, progressCallBack, onerror);
};
module.exports.BlendWrapper = BlendWrapper;
| {
"content_hash": "ee34baf8cada168b535bf3d8ca0f98e7",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 118,
"avg_line_length": 41.4,
"alnum_prop": 0.7608695652173914,
"repo_name": "binki/babylonjs-blender-loader",
"id": "0db9c5cd1dd607b83a1ebbe8901ca9ec557724eb",
"size": "828",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "runtime.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Emacs Lisp",
"bytes": "98"
},
{
"name": "JavaScript",
"bytes": "7482"
}
],
"symlink_target": ""
} |
import React from 'react'
import { Text as BaseText } from 'rebass/styled-components'
const Text = props => <BaseText color="primaryText" fontSize="m" lineHeight="normal" {...props} />
export default Text
| {
"content_hash": "7a1665671b450c4a25b4f626385618a3",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 98,
"avg_line_length": 34.5,
"alnum_prop": 0.7294685990338164,
"repo_name": "LN-Zap/zap-desktop",
"id": "c5611035c96cea8a3354c674f20e2b4e10e309be",
"size": "207",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "renderer/components/UI/Text.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "991"
},
{
"name": "HTML",
"bytes": "2169"
},
{
"name": "JavaScript",
"bytes": "1774251"
},
{
"name": "Shell",
"bytes": "605"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admins', '0003_auto_20160313_1839'),
]
operations = [
migrations.AddField(
model_name='availableproject',
name='published_date',
field=models.DateTimeField(blank=True, null=True),
),
]
| {
"content_hash": "116ca9e7a61f7317282c73431c29ca95",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 22.5,
"alnum_prop": 0.6098765432098765,
"repo_name": "adam2392/smile",
"id": "5fd7d5358c8fc58f263a05437818fdd54f0f1dbd",
"size": "477",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "smile/admins/migrations/0004_availableproject_published_date.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "137155"
},
{
"name": "HTML",
"bytes": "20461"
},
{
"name": "JavaScript",
"bytes": "5055"
},
{
"name": "Python",
"bytes": "21417"
}
],
"symlink_target": ""
} |
package com.shaheed.codewarior.checkboxdevelopers;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | {
"content_hash": "f216fbe7566a8553ff762048df8d1179",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 28.615384615384617,
"alnum_prop": 0.760752688172043,
"repo_name": "sdewan64/Profiler",
"id": "d1d0de33e80469d11340d319f3d7b969de88261a",
"size": "372",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/androidTest/java/com/shaheed/codewarior/checkboxdevelopers/ApplicationTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1431886"
}
],
"symlink_target": ""
} |
package org.nixos.idea.psi;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.PsiElement;
import com.intellij.lang.ASTNode;
import org.nixos.idea.psi.impl.*;
public interface NixTypes {
IElementType ADD_EXPR = new NixElementType("ADD_EXPR");
IElementType ATTR = new NixElementType("ATTR");
IElementType ATTRS = new NixElementType("ATTRS");
IElementType ATTR_ASSIGN = new NixElementType("ATTR_ASSIGN");
IElementType ATTR_PATH = new NixElementType("ATTR_PATH");
IElementType BINDS = new NixElementType("BINDS");
IElementType BIND_SET = new NixElementType("BIND_SET");
IElementType BN_LAMBDA = new NixElementType("BN_LAMBDA");
IElementType BOOL_EXPR = new NixElementType("BOOL_EXPR");
IElementType CALL_ARGS = new NixElementType("CALL_ARGS");
IElementType EVAL_EXPR = new NixElementType("EVAL_EXPR");
IElementType EXPR = new NixElementType("EXPR");
IElementType EXPR_APP = new NixElementType("EXPR_APP");
IElementType EXPR_FUNCTION = new NixElementType("EXPR_FUNCTION");
IElementType EXPR_IF = new NixElementType("EXPR_IF");
IElementType EXPR_LIST = new NixElementType("EXPR_LIST");
IElementType EXPR_OP = new NixElementType("EXPR_OP");
IElementType EXPR_SELECT = new NixElementType("EXPR_SELECT");
IElementType EXPR_SIMPLE = new NixElementType("EXPR_SIMPLE");
IElementType FACTOR = new NixElementType("FACTOR");
IElementType FN_LAMBDA = new NixElementType("FN_LAMBDA");
IElementType FORMAL = new NixElementType("FORMAL");
IElementType FORMALS = new NixElementType("FORMALS");
IElementType FORMAL_SET = new NixElementType("FORMAL_SET");
IElementType IMPORT_STMT = new NixElementType("IMPORT_STMT");
IElementType IND_STRING_PARTS = new NixElementType("IND_STRING_PARTS");
IElementType INHERIT_ATTRS = new NixElementType("INHERIT_ATTRS");
IElementType LAMBDA = new NixElementType("LAMBDA");
IElementType LET_IN = new NixElementType("LET_IN");
IElementType LITERAL = new NixElementType("LITERAL");
IElementType LOGICAL = new NixElementType("LOGICAL");
IElementType MUL_EXPR = new NixElementType("MUL_EXPR");
IElementType NIX_INIT = new NixElementType("NIX_INIT");
IElementType PATHS_ASSIGN = new NixElementType("PATHS_ASSIGN");
IElementType PATHS_EXPR = new NixElementType("PATHS_EXPR");
IElementType PATH_ASSIGN = new NixElementType("PATH_ASSIGN");
IElementType PATH_STMT = new NixElementType("PATH_STMT");
IElementType PRIMARY = new NixElementType("PRIMARY");
IElementType PURE_BIND = new NixElementType("PURE_BIND");
IElementType RELATIVE = new NixElementType("RELATIVE");
IElementType REL_EXPR = new NixElementType("REL_EXPR");
IElementType REQUIRE_EXPR = new NixElementType("REQUIRE_EXPR");
IElementType STRING_ATTR = new NixElementType("STRING_ATTR");
IElementType STRING_PARTS = new NixElementType("STRING_PARTS");
IElementType UNARY_OP = new NixElementType("UNARY_OP");
IElementType AND = new NixTokenType("&&");
IElementType ASSERT = new NixTokenType("assert");
IElementType ASSIGN = new NixTokenType("=");
IElementType BOOL = new NixTokenType("BOOL");
IElementType COLON = new NixTokenType(":");
IElementType COMMA = new NixTokenType(",");
IElementType CONCAT = new NixTokenType("++");
IElementType DIVIDE = new NixTokenType("/");
IElementType DOLLAR = new NixTokenType("$");
IElementType DOLLAR_CURLY = new NixTokenType("${");
IElementType DOT = new NixTokenType(".");
IElementType ELLIPSIS = new NixTokenType("...");
IElementType ELSE = new NixTokenType("else");
IElementType EQ = new NixTokenType("==");
IElementType FNUTT = new NixTokenType("\"");
IElementType GEQ = new NixTokenType(">=");
IElementType GT = new NixTokenType(">");
IElementType HPATH = new NixTokenType("HPATH");
IElementType ID = new NixTokenType("ID");
IElementType IF = new NixTokenType("if");
IElementType IMPL = new NixTokenType("->");
IElementType IMPORT = new NixTokenType("import");
IElementType IMPORTS = new NixTokenType("imports");
IElementType IN = new NixTokenType("in");
IElementType IND_STR = new NixTokenType("IND_STR");
IElementType IND_STRING_CLOSE = new NixTokenType("IND_STRING_CLOSE");
IElementType IND_STRING_OPEN = new NixTokenType("IND_STRING_OPEN");
IElementType INHERIT = new NixTokenType("inherit");
IElementType INT = new NixTokenType("INT");
IElementType IS = new NixTokenType("?");
IElementType LBRAC = new NixTokenType("[");
IElementType LCURLY = new NixTokenType("{");
IElementType LEQ = new NixTokenType("<=");
IElementType LET = new NixTokenType("let");
IElementType LPAREN = new NixTokenType("(");
IElementType LT = new NixTokenType("<");
IElementType MCOMMENT = new NixTokenType("MCOMMENT");
IElementType MINUS = new NixTokenType("-");
IElementType NAMED = new NixTokenType("@");
IElementType NEQ = new NixTokenType("!=");
IElementType NOT = new NixTokenType("!");
IElementType OR = new NixTokenType("||");
IElementType OR_KW = new NixTokenType("or");
IElementType OW_KW = new NixTokenType("OW_KW");
IElementType PATH = new NixTokenType("PATH");
IElementType PLUS = new NixTokenType("+");
IElementType RBRAC = new NixTokenType("]");
IElementType RCURLY = new NixTokenType("}");
IElementType REC = new NixTokenType("rec");
IElementType REQUIRE = new NixTokenType("require");
IElementType REQUIRES = new NixTokenType("requires");
IElementType RPAREN = new NixTokenType(")");
IElementType SCOMMENT = new NixTokenType("SCOMMENT");
IElementType SEMI = new NixTokenType(";");
IElementType SPATH = new NixTokenType("SPATH");
IElementType STR = new NixTokenType("STR");
IElementType THEN = new NixTokenType("then");
IElementType TIMES = new NixTokenType("*");
IElementType UPDATE = new NixTokenType("//");
IElementType URI = new NixTokenType("URI");
IElementType WITH = new NixTokenType("with");
class Factory {
public static PsiElement createElement(ASTNode node) {
IElementType type = node.getElementType();
if (type == ADD_EXPR) {
return new NixAddExprImpl(node);
}
else if (type == ATTR) {
return new NixAttrImpl(node);
}
else if (type == ATTRS) {
return new NixAttrsImpl(node);
}
else if (type == ATTR_ASSIGN) {
return new NixAttrAssignImpl(node);
}
else if (type == ATTR_PATH) {
return new NixAttrPathImpl(node);
}
else if (type == BINDS) {
return new NixBindsImpl(node);
}
else if (type == BIND_SET) {
return new NixBindSetImpl(node);
}
else if (type == BN_LAMBDA) {
return new NixBnLambdaImpl(node);
}
else if (type == BOOL_EXPR) {
return new NixBoolExprImpl(node);
}
else if (type == CALL_ARGS) {
return new NixCallArgsImpl(node);
}
else if (type == EVAL_EXPR) {
return new NixEvalExprImpl(node);
}
else if (type == EXPR) {
return new NixExprImpl(node);
}
else if (type == EXPR_APP) {
return new NixExprAppImpl(node);
}
else if (type == EXPR_FUNCTION) {
return new NixExprFunctionImpl(node);
}
else if (type == EXPR_IF) {
return new NixExprIfImpl(node);
}
else if (type == EXPR_LIST) {
return new NixExprListImpl(node);
}
else if (type == EXPR_OP) {
return new NixExprOpImpl(node);
}
else if (type == EXPR_SELECT) {
return new NixExprSelectImpl(node);
}
else if (type == EXPR_SIMPLE) {
return new NixExprSimpleImpl(node);
}
else if (type == FACTOR) {
return new NixFactorImpl(node);
}
else if (type == FN_LAMBDA) {
return new NixFnLambdaImpl(node);
}
else if (type == FORMAL) {
return new NixFormalImpl(node);
}
else if (type == FORMALS) {
return new NixFormalsImpl(node);
}
else if (type == FORMAL_SET) {
return new NixFormalSetImpl(node);
}
else if (type == IMPORT_STMT) {
return new NixImportStmtImpl(node);
}
else if (type == IND_STRING_PARTS) {
return new NixIndStringPartsImpl(node);
}
else if (type == INHERIT_ATTRS) {
return new NixInheritAttrsImpl(node);
}
else if (type == LAMBDA) {
return new NixLambdaImpl(node);
}
else if (type == LET_IN) {
return new NixLetInImpl(node);
}
else if (type == LITERAL) {
return new NixLiteralImpl(node);
}
else if (type == LOGICAL) {
return new NixLogicalImpl(node);
}
else if (type == MUL_EXPR) {
return new NixMulExprImpl(node);
}
else if (type == NIX_INIT) {
return new NixNixInitImpl(node);
}
else if (type == PATHS_ASSIGN) {
return new NixPathsAssignImpl(node);
}
else if (type == PATHS_EXPR) {
return new NixPathsExprImpl(node);
}
else if (type == PATH_ASSIGN) {
return new NixPathAssignImpl(node);
}
else if (type == PATH_STMT) {
return new NixPathStmtImpl(node);
}
else if (type == PRIMARY) {
return new NixPrimaryImpl(node);
}
else if (type == PURE_BIND) {
return new NixPureBindImpl(node);
}
else if (type == RELATIVE) {
return new NixRelativeImpl(node);
}
else if (type == REL_EXPR) {
return new NixRelExprImpl(node);
}
else if (type == REQUIRE_EXPR) {
return new NixRequireExprImpl(node);
}
else if (type == STRING_ATTR) {
return new NixStringAttrImpl(node);
}
else if (type == STRING_PARTS) {
return new NixStringPartsImpl(node);
}
else if (type == UNARY_OP) {
return new NixUnaryOpImpl(node);
}
throw new AssertionError("Unknown element type: " + type);
}
}
}
| {
"content_hash": "0dd175fd444da5f59602bb0e7e56fe09",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 73,
"avg_line_length": 38.181467181467184,
"alnum_prop": 0.6555769036302963,
"repo_name": "edwtjo/nixitch",
"id": "fba2c864a62c16577f024747d695bee37ec928ff",
"size": "9951",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gen/org/nixos/idea/psi/NixTypes.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "27971"
},
{
"name": "Lex",
"bytes": "5601"
},
{
"name": "Shell",
"bytes": "483"
}
],
"symlink_target": ""
} |
package org.openeos.services.ui.model;
public interface WindowAction {
int getOrder();
public boolean isVisibeForWindow(IWindow window);
public boolean isEnabledForWindow(IWindow window);
void run(IWindow window);
String getCaption();
}
| {
"content_hash": "ef3ab4bdc76918d459cc16763e26c291",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 15.625,
"alnum_prop": 0.772,
"repo_name": "frincon/openeos",
"id": "5cdc6621ff386a27720b3a4f2536362250bc0b22",
"size": "880",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/org.openeos.services.ui/src/main/java/org/openeos/services/ui/model/WindowAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "37665"
},
{
"name": "CSS",
"bytes": "439"
},
{
"name": "Groovy",
"bytes": "4095"
},
{
"name": "Java",
"bytes": "1395884"
},
{
"name": "Shell",
"bytes": "6138"
}
],
"symlink_target": ""
} |
set -euo pipefail
source ci/openstack/vars.sh
if [ "${RUN_OPENSTACK_CI:-}" != "true" ]; then
echo RUN_OPENSTACK_CI is set to false, skipping the openstack end to end test.
exit
fi
export PATH="$PWD/bin:$PATH"
ENV_ID="openshift-$TRAVIS_BUILD_NUMBER"
oc login --insecure-skip-tls-verify=true https://master-0.$ENV_ID.example.com:8443 -u test -p password
oc new-project test
oc new-app --template=cakephp-mysql-example
echo Waiting for the pods to come up
STATUS=timeout
for i in $(seq 600); do
if [ "$(oc status -v | grep 'deployment.*deployed' | wc -l)" -eq 2 ]; then
STATUS=success
echo Both pods were deployed
break
elif [ "$(oc status -v | grep -i 'error\|fail' | wc -l)" -gt 0 ]; then
STATUS=error
echo ERROR: The deployment failed
break
else
printf .
sleep 15
fi
done
if [ "$STATUS" = timeout ]; then
echo ERROR: Timed out waiting for the pods
fi
echo 'Output of `oc status -v`:'
oc status -v
echo
echo 'Output of `oc logs bc/cakephp-mysql-example`:'
oc logs bc/cakephp-mysql-example
if [ "$STATUS" != success ]; then
echo "ERROR: The deployment didn't succeed"
exit 1
fi
set -o pipefail
curl "http://cakephp-mysql-example-test.apps.$ENV_ID.example.com" | grep 'Welcome to your CakePHP application on OpenShift'
echo "SUCCESS \o/"
| {
"content_hash": "b8e375554d85e174a5d5eb0f0e6e39c1",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 123,
"avg_line_length": 24.944444444444443,
"alnum_prop": 0.6592427616926503,
"repo_name": "cooktheryan/openshift-ansible-contrib",
"id": "b47b64d22c6622958133b1ea46483c1e1c62707b",
"size": "1360",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ci/openstack/validate.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "20812"
},
{
"name": "Makefile",
"bytes": "252"
},
{
"name": "Python",
"bytes": "584932"
},
{
"name": "Ruby",
"bytes": "8062"
},
{
"name": "Shell",
"bytes": "110354"
}
],
"symlink_target": ""
} |
module Drivers
module Webserver
class Factory
def self.build(context, app, options = {})
engine = detect_engine(app, context.node, options)
raise StandardError, 'There is no supported Webserver driver for given configuration.' if engine.blank?
engine.new(context, app, options)
end
def self.detect_engine(app, node, _options)
Drivers::Webserver::Base.descendants.detect do |webserver_driver|
webserver_driver.allowed_engines.include?(
node['deploy'][app['shortname']][webserver_driver.driver_type].try(:[], 'adapter') ||
node['defaults'][webserver_driver.driver_type]['adapter']
)
end
end
end
end
end
| {
"content_hash": "8863fc607fd68f131f3000efb69fbca1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 111,
"avg_line_length": 34.42857142857143,
"alnum_prop": 0.6376210235131397,
"repo_name": "kpheasey/opsworks_ruby",
"id": "318d50b14cf041cff6684c036d7621f049955741",
"size": "754",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "libraries/drivers_webserver_factory.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1745"
},
{
"name": "HTML",
"bytes": "29474"
},
{
"name": "Ruby",
"bytes": "302267"
},
{
"name": "Shell",
"bytes": "195"
}
],
"symlink_target": ""
} |
@interface BIDBallNode ()
@property (nonatomic) CGVector velocityOfBall;
@end
@implementation BIDBallNode
- (instancetype) init{
if (self = [super init]) {
SKSpriteNode *ball = [SKSpriteNode spriteNodeWithImageNamed:@"Ball"];
[self initPhysicsBody];
[self addChild:ball];
}
return self;
}
- (void)initPhysicsBody {
SKPhysicsBody *body = [SKPhysicsBody bodyWithRectangleOfSize:
CGSizeMake(15, 15)];
//Physics of ball
body.friction = 0.0f;
body.restitution = 1.0f;
body.allowsRotation = NO;
body.linearDamping = 0.0f;
body.angularVelocity = .9;
body.mass = .07;
self.physicsBody = body;
[self.physicsBody applyImpulse:CGVectorMake(10.0f, -10.0f)];
}
@end
| {
"content_hash": "25dc81d02eb7795744eaf67cdd189761",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 20.945945945945947,
"alnum_prop": 0.632258064516129,
"repo_name": "zduford/PongSKGame_iOS",
"id": "14ca23bba2fa899b6b197cc3b1d097220222422d",
"size": "971",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PongSKGame/BIDBallNode.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "448"
},
{
"name": "C++",
"bytes": "1103"
},
{
"name": "Objective-C",
"bytes": "22909"
}
],
"symlink_target": ""
} |
package com.jakduk.api.notification;
import com.jakduk.api.common.Constants;
import com.jakduk.api.common.rabbitmq.EmailRoutingKey;
import com.jakduk.api.common.rabbitmq.RabbitMQPublisher;
import com.jakduk.api.common.util.JakdukUtils;
import com.jakduk.api.configuration.JakdukProperties;
import com.jakduk.api.mail.EmailService;
import com.jakduk.api.model.rabbitmq.EmailPayload;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.mail.MessagingException;
import java.util.HashMap;
import java.util.Locale;
/**
* Created by pyohwan on 16. 9. 11.
*/
public class NotificationTest {
@Resource
private JakdukProperties jakdukProperties;
@Autowired
private EmailService emailService;
@Autowired
private RabbitMQPublisher rabbitMQPublisher;
@Disabled
@Test
public void 메일발송() throws MessagingException {
Locale locale = Locale.KOREAN;
emailService.sendMailWithInline("Pyohwan", "phjang1983@daum.net", locale);
}
@Disabled
@Test
public void 가입메일() throws MessagingException {
EmailPayload emailPayload = new EmailPayload();
emailPayload.setLocale(Locale.KOREAN);
emailPayload.setType(Constants.EMAIL_TYPE.WELCOME);
emailPayload.setRecipientEmail("phjang1983@daum.net");
emailPayload.setSubject("가입 메일 연습");
emailPayload.setBody(
new HashMap<String, Object>() {
{
put("username", "이은상");
}
}
);
emailService.sendBulk(emailPayload);
}
@Disabled
@Test
public void 비밀번호_갱신() throws MessagingException {
EmailPayload emailPayload = new EmailPayload();
emailPayload.setLocale(Locale.KOREA);
emailPayload.setType(Constants.EMAIL_TYPE.RESET_PASSWORD);
emailPayload.setRecipientEmail("phjang1983@daum.net");
emailPayload.setSubject("jakduk.com-" + JakdukUtils.getMessageSource("email.user.password.reset.about"));
emailPayload.setExtra(
new HashMap<String, String>() {
{
put("host", "http://localhost:8080");
}
}
);
emailPayload.setBody(
new HashMap<String, Object>() {
{
put("email", "phjang1983@daum.net");
}
}
);
emailService.sendResetPassword(emailPayload);
}
@Disabled
@Test
public void testSendBulk() throws MessagingException {
EmailPayload emailPayload = new EmailPayload();
emailPayload.setLocale(Locale.KOREAN);
emailPayload.setType(Constants.EMAIL_TYPE.BULK);
emailPayload.setTemplateName("mail/bulk01");
emailPayload.setRecipientEmail("phjang1983@daum.net");
emailPayload.setSubject("단체 메일 연습");
emailPayload.setBody(
new HashMap<String, Object>() {
{
put("username", "이은상");
}
}
);
emailService.sendBulk(emailPayload);
}
@Disabled
@Test
public void sendWelcomeWithRabbitMQ() throws InterruptedException {
EmailPayload emailPayload = new EmailPayload();
emailPayload.setLocale(Locale.KOREAN);
emailPayload.setType(Constants.EMAIL_TYPE.WELCOME);
emailPayload.setRecipientEmail("phjang1983@daum.net");
emailPayload.setSubject("K리그 작두왕에 오신것을 환영합니다.");
emailPayload.setBody(
new HashMap<String, Object>() {
{
put("username", "이은상");
}
}
);
String routingKey = jakdukProperties.getRabbitmq()
.getRoutingKeys()
.get(EmailRoutingKey.EMAIL_WELCOME.getRoutingKey());
rabbitMQPublisher.publishEmail(routingKey, emailPayload);
Thread.sleep(1000 * 5);
}
@Disabled
@Test
public void sendResetPasswordWithRabbitMQ() throws InterruptedException {
EmailPayload emailPayload = new EmailPayload();
emailPayload.setLocale(Locale.KOREA);
emailPayload.setType(Constants.EMAIL_TYPE.RESET_PASSWORD);
emailPayload.setRecipientEmail("phjang1983@daum.net");
emailPayload.setSubject("jakduk.com-" + JakdukUtils.getMessageSource("email.user.password.reset.about"));
emailPayload.setExtra(
new HashMap<String, String>() {
{
put("host", "http://localhost:8080");
}
}
);
emailPayload.setBody(
new HashMap<String, Object>() {
{
put("email", "phjang1983@daum.net");
}
}
);
String routingKey = jakdukProperties.getRabbitmq()
.getRoutingKeys()
.get(EmailRoutingKey.EMAIL_RESET_PASSWORD.getRoutingKey());
rabbitMQPublisher.publishEmail(routingKey, emailPayload);
Thread.sleep(1000 * 5);
}
}
| {
"content_hash": "d96c9085fd5b61b4244ffb60b85d77e0",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 107,
"avg_line_length": 25.270588235294117,
"alnum_prop": 0.7360335195530726,
"repo_name": "JakduK/jakduk-api",
"id": "d29d4aa75657f34ca2c3f7af3269d51e7143722f",
"size": "4396",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/java/com/jakduk/api/notification/NotificationTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "9549"
},
{
"name": "Java",
"bytes": "675119"
}
],
"symlink_target": ""
} |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# 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
#
# https://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.
"""Accesses the google.cloud.kms.v1 KeyManagementService API."""
import functools
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.gapic_v1.routing_header
import google.api_core.grpc_helpers
import google.api_core.page_iterator
import google.api_core.path_template
import grpc
from google.cloud.kms_v1.gapic import enums
from google.cloud.kms_v1.gapic import key_management_service_client_config
from google.cloud.kms_v1.gapic.transports import key_management_service_grpc_transport
from google.cloud.kms_v1.proto import resources_pb2
from google.cloud.kms_v1.proto import service_pb2
from google.cloud.kms_v1.proto import service_pb2_grpc
from google.iam.v1 import iam_policy_pb2
from google.iam.v1 import policy_pb2
from google.protobuf import field_mask_pb2
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
'google-cloud-kms', ).version
class KeyManagementServiceClient(object):
"""
Google Cloud Key Management Service
Manages cryptographic keys and operations using those keys. Implements a
REST model with the following objects:
- ``KeyRing``
- ``CryptoKey``
- ``CryptoKeyVersion``
If you are using manual gRPC libraries, see `Using gRPC with Cloud
KMS <https://cloud.google.com/kms/docs/grpc>`__.
"""
SERVICE_ADDRESS = 'cloudkms.googleapis.com:443'
"""The default address of the service."""
# The name of the interface for this client. This is the key used to
# find the method configuration in the client_config dictionary.
_INTERFACE_NAME = 'google.cloud.kms.v1.KeyManagementService'
@classmethod
def from_service_account_file(cls, filename, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
KeyManagementServiceClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(
filename)
kwargs['credentials'] = credentials
return cls(*args, **kwargs)
from_service_account_json = from_service_account_file
@classmethod
def key_ring_path(cls, project, location, key_ring):
"""Return a fully-qualified key_ring string."""
return google.api_core.path_template.expand(
'projects/{project}/locations/{location}/keyRings/{key_ring}',
project=project,
location=location,
key_ring=key_ring,
)
@classmethod
def crypto_key_path_path(cls, project, location, key_ring,
crypto_key_path):
"""Return a fully-qualified crypto_key_path string."""
return google.api_core.path_template.expand(
'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}',
project=project,
location=location,
key_ring=key_ring,
crypto_key_path=crypto_key_path,
)
@classmethod
def location_path(cls, project, location):
"""Return a fully-qualified location string."""
return google.api_core.path_template.expand(
'projects/{project}/locations/{location}',
project=project,
location=location,
)
@classmethod
def crypto_key_path(cls, project, location, key_ring, crypto_key):
"""Return a fully-qualified crypto_key string."""
return google.api_core.path_template.expand(
'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}',
project=project,
location=location,
key_ring=key_ring,
crypto_key=crypto_key,
)
@classmethod
def crypto_key_version_path(cls, project, location, key_ring, crypto_key,
crypto_key_version):
"""Return a fully-qualified crypto_key_version string."""
return google.api_core.path_template.expand(
'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}',
project=project,
location=location,
key_ring=key_ring,
crypto_key=crypto_key,
crypto_key_version=crypto_key_version,
)
def __init__(self,
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None):
"""Constructor.
Args:
transport (Union[~.KeyManagementServiceGrpcTransport,
Callable[[~.Credentials, type], ~.KeyManagementServiceGrpcTransport]): A transport
instance, responsible for actually making the API calls.
The default transport uses the gRPC protocol.
This argument may also be a callable which returns a
transport instance. Callables will be sent the credentials
as the first argument and the default transport class as
the second argument.
channel (grpc.Channel): DEPRECATED. A ``Channel`` instance
through which to make calls. This argument is mutually exclusive
with ``credentials``; providing both will raise an exception.
credentials (google.auth.credentials.Credentials): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If none
are specified, the client will attempt to ascertain the
credentials from the environment.
This argument is mutually exclusive with providing a
transport instance to ``transport``; doing so will raise
an exception.
client_config (dict): DEPRECATED. A dictionary of call options for
each method. If not specified, the default configuration is used.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
"""
# Raise deprecation warnings for things we want to go away.
if client_config is not None:
warnings.warn(
'The `client_config` argument is deprecated.',
PendingDeprecationWarning,
stacklevel=2)
else:
client_config = key_management_service_client_config.config
if channel:
warnings.warn(
'The `channel` argument is deprecated; use '
'`transport` instead.',
PendingDeprecationWarning,
stacklevel=2)
# Instantiate the transport.
# The transport is responsible for handling serialization and
# deserialization and actually sending data to the service.
if transport:
if callable(transport):
self.transport = transport(
credentials=credentials,
default_class=key_management_service_grpc_transport.
KeyManagementServiceGrpcTransport,
)
else:
if credentials:
raise ValueError(
'Received both a transport instance and '
'credentials; these are mutually exclusive.')
self.transport = transport
else:
self.transport = key_management_service_grpc_transport.KeyManagementServiceGrpcTransport(
address=self.SERVICE_ADDRESS,
channel=channel,
credentials=credentials,
)
if client_info is None:
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version=_GAPIC_LIBRARY_VERSION, )
else:
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
self._client_info = client_info
# Parse out the default settings for retry and timeout for each RPC
# from the client configuration.
# (Ordinarily, these are the defaults specified in the `*_config.py`
# file next to this one.)
self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
client_config['interfaces'][self._INTERFACE_NAME], )
# Save a dictionary of cached API call functions.
# These are the actual callables which invoke the proper
# transport methods, wrapped with `wrap_method` to add retry,
# timeout, and the like.
self._inner_api_calls = {}
# Service calls
def list_key_rings(self,
parent,
page_size=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Lists ``KeyRings``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.location_path('[PROJECT]', '[LOCATION]')
>>>
>>> # Iterate over all results
>>> for element in client.list_key_rings(parent):
... # process element
... pass
>>>
>>>
>>> # Alternatively:
>>>
>>> # Iterate over results one page at a time
>>> for page in client.list_key_rings(parent).pages:
... for element in page:
... # process element
... pass
Args:
parent (str): Required. The resource name of the location associated with the
``KeyRings``, in the format ``projects/*/locations/*``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
streaming is performed per-page, this determines the maximum number
of resources in a page.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.gax.PageIterator` instance. By default, this
is an iterable of :class:`~google.cloud.kms_v1.types.KeyRing` instances.
This object can also be configured to iterate over the pages
of the response through the `options` parameter.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'list_key_rings' not in self._inner_api_calls:
self._inner_api_calls[
'list_key_rings'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.list_key_rings,
default_retry=self._method_configs['ListKeyRings'].retry,
default_timeout=self._method_configs['ListKeyRings'].
timeout,
client_info=self._client_info,
)
request = service_pb2.ListKeyRingsRequest(
parent=parent,
page_size=page_size,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
iterator = google.api_core.page_iterator.GRPCIterator(
client=None,
method=functools.partial(
self._inner_api_calls['list_key_rings'],
retry=retry,
timeout=timeout,
metadata=metadata),
request=request,
items_field='key_rings',
request_token_field='page_token',
response_token_field='next_page_token',
)
return iterator
def list_crypto_keys(self,
parent,
page_size=None,
version_view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Lists ``CryptoKeys``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>>
>>> # Iterate over all results
>>> for element in client.list_crypto_keys(parent):
... # process element
... pass
>>>
>>>
>>> # Alternatively:
>>>
>>> # Iterate over results one page at a time
>>> for page in client.list_crypto_keys(parent).pages:
... for element in page:
... # process element
... pass
Args:
parent (str): Required. The resource name of the ``KeyRing`` to list, in the format
``projects/*/locations/*/keyRings/*``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
streaming is performed per-page, this determines the maximum number
of resources in a page.
version_view (~google.cloud.kms_v1.types.CryptoKeyVersionView): The fields of the primary version to include in the response.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.gax.PageIterator` instance. By default, this
is an iterable of :class:`~google.cloud.kms_v1.types.CryptoKey` instances.
This object can also be configured to iterate over the pages
of the response through the `options` parameter.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'list_crypto_keys' not in self._inner_api_calls:
self._inner_api_calls[
'list_crypto_keys'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.list_crypto_keys,
default_retry=self._method_configs['ListCryptoKeys'].retry,
default_timeout=self._method_configs['ListCryptoKeys'].
timeout,
client_info=self._client_info,
)
request = service_pb2.ListCryptoKeysRequest(
parent=parent,
page_size=page_size,
version_view=version_view,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
iterator = google.api_core.page_iterator.GRPCIterator(
client=None,
method=functools.partial(
self._inner_api_calls['list_crypto_keys'],
retry=retry,
timeout=timeout,
metadata=metadata),
request=request,
items_field='crypto_keys',
request_token_field='page_token',
response_token_field='next_page_token',
)
return iterator
def list_crypto_key_versions(
self,
parent,
page_size=None,
view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Lists ``CryptoKeyVersions``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.crypto_key_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]')
>>>
>>> # Iterate over all results
>>> for element in client.list_crypto_key_versions(parent):
... # process element
... pass
>>>
>>>
>>> # Alternatively:
>>>
>>> # Iterate over results one page at a time
>>> for page in client.list_crypto_key_versions(parent).pages:
... for element in page:
... # process element
... pass
Args:
parent (str): Required. The resource name of the ``CryptoKey`` to list, in the format
``projects/*/locations/*/keyRings/*/cryptoKeys/*``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
streaming is performed per-page, this determines the maximum number
of resources in a page.
view (~google.cloud.kms_v1.types.CryptoKeyVersionView): The fields to include in the response.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.gax.PageIterator` instance. By default, this
is an iterable of :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instances.
This object can also be configured to iterate over the pages
of the response through the `options` parameter.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'list_crypto_key_versions' not in self._inner_api_calls:
self._inner_api_calls[
'list_crypto_key_versions'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.list_crypto_key_versions,
default_retry=self.
_method_configs['ListCryptoKeyVersions'].retry,
default_timeout=self.
_method_configs['ListCryptoKeyVersions'].timeout,
client_info=self._client_info,
)
request = service_pb2.ListCryptoKeyVersionsRequest(
parent=parent,
page_size=page_size,
view=view,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
iterator = google.api_core.page_iterator.GRPCIterator(
client=None,
method=functools.partial(
self._inner_api_calls['list_crypto_key_versions'],
retry=retry,
timeout=timeout,
metadata=metadata),
request=request,
items_field='crypto_key_versions',
request_token_field='page_token',
response_token_field='next_page_token',
)
return iterator
def get_key_ring(self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Returns metadata for a given ``KeyRing``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>>
>>> response = client.get_key_ring(name)
Args:
name (str): The ``name`` of the ``KeyRing`` to get.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.KeyRing` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'get_key_ring' not in self._inner_api_calls:
self._inner_api_calls[
'get_key_ring'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_key_ring,
default_retry=self._method_configs['GetKeyRing'].retry,
default_timeout=self._method_configs['GetKeyRing'].timeout,
client_info=self._client_info,
)
request = service_pb2.GetKeyRingRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['get_key_ring'](
request, retry=retry, timeout=timeout, metadata=metadata)
def get_crypto_key(self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Returns metadata for a given ``CryptoKey``, as well as its ``primary``
``CryptoKeyVersion``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]')
>>>
>>> response = client.get_crypto_key(name)
Args:
name (str): The ``name`` of the ``CryptoKey`` to get.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKey` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'get_crypto_key' not in self._inner_api_calls:
self._inner_api_calls[
'get_crypto_key'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_crypto_key,
default_retry=self._method_configs['GetCryptoKey'].retry,
default_timeout=self._method_configs['GetCryptoKey'].
timeout,
client_info=self._client_info,
)
request = service_pb2.GetCryptoKeyRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['get_crypto_key'](
request, retry=retry, timeout=timeout, metadata=metadata)
def get_crypto_key_version(self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Returns metadata for a given ``CryptoKeyVersion``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> response = client.get_crypto_key_version(name)
Args:
name (str): The ``name`` of the ``CryptoKeyVersion`` to get.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'get_crypto_key_version' not in self._inner_api_calls:
self._inner_api_calls[
'get_crypto_key_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_crypto_key_version,
default_retry=self._method_configs['GetCryptoKeyVersion'].
retry,
default_timeout=self.
_method_configs['GetCryptoKeyVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.GetCryptoKeyVersionRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['get_crypto_key_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def create_key_ring(self,
parent,
key_ring_id,
key_ring,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Create a new ``KeyRing`` in a given Project and Location.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.location_path('[PROJECT]', '[LOCATION]')
>>>
>>> # TODO: Initialize `key_ring_id`:
>>> key_ring_id = ''
>>>
>>> # TODO: Initialize `key_ring`:
>>> key_ring = {}
>>>
>>> response = client.create_key_ring(parent, key_ring_id, key_ring)
Args:
parent (str): Required. The resource name of the location associated with the
``KeyRings``, in the format ``projects/*/locations/*``.
key_ring_id (str): Required. It must be unique within a location and match the regular
expression ``[a-zA-Z0-9_-]{1,63}``
key_ring (Union[dict, ~google.cloud.kms_v1.types.KeyRing]): A ``KeyRing`` with initial field values.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.KeyRing`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.KeyRing` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'create_key_ring' not in self._inner_api_calls:
self._inner_api_calls[
'create_key_ring'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.create_key_ring,
default_retry=self._method_configs['CreateKeyRing'].retry,
default_timeout=self._method_configs['CreateKeyRing'].
timeout,
client_info=self._client_info,
)
request = service_pb2.CreateKeyRingRequest(
parent=parent,
key_ring_id=key_ring_id,
key_ring=key_ring,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['create_key_ring'](
request, retry=retry, timeout=timeout, metadata=metadata)
def create_crypto_key(self,
parent,
crypto_key_id,
crypto_key,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Create a new ``CryptoKey`` within a ``KeyRing``.
``CryptoKey.purpose`` and ``CryptoKey.version_template.algorithm`` are
required.
Example:
>>> from google.cloud import kms_v1
>>> from google.cloud.kms_v1 import enums
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>> crypto_key_id = 'my-app-key'
>>> purpose = enums.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT
>>> seconds = 2147483647
>>> next_rotation_time = {'seconds': seconds}
>>> seconds_2 = 604800
>>> rotation_period = {'seconds': seconds_2}
>>> crypto_key = {'purpose': purpose, 'next_rotation_time': next_rotation_time, 'rotation_period': rotation_period}
>>>
>>> response = client.create_crypto_key(parent, crypto_key_id, crypto_key)
Args:
parent (str): Required. The ``name`` of the KeyRing associated with the
``CryptoKeys``.
crypto_key_id (str): Required. It must be unique within a KeyRing and match the regular
expression ``[a-zA-Z0-9_-]{1,63}``
crypto_key (Union[dict, ~google.cloud.kms_v1.types.CryptoKey]): A ``CryptoKey`` with initial field values.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.CryptoKey`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKey` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'create_crypto_key' not in self._inner_api_calls:
self._inner_api_calls[
'create_crypto_key'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.create_crypto_key,
default_retry=self._method_configs['CreateCryptoKey'].
retry,
default_timeout=self._method_configs['CreateCryptoKey'].
timeout,
client_info=self._client_info,
)
request = service_pb2.CreateCryptoKeyRequest(
parent=parent,
crypto_key_id=crypto_key_id,
crypto_key=crypto_key,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['create_crypto_key'](
request, retry=retry, timeout=timeout, metadata=metadata)
def create_crypto_key_version(
self,
parent,
crypto_key_version,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Create a new ``CryptoKeyVersion`` in a ``CryptoKey``.
The server will assign the next sequential id. If unset, ``state`` will
be set to ``ENABLED``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> parent = client.crypto_key_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]')
>>>
>>> # TODO: Initialize `crypto_key_version`:
>>> crypto_key_version = {}
>>>
>>> response = client.create_crypto_key_version(parent, crypto_key_version)
Args:
parent (str): Required. The ``name`` of the ``CryptoKey`` associated with the
``CryptoKeyVersions``.
crypto_key_version (Union[dict, ~google.cloud.kms_v1.types.CryptoKeyVersion]): A ``CryptoKeyVersion`` with initial field values.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.CryptoKeyVersion`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'create_crypto_key_version' not in self._inner_api_calls:
self._inner_api_calls[
'create_crypto_key_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.create_crypto_key_version,
default_retry=self.
_method_configs['CreateCryptoKeyVersion'].retry,
default_timeout=self.
_method_configs['CreateCryptoKeyVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.CreateCryptoKeyVersionRequest(
parent=parent,
crypto_key_version=crypto_key_version,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('parent', parent)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['create_crypto_key_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def update_crypto_key(self,
crypto_key,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Update a ``CryptoKey``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> # TODO: Initialize `crypto_key`:
>>> crypto_key = {}
>>>
>>> # TODO: Initialize `update_mask`:
>>> update_mask = {}
>>>
>>> response = client.update_crypto_key(crypto_key, update_mask)
Args:
crypto_key (Union[dict, ~google.cloud.kms_v1.types.CryptoKey]): ``CryptoKey`` with updated values.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.CryptoKey`
update_mask (Union[dict, ~google.cloud.kms_v1.types.FieldMask]): Required list of fields to be updated in this request.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.FieldMask`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKey` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'update_crypto_key' not in self._inner_api_calls:
self._inner_api_calls[
'update_crypto_key'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.update_crypto_key,
default_retry=self._method_configs['UpdateCryptoKey'].
retry,
default_timeout=self._method_configs['UpdateCryptoKey'].
timeout,
client_info=self._client_info,
)
request = service_pb2.UpdateCryptoKeyRequest(
crypto_key=crypto_key,
update_mask=update_mask,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('crypto_key.name', crypto_key.name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['update_crypto_key'](
request, retry=retry, timeout=timeout, metadata=metadata)
def update_crypto_key_version(
self,
crypto_key_version,
update_mask,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Update a ``CryptoKeyVersion``'s metadata.
``state`` may be changed between ``ENABLED`` and ``DISABLED`` using this
method. See ``DestroyCryptoKeyVersion`` and ``RestoreCryptoKeyVersion``
to move between other states.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> # TODO: Initialize `crypto_key_version`:
>>> crypto_key_version = {}
>>>
>>> # TODO: Initialize `update_mask`:
>>> update_mask = {}
>>>
>>> response = client.update_crypto_key_version(crypto_key_version, update_mask)
Args:
crypto_key_version (Union[dict, ~google.cloud.kms_v1.types.CryptoKeyVersion]): ``CryptoKeyVersion`` with updated values.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.CryptoKeyVersion`
update_mask (Union[dict, ~google.cloud.kms_v1.types.FieldMask]): Required list of fields to be updated in this request.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.FieldMask`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'update_crypto_key_version' not in self._inner_api_calls:
self._inner_api_calls[
'update_crypto_key_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.update_crypto_key_version,
default_retry=self.
_method_configs['UpdateCryptoKeyVersion'].retry,
default_timeout=self.
_method_configs['UpdateCryptoKeyVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.UpdateCryptoKeyVersionRequest(
crypto_key_version=crypto_key_version,
update_mask=update_mask,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('crypto_key_version.name',
crypto_key_version.name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['update_crypto_key_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def encrypt(self,
name,
plaintext,
additional_authenticated_data=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Encrypts data, so that it can only be recovered by a call to
``Decrypt``. The ``CryptoKey.purpose`` must be ``ENCRYPT_DECRYPT``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_path_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY_PATH]')
>>>
>>> # TODO: Initialize `plaintext`:
>>> plaintext = b''
>>>
>>> response = client.encrypt(name, plaintext)
Args:
name (str): Required. The resource name of the ``CryptoKey`` or ``CryptoKeyVersion``
to use for encryption.
If a ``CryptoKey`` is specified, the server will use its
``primary version``.
plaintext (bytes): Required. The data to encrypt. Must be no larger than 64KiB.
The maximum size depends on the key version's ``protection_level``. For
``SOFTWARE`` keys, the plaintext must be no larger than 64KiB. For
``HSM`` keys, the combined length of the plaintext and
additional\_authenticated\_data fields must be no larger than 8KiB.
additional_authenticated_data (bytes): Optional data that, if specified, must also be provided during
decryption through ``DecryptRequest.additional_authenticated_data``.
The maximum size depends on the key version's ``protection_level``. For
``SOFTWARE`` keys, the AAD must be no larger than 64KiB. For ``HSM``
keys, the combined length of the plaintext and
additional\_authenticated\_data fields must be no larger than 8KiB.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.EncryptResponse` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'encrypt' not in self._inner_api_calls:
self._inner_api_calls[
'encrypt'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.encrypt,
default_retry=self._method_configs['Encrypt'].retry,
default_timeout=self._method_configs['Encrypt'].timeout,
client_info=self._client_info,
)
request = service_pb2.EncryptRequest(
name=name,
plaintext=plaintext,
additional_authenticated_data=additional_authenticated_data,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['encrypt'](
request, retry=retry, timeout=timeout, metadata=metadata)
def decrypt(self,
name,
ciphertext,
additional_authenticated_data=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Decrypts data that was protected by ``Encrypt``. The
``CryptoKey.purpose`` must be ``ENCRYPT_DECRYPT``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]')
>>>
>>> # TODO: Initialize `ciphertext`:
>>> ciphertext = b''
>>>
>>> response = client.decrypt(name, ciphertext)
Args:
name (str): Required. The resource name of the ``CryptoKey`` to use for decryption.
The server will choose the appropriate version.
ciphertext (bytes): Required. The encrypted data originally returned in
``EncryptResponse.ciphertext``.
additional_authenticated_data (bytes): Optional data that must match the data originally supplied in
``EncryptRequest.additional_authenticated_data``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.DecryptResponse` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'decrypt' not in self._inner_api_calls:
self._inner_api_calls[
'decrypt'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.decrypt,
default_retry=self._method_configs['Decrypt'].retry,
default_timeout=self._method_configs['Decrypt'].timeout,
client_info=self._client_info,
)
request = service_pb2.DecryptRequest(
name=name,
ciphertext=ciphertext,
additional_authenticated_data=additional_authenticated_data,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['decrypt'](
request, retry=retry, timeout=timeout, metadata=metadata)
def update_crypto_key_primary_version(
self,
name,
crypto_key_version_id,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Update the version of a ``CryptoKey`` that will be used in ``Encrypt``.
Returns an error if called on an asymmetric key.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]')
>>>
>>> # TODO: Initialize `crypto_key_version_id`:
>>> crypto_key_version_id = ''
>>>
>>> response = client.update_crypto_key_primary_version(name, crypto_key_version_id)
Args:
name (str): The resource name of the ``CryptoKey`` to update.
crypto_key_version_id (str): The id of the child ``CryptoKeyVersion`` to use as primary.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKey` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'update_crypto_key_primary_version' not in self._inner_api_calls:
self._inner_api_calls[
'update_crypto_key_primary_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.update_crypto_key_primary_version,
default_retry=self.
_method_configs['UpdateCryptoKeyPrimaryVersion'].retry,
default_timeout=self.
_method_configs['UpdateCryptoKeyPrimaryVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.UpdateCryptoKeyPrimaryVersionRequest(
name=name,
crypto_key_version_id=crypto_key_version_id,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['update_crypto_key_primary_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def destroy_crypto_key_version(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Schedule a ``CryptoKeyVersion`` for destruction.
Upon calling this method, ``CryptoKeyVersion.state`` will be set to
``DESTROY_SCHEDULED`` and ``destroy_time`` will be set to a time 24
hours in the future, at which point the ``state`` will be changed to
``DESTROYED``, and the key material will be irrevocably destroyed.
Before the ``destroy_time`` is reached, ``RestoreCryptoKeyVersion`` may
be called to reverse the process.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> response = client.destroy_crypto_key_version(name)
Args:
name (str): The resource name of the ``CryptoKeyVersion`` to destroy.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'destroy_crypto_key_version' not in self._inner_api_calls:
self._inner_api_calls[
'destroy_crypto_key_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.destroy_crypto_key_version,
default_retry=self.
_method_configs['DestroyCryptoKeyVersion'].retry,
default_timeout=self.
_method_configs['DestroyCryptoKeyVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.DestroyCryptoKeyVersionRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['destroy_crypto_key_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def restore_crypto_key_version(
self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Restore a ``CryptoKeyVersion`` in the ``DESTROY_SCHEDULED`` state.
Upon restoration of the CryptoKeyVersion, ``state`` will be set to
``DISABLED``, and ``destroy_time`` will be cleared.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> response = client.restore_crypto_key_version(name)
Args:
name (str): The resource name of the ``CryptoKeyVersion`` to restore.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.CryptoKeyVersion` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'restore_crypto_key_version' not in self._inner_api_calls:
self._inner_api_calls[
'restore_crypto_key_version'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.restore_crypto_key_version,
default_retry=self.
_method_configs['RestoreCryptoKeyVersion'].retry,
default_timeout=self.
_method_configs['RestoreCryptoKeyVersion'].timeout,
client_info=self._client_info,
)
request = service_pb2.RestoreCryptoKeyVersionRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['restore_crypto_key_version'](
request, retry=retry, timeout=timeout, metadata=metadata)
def get_public_key(self,
name,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Returns the public key for the given ``CryptoKeyVersion``. The
``CryptoKey.purpose`` must be ``ASYMMETRIC_SIGN`` or
``ASYMMETRIC_DECRYPT``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> response = client.get_public_key(name)
Args:
name (str): The ``name`` of the ``CryptoKeyVersion`` public key to get.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.PublicKey` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'get_public_key' not in self._inner_api_calls:
self._inner_api_calls[
'get_public_key'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_public_key,
default_retry=self._method_configs['GetPublicKey'].retry,
default_timeout=self._method_configs['GetPublicKey'].
timeout,
client_info=self._client_info,
)
request = service_pb2.GetPublicKeyRequest(name=name, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['get_public_key'](
request, retry=retry, timeout=timeout, metadata=metadata)
def asymmetric_decrypt(self,
name,
ciphertext,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Decrypts data that was encrypted with a public key retrieved from
``GetPublicKey`` corresponding to a ``CryptoKeyVersion`` with
``CryptoKey.purpose`` ASYMMETRIC\_DECRYPT.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> # TODO: Initialize `ciphertext`:
>>> ciphertext = b''
>>>
>>> response = client.asymmetric_decrypt(name, ciphertext)
Args:
name (str): Required. The resource name of the ``CryptoKeyVersion`` to use for
decryption.
ciphertext (bytes): Required. The data encrypted with the named ``CryptoKeyVersion``'s
public key using OAEP.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.AsymmetricDecryptResponse` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'asymmetric_decrypt' not in self._inner_api_calls:
self._inner_api_calls[
'asymmetric_decrypt'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.asymmetric_decrypt,
default_retry=self._method_configs['AsymmetricDecrypt'].
retry,
default_timeout=self._method_configs['AsymmetricDecrypt'].
timeout,
client_info=self._client_info,
)
request = service_pb2.AsymmetricDecryptRequest(
name=name,
ciphertext=ciphertext,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['asymmetric_decrypt'](
request, retry=retry, timeout=timeout, metadata=metadata)
def asymmetric_sign(self,
name,
digest,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Signs data using a ``CryptoKeyVersion`` with ``CryptoKey.purpose``
ASYMMETRIC\_SIGN, producing a signature that can be verified with the
public key retrieved from ``GetPublicKey``.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> name = client.crypto_key_version_path('[PROJECT]', '[LOCATION]', '[KEY_RING]', '[CRYPTO_KEY]', '[CRYPTO_KEY_VERSION]')
>>>
>>> # TODO: Initialize `digest`:
>>> digest = {}
>>>
>>> response = client.asymmetric_sign(name, digest)
Args:
name (str): Required. The resource name of the ``CryptoKeyVersion`` to use for
signing.
digest (Union[dict, ~google.cloud.kms_v1.types.Digest]): Required. The digest of the data to sign. The digest must be produced
with the same digest algorithm as specified by the key version's
``algorithm``.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.Digest`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.AsymmetricSignResponse` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'asymmetric_sign' not in self._inner_api_calls:
self._inner_api_calls[
'asymmetric_sign'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.asymmetric_sign,
default_retry=self._method_configs['AsymmetricSign'].retry,
default_timeout=self._method_configs['AsymmetricSign'].
timeout,
client_info=self._client_info,
)
request = service_pb2.AsymmetricSignRequest(
name=name,
digest=digest,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('name', name)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['asymmetric_sign'](
request, retry=retry, timeout=timeout, metadata=metadata)
def set_iam_policy(self,
resource,
policy,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Sets the access control policy on the specified resource. Replaces any
existing policy.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> resource = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>>
>>> # TODO: Initialize `policy`:
>>> policy = {}
>>>
>>> response = client.set_iam_policy(resource, policy)
Args:
resource (str): REQUIRED: The resource for which the policy is being specified.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
policy (Union[dict, ~google.cloud.kms_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The
size of the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
might reject them.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.kms_v1.types.Policy`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.Policy` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'set_iam_policy' not in self._inner_api_calls:
self._inner_api_calls[
'set_iam_policy'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.set_iam_policy,
default_retry=self._method_configs['SetIamPolicy'].retry,
default_timeout=self._method_configs['SetIamPolicy'].
timeout,
client_info=self._client_info,
)
request = iam_policy_pb2.SetIamPolicyRequest(
resource=resource,
policy=policy,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('resource', resource)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['set_iam_policy'](
request, retry=retry, timeout=timeout, metadata=metadata)
def get_iam_policy(self,
resource,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> resource = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>>
>>> response = client.get_iam_policy(resource)
Args:
resource (str): REQUIRED: The resource for which the policy is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.Policy` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'get_iam_policy' not in self._inner_api_calls:
self._inner_api_calls[
'get_iam_policy'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.get_iam_policy,
default_retry=self._method_configs['GetIamPolicy'].retry,
default_timeout=self._method_configs['GetIamPolicy'].
timeout,
client_info=self._client_info,
)
request = iam_policy_pb2.GetIamPolicyRequest(resource=resource, )
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('resource', resource)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['get_iam_policy'](
request, retry=retry, timeout=timeout, metadata=metadata)
def test_iam_permissions(self,
resource,
permissions,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of permissions,
not a NOT\_FOUND error.
Example:
>>> from google.cloud import kms_v1
>>>
>>> client = kms_v1.KeyManagementServiceClient()
>>>
>>> resource = client.key_ring_path('[PROJECT]', '[LOCATION]', '[KEY_RING]')
>>>
>>> # TODO: Initialize `permissions`:
>>> permissions = []
>>>
>>> response = client.test_iam_permissions(resource, permissions)
Args:
resource (str): REQUIRED: The resource for which the policy detail is being requested.
``resource`` is usually specified as a path. For example, a Project
resource is specified as ``projects/{project}``.
permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with
wildcards (such as '*' or 'storage.*') are not allowed. For more
information see `IAM
Overview <https://cloud.google.com/iam/docs/overview#permissions>`__.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
timeout (Optional[float]): The amount of time, in seconds, to wait
for the request to complete. Note that if ``retry`` is
specified, the timeout applies to each individual attempt.
metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
that is provided to the method.
Returns:
A :class:`~google.cloud.kms_v1.types.TestIamPermissionsResponse` instance.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
google.api_core.exceptions.RetryError: If the request failed due
to a retryable error and retry attempts failed.
ValueError: If the parameters are invalid.
"""
# Wrap the transport method to add retry and timeout logic.
if 'test_iam_permissions' not in self._inner_api_calls:
self._inner_api_calls[
'test_iam_permissions'] = google.api_core.gapic_v1.method.wrap_method(
self.transport.test_iam_permissions,
default_retry=self._method_configs['TestIamPermissions'].
retry,
default_timeout=self._method_configs['TestIamPermissions'].
timeout,
client_info=self._client_info,
)
request = iam_policy_pb2.TestIamPermissionsRequest(
resource=resource,
permissions=permissions,
)
if metadata is None:
metadata = []
metadata = list(metadata)
try:
routing_header = [('resource', resource)]
except AttributeError:
pass
else:
routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
routing_header)
metadata.append(routing_metadata)
return self._inner_api_calls['test_iam_permissions'](
request, retry=retry, timeout=timeout, metadata=metadata)
| {
"content_hash": "76ec441fdc19b520054346d21bc4eeab",
"timestamp": "",
"source": "github",
"line_count": 2019,
"max_line_length": 140,
"avg_line_length": 44.156017830609215,
"alnum_prop": 0.5661742436988929,
"repo_name": "jonparrott/gcloud-python",
"id": "461866571810289787cd6fcdaea2d268ff72d7dd",
"size": "89151",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "kms/google/cloud/kms_v1/gapic/key_management_service_client.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3366"
},
{
"name": "PowerShell",
"bytes": "7195"
},
{
"name": "Protocol Buffer",
"bytes": "62009"
},
{
"name": "Python",
"bytes": "3459300"
},
{
"name": "Shell",
"bytes": "7548"
}
],
"symlink_target": ""
} |
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Buttons</title>
<link href='http://fonts.googleapis.com/css?family=Muli:300' rel='stylesheet' type='text/css'>
<link href="../css/typography.css" rel="stylesheet">
<link href="../css/buttons.css" rel="stylesheet">
</head>
<body>
<h1>Buttons</h1>
<a href="#" class="btn micro">Click Here!</a>
<a href="#" class="btn">Click Here!</a>
<a href="#" class="btn giga">Click Here!</a>
<a href="#" class="btn btn-alt micro">Click Here!</a>
<a href="#" class="btn btn-alt">Click Here!</a>
<a href="#" class="btn btn-alt giga">Click Here!</a>
</body>
</html> | {
"content_hash": "e6ebf14a70ec4a2bf1b5283b2bb589ae",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 95,
"avg_line_length": 27.17391304347826,
"alnum_prop": 0.6288,
"repo_name": "padd0010/ecommerce-website",
"id": "25525a0830ee5922b1bacd9d8aad40e2b0c5bc34",
"size": "625",
"binary": false,
"copies": "2",
"ref": "refs/heads/gh-pages",
"path": "styleguide/buttons.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8670"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.0">
<defauMSCodec>UTF-8</defauMSCodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About MiscCoin</source>
<translation>Σχετικά με το MiscCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>MiscCoin</b> version</source>
<translation>Έκδοση MiscCoin</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation>Πνευματική ιδιοκτησία </translation>
</message>
<message>
<location line="+0"/>
<source>The MiscCoin developers</source>
<translation>Οι MiscCoin προγραμματιστές </translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Βιβλίο Διευθύνσεων</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Διπλό-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Δημιούργησε νέα διεύθυνση</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Νέα διεύθυνση</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your MiscCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Αυτές είναι οι MiscCoin διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Αντιγραφή διεύθυνσης</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Δείξε &QR κωδικα</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a MiscCoin address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>&Υπέγραψε το μήνυμα</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Αντιγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation>&Εξαγωγή</translation>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified MiscCoin address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Διαγραφή</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your MiscCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Αυτές είναι οι MiscCoin διευθύνσεις σας για να λαμβάνετε πληρωμές. Δίνοντας μία ξεχωριστή διεύθυνση σε κάθε αποστολέα, θα μπορείτε να ελέγχετε ποιος σας πληρώνει.</translation>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Αντιγραφή &επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Επεξεργασία</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Εξαγωγή Δεδομενων Βιβλίου Διευθύνσεων</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Εξαγωγή λαθών</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Αδυναμία εγγραφής στο αρχείο %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Ετικέτα</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(χωρίς ετικέτα)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Φράση πρόσβασης </translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Βάλτε κωδικό πρόσβασης</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Νέος κωδικός πρόσβασης</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Εισάγετε τον νέο κωδικό πρόσβασης στον πορτοφόλι <br/> Παρακαλώ χρησιμοποιείστε ένα κωδικό με <b> 10 ή περισσότερους τυχαίους χαρακτήρες</b> ή <b> οχτώ ή παραπάνω λέξεις</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Κρυπτογράφησε το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Αυτη η ενεργεία χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Ξεκλειδωσε το πορτοφολι</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Αυτη η ενεργεια χρειάζεται τον κωδικο του πορτοφολιου για να αποκρυπτογραφησειι το πορτοφολι.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Αποκρυπτογράφησε το πορτοφολι</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Άλλαξε κωδικο πρόσβασης</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Εισάγετε τον παλιό και τον νεο κωδικο στο πορτοφολι.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Επιβεβαίωσε την κρυπτογραφηση του πορτοφολιού</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR MiscCoinS</b>!</source>
<translation>Προσοχη: Εαν κρυπτογραφησεις το πορτοφολι σου και χάσεις τον κωδικο σου θα χάσεις <b> ΟΛΑ ΣΟΥ ΤΑ MiscCoinS</b>!
Είσαι σίγουρος ότι θέλεις να κρυπτογραφησεις το πορτοφολι;</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Είστε σίγουροι ότι θέλετε να κρυπτογραφήσετε το πορτοφόλι σας;</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>ΣΗΜΑΝΤΙΚΟ: Τα προηγούμενα αντίγραφα ασφαλείας που έχετε κάνει από το αρχείο του πορτοφόλιου σας θα πρέπει να αντικατασταθουν με το νέο που δημιουργείται, κρυπτογραφημένο αρχείο πορτοφόλιου. Για λόγους ασφαλείας, τα προηγούμενα αντίγραφα ασφαλείας του μη κρυπτογραφημένου αρχείου πορτοφόλιου θα καταστουν άχρηστα μόλις αρχίσετε να χρησιμοποιείτε το νέο κρυπτογραφημένο πορτοφόλι. </translation>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Προσοχη: το πλήκτρο Caps Lock είναι ενεργο.</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Κρυπτογραφημενο πορτοφολι</translation>
</message>
<message>
<location line="-56"/>
<source>MiscCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your MiscCoins from being stolen by malware infecting your computer.</source>
<translation>Το MiscCoin θα κλεισει τώρα για να τελειώσει την διαδικασία κρυπτογραφησης. Θυμησου ότι κρυπτογραφώντας το πορτοφολι σου δεν μπορείς να προστατέψεις πλήρως τα MiscCoins σου από κλοπή στην περίπτωση όπου μολυνθεί ο υπολογιστής σου με κακόβουλο λογισμικο.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Η κρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε λογω εσωτερικού σφάλματος. Το πορτοφολι δεν κρυπτογραφηθηκε.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Οι εισαχθέντες κωδικοί δεν ταιριάζουν.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Ο κωδικος που εισήχθη για την αποκρυπτογραφηση του πορτοφολιού ήταν λαθος.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Η αποκρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Ο κωδικος του πορτοφολιού άλλαξε με επιτυχία.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Υπογραφή &Μηνύματος...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Συγχρονισμός με το δίκτυο...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Επισκόπηση</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Εμφάνισε γενική εικονα του πορτοφολιού</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Συναλλαγές</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Περιήγηση στο ιστορικο συνναλαγων</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Εξεργασια της λιστας των αποθηκευμενων διευθύνσεων και ετικετων</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Εμφάνισε την λίστα των διευθύνσεων για την παραλαβή πληρωμων</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>Έ&ξοδος</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Εξοδος από την εφαρμογή</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about MiscCoin</source>
<translation>Εμφάνισε πληροφορίες σχετικά με το MiscCoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Σχετικά με &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Επιλογές...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Κρυπτογράφησε το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Αντίγραφο ασφαλείας του πορτοφολιού</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Άλλαξε κωδικο πρόσβασης</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation>Εισαγωγή μπλοκ από τον σκληρο δίσκο ... </translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation>Φόρτωση ευρετηρίου μπλοκ στον σκληρο δισκο...</translation>
</message>
<message>
<location line="-347"/>
<source>Send coins to a MiscCoin address</source>
<translation>Στείλε νομισματα σε μια διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for MiscCoin</source>
<translation>Επεργασία ρυθμισεων επιλογών για το MiscCoin</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Παράθυρο αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Άνοιγμα κονσόλας αποσφαλμάτωσης και διαγνωστικών</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>MiscCoin</source>
<translation>MiscCoin</translation>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Πορτοφόλι</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation>&Αποστολή</translation>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation>&Παραλαβή </translation>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation>&Διεύθυνσεις</translation>
</message>
<message>
<location line="+22"/>
<source>&About MiscCoin</source>
<translation>&Σχετικα:MiscCoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Εμφάνισε/Κρύψε</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation>Εμφάνιση ή αποκρύψη του κεντρικου παράθυρου </translation>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Κρυπτογραφήστε τα ιδιωτικά κλειδιά που ανήκουν στο πορτοφόλι σας </translation>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your MiscCoin addresses to prove you own them</source>
<translation>Υπογράψτε ένα μήνυμα για να βεβαιώσετε πως είστε ο κάτοχος αυτής της διεύθυνσης</translation>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified MiscCoin addresses</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Αρχείο</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Ρυθμίσεις</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Βοήθεια</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Εργαλειοθήκη καρτελών</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+47"/>
<source>MiscCoin client</source>
<translation>Πελάτης MiscCoin</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to MiscCoin network</source>
<translation><numerusform>%n ενεργή σύνδεση στο δίκτυο MiscCoin</numerusform><numerusform>%n ενεργές συνδέσεις στο δίκτυο Βitcoin</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation>Η πηγή του μπλοκ δεν ειναι διαθέσιμη... </translation>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation>Μεταποιημένα %1 απο % 2 (κατ 'εκτίμηση) μπλοκ της ιστορίας της συναλλαγής. </translation>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation><numerusform>%n ώρες </numerusform><numerusform>%n ώρες </numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n ημέρες </numerusform><numerusform>%n ημέρες </numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation><numerusform>%n εβδομαδες</numerusform><numerusform>%n εβδομαδες</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation>%1 πίσω</translation>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation>Το τελευταίο μπλοκ που ελήφθη δημιουργήθηκε %1 πριν.</translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation>Οι συναλλαγές μετά από αυτό δεν θα είναι ακόμη ορατες.</translation>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Σφάλμα</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation>Πληροφορία</translation>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation>Η συναλλαγή ξεπερνάει το όριο.
Μπορεί να ολοκληρωθεί με μια αμοιβή των %1, η οποία αποδίδεται στους κόμβους που επεξεργάζονται τις συναλλαγές και βοηθούν στην υποστήριξη του δικτύου.
Θέλετε να συνεχίσετε;</translation>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Ενημερωμένο</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Ενημέρωση...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Επιβεβαίωση αμοιβής συναλλαγής</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Η συναλλαγή απεστάλη</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Εισερχόμενη συναλλαγή</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Ημερομηνία: %1
Ποσό: %2
Τύπος: %3
Διεύθυνση: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>Χειρισμός URI</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid MiscCoin address or malformed URI parameters.</source>
<translation>Το URI δεν μπορεί να αναλυθεί! Αυτό μπορεί να προκληθεί από μια μη έγκυρη διεύθυνση MiscCoin ή ακατάλληλη παραμέτρο URI.</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>ξεκλείδωτο</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>κλειδωμένο</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. MiscCoin can no longer continue safely and will quit.</source>
<translation>Παρουσιάστηκε ανεπανόρθωτο σφάλμα. Το MiscCoin δεν μπορεί πλέον να συνεχίσει με ασφάλεια και θα τερματισθει.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation>Ειδοποίηση Δικτύου</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Επεξεργασία Διεύθυνσης</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Η επιγραφή που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Διεύθυνση</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Η διεύθυνση που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων. Μπορεί να τροποποιηθεί μόνο για τις διευθύνσεις αποστολής.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Νέα διεύθυνση λήψης</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Νέα διεύθυνση αποστολής</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Επεξεργασία διεύθυνσης λήψης</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Επεξεργασία διεύθυνσης αποστολής</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Η διεύθυνση "%1" βρίσκεται ήδη στο βιβλίο διευθύνσεων.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid MiscCoin address.</source>
<translation>Η διεύθυνση "%1" δεν είναι έγκυρη MiscCoin διεύθυνση.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Δεν είναι δυνατό το ξεκλείδωμα του πορτοφολιού.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Η δημιουργία νέου κλειδιού απέτυχε.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>MiscCoin-Qt</source>
<translation>MiscCoin-qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>έκδοση</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>επιλογής γραμμής εντολών</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>επιλογές UI</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Όρισε γλώσσα, για παράδειγμα "de_DE"(προεπιλογή:τοπικές ρυθμίσεις)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Έναρξη ελαχιστοποιημένο</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Εμφάνισε την οθόνη εκκίνησης κατά την εκκίνηση(προεπιλογή:1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Ρυθμίσεις</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Κύριο</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation>Η προαιρετική αμοιβή για κάθε kB επισπεύδει την επεξεργασία των συναλλαγών σας. Οι περισσότερες συναλλαγές είναι 1 kB. </translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Αμοιβή &συναλλαγής</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start MiscCoin after logging in to the system.</source>
<translation>Αυτόματη εκκίνηση του MiscCoin μετά την εισαγωγή στο σύστημα</translation>
</message>
<message>
<location line="+3"/>
<source>&Start MiscCoin on system login</source>
<translation>&Έναρξη του Βιtcoin κατά την εκκίνηση του συστήματος</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation>Επαναφορα όλων των επιλογων του πελάτη σε default.</translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation>Επαναφορα ρυθμίσεων</translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Δίκτυο</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the MiscCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Αυτόματο άνοιγμα των θυρών MiscCoin στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Απόδοση θυρών με χρήστη &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the MiscCoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Σύνδεση στο MiscCoin δίκτυο μέσω διαμεσολαβητή SOCKS4 (π.χ. για σύνδεση μέσω Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Σύνδεση μέσω διαμεσολαβητή SOCKS</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>&IP διαμεσολαβητή:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Διεύθυνση IP του διαμεσολαβητή (π.χ. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Θύρα:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Θύρα διαμεσολαβητή</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Έκδοση:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS εκδοση του διαμεσολαβητη (e.g. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Παράθυρο</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Εμφάνιση μόνο εικονιδίου στην περιοχή ειδοποιήσεων κατά την ελαχιστοποίηση</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Ελαχιστοποίηση αντί για έξοδο κατά το κλείσιμο του παραθύρου</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>Ε&λαχιστοποίηση κατά το κλείσιμο</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>%Απεικόνιση</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Γλώσσα περιβάλλοντος εργασίας: </translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting MiscCoin.</source>
<translation>Εδώ μπορεί να ρυθμιστεί η γλώσσα διεπαφής χρήστη. Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του MiscCoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Μονάδα μέτρησης:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show MiscCoin addresses in the transaction list or not.</source>
<translation>Επιλέξτε αν θέλετε να εμφανίζονται οι διευθύνσεις MiscCoin στη λίστα συναλλαγών.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>Εμφάνιση διευθύνσεων στη λίστα συναλλαγών</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&ΟΚ</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Ακύρωση</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Εφαρμογή</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation>προεπιλογή</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation>Επιβεβαιώση των επιλογων επαναφοράς </translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation>Για ορισμένες ρυθμίσεις πρεπει η επανεκκίνηση να τεθεί σε ισχύ.</translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation>Θέλετε να προχωρήσετε;</translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting MiscCoin.</source>
<translation>Αυτή η ρύθμιση θα ισχύσει μετά την επανεκκίνηση του MiscCoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Φόρμα</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the MiscCoin network after a connection is established, but this process has not completed yet.</source>
<translation>Οι πληροφορίες που εμφανίζονται μπορεί να είναι ξεπερασμένες. Το πορτοφόλι σας συγχρονίζεται αυτόματα με το δίκτυο MiscCoin μετά από μια σύνδεση, αλλά αυτή η διαδικασία δεν έχει ακόμη ολοκληρωθεί. </translation>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Υπόλοιπο</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Ανεπιβεβαίωτες</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Πορτοφόλι</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation>Ανώριμος</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Εξορυγμενο υπόλοιπο που δεν έχει ακόμα ωριμάσει </translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Πρόσφατες συναλλαγές</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Το τρέχον υπόλοιπο</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον υπόλοιπό σας</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>εκτός συγχρονισμού</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start MiscCoin: click-to-pay handler</source>
<translation>Δεν είναι δυνατή η εκκίνηση του MiscCoin: click-to-pay handler</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>Κώδικας QR</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Αίτηση πληρωμής</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Ποσό:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Επιγραφή:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Μήνυμα:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Αποθήκευση ως...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Σφάλμα κατά την κωδικοποίηση του URI σε κώδικα QR</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Το αναγραφόμενο ποσό δεν είναι έγκυρο, παρακαλούμε να το ελέγξετε.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Το αποτέλεσμα της διεύθυνσης είναι πολύ μεγάλο. Μειώστε το μέγεθος για το κείμενο της ετικέτας/ μηνύματος.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Αποθήκευση κώδικα QR</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>Εικόνες PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Όνομα Πελάτη</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation>Μη διαθέσιμο</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Έκδοση Πελάτη</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Πληροφορία</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Χρησιμοποιηση της OpenSSL εκδοσης</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Χρόνος εκκίνησης</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Δίκτυο</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Αριθμός συνδέσεων</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Στο testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>αλυσίδα εμποδισμού</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Τρέχον αριθμός μπλοκ</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Κατ' εκτίμηση συνολικά μπλοκς</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Χρόνος τελευταίου μπλοκ</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Άνοιγμα</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>επιλογής γραμμής εντολών</translation>
</message>
<message>
<location line="+7"/>
<source>Show the MiscCoin-Qt help message to get a list with possible MiscCoin command-line options.</source>
<translation>Εμφανιση του MiscCoin-Qt μήνυματος βοήθειας για να πάρετε μια λίστα με τις πιθανές επιλογές MiscCoin γραμμής εντολών.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Εμφάνιση</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Κονσόλα</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Ημερομηνία κατασκευής</translation>
</message>
<message>
<location line="-104"/>
<source>MiscCoin - Debug window</source>
<translation>MiscCoin - Παράθυρο αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+25"/>
<source>MiscCoin Core</source>
<translation>MiscCoin Core</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Αρχείο καταγραφής εντοπισμού σφαλμάτων </translation>
</message>
<message>
<location line="+7"/>
<source>Open the MiscCoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Ανοίξτε το αρχείο καταγραφής εντοπισμού σφαλμάτων από τον τρέχοντα κατάλογο δεδομένων. Αυτό μπορεί να πάρει μερικά δευτερόλεπτα για τα μεγάλα αρχεία καταγραφής. </translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Καθαρισμός κονσόλας</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the MiscCoin RPC console.</source>
<translation>Καλώς ήρθατε στην MiscCoin RPC κονσόλα.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Χρησιμοποιήστε το πάνω και κάτω βέλος για να περιηγηθείτε στο ιστορικο, και <b>Ctrl-L</b> για εκκαθαριση οθονης.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Γράψτε <b>βοήθεια</b> για μια επισκόπηση των διαθέσιμων εντολών</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Προσθήκη αποδέκτη</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Διαγραφή όλων των πεδίων συναλλαγής</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Καθαρισμός &Όλων</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Υπόλοιπο:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Επιβεβαίωση αποστολής</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>Αποστολη</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> σε %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Επιβεβαίωση αποστολής νομισμάτων</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Είστε βέβαιοι για την αποστολή %1;</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>και</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Η διεύθυνση του αποδέκτη δεν είναι σωστή. Παρακαλώ ελέγξτε ξανά.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Το ποσό πληρωμής πρέπει να είναι μεγαλύτερο από 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Το ποσό ξεπερνάει το διαθέσιμο υπόλοιπο</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Το σύνολο υπερβαίνει το υπόλοιπό σας όταν συμπεριληφθεί και η αμοιβή %1</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Βρέθηκε η ίδια διεύθυνση δύο φορές. Επιτρέπεται μία μόνο εγγραφή για κάθε διεύθυνση, σε κάθε διαδικασία αποστολής.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation>Σφάλμα: Η δημιουργία της συναλλαγής απέτυχε</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Σφάλμα: Η συναλλαγή απερρίφθη. Αυτό ενδέχεται να συμβαίνει αν κάποια από τα νομίσματα έχουν ήδη ξοδευθεί, όπως αν χρησιμοποιήσατε αντίγραφο του wallet.dat και τα νομίσματα ξοδεύθηκαν εκεί.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Φόρμα</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Ποσό:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Πληρωμή &σε:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Διεύθυνση αποστολής της πληρωμής (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Εισάγετε μια επιγραφή για αυτή τη διεύθυνση ώστε να καταχωρηθεί στο βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το πρόχειρο</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Αφαίρεση αποδέκτη</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a MiscCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση MiscCoin (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Υπογραφές - Είσοδος / Επαλήθευση μήνυματος </translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Υπογραφή Μηνύματος</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν' αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση MiscCoin (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation>Υπογραφή</translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Αντέγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this MiscCoin address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως σας ανήκει μια συγκεκριμένη διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Υπογραφη μήνυματος</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Επαναφορά όλων των πεδίων μήνυματος</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Καθαρισμός &Όλων</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>&Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Πληκτρολογήστε την υπογραφή διεύθυνσης, μήνυμα (βεβαιωθείτε ότι έχετε αντιγράψει τις αλλαγές γραμμής, κενά, tabs, κ.λπ. ακριβώς) και την υπογραφή παρακάτω, για να ελέγξει το μήνυμα. Να είστε προσεκτικοί για να μην διαβάσετε περισσότερα στην υπογραφή ό, τι είναι στην υπογραφή ίδιο το μήνυμα , για να μην εξαπατηθούν από έναν άνθρωπο -in - the-middle επίθεση.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση MiscCoin (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified MiscCoin address</source>
<translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως υπογραφθηκε απο μια συγκεκριμένη διεύθυνση MiscCoin</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation>Επιβεβαίωση μηνύματος</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Επαναφορά όλων επαλήθευμενων πεδίων μήνυματος </translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a MiscCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation>Εισάγετε μια διεύθυνση MiscCoin (π.χ. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Κάντε κλικ στο "Υπογραφή Μηνύματος" για να λάβετε την υπογραφή</translation>
</message>
<message>
<location line="+3"/>
<source>Enter MiscCoin signature</source>
<translation>Εισαγωγή υπογραφής MiscCoin</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Η διεύθυνση που εισήχθη είναι λάθος.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Παρακαλούμε ελέγξτε την διεύθυνση και δοκιμάστε ξανά.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Η διεύθυνση που έχει εισαχθεί δεν αναφέρεται σε ένα πλήκτρο.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Το προσωπικό κλειδί εισαγμενης διευθυνσης δεν είναι διαθέσιμο.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Η υπογραφή του μηνύματος απέτυχε.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Μήνυμα υπεγράφη.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Η υπογραφή δεν μπόρεσε να αποκρυπτογραφηθεί.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Παρακαλούμε ελέγξτε την υπογραφή και δοκιμάστε ξανά.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Η υπογραφή δεν ταιριάζει με το μήνυμα. </translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Η επιβεβαίωση του μηνύματος απέτυχε</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Μήνυμα επιβεβαιώθηκε.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The MiscCoin developers</source>
<translation>Οι MiscCoin προγραμματιστές </translation>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/χωρίς σύνδεση;</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/χωρίς επιβεβαίωση</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 επιβεβαιώσεις</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Κατάσταση</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Πηγή</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Δημιουργία </translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Από</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Προς</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation> δική σας διεύθυνση </translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>eπιγραφή</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Πίστωση </translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>μη αποδεκτό</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debit</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Τέλος συναλλαγής </translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Καθαρό ποσό</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Μήνυμα</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Σχόλιο:</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID Συναλλαγής:</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Πρέπει να περιμένετε 120 μπλοκ πριν μπορέσετε να χρησιμοποιήσετε τα νομίσματα που έχετε δημιουργήσει. Το μπλοκ που δημιουργήσατε μεταδόθηκε στο δίκτυο για να συμπεριληφθεί στην αλυσίδα των μπλοκ. Αν δεν μπει σε αυτή θα μετατραπεί σε "μη αποδεκτό" και δε θα μπορεί να καταναλωθεί. Αυτό συμβαίνει σπάνια όταν κάποιος άλλος κόμβος δημιουργήσει ένα μπλοκ λίγα δευτερόλεπτα πριν από εσάς.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Πληροφορίες αποσφαλμάτωσης</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Συναλλαγή</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>εισροές </translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>αληθής</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>αναληθής </translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, δεν έχει ακόμα μεταδοθεί μ' επιτυχία</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>άγνωστο</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Λεπτομέρειες συναλλαγής</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Αυτό το παράθυρο δείχνει μια λεπτομερή περιγραφή της συναλλαγής</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Χωρίς σύνδεση (%1 επικυρώσεις)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Χωρίς επιβεβαίωση (%1 από %2 επικυρώσεις)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Επικυρωμένη (%1 επικυρώσεις)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Αυτό το μπλοκ δεν έχει παραληφθεί από κανέναν άλλο κόμβο και κατά πάσα πιθανότητα θα απορριφθεί!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Δημιουργήθηκε αλλά απορρίφθηκε</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Παραλαβή με</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Ελήφθη από</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Αποστολή προς</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Πληρωμή προς εσάς</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(δ/α)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Κατάσταση συναλλαγής. Πηγαίνετε το ποντίκι πάνω από αυτό το πεδίο για να δείτε τον αριθμό των επικυρώσεων</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Ημερομηνία κι ώρα λήψης της συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Είδος συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Διεύθυνση αποστολής της συναλλαγής.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Ποσό που αφαιρέθηκε ή προστέθηκε στο υπόλοιπο.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Όλα</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Σήμερα</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Αυτή την εβδομάδα</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Αυτόν τον μήνα</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Τον προηγούμενο μήνα</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Αυτό το έτος</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Έκταση...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Ελήφθη με</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Απεστάλη προς</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Προς εσάς</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Άλλο</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Αναζήτηση με βάση τη διεύθυνση ή την επιγραφή</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Ελάχιστο ποσό</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Αντιγραφή διεύθυνσης</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Αντιγραφή επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Αντιγραφή ποσού</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Αντιγραφη του ID Συναλλαγής</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Επεξεργασία επιγραφής</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Εμφάνιση λεπτομερειών συναλλαγής</translation>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Εξαγωγή Στοιχείων Συναλλαγών</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Επικυρωμένες</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Επιγραφή</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Σφάλμα εξαγωγής</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Αδυναμία εγγραφής στο αρχείο %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Έκταση:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>έως</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation>&Εξαγωγή</translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation>Αντίγραφο ασφαλείας του πορτοφολιού</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Αρχεία δεδομένων πορτοφολιού (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Αποτυχία κατά τη δημιουργία αντιγράφου</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Παρουσιάστηκε σφάλμα κατά την αποθήκευση των δεδομένων πορτοφολιού στη νέα τοποθεσία.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation>Η δημιουργια αντιγραφου ασφαλειας πετυχε</translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation>Τα δεδομένα πορτοφόλιου αποθηκεύτηκαν με επιτυχία στη νέα θέση. </translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>MiscCoin version</source>
<translation>Έκδοση MiscCoin</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or MiscCoind</source>
<translation>Αποστολή εντολής στον εξυπηρετητή ή στο MiscCoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Λίστα εντολών</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Επεξήγηση εντολής</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Επιλογές:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: MiscCoin.conf)</source>
<translation>Ορίστε αρχείο ρυθμίσεων (προεπιλογή: MiscCoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: MiscCoind.pid)</source>
<translation>Ορίστε αρχείο pid (προεπιλογή: MiscCoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Ορισμός φακέλου δεδομένων</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Όρισε το μέγεθος της βάσης προσωρινής αποθήκευσης σε megabytes(προεπιλογή:25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9333 or testnet: 19333)</source>
<translation>Εισερχόμενες συνδέσεις στη θύρα <port> (προεπιλογή: 9333 ή στο testnet: 19333)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Μέγιστες αριθμός συνδέσεων με τους peers <n> (προεπιλογή: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομοτίμους, και αποσυνδέσh</translation>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation>Διευκρινίστε τη δικιά σας δημόσια διεύθυνση.</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %u για αναμονή IPv4: %s</translation>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)</source>
<translation>Εισερχόμενες συνδέσεις JSON-RPC στη θύρα <port> (προεπιλογή: 9332 or testnet: 19332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Χρήση του δοκιμαστικού δικτύου</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=MiscCoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "MiscCoin Alert" admin@foo.com
</source>
<translation>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=MiscCoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "MiscCoin Alert" admin@foo.com
</translation>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η υποδοχη RPC %u για αναμονη του IPv6, επεσε πισω στο IPv4:%s</translation>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Αποθηκευση σε συγκεκριμένη διεύθυνση. Χρησιμοποιήστε τα πλήκτρα [Host] : συμβολισμός θύρα για IPv6</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. MiscCoin is probably already running.</source>
<translation>Αδυναμία κλειδώματος του φακέλου δεδομένων %s. Πιθανώς το MiscCoin να είναι ήδη ενεργό.</translation>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Σφάλμα: Η συναλλαγή απορρίφθηκε.
Αυτό ίσως οφείλεται στο ότι τα νομίσματά σας έχουν ήδη ξοδευτεί, π.χ. με την αντιγραφή του wallet.dat σε άλλο σύστημα και την χρήση τους εκεί, χωρίς η συναλλαγή να έχει καταγραφεί στο παρόν σύστημα.</translation>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation>Σφάλμα: Αυτή η συναλλαγή απαιτεί αμοιβή συναλλαγής τουλάχιστον %s λόγω του μεγέθους, πολυπλοκότητας ή της χρήσης πρόσφατης παραλαβής κεφαλαίου</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Εκτέλεση της εντολής όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Ορίστε το μέγιστο μέγεθος των high-priority/low-fee συναλλαγων σε bytes (προεπιλογή: 27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Αυτό είναι ένα προ-τεστ κυκλοφορίας - χρησιμοποιήστε το με δική σας ευθύνη - δεν χρησιμοποιείτε για εξόρυξη ή για αλλες εφαρμογές</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Προειδοποίηση: Η παράμετρος -paytxfee είναι πολύ υψηλή. Πρόκειται για την αμοιβή που θα πληρώνετε για κάθε συναλλαγή που θα στέλνετε.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Προειδοποίηση: Εμφανίσεις συναλλαγων δεν μπορεί να είναι σωστες! Μπορεί να χρειαστεί να αναβαθμίσετε, ή άλλοι κόμβοι μπορεί να χρειαστεί να αναβαθμίστουν. </translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong MiscCoin will not work properly.</source>
<translation>Προειδοποίηση: Παρακαλώ βεβαιωθείτε πως η ημερομηνία κι ώρα του συστήματός σας είναι σωστές. Αν το ρολόι του υπολογιστή σας πάει λάθος, ενδέχεται να μη λειτουργεί σωστά το MiscCoin.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Προειδοποίηση : Σφάλμα wallet.dat κατα την ανάγνωση ! Όλα τα κλειδιά αναγνωρισθηκαν σωστά, αλλά τα δεδομένα των συναλλαγών ή καταχωρήσεις στο βιβλίο διευθύνσεων μπορεί να είναι ελλιπείς ή λανθασμένα. </translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Προειδοποίηση : το αρχειο wallet.dat ειναι διεφθαρμένο, τα δεδομένα σώζονται ! Original wallet.dat αποθηκεύονται ως πορτοφόλι { timestamp } bak στο % s ? . . Αν το υπόλοιπο του ή τις συναλλαγές σας, είναι λάθος θα πρέπει να επαναφέρετε από ένα αντίγραφο ασφαλείας</translation>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat </translation>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Αποκλεισμός επιλογων δημιουργίας: </translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Σύνδεση μόνο με ορισμένους κόμβους</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation>Εντοπισθηκε διεφθαρμενη βαση δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Ανακαλύψτε την δικη σας IP διεύθυνση (προεπιλογή: 1 όταν ακούει και δεν - externalip) </translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation>Θελετε να δημιουργηθει τωρα η βαση δεδομενων του μπλοκ? </translation>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων μπλοκ</translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων πορτοφόλιου %s!</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation>Σφάλμα φορτωσης της βασης δεδομενων των μπλοκ</translation>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation>Προειδοποίηση: Χαμηλός χώρος στο δίσκο </translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Σφάλμα: το πορτοφόλι είναι κλειδωμένο, δεν μπορεί να δημιουργηθεί συναλλαγή</translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation>Λάθος: λάθος συστήματος:</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>ταλαιπωρηθειτε για να ακούσετε σε οποιαδήποτε θύρα. Χρήση - ακούστε = 0 , αν θέλετε αυτό.</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation>Αποτυχία αναγνωσης των block πληροφοριων</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation>Η αναγνωση του μπλοκ απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation>Ο συγχρονισμος του μπλοκ ευρετηριου απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation>Η δημιουργια του μπλοκ ευρετηριου απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation>Η δημιουργια των μπλοκ πληροφοριων απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation>Η δημιουργια του μπλοκ απετυχε</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation>Αδυναμία εγγραφής πληροφοριων αρχειου</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation>Αποτυχία εγγραφής στη βάση δεδομένων νομίσματος</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation>Αποτυχία εγγραφής δείκτη συναλλαγών </translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation>Αποτυχία εγγραφής αναίρεσης δεδομένων </translation>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>Βρες ομότιμους υπολογιστές χρησιμοποιώντας αναζήτηση DNS(προεπιλογή:1)</translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation>Δημιουργία νομισμάτων (προκαθορισμος: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>Πόσα μπλοκ να ελέγχθουν κατά την εκκίνηση (προεπιλογή:288,0=όλα)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation>Πόσο εξονυχιστική να είναι η επιβεβαίωση του μπλοκ(0-4, προεπιλογή:3)</translation>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation>Δεν ειναι αρκετες περιγραφες αρχείων διαθέσιμες.</translation>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation>Ορίσμος του αριθμόυ θεματων στην υπηρεσία κλήσεων RPC (προεπιλογή: 4) </translation>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation>Επαλήθευση των μπλοκ... </translation>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation>Επαλήθευση πορτοφολιου... </translation>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Εισαγωγή μπλοκ από εξωτερικό αρχείο blk000?.dat</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation>Ορίσμος του αριθμό των νημάτων ελέγχου σεναρίου (μέχρι 16, 0 = auto, <0 = αφήνουν τους πολλους πυρήνες δωρεάν, default: 0)</translation>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation>Πληροφορία</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation>Διατηρήση ένος πλήρες ευρετήριου συναλλαγών (προεπιλογή: 0) </translation>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Μέγιστος buffer λήψης ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Μέγιστος buffer αποστολής ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 1000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation>Μονο αποδοχη αλυσίδας μπλοκ που ταιριάζει με τα ενσωματωμένα σημεία ελέγχου (προεπιλογή: 1) </translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation> Συνδέση μόνο σε κόμβους του δικτύου <net> (IPv4, IPv6 ή Tor) </translation>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Χρονοσφραγίδα πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the MiscCoin Wiki for SSL setup instructions)</source>
<translation>Ρυθμίσεις SSL: (ανατρέξτε στο MiscCoin Wiki για οδηγίες ρυθμίσεων SSL)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Επιλέξτε την έκδοση του διαμεσολαβητη για να χρησιμοποιήσετε (4-5 , προεπιλογή: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στον debugger</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Ορίσμος του μέγιστου μέγεθος block σε bytes (προεπιλογή: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Ορίστε το μέγιστο μέγεθος block σε bytes (προεπιλογή: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation>Η υπογραφή συναλλαγής απέτυχε </translation>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation>Λάθος Συστήματος:</translation>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation>Το ποσό της συναλλαγής είναι πολύ μικρο </translation>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation>Τα ποσά των συναλλαγών πρέπει να είναι θετικα</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation>Η συναλλαγή ειναι πολύ μεγάλη </translation>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:1)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Χρήση διακομιστή μεσολάβησης για την επίτευξη των Tor κρυμμένων υπηρεσιων (προεπιλογή: ίδιο με το-proxy) </translation>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation>Προειδοποίηση</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Προειδοποίηση: Αυτή η έκδοση είναι ξεπερασμένη, απαιτείται αναβάθμιση </translation>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation>Θα πρέπει να ξαναχτίστουν οι βάσεις δεδομένων που χρησιμοποιούντε-Αναδημιουργία αλλάγων-txindex </translation>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>Το αρχειο wallet.dat ειναι διεφθαρμένο, η διάσωση απέτυχε</translation>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Κωδικός για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Αποστολή εντολών στον κόμβο <ip> (προεπιλογή: 127.0.0.1)</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Όριο πλήθους κλειδιών pool <n> (προεπιλογή: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Αποδεκτά κρυπτογραφήματα (προεπιλογή: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Αυτό το κείμενο βοήθειας</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή (bind returned error %d, %s) </translation>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Σύνδεση μέσω διαμεσολαβητή socks</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Φόρτωση διευθύνσεων...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of MiscCoin</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του MiscCoin</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart MiscCoin to complete</source>
<translation>Απαιτείται η επανεγγραφή του Πορτοφολιού, η οποία θα ολοκληρωθεί στην επανεκκίνηση του MiscCoin</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Σφάλμα φόρτωσης αρχείου wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s'</translation>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Άγνωστo δίκτυο ορίζεται σε onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Άγνωστo δίκτυο ορίζεται: %i</translation>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Λάθος ποσότητα</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Ανεπαρκές κεφάλαιο</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Φόρτωση ευρετηρίου μπλοκ...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Προσέθεσε ένα κόμβο για σύνδεση και προσπάθησε να κρατήσεις την σύνδεση ανοιχτή</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. MiscCoin is probably already running.</source>
<translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή. Το MiscCoin είναι πιθανώς ήδη ενεργό.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Αμοιβή ανά KB που θα προστίθεται στις συναλλαγές που στέλνεις</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Φόρτωση πορτοφολιού...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation>Ανίχνευση...</translation>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Η φόρτωση ολοκληρώθηκε</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Χρήση της %s επιλογής</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Σφάλμα</translation>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s
Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό</translation>
</message>
</context>
</TS> | {
"content_hash": "75c5c8eb6d44210d4b0e215b9295a449",
"timestamp": "",
"source": "github",
"line_count": 2941,
"max_line_length": 428,
"avg_line_length": 40.56851411084665,
"alnum_prop": 0.6400864959098833,
"repo_name": "miscbrah/misccoin",
"id": "119e141740c12883feed30e7007347e4d677d974",
"size": "138188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_el_GR.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "89580"
},
{
"name": "C++",
"bytes": "2537239"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Objective-C",
"bytes": "5864"
},
{
"name": "Prolog",
"bytes": "14696"
},
{
"name": "Python",
"bytes": "69709"
},
{
"name": "Shell",
"bytes": "9702"
},
{
"name": "TypeScript",
"bytes": "5236293"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jan 16 11:48:26 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package org.wildfly.swarm.microprofile.restclient (BOM: * : All 2.3.0.Final API)</title>
<meta name="date" content="2019-01-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.wildfly.swarm.microprofile.restclient (BOM: * : All 2.3.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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 class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></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 class="aboutLanguage">Thorntail API, 2.3.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/microprofile/restclient/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.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 title="Uses of Package org.wildfly.swarm.microprofile.restclient" class="title">Uses of Package<br>org.wildfly.swarm.microprofile.restclient</h1>
</div>
<div class="contentContainer">No usage of org.wildfly.swarm.microprofile.restclient</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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 class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></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 class="aboutLanguage">Thorntail API, 2.3.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/microprofile/restclient/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.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 © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "de817265119ec08b9f924a6aef33c998",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 149,
"avg_line_length": 35.5703125,
"alnum_prop": 0.6176147594992313,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "f0e590ef7bb89e46972d621e3ad6fe696c4913bf",
"size": "4553",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.3.0.Final/apidocs/org/wildfly/swarm/microprofile/restclient/package-use.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
require_once 'phing/Task.php';
require_once 'phing/tasks/ext/git/GitBaseTask.php';
/**
* Wrapper around git-clone
*
* @author Victor Farazdagi <simple.square@gmail.com>
* @version $Id: 1ca04138e62374984bd4e04a46fccec605dff5a7 $
* @package phing.tasks.ext.git
* @see VersionControl_Git
* @since 2.4.3
*/
class GitCloneTask extends GitBaseTask
{
/**
* Whether --depth key should be set for git-clone
* @var int
*/
private $depth = 0;
/**
* Whether --bare key should be set for git-clone
* @var bool
*/
private $isBare = false;
/**
* Whether --single-branch key should be set for git-clone
* @var bool
*/
private $singleBranch = false;
/**
* Branch to check out
*
* @var string
*/
private $branch = "";
/**
* Path to target directory
* @var string
*/
private $targetPath;
/**
* The main entry point for the task
*/
public function main()
{
if (null === $this->getRepository()) {
throw new BuildException('"repository" is required parameter');
}
if (null === $this->getTargetPath()) {
throw new BuildException('"targetPath" is required parameter');
}
$files = @scandir($this->getTargetPath());
if (isset($files) && is_array($files) && (count($files) > 2)) {
throw new BuildException(
sprintf(
'"%s" target directory is not empty',
$this->getTargetPath()
)
);
}
try {
$this->doClone($this->getGitClient(false, getcwd()));
} catch (Exception $e) {
throw new BuildException('The remote end hung up unexpectedly', $e);
}
$msg = 'git-clone: cloning '
. ($this->isBare() ? '(bare) ' : '')
. ($this->hasDepth() ? ' (depth="' . $this->getDepth() . '") ' : '')
. '"' . $this->getRepository() . '" repository'
. ' to "' . $this->getTargetPath() . '" directory';
$this->log($msg, Project::MSG_INFO);
}
/**
* Create a new clone
*
* @param VersionControl_Git $client
*
* @throws VersionControl_Git_Exception
*/
protected function doClone(VersionControl_Git $client)
{
$command = $client->getCommand('clone')
->setOption('q')
->setOption('bare', $this->isBare())
->setOption('single-branch', $this->isSingleBranch())
->setOption('depth', $this->hasDepth() ? $this->getDepth() : false)
->setOption('branch', $this->hasBranch() ? $this->getBranch() : false)
->addArgument($this->getRepository())
->addArgument($this->getTargetPath());
if (is_dir($this->getTargetPath()) && version_compare('1.6.1.4', $client->getGitVersion(), '>=')) {
$isEmptyDir = true;
$entries = scandir($this->getTargetPath());
foreach ($entries as $entry) {
if ('.' !== $entry && '..' !== $entry) {
$isEmptyDir = false;
break;
}
}
if ($isEmptyDir) {
@rmdir($this->getTargetPath());
}
}
$command->execute();
}
/**
* @return int
*/
public function getDepth()
{
return $this->depth;
}
/**
* @param int $depth
*/
public function setDepth($depth)
{
$this->depth = $depth;
}
/**
* @return bool
*/
public function hasDepth()
{
return (bool) $this->depth;
}
/**
* Get path to target direcotry repo
*
* @return string
*/
public function getTargetPath()
{
return $this->targetPath;
}
/**
* Set path to source repo
*
* @param string $targetPath Path to repository used as source
* @return void
*/
public function setTargetPath($targetPath)
{
$this->targetPath = $targetPath;
}
/**
* Alias @see getBare()
*
* @return bool
*/
public function isBare()
{
return $this->getBare();
}
/**
* @return bool
*/
public function getBare()
{
return $this->isBare;
}
/**
* @param $flag
*/
public function setBare($flag)
{
$this->isBare = (bool) $flag;
}
/**
* @return boolean
*/
public function isSingleBranch()
{
return $this->singleBranch;
}
/**
* @param boolean $singleBranch
*/
public function setSingleBranch($singleBranch)
{
$this->singleBranch = $singleBranch;
}
/**
* @return string
*/
public function getBranch()
{
return $this->branch;
}
/**
* @return bool
*/
public function hasBranch()
{
return !empty($this->branch);
}
/**
* @param string $branch
*/
public function setBranch($branch)
{
$this->branch = $branch;
}
}
| {
"content_hash": "d73bcf47e07b1875d060dab555d545f3",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 107,
"avg_line_length": 22.15948275862069,
"alnum_prop": 0.4967905076833301,
"repo_name": "andyreis/mystyle",
"id": "31a04e7528c34854c0efef632ccaa3ef0734466d",
"size": "6162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "phing-2.15.2/classes/phing/tasks/ext/git/GitCloneTask.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1727"
},
{
"name": "CSS",
"bytes": "60102"
},
{
"name": "HTML",
"bytes": "55198646"
},
{
"name": "JavaScript",
"bytes": "228918"
},
{
"name": "PHP",
"bytes": "4553573"
},
{
"name": "XSLT",
"bytes": "96201"
}
],
"symlink_target": ""
} |
import Profiler = require('../Developer/Profiler/Profiler');
var profiler = new Profiler('Profiler Test');
profiler.beginProfiling();
profiler.step('1');
setTimeout(
function(){
profiler.step('2');
},1000
)
| {
"content_hash": "01f988d21f51c87a2c860e66f50c604d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 21.6,
"alnum_prop": 0.6944444444444444,
"repo_name": "gastrodia/WaspEngine",
"id": "01269885a6ff748e299a5dd042563e8b8f06b314",
"size": "217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Engine/Source/Test/ProfilerTest.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "136"
},
{
"name": "CoffeeScript",
"bytes": "813"
},
{
"name": "GLSL",
"bytes": "37013"
},
{
"name": "HTML",
"bytes": "4016"
},
{
"name": "JavaScript",
"bytes": "1604858"
},
{
"name": "Shell",
"bytes": "537"
},
{
"name": "TypeScript",
"bytes": "184012"
}
],
"symlink_target": ""
} |
using DuplicatedCode.Interfaces;
namespace DuplicatedCode.Practice
{
public class Football : Product, IFootball
{
public bool CanFitIntoTheBox(decimal boxVolume)
{
var productVolume = Width * Height * Depth;
return productVolume < boxVolume;
}
}
} | {
"content_hash": "2185773bd5a31aa1837c2b99773bed2c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 55,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6375404530744336,
"repo_name": "omid7791/refactoring-techniques",
"id": "2796af39319179b4177f692086b8482bbd6c5ad3",
"size": "311",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RefactoringTechniques/DuplicatedCode/Practice/Football.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "43942"
}
],
"symlink_target": ""
} |
using Railgun.Common.Chat.Permissions;
using Railgun.Protocols.SockChat.ServerMessages;
using System;
using System.Collections.Generic;
namespace Railgun.Protocols.SockChat.Commands
{
public sealed class SockChatPasswordCommand : SockChatCommand
{
public override string[] Names => new[] { SockChatConstants.CMD_PWD, SockChatConstants.CMD_PASSWORD };
public override string Summary => @"Sets a password on the current channel.";
public override Type[] RequiredPermissions => new[] { typeof(ChatManageChannelsPermission) };
public override string[] OptionalArgs => new[] { @"password" };
public SockChatPasswordCommand(SockChatSession session) : base(session)
{
}
public override IEnumerable<SockChatServerMessage> Handle(string[] args)
{
return null;
}
}
}
| {
"content_hash": "eb429daa8b2e90d6be5cedfc9e781e7d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 110,
"avg_line_length": 36.041666666666664,
"alnum_prop": 0.6947976878612717,
"repo_name": "flashwave/railgun",
"id": "541274f7e019a200318489c0eb4a0d0866dcfb36",
"size": "867",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Railgun.Protocols.SockChat/Commands/SockChatPasswordCommand.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "127"
},
{
"name": "C#",
"bytes": "157511"
},
{
"name": "Shell",
"bytes": "130"
}
],
"symlink_target": ""
} |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import 'tachyons'
class Welcome extends Component {
render() {
const handleScanClick = this.props.onScan
return (
<div>
<header className="tc ph4 pv4">
<h1 className="f2 f2-m f1-l fw2 black-90 mv3">
Connect your Raspberry Pi
</h1>
</header>
<div className="ph3 tc mt7 mt9-l">
<h1 className="f6 fw6 ttu tracked black-60">Find your device</h1>
<a
className="f4 link dim br2 ba ph3 pv2 mt2 dib black"
onClick={handleScanClick}
>
Scan
</a>
</div>
</div>
)
}
}
Welcome.propTypes = {
onScan: PropTypes.func.isRequired,
}
export default Welcome
| {
"content_hash": "0fdadb078c22d7a3466f91dccfe23d45",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 75,
"avg_line_length": 21.944444444444443,
"alnum_prop": 0.5645569620253165,
"repo_name": "rnbez/bluetooth-chrome",
"id": "5549274416fb4b0272282aaa09c3f49a051b0340",
"size": "790",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/Welcome.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "365"
},
{
"name": "HTML",
"bytes": "1137"
},
{
"name": "JavaScript",
"bytes": "12920"
}
],
"symlink_target": ""
} |
__all__ = ["createWsUrl",
"parseWsUrl",
"connectWS",
"listenWS",
"HttpException",
"ConnectionRequest",
"ConnectionResponse",
"Timings",
"WebSocketProtocol",
"WebSocketFactory",
"WebSocketServerProtocol",
"WebSocketServerFactory",
"WebSocketClientProtocol",
"WebSocketClientFactory"]
## The Python urlparse module currently does not contain the ws/wss
## schemes, so we add those dynamically (which is a hack of course).
##
import urlparse
wsschemes = ["ws", "wss"]
urlparse.uses_relative.extend(wsschemes)
urlparse.uses_netloc.extend(wsschemes)
urlparse.uses_params.extend(wsschemes)
urlparse.uses_query.extend(wsschemes)
urlparse.uses_fragment.extend(wsschemes)
import urllib
import binascii
import hashlib
import base64
import struct
import random
import os
from pprint import pformat
from array import array
from collections import deque
from twisted.internet import reactor, protocol
from twisted.internet.defer import maybeDeferred
from twisted.python import log
from _version import __version__
from utf8validator import Utf8Validator
from xormasker import XorMaskerNull, createXorMasker
from httpstatus import *
from util import Stopwatch
def createWsUrl(hostname, port = None, isSecure = False, path = None, params = None):
"""
Create a WebSocket URL from components.
:param hostname: WebSocket server hostname.
:type hostname: str
:param port: WebSocket service port or None (to select default ports 80/443 depending on isSecure).
:type port: int
:param isSecure: Set True for secure WebSocket ("wss" scheme).
:type isSecure: bool
:param path: Path component of addressed resource (will be properly URL escaped).
:type path: str
:param params: A dictionary of key-values to construct the query component of the addressed resource (will be properly URL escaped).
:type params: dict
:returns: str -- Constructed WebSocket URL.
"""
if port is not None:
netloc = "%s:%d" % (hostname, port)
else:
if isSecure:
netloc = "%s:443" % hostname
else:
netloc = "%s:80" % hostname
if isSecure:
scheme = "wss"
else:
scheme = "ws"
if path is not None:
ppath = urllib.quote(path)
else:
ppath = "/"
if params is not None:
query = urllib.urlencode(params)
else:
query = None
return urlparse.urlunparse((scheme, netloc, ppath, None, query, None))
def parseWsUrl(url):
"""
Parses as WebSocket URL into it's components and returns a tuple (isSecure, host, port, resource, path, params).
isSecure is a flag which is True for wss URLs.
host is the hostname or IP from the URL.
port is the port from the URL or standard port derived from scheme (ws = 80, wss = 443).
resource is the /resource name/ from the URL, the /path/ together with the (optional) /query/ component.
path is the /path/ component properly unescaped.
params is the /query) component properly unescaped and returned as dictionary.
:param url: A valid WebSocket URL, i.e. `ws://localhost:9000/myresource?param1=23¶m2=666`
:type url: str
:returns: tuple -- A tuple (isSecure, host, port, resource, path, params)
"""
parsed = urlparse.urlparse(url)
if parsed.scheme not in ["ws", "wss"]:
raise Exception("invalid WebSocket scheme '%s'" % parsed.scheme)
if parsed.port is None or parsed.port == "":
if parsed.scheme == "ws":
port = 80
else:
port = 443
else:
port = int(parsed.port)
if parsed.fragment is not None and parsed.fragment != "":
raise Exception("invalid WebSocket URL: non-empty fragment '%s" % parsed.fragment)
if parsed.path is not None and parsed.path != "":
ppath = parsed.path
path = urllib.unquote(ppath)
else:
ppath = "/"
path = ppath
if parsed.query is not None and parsed.query != "":
resource = ppath + "?" + parsed.query
params = urlparse.parse_qs(parsed.query)
else:
resource = ppath
params = {}
return (parsed.scheme == "wss", parsed.hostname, port, resource, path, params)
def connectWS(factory, contextFactory = None, timeout = 30, bindAddress = None):
"""
Establish WebSocket connection to a server. The connection parameters like target
host, port, resource and others are provided via the factory.
:param factory: The WebSocket protocol factory to be used for creating client protocol instances.
:type factory: An :class:`autobahn.websocket.WebSocketClientFactory` instance.
:param contextFactory: SSL context factory, required for secure WebSocket connections ("wss").
:type contextFactory: A `twisted.internet.ssl.ClientContextFactory <http://twistedmatrix.com/documents/current/api/twisted.internet.ssl.ClientContextFactory.html>`_ instance.
:param timeout: Number of seconds to wait before assuming the connection has failed.
:type timeout: int
:param bindAddress: A (host, port) tuple of local address to bind to, or None.
:type bindAddress: tuple
:returns: obj -- An object which implements `twisted.interface.IConnector <http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IConnector.html>`_.
"""
if factory.proxy is not None:
if factory.isSecure:
raise Exception("WSS over explicit proxies not implemented")
else:
conn = reactor.connectTCP(factory.proxy['host'], factory.proxy['port'], factory, timeout, bindAddress)
else:
if factory.isSecure:
if contextFactory is None:
# create default client SSL context factory when none given
from twisted.internet import ssl
contextFactory = ssl.ClientContextFactory()
conn = reactor.connectSSL(factory.host, factory.port, factory, contextFactory, timeout, bindAddress)
else:
conn = reactor.connectTCP(factory.host, factory.port, factory, timeout, bindAddress)
return conn
def listenWS(factory, contextFactory = None, backlog = 50, interface = ''):
"""
Listen for incoming WebSocket connections from clients. The connection parameters like
listening port and others are provided via the factory.
:param factory: The WebSocket protocol factory to be used for creating server protocol instances.
:type factory: An :class:`autobahn.websocket.WebSocketServerFactory` instance.
:param contextFactory: SSL context factory, required for secure WebSocket connections ("wss").
:type contextFactory: A twisted.internet.ssl.ContextFactory.
:param backlog: Size of the listen queue.
:type backlog: int
:param interface: The interface (derived from hostname given) to bind to, defaults to '' (all).
:type interface: str
:returns: obj -- An object that implements `twisted.interface.IListeningPort <http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IListeningPort.html>`_.
"""
if factory.isSecure:
if contextFactory is None:
raise Exception("Secure WebSocket listen requested, but no SSL context factory given")
listener = reactor.listenSSL(factory.port, factory, contextFactory, backlog, interface)
else:
listener = reactor.listenTCP(factory.port, factory, backlog, interface)
return listener
class FrameHeader:
"""
Thin-wrapper for storing WebSocket frame metadata.
FOR INTERNAL USE ONLY!
"""
def __init__(self, opcode, fin, rsv, length, mask):
"""
Constructor.
:param opcode: Frame opcode (0-15).
:type opcode: int
:param fin: Frame FIN flag.
:type fin: bool
:param rsv: Frame reserved flags (0-7).
:type rsv: int
:param length: Frame payload length.
:type length: int
:param mask: Frame mask (binary string) or None.
:type mask: str
"""
self.opcode = opcode
self.fin = fin
self.rsv = rsv
self.length = length
self.mask = mask
class HttpException:
"""
Throw an instance of this class to deny a WebSocket connection
during handshake in :meth:`autobahn.websocket.WebSocketServerProtocol.onConnect`.
You can find definitions of HTTP status codes in module :mod:`autobahn.httpstatus`.
"""
def __init__(self, code, reason):
"""
Constructor.
:param code: HTTP error code.
:type code: int
:param reason: HTTP error reason.
:type reason: str
"""
self.code = code
self.reason = reason
class ConnectionRequest:
"""
Thin-wrapper for WebSocket connection request information
provided in :meth:`autobahn.websocket.WebSocketServerProtocol.onConnect` when a WebSocket
client establishes a connection to a WebSocket server.
"""
def __init__(self, peer, peerstr, headers, host, path, params, version, origin, protocols, extensions):
"""
Constructor.
:param peer: IP address/port of the connecting client.
:type peer: object
:param peerstr: IP address/port of the connecting client as string.
:type peerstr: str
:param headers: HTTP headers from opening handshake request.
:type headers: dict
:param host: Host from opening handshake HTTP header.
:type host: str
:param path: Path from requested HTTP resource URI. For example, a resource URI of `/myservice?foo=23&foo=66&bar=2` will be parsed to `/myservice`.
:type path: str
:param params: Query parameters (if any) from requested HTTP resource URI. For example, a resource URI of `/myservice?foo=23&foo=66&bar=2` will be parsed to `{'foo': ['23', '66'], 'bar': ['2']}`.
:type params: dict of arrays of strings
:param version: The WebSocket protocol version the client announced (and will be spoken, when connection is accepted).
:type version: int
:param origin: The WebSocket origin header or None. Note that this only a reliable source of information for browser clients!
:type origin: str
:param protocols: The WebSocket (sub)protocols the client announced. You must select and return one of those (or None) in :meth:`autobahn.websocket.WebSocketServerProtocol.onConnect`.
:type protocols: array of strings
:param extensions: The WebSocket extensions the client requested and the server accepted (and thus will be spoken, when WS connection is established).
:type extensions: array of strings
"""
self.peer = peer
self.peerstr = peerstr
self.headers = headers
self.host = host
self.path = path
self.params = params
self.version = version
self.origin = origin
self.protocols = protocols
self.extensions = extensions
class ConnectionResponse():
"""
Thin-wrapper for WebSocket connection response information
provided in :meth:`autobahn.websocket.WebSocketClientProtocol.onConnect` when a WebSocket
client has established a connection to a WebSocket server.
"""
def __init__(self, peer, peerstr, headers, version, protocol, extensions):
"""
Constructor.
:param peer: IP address/port of the connected server.
:type peer: object
:param peerstr: IP address/port of the connected server as string.
:type peerstr: str
:param headers: HTTP headers from opening handshake response.
:type headers: dict
:param version: The WebSocket protocol version that is spoken.
:type version: int
:param protocol: The WebSocket (sub)protocol in use.
:type protocol: str
:param extensions: The WebSocket extensions in use.
:type extensions: array of strings
"""
self.peer = peer
self.peerstr = peerstr
self.headers = headers
self.version = version
self.protocol = protocol
self.extensions = extensions
def parseHttpHeader(data):
"""
Parses the beginning of a HTTP request header (the data up to the \n\n line) into a pair
of status line and HTTP headers dictionary.
Header keys are normalized to all-lower-case.
FOR INTERNAL USE ONLY!
:param data: The HTTP header data up to the \n\n line.
:type data: str
:returns: tuple -- Tuple of HTTP status line, headers and headers count.
"""
raw = data.splitlines()
http_status_line = raw[0].strip()
http_headers = {}
http_headers_cnt = {}
for h in raw[1:]:
i = h.find(":")
if i > 0:
## HTTP header keys are case-insensitive
key = h[:i].strip().lower()
## not sure if UTF-8 is allowed for HTTP header values..
value = h[i+1:].strip().decode("utf-8")
## handle HTTP headers split across multiple lines
if http_headers.has_key(key):
http_headers[key] += ", %s" % value
http_headers_cnt[key] += 1
else:
http_headers[key] = value
http_headers_cnt[key] = 1
else:
# skip bad HTTP header
pass
return (http_status_line, http_headers, http_headers_cnt)
class Timings:
"""
Helper class to track timings by key. This class also supports item access,
iteration and conversion to string.
"""
def __init__(self):
self._stopwatch = Stopwatch()
self._timings = {}
def track(self, key):
"""
Track elapsed for key.
:param key: Key under which to track the timing.
:type key: str
"""
self._timings[key] = self._stopwatch.elapsed()
def diff(self, startKey, endKey, format = True):
"""
Get elapsed difference between two previously tracked keys.
:param startKey: First key for interval (older timestamp).
:type startKey: str
:param endKey: Second key for interval (younger timestamp).
:type endKey: str
:param format: If `True`, format computed time period and return string.
:type format: bool
:returns: float or str -- Computed time period in seconds (or formatted string).
"""
if self._timings.has_key(endKey) and self._timings.has_key(startKey):
d = self._timings[endKey] - self._timings[startKey]
if format:
if d < 0.00001: # 10us
s = "%d ns" % round(d * 1000000000.)
elif d < 0.01: # 10ms
s = "%d us" % round(d * 1000000.)
elif d < 10: # 10s
s = "%d ms" % round(d * 1000.)
else:
s = "%d s" % round(d)
return s.rjust(8)
else:
return d
else:
if format:
return "n.a.".rjust(8)
else:
return None
def __getitem__(self, key):
return self._timings.get(key, None)
def __iter__(self):
return self._timings.__iter__(self)
def __str__(self):
return pformat(self._timings)
class WebSocketProtocol(protocol.Protocol):
"""
A Twisted Protocol class for WebSocket. This class is used by both WebSocket
client and server protocol version. It is unusable standalone, for example
the WebSocket initial handshake is implemented in derived class differently
for clients and servers.
"""
SUPPORTED_SPEC_VERSIONS = [0, 10, 11, 12, 13, 14, 15, 16, 17, 18]
"""
WebSocket protocol spec (draft) versions supported by this implementation.
Use of version 18 indicates RFC6455. Use of versions < 18 indicate actual
draft spec versions (Hybi-Drafts). Use of version 0 indicates Hixie-76.
"""
SUPPORTED_PROTOCOL_VERSIONS = [0, 8, 13]
"""
WebSocket protocol versions supported by this implementation. For Hixie-76,
there is no protocol version announced in HTTP header, and we just use the
draft version (0) in this case.
"""
SPEC_TO_PROTOCOL_VERSION = {0: 0, 10: 8, 11: 8, 12: 8, 13: 13, 14: 13, 15: 13, 16: 13, 17: 13, 18: 13}
"""
Mapping from protocol spec (draft) version to protocol version. For Hixie-76,
there is no protocol version announced in HTTP header, and we just use the
pseudo protocol version 0 in this case.
"""
PROTOCOL_TO_SPEC_VERSION = {0: 0, 8: 12, 13: 18}
"""
Mapping from protocol version to the latest protocol spec (draft) version
using that protocol version. For Hixie-76, there is no protocol version
announced in HTTP header, and we just use the draft version (0) in this case.
"""
DEFAULT_SPEC_VERSION = 18
"""
Default WebSocket protocol spec version this implementation speaks: final RFC6455.
"""
DEFAULT_ALLOW_HIXIE76 = False
"""
By default, this implementation will not allow to speak the obsoleted
Hixie-76 protocol version. That protocol version has security issues, but
is still spoken by some clients. Enable at your own risk! Enabling can be
done by using setProtocolOptions() on the factories for clients and servers.
"""
_WS_MAGIC = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
"""
Protocol defined magic used during WebSocket handshake (used in Hybi-drafts
and final RFC6455.
"""
_QUEUED_WRITE_DELAY = 0.00001
"""
For synched/chopped writes, this is the reactor reentry delay in seconds.
"""
MESSAGE_TYPE_TEXT = 1
"""
WebSocket text message type (UTF-8 payload).
"""
MESSAGE_TYPE_BINARY = 2
"""
WebSocket binary message type (arbitrary binary payload).
"""
## WebSocket protocol state:
## (STATE_PROXY_CONNECTING) => STATE_CONNECTING => STATE_OPEN => STATE_CLOSING => STATE_CLOSED
##
STATE_CLOSED = 0
STATE_CONNECTING = 1
STATE_CLOSING = 2
STATE_OPEN = 3
STATE_PROXY_CONNECTING = 4
## Streaming Send State
SEND_STATE_GROUND = 0
SEND_STATE_MESSAGE_BEGIN = 1
SEND_STATE_INSIDE_MESSAGE = 2
SEND_STATE_INSIDE_MESSAGE_FRAME = 3
## WebSocket protocol close codes
##
CLOSE_STATUS_CODE_NORMAL = 1000
"""Normal close of connection."""
CLOSE_STATUS_CODE_GOING_AWAY = 1001
"""Going away."""
CLOSE_STATUS_CODE_PROTOCOL_ERROR = 1002
"""Protocol error."""
CLOSE_STATUS_CODE_UNSUPPORTED_DATA = 1003
"""Unsupported data."""
CLOSE_STATUS_CODE_RESERVED1 = 1004
"""RESERVED"""
CLOSE_STATUS_CODE_NULL = 1005 # MUST NOT be set in close frame!
"""No status received. (MUST NOT be used as status code when sending a close)."""
CLOSE_STATUS_CODE_ABNORMAL_CLOSE = 1006 # MUST NOT be set in close frame!
"""Abnormal close of connection. (MUST NOT be used as status code when sending a close)."""
CLOSE_STATUS_CODE_INVALID_PAYLOAD = 1007
"""Invalid frame payload data."""
CLOSE_STATUS_CODE_POLICY_VIOLATION = 1008
"""Policy violation."""
CLOSE_STATUS_CODE_MESSAGE_TOO_BIG = 1009
"""Message too big."""
CLOSE_STATUS_CODE_MANDATORY_EXTENSION = 1010
"""Mandatory extension."""
CLOSE_STATUS_CODE_INTERNAL_ERROR = 1011
"""The peer encountered an unexpected condition or internal error."""
CLOSE_STATUS_CODE_TLS_HANDSHAKE_FAILED = 1015 # MUST NOT be set in close frame!
"""TLS handshake failed, i.e. server certificate could not be verified. (MUST NOT be used as status code when sending a close)."""
CLOSE_STATUS_CODES_ALLOWED = [CLOSE_STATUS_CODE_NORMAL,
CLOSE_STATUS_CODE_GOING_AWAY,
CLOSE_STATUS_CODE_PROTOCOL_ERROR,
CLOSE_STATUS_CODE_UNSUPPORTED_DATA,
CLOSE_STATUS_CODE_INVALID_PAYLOAD,
CLOSE_STATUS_CODE_POLICY_VIOLATION,
CLOSE_STATUS_CODE_MESSAGE_TOO_BIG,
CLOSE_STATUS_CODE_MANDATORY_EXTENSION,
CLOSE_STATUS_CODE_INTERNAL_ERROR]
"""Status codes allowed to send in close."""
def onOpen(self):
"""
Callback when initial WebSocket handshake was completed. Now you may send messages.
Default implementation does nothing. Override in derived class.
Modes: Hybi, Hixie
"""
if self.debugCodePaths:
log.msg("WebSocketProtocol.onOpen")
def onMessageBegin(self, opcode):
"""
Callback when receiving a new message has begun. Default implementation will
prepare to buffer message frames. Override in derived class.
Modes: Hybi, Hixie
:param opcode: Opcode of message.
:type opcode: int
"""
self.message_opcode = opcode
self.message_data = []
self.message_data_total_length = 0
def onMessageFrameBegin(self, length, reserved):
"""
Callback when receiving a new message frame has begun. Default implementation will
prepare to buffer message frame data. Override in derived class.
Modes: Hybi
:param length: Payload length of message frame which is to be received.
:type length: int
:param reserved: Reserved bits set in frame (an integer from 0 to 7).
:type reserved: int
"""
self.frame_length = length
self.frame_reserved = reserved
self.frame_data = []
self.message_data_total_length += length
if not self.failedByMe:
if self.maxMessagePayloadSize > 0 and self.message_data_total_length > self.maxMessagePayloadSize:
self.wasMaxMessagePayloadSizeExceeded = True
self.failConnection(WebSocketProtocol.CLOSE_STATUS_CODE_MESSAGE_TOO_BIG, "message exceeds payload limit of %d octets" % self.maxMessagePayloadSize)
elif self.maxFramePayloadSize > 0 and length > self.maxFramePayloadSize:
self.wasMaxFramePayloadSizeExceeded = True
self.failConnection(WebSocketProtocol.CLOSE_STATUS_CODE_POLICY_VIOLATION, "frame exceeds payload limit of %d octets" % self.maxFramePayloadSize)
def onMessageFrameData(self, payload):
"""
Callback when receiving data witin message frame. Default implementation will
buffer data for frame. Override in derived class.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, this method is slightly misnamed for historic reasons.
:param payload: Partial payload for message frame.
:type payload: str
"""
if not self.failedByMe:
if self.websocket_version == 0:
self.message_data_total_length += len(payload)
if self.maxMessagePayloadSize > 0 and self.message_data_total_length > self.maxMessagePayloadSize:
self.wasMaxMessagePayloadSizeExceeded = True
self.failConnection(WebSocketProtocol.CLOSE_STATUS_CODE_MESSAGE_TOO_BIG, "message exceeds payload limit of %d octets" % self.maxMessagePayloadSize)
self.message_data.append(payload)
else:
self.frame_data.append(payload)
def onMessageFrameEnd(self):
"""
Callback when a message frame has been completely received. Default implementation
will flatten the buffered frame data and callback onMessageFrame. Override
in derived class.
Modes: Hybi
"""
if not self.failedByMe:
self.onMessageFrame(self.frame_data, self.frame_reserved)
self.frame_data = None
def onMessageFrame(self, payload, reserved):
"""
Callback fired when complete message frame has been received. Default implementation
will buffer frame for message. Override in derived class.
Modes: Hybi
:param payload: Message frame payload.
:type payload: list of str
:param reserved: Reserved bits set in frame (an integer from 0 to 7).
:type reserved: int
"""
if not self.failedByMe:
self.message_data.extend(payload)
def onMessageEnd(self):
"""
Callback when a message has been completely received. Default implementation
will flatten the buffered frames and callback onMessage. Override
in derived class.
Modes: Hybi, Hixie
"""
if not self.failedByMe:
payload = ''.join(self.message_data)
if self.trackedTimings:
self.trackedTimings.track("onMessage")
self.onMessage(payload, self.message_opcode == WebSocketProtocol.MESSAGE_TYPE_BINARY)
self.message_data = None
def onMessage(self, payload, binary):
"""
Callback when a complete message was received. Default implementation does nothing.
Override in derived class.
Modes: Hybi, Hixie
:param payload: Message payload (UTF-8 encoded text string or binary string). Can also be an empty string, when message contained no payload.
:type payload: str
:param binary: If True, payload is binary, otherwise text.
:type binary: bool
"""
if self.debug:
log.msg("WebSocketProtocol.onMessage")
def onPing(self, payload):
"""
Callback when Ping was received. Default implementation responds
with a Pong. Override in derived class.
Modes: Hybi
:param payload: Payload of Ping, when there was any. Can be arbitrary, up to 125 octets.
:type payload: str
"""
if self.debug:
log.msg("WebSocketProtocol.onPing")
if self.state == WebSocketProtocol.STATE_OPEN:
self.sendPong(payload)
def onPong(self, payload):
"""
Callback when Pong was received. Default implementation does nothing.
Override in derived class.
Modes: Hybi
:param payload: Payload of Pong, when there was any. Can be arbitrary, up to 125 octets.
"""
if self.debug:
log.msg("WebSocketProtocol.onPong")
def onClose(self, wasClean, code, reason):
"""
Callback when the connection has been closed. Override in derived class.
Modes: Hybi, Hixie
:param wasClean: True, iff the connection was closed cleanly.
:type wasClean: bool
:param code: None or close status code (sent by peer), if there was one (:class:`WebSocketProtocol`.CLOSE_STATUS_CODE_*).
:type code: int
:param reason: None or close reason (sent by peer) (when present, a status code MUST have been also be present).
:type reason: str
"""
if self.debugCodePaths:
s = "WebSocketProtocol.onClose:\n"
s += "wasClean=%s\n" % wasClean
s += "code=%s\n" % code
s += "reason=%s\n" % reason
s += "self.closedByMe=%s\n" % self.closedByMe
s += "self.failedByMe=%s\n" % self.failedByMe
s += "self.droppedByMe=%s\n" % self.droppedByMe
s += "self.wasClean=%s\n" % self.wasClean
s += "self.wasNotCleanReason=%s\n" % self.wasNotCleanReason
s += "self.localCloseCode=%s\n" % self.localCloseCode
s += "self.localCloseReason=%s\n" % self.localCloseReason
s += "self.remoteCloseCode=%s\n" % self.remoteCloseCode
s += "self.remoteCloseReason=%s\n" % self.remoteCloseReason
log.msg(s)
def onCloseFrame(self, code, reasonRaw):
"""
Callback when a Close frame was received. The default implementation answers by
sending a Close when no Close was sent before. Otherwise it drops
the TCP connection either immediately (when we are a server) or after a timeout
(when we are a client and expect the server to drop the TCP).
Modes: Hybi, Hixie
Notes:
- For Hixie mode, this method is slightly misnamed for historic reasons.
- For Hixie mode, code and reasonRaw are silently ignored.
:param code: None or close status code, if there was one (:class:`WebSocketProtocol`.CLOSE_STATUS_CODE_*).
:type code: int
:param reason: None or close reason (when present, a status code MUST have been also be present).
:type reason: str
"""
if self.debugCodePaths:
log.msg("WebSocketProtocol.onCloseFrame")
self.remoteCloseCode = code
self.remoteCloseReason = reasonRaw
## reserved close codes: 0-999, 1004, 1005, 1006, 1011-2999, >= 5000
##
if code is not None and (code < 1000 or (code >= 1000 and code <= 2999 and code not in WebSocketProtocol.CLOSE_STATUS_CODES_ALLOWED) or code >= 5000):
if self.protocolViolation("invalid close code %d" % code):
return True
## closing reason
##
if reasonRaw is not None:
## we use our own UTF-8 validator to get consistent and fully conformant
## UTF-8 validation behavior
u = Utf8Validator()
val = u.validate(reasonRaw)
if not val[0]:
if self.invalidPayload("invalid close reason (non-UTF-8 payload)"):
return True
if self.state == WebSocketProtocol.STATE_CLOSING:
## We already initiated the closing handshake, so this
## is the peer's reply to our close frame.
## cancel any closing HS timer if present
##
if self.closeHandshakeTimeoutCall is not None:
if self.debugCodePaths:
log.msg("closeHandshakeTimeoutCall.cancel")
self.closeHandshakeTimeoutCall.cancel()
self.closeHandshakeTimeoutCall = None
self.wasClean = True
if self.isServer:
## When we are a server, we immediately drop the TCP.
self.dropConnection(abort = True)
else:
## When we are a client, the server should drop the TCP
## If that doesn't happen, we do. And that will set wasClean = False.
if self.serverConnectionDropTimeout > 0:
self.serverConnectionDropTimeoutCall = reactor.callLater(self.serverConnectionDropTimeout, self.onServerConnectionDropTimeout)
elif self.state == WebSocketProtocol.STATE_OPEN:
## The peer initiates a closing handshake, so we reply
## by sending close frame.
self.wasClean = True
if self.websocket_version == 0:
self.sendCloseFrame(isReply = True)
else:
## Either reply with same code/reason, or code == NORMAL/reason=None
if self.echoCloseCodeReason:
self.sendCloseFrame(code = code, reasonUtf8 = reason.encode("UTF-8"), isReply = True)
else:
self.sendCloseFrame(code = WebSocketProtocol.CLOSE_STATUS_CODE_NORMAL, isReply = True)
if self.isServer:
## When we are a server, we immediately drop the TCP.
self.dropConnection(abort = False)
else:
## When we are a client, we expect the server to drop the TCP,
## and when the server fails to do so, a timeout in sendCloseFrame()
## will set wasClean = False back again.
pass
else:
## STATE_PROXY_CONNECTING, STATE_CONNECTING, STATE_CLOSED
raise Exception("logic error")
def onServerConnectionDropTimeout(self):
"""
We (a client) expected the peer (a server) to drop the connection,
but it didn't (in time self.serverConnectionDropTimeout).
So we drop the connection, but set self.wasClean = False.
Modes: Hybi, Hixie
"""
self.serverConnectionDropTimeoutCall = None
if self.state != WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("onServerConnectionDropTimeout")
self.wasClean = False
self.wasNotCleanReason = "server did not drop TCP connection (in time)"
self.wasServerConnectionDropTimeout = True
self.dropConnection(abort = True)
else:
if self.debugCodePaths:
log.msg("skipping onServerConnectionDropTimeout since connection is already closed")
def onOpenHandshakeTimeout(self):
"""
We expected the peer to complete the opening handshake with to us.
It didn't do so (in time self.openHandshakeTimeout).
So we drop the connection, but set self.wasClean = False.
Modes: Hybi, Hixie
"""
self.openHandshakeTimeoutCall = None
if self.state in [WebSocketProtocol.STATE_CONNECTING, WebSocketProtocol.STATE_PROXY_CONNECTING]:
if self.debugCodePaths:
log.msg("onOpenHandshakeTimeout fired")
self.wasClean = False
self.wasNotCleanReason = "peer did not finish (in time) the opening handshake"
self.wasOpenHandshakeTimeout = True
self.dropConnection(abort = True)
elif self.state == WebSocketProtocol.STATE_OPEN:
if self.debugCodePaths:
log.msg("skipping onOpenHandshakeTimeout since WebSocket connection is open (opening handshake already finished)")
elif self.state == WebSocketProtocol.STATE_CLOSING:
if self.debugCodePaths:
log.msg("skipping onOpenHandshakeTimeout since WebSocket connection is closing")
elif self.state == WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("skipping onOpenHandshakeTimeout since WebSocket connection already closed")
else:
# should not arrive here
raise Exception("logic error")
def onCloseHandshakeTimeout(self):
"""
We expected the peer to respond to us initiating a close handshake. It didn't
respond (in time self.closeHandshakeTimeout) with a close response frame though.
So we drop the connection, but set self.wasClean = False.
Modes: Hybi, Hixie
"""
self.closeHandshakeTimeoutCall = None
if self.state != WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("onCloseHandshakeTimeout fired")
self.wasClean = False
self.wasNotCleanReason = "peer did not respond (in time) in closing handshake"
self.wasCloseHandshakeTimeout = True
self.dropConnection(abort = True)
else:
if self.debugCodePaths:
log.msg("skipping onCloseHandshakeTimeout since connection is already closed")
def dropConnection(self, abort = False):
"""
Drop the underlying TCP connection. For abort parameter, see:
* http://twistedmatrix.com/documents/current/core/howto/servers.html#auto2
* https://github.com/tavendo/AutobahnPython/issues/96
Modes: Hybi, Hixie
"""
if self.state != WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("dropping connection")
self.droppedByMe = True
self.state = WebSocketProtocol.STATE_CLOSED
if abort:
self.transport.abortConnection()
else:
self.transport.loseConnection()
else:
if self.debugCodePaths:
log.msg("skipping dropConnection since connection is already closed")
def failConnection(self, code = CLOSE_STATUS_CODE_GOING_AWAY, reason = "Going Away"):
"""
Fails the WebSocket connection.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, the code and reason are silently ignored.
"""
if self.state != WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("Failing connection : %s - %s" % (code, reason))
self.failedByMe = True
if self.failByDrop:
## brutally drop the TCP connection
self.wasClean = False
self.wasNotCleanReason = "I failed the WebSocket connection by dropping the TCP connection"
self.dropConnection(abort = True)
else:
## perform WebSocket closing handshake
if self.state != WebSocketProtocol.STATE_CLOSING:
self.sendCloseFrame(code = code, reasonUtf8 = reason.encode("UTF-8"), isReply = False)
else:
if self.debugCodePaths:
log.msg("skipping failConnection since connection is already closing")
else:
if self.debugCodePaths:
log.msg("skipping failConnection since connection is already closed")
def protocolViolation(self, reason):
"""
Fired when a WebSocket protocol violation/error occurs.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, reason is silently ignored.
:param reason: Protocol violation that was encountered (human readable).
:type reason: str
:returns: bool -- True, when any further processing should be discontinued.
"""
if self.debugCodePaths:
log.msg("Protocol violation : %s" % reason)
self.failConnection(WebSocketProtocol.CLOSE_STATUS_CODE_PROTOCOL_ERROR, reason)
if self.failByDrop:
return True
else:
## if we don't immediately drop the TCP, we need to skip the invalid frame
## to continue to later receive the closing handshake reply
return False
def invalidPayload(self, reason):
"""
Fired when invalid payload is encountered. Currently, this only happens
for text message when payload is invalid UTF-8 or close frames with
close reason that is invalid UTF-8.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, reason is silently ignored.
:param reason: What was invalid for the payload (human readable).
:type reason: str
:returns: bool -- True, when any further processing should be discontinued.
"""
if self.debugCodePaths:
log.msg("Invalid payload : %s" % reason)
self.failConnection(WebSocketProtocol.CLOSE_STATUS_CODE_INVALID_PAYLOAD, reason)
if self.failByDrop:
return True
else:
## if we don't immediately drop the TCP, we need to skip the invalid frame
## to continue to later receive the closing handshake reply
return False
def setTrackTimings(self, enable):
"""
Enable/disable tracking of detailed timings.
:param enable: Turn time tracking on/off.
:type enable: bool
"""
if not hasattr(self, 'trackTimings') or self.trackTimings != enable:
self.trackTimings = enable
if self.trackTimings:
self.trackedTimings = Timings()
else:
self.trackedTimings = None
def doTrack(self, msg):
if not hasattr(self, 'trackTimings') or not self.trackTimings:
return
self.trackedTimings.track(msg)
def connectionMade(self):
"""
This is called by Twisted framework when a new TCP connection has been established
and handed over to a Protocol instance (an instance of this class).
Modes: Hybi, Hixie
"""
## copy default options from factory (so we are not affected by changed on those)
##
self.debug = self.factory.debug
self.debugCodePaths = self.factory.debugCodePaths
self.logOctets = self.factory.logOctets
self.logFrames = self.factory.logFrames
self.setTrackTimings(self.factory.trackTimings)
self.allowHixie76 = self.factory.allowHixie76
self.utf8validateIncoming = self.factory.utf8validateIncoming
self.applyMask = self.factory.applyMask
self.maxFramePayloadSize = self.factory.maxFramePayloadSize
self.maxMessagePayloadSize = self.factory.maxMessagePayloadSize
self.autoFragmentSize = self.factory.autoFragmentSize
self.failByDrop = self.factory.failByDrop
self.echoCloseCodeReason = self.factory.echoCloseCodeReason
self.openHandshakeTimeout = self.factory.openHandshakeTimeout
self.closeHandshakeTimeout = self.factory.closeHandshakeTimeout
self.tcpNoDelay = self.factory.tcpNoDelay
if self.isServer:
self.versions = self.factory.versions
self.webStatus = self.factory.webStatus
self.requireMaskedClientFrames = self.factory.requireMaskedClientFrames
self.maskServerFrames = self.factory.maskServerFrames
else:
self.version = self.factory.version
self.acceptMaskedServerFrames = self.factory.acceptMaskedServerFrames
self.maskClientFrames = self.factory.maskClientFrames
self.serverConnectionDropTimeout = self.factory.serverConnectionDropTimeout
## Set "Nagle"
self.transport.setTcpNoDelay(self.tcpNoDelay)
## the peer we are connected to
self.peer = self.transport.getPeer()
self.peerstr = "%s:%d" % (self.peer.host, self.peer.port)
## initial state
if not self.isServer and self.factory.proxy is not None:
self.state = WebSocketProtocol.STATE_PROXY_CONNECTING
else:
self.state = WebSocketProtocol.STATE_CONNECTING
self.send_state = WebSocketProtocol.SEND_STATE_GROUND
self.data = ""
## for chopped/synched sends, we need to queue to maintain
## ordering when recalling the reactor to actually "force"
## the octets to wire (see test/trickling in the repo)
self.send_queue = deque()
self.triggered = False
## incremental UTF8 validator
self.utf8validator = Utf8Validator()
## track when frame/message payload sizes (incoming) were exceeded
self.wasMaxFramePayloadSizeExceeded = False
self.wasMaxMessagePayloadSizeExceeded = False
## the following vars are related to connection close handling/tracking
# True, iff I have initiated closing HS (that is, did send close first)
self.closedByMe = False
# True, iff I have failed the WS connection (i.e. due to protocol error)
# Failing can be either by initiating close HS or brutal drop (this is
# controlled by failByDrop option)
self.failedByMe = False
# True, iff I dropped the TCP connection (called transport.loseConnection())
self.droppedByMe = False
# True, iff full WebSocket closing handshake was performed (close frame sent
# and received) _and_ the server dropped the TCP (which is its responsibility)
self.wasClean = False
# When self.wasClean = False, the reason (what happened)
self.wasNotCleanReason = None
# When we are a client, and we expected the server to drop the TCP, but that
# didn't happen in time, this gets True
self.wasServerConnectionDropTimeout = False
# When the initial WebSocket opening handshake times out, this gets True
self.wasOpenHandshakeTimeout = False
# When we initiated a closing handshake, but the peer did not respond in
# time, this gets True
self.wasCloseHandshakeTimeout = False
# The close code I sent in close frame (if any)
self.localCloseCode = None
# The close reason I sent in close frame (if any)
self.localCloseReason = None
# The close code the peer sent me in close frame (if any)
self.remoteCloseCode = None
# The close reason the peer sent me in close frame (if any)
self.remoteCloseReason = None
# timers, which might get set up later, and remembered here to get canceled
# when appropriate
if not self.isServer:
self.serverConnectionDropTimeoutCall = None
self.openHandshakeTimeoutCall = None
self.closeHandshakeTimeoutCall = None
# set opening handshake timeout handler
if self.openHandshakeTimeout > 0:
self.openHandshakeTimeoutCall = reactor.callLater(self.openHandshakeTimeout, self.onOpenHandshakeTimeout)
def connectionLost(self, reason):
"""
This is called by Twisted framework when a TCP connection was lost.
Modes: Hybi, Hixie
"""
## cancel any server connection drop timer if present
##
if not self.isServer and self.serverConnectionDropTimeoutCall is not None:
if self.debugCodePaths:
log.msg("serverConnectionDropTimeoutCall.cancel")
self.serverConnectionDropTimeoutCall.cancel()
self.serverConnectionDropTimeoutCall = None
self.state = WebSocketProtocol.STATE_CLOSED
if not self.wasClean:
if not self.droppedByMe and self.wasNotCleanReason is None:
self.wasNotCleanReason = "peer dropped the TCP connection without previous WebSocket closing handshake"
self.onClose(self.wasClean, WebSocketProtocol.CLOSE_STATUS_CODE_ABNORMAL_CLOSE, "connection was closed uncleanly (%s)" % self.wasNotCleanReason)
else:
self.onClose(self.wasClean, self.remoteCloseCode, self.remoteCloseReason)
def logRxOctets(self, data):
"""
Hook fired right after raw octets have been received, but only when self.logOctets == True.
Modes: Hybi, Hixie
"""
log.msg("RX Octets from %s : octets = %s" % (self.peerstr, binascii.b2a_hex(data)))
def logTxOctets(self, data, sync):
"""
Hook fired right after raw octets have been sent, but only when self.logOctets == True.
Modes: Hybi, Hixie
"""
log.msg("TX Octets to %s : sync = %s, octets = %s" % (self.peerstr, sync, binascii.b2a_hex(data)))
def logRxFrame(self, frameHeader, payload):
"""
Hook fired right after WebSocket frame has been received and decoded, but only when self.logFrames == True.
Modes: Hybi
"""
data = ''.join(payload)
info = (self.peerstr,
frameHeader.fin,
frameHeader.rsv,
frameHeader.opcode,
binascii.b2a_hex(frameHeader.mask) if frameHeader.mask else "-",
frameHeader.length,
data if frameHeader.opcode == 1 else binascii.b2a_hex(data))
log.msg("RX Frame from %s : fin = %s, rsv = %s, opcode = %s, mask = %s, length = %s, payload = %s" % info)
def logTxFrame(self, frameHeader, payload, repeatLength, chopsize, sync):
"""
Hook fired right after WebSocket frame has been encoded and sent, but only when self.logFrames == True.
Modes: Hybi
"""
info = (self.peerstr,
frameHeader.fin,
frameHeader.rsv,
frameHeader.opcode,
binascii.b2a_hex(frameHeader.mask) if frameHeader.mask else "-",
frameHeader.length,
repeatLength,
chopsize,
sync,
payload if frameHeader.opcode == 1 else binascii.b2a_hex(payload))
log.msg("TX Frame to %s : fin = %s, rsv = %s, opcode = %s, mask = %s, length = %s, repeat_length = %s, chopsize = %s, sync = %s, payload = %s" % info)
def dataReceived(self, data):
"""
This is called by Twisted framework upon receiving data on TCP connection.
Modes: Hybi, Hixie
"""
if self.logOctets:
self.logRxOctets(data)
self.data += data
self.consumeData()
def consumeData(self):
"""
Consume buffered (incoming) data.
Modes: Hybi, Hixie
"""
## WebSocket is open (handshake was completed) or close was sent
##
if self.state == WebSocketProtocol.STATE_OPEN or self.state == WebSocketProtocol.STATE_CLOSING:
## process until no more buffered data left or WS was closed
##
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
pass
## need to establish proxy connection
##
elif self.state == WebSocketProtocol.STATE_PROXY_CONNECTING:
self.processProxyConnect()
## WebSocket needs handshake
##
elif self.state == WebSocketProtocol.STATE_CONNECTING:
## the implementation of processHandshake() in derived
## class needs to perform client or server handshake
## from other party here ..
##
self.processHandshake()
## we failed the connection .. don't process any more data!
##
elif self.state == WebSocketProtocol.STATE_CLOSED:
## ignore any data received after WS was closed
##
if self.debugCodePaths:
log.msg("received data in STATE_CLOSED")
## should not arrive here (invalid state)
##
else:
raise Exception("invalid state")
def processProxyConnect(self):
"""
Process proxy connect.
Modes: Hybi, Hixie
"""
raise Exception("must implement proxy connect (client or server) in derived class")
def processHandshake(self):
"""
Process WebSocket handshake.
Modes: Hybi, Hixie
"""
raise Exception("must implement handshake (client or server) in derived class")
def registerProducer(self, producer, streaming):
"""
Register a Twisted producer with this protocol.
Modes: Hybi, Hixie
:param producer: A Twisted push or pull producer.
:type producer: object
:param streaming: Producer type.
:type streaming: bool
"""
self.transport.registerProducer(producer, streaming)
def _trigger(self):
"""
Trigger sending stuff from send queue (which is only used for chopped/synched writes).
Modes: Hybi, Hixie
"""
if not self.triggered:
self.triggered = True
self._send()
def _send(self):
"""
Send out stuff from send queue. For details how this works, see test/trickling
in the repo.
Modes: Hybi, Hixie
"""
if len(self.send_queue) > 0:
e = self.send_queue.popleft()
if self.state != WebSocketProtocol.STATE_CLOSED:
self.transport.write(e[0])
if self.logOctets:
self.logTxOctets(e[0], e[1])
else:
if self.debugCodePaths:
log.msg("skipped delayed write, since connection is closed")
# we need to reenter the reactor to make the latter
# reenter the OS network stack, so that octets
# can get on the wire. Note: this is a "heuristic",
# since there is no (easy) way to really force out
# octets from the OS network stack to wire.
reactor.callLater(WebSocketProtocol._QUEUED_WRITE_DELAY, self._send)
else:
self.triggered = False
def sendData(self, data, sync = False, chopsize = None):
"""
Wrapper for self.transport.write which allows to give a chopsize.
When asked to chop up writing to TCP stream, we write only chopsize octets
and then give up control to select() in underlying reactor so that bytes
get onto wire immediately. Note that this is different from and unrelated
to WebSocket data message fragmentation. Note that this is also different
from the TcpNoDelay option which can be set on the socket.
Modes: Hybi, Hixie
"""
if chopsize and chopsize > 0:
i = 0
n = len(data)
done = False
while not done:
j = i + chopsize
if j >= n:
done = True
j = n
self.send_queue.append((data[i:j], True))
i += chopsize
self._trigger()
else:
if sync or len(self.send_queue) > 0:
self.send_queue.append((data, sync))
self._trigger()
else:
self.transport.write(data)
if self.logOctets:
self.logTxOctets(data, False)
def sendPreparedMessage(self, preparedMsg):
"""
Send a message that was previously prepared with
WebSocketFactory.prepareMessage().
Modes: Hybi, Hixie
"""
if self.websocket_version == 0:
self.sendData(preparedMsg.payloadHixie)
else:
self.sendData(preparedMsg.payloadHybi)
def processData(self):
"""
After WebSocket handshake has been completed, this procedure will do all
subsequent processing of incoming bytes.
Modes: Hybi, Hixie
"""
if self.websocket_version == 0:
return self.processDataHixie76()
else:
return self.processDataHybi()
def processDataHixie76(self):
"""
Hixie-76 incoming data processing.
Modes: Hixie
"""
buffered_len = len(self.data)
## outside a message, that is we are awaiting data which starts a new message
##
if not self.inside_message:
if buffered_len >= 2:
## new message
##
if self.data[0] == '\x00':
self.inside_message = True
if self.utf8validateIncoming:
self.utf8validator.reset()
self.utf8validateIncomingCurrentMessage = True
self.utf8validateLast = (True, True, 0, 0)
else:
self.utf8validateIncomingCurrentMessage = False
self.data = self.data[1:]
if self.trackedTimings:
self.trackedTimings.track("onMessageBegin")
self.onMessageBegin(1)
## Hixie close from peer received
##
elif self.data[0] == '\xff' and self.data[1] == '\x00':
self.onCloseFrame(None, None)
self.data = self.data[2:]
# stop receiving/processing after having received close!
return False
## malformed data
##
else:
if self.protocolViolation("malformed data received"):
return False
else:
## need more data
return False
end_index = self.data.find('\xff')
if end_index > 0:
payload = self.data[:end_index]
self.data = self.data[end_index + 1:]
else:
payload = self.data
self.data = ''
## incrementally validate UTF-8 payload
##
if self.utf8validateIncomingCurrentMessage:
self.utf8validateLast = self.utf8validator.validate(payload)
if not self.utf8validateLast[0]:
if self.invalidPayload("encountered invalid UTF-8 while processing text message at payload octet index %d" % self.utf8validateLast[3]):
return False
self.onMessageFrameData(payload)
if end_index > 0:
self.inside_message = False
self.onMessageEnd()
return len(self.data) > 0
def processDataHybi(self):
"""
RFC6455/Hybi-Drafts incoming data processing.
Modes: Hybi
"""
buffered_len = len(self.data)
## outside a frame, that is we are awaiting data which starts a new frame
##
if self.current_frame is None:
## need minimum of 2 octets to for new frame
##
if buffered_len >= 2:
## FIN, RSV, OPCODE
##
b = ord(self.data[0])
frame_fin = (b & 0x80) != 0
frame_rsv = (b & 0x70) >> 4
frame_opcode = b & 0x0f
## MASK, PAYLOAD LEN 1
##
b = ord(self.data[1])
frame_masked = (b & 0x80) != 0
frame_payload_len1 = b & 0x7f
## MUST be 0 when no extension defining
## the semantics of RSV has been negotiated
##
if frame_rsv != 0:
if self.protocolViolation("RSV != 0 and no extension negotiated"):
return False
## all client-to-server frames MUST be masked
##
if self.isServer and self.requireMaskedClientFrames and not frame_masked:
if self.protocolViolation("unmasked client-to-server frame"):
return False
## all server-to-client frames MUST NOT be masked
##
if not self.isServer and not self.acceptMaskedServerFrames and frame_masked:
if self.protocolViolation("masked server-to-client frame"):
return False
## check frame
##
if frame_opcode > 7: # control frame (have MSB in opcode set)
## control frames MUST NOT be fragmented
##
if not frame_fin:
if self.protocolViolation("fragmented control frame"):
return False
## control frames MUST have payload 125 octets or less
##
if frame_payload_len1 > 125:
if self.protocolViolation("control frame with payload length > 125 octets"):
return False
## check for reserved control frame opcodes
##
if frame_opcode not in [8, 9, 10]:
if self.protocolViolation("control frame using reserved opcode %d" % frame_opcode):
return False
## close frame : if there is a body, the first two bytes of the body MUST be a 2-byte
## unsigned integer (in network byte order) representing a status code
##
if frame_opcode == 8 and frame_payload_len1 == 1:
if self.protocolViolation("received close control frame with payload len 1"):
return False
else: # data frame
## check for reserved data frame opcodes
##
if frame_opcode not in [0, 1, 2]:
if self.protocolViolation("data frame using reserved opcode %d" % frame_opcode):
return False
## check opcode vs message fragmentation state 1/2
##
if not self.inside_message and frame_opcode == 0:
if self.protocolViolation("received continuation data frame outside fragmented message"):
return False
## check opcode vs message fragmentation state 2/2
##
if self.inside_message and frame_opcode != 0:
if self.protocolViolation("received non-continuation data frame while inside fragmented message"):
return False
## compute complete header length
##
if frame_masked:
mask_len = 4
else:
mask_len = 0
if frame_payload_len1 < 126:
frame_header_len = 2 + mask_len
elif frame_payload_len1 == 126:
frame_header_len = 2 + 2 + mask_len
elif frame_payload_len1 == 127:
frame_header_len = 2 + 8 + mask_len
else:
raise Exception("logic error")
## only proceed when we have enough data buffered for complete
## frame header (which includes extended payload len + mask)
##
if buffered_len >= frame_header_len:
## minimum frame header length (already consumed)
##
i = 2
## extract extended payload length
##
if frame_payload_len1 == 126:
frame_payload_len = struct.unpack("!H", self.data[i:i+2])[0]
if frame_payload_len < 126:
if self.protocolViolation("invalid data frame length (not using minimal length encoding)"):
return False
i += 2
elif frame_payload_len1 == 127:
frame_payload_len = struct.unpack("!Q", self.data[i:i+8])[0]
if frame_payload_len > 0x7FFFFFFFFFFFFFFF: # 2**63
if self.protocolViolation("invalid data frame length (>2^63)"):
return False
if frame_payload_len < 65536:
if self.protocolViolation("invalid data frame length (not using minimal length encoding)"):
return False
i += 8
else:
frame_payload_len = frame_payload_len1
## when payload is masked, extract frame mask
##
frame_mask = None
if frame_masked:
frame_mask = self.data[i:i+4]
i += 4
if frame_masked and frame_payload_len > 0 and self.applyMask:
self.current_frame_masker = createXorMasker(frame_mask, frame_payload_len)
else:
self.current_frame_masker = XorMaskerNull()
## remember rest (payload of current frame after header and everything thereafter)
##
self.data = self.data[i:]
## ok, got complete frame header
##
self.current_frame = FrameHeader(frame_opcode,
frame_fin,
frame_rsv,
frame_payload_len,
frame_mask)
## process begin on new frame
##
self.onFrameBegin()
## reprocess when frame has no payload or and buffered data left
##
return frame_payload_len == 0 or len(self.data) > 0
else:
return False # need more data
else:
return False # need more data
## inside a started frame
##
else:
## cut out rest of frame payload
##
rest = self.current_frame.length - self.current_frame_masker.pointer()
if buffered_len >= rest:
data = self.data[:rest]
length = rest
self.data = self.data[rest:]
else:
data = self.data
length = buffered_len
self.data = ""
if length > 0:
## unmask payload
##
payload = self.current_frame_masker.process(data)
## process frame data
##
fr = self.onFrameData(payload)
if fr == False:
return False
## fire frame end handler when frame payload is complete
##
if self.current_frame_masker.pointer() == self.current_frame.length:
fr = self.onFrameEnd()
if fr == False:
return False
## reprocess when no error occurred and buffered data left
##
return len(self.data) > 0
def onFrameBegin(self):
"""
Begin of receive new frame.
Modes: Hybi
"""
if self.current_frame.opcode > 7:
self.control_frame_data = []
else:
## new message started
##
if not self.inside_message:
self.inside_message = True
if self.current_frame.opcode == WebSocketProtocol.MESSAGE_TYPE_TEXT and self.utf8validateIncoming:
self.utf8validator.reset()
self.utf8validateIncomingCurrentMessage = True
self.utf8validateLast = (True, True, 0, 0)
else:
self.utf8validateIncomingCurrentMessage = False
if self.trackedTimings:
self.trackedTimings.track("onMessageBegin")
self.onMessageBegin(self.current_frame.opcode)
self.onMessageFrameBegin(self.current_frame.length, self.current_frame.rsv)
def onFrameData(self, payload):
"""
New data received within frame.
Modes: Hybi
"""
if self.current_frame.opcode > 7:
self.control_frame_data.append(payload)
else:
## incrementally validate UTF-8 payload
##
if self.utf8validateIncomingCurrentMessage:
self.utf8validateLast = self.utf8validator.validate(payload)
if not self.utf8validateLast[0]:
if self.invalidPayload("encountered invalid UTF-8 while processing text message at payload octet index %d" % self.utf8validateLast[3]):
return False
self.onMessageFrameData(payload)
def onFrameEnd(self):
"""
End of frame received.
Modes: Hybi
"""
if self.current_frame.opcode > 7:
if self.logFrames:
self.logRxFrame(self.current_frame, self.control_frame_data)
self.processControlFrame()
else:
if self.logFrames:
self.logRxFrame(self.current_frame, self.frame_data)
self.onMessageFrameEnd()
if self.current_frame.fin:
if self.utf8validateIncomingCurrentMessage:
if not self.utf8validateLast[1]:
if self.invalidPayload("UTF-8 text message payload ended within Unicode code point at payload octet index %d" % self.utf8validateLast[3]):
return False
self.onMessageEnd()
self.inside_message = False
self.current_frame = None
def processControlFrame(self):
"""
Process a completely received control frame.
Modes: Hybi
"""
payload = ''.join(self.control_frame_data)
self.control_frame_data = None
## CLOSE frame
##
if self.current_frame.opcode == 8:
code = None
reasonRaw = None
ll = len(payload)
if ll > 1:
code = struct.unpack("!H", payload[0:2])[0]
if ll > 2:
reasonRaw = payload[2:]
if self.onCloseFrame(code, reasonRaw):
return False
## PING frame
##
elif self.current_frame.opcode == 9:
self.onPing(payload)
## PONG frame
##
elif self.current_frame.opcode == 10:
self.onPong(payload)
else:
## we might arrive here, when protocolViolation
## wants us to continue anyway
pass
return True
def sendFrame(self, opcode, payload = "", fin = True, rsv = 0, mask = None, payload_len = None, chopsize = None, sync = False):
"""
Send out frame. Normally only used internally via sendMessage(), sendPing(), sendPong() and sendClose().
This method deliberately allows to send invalid frames (that is frames invalid
per-se, or frames invalid because of protocol state). Other than in fuzzing servers,
calling methods will ensure that no invalid frames are sent.
In addition, this method supports explicit specification of payload length.
When payload_len is given, it will always write that many octets to the stream.
It'll wrap within payload, resending parts of that when more octets were requested
The use case is again for fuzzing server which want to sent increasing amounts
of payload data to peers without having to construct potentially large messges
themselfes.
Modes: Hybi
"""
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
if payload_len is not None:
if len(payload) < 1:
raise Exception("cannot construct repeated payload with length %d from payload of length %d" % (payload_len, len(payload)))
l = payload_len
pl = ''.join([payload for k in range(payload_len / len(payload))]) + payload[:payload_len % len(payload)]
else:
l = len(payload)
pl = payload
## first byte
##
b0 = 0
if fin:
b0 |= (1 << 7)
b0 |= (rsv % 8) << 4
b0 |= opcode % 128
## second byte, payload len bytes and mask
##
b1 = 0
if mask or (not self.isServer and self.maskClientFrames) or (self.isServer and self.maskServerFrames):
b1 |= 1 << 7
if not mask:
mask = struct.pack("!I", random.getrandbits(32))
mv = mask
else:
mv = ""
## mask frame payload
##
if l > 0 and self.applyMask:
masker = createXorMasker(mask, l)
plm = masker.process(pl)
else:
plm = pl
else:
mv = ""
plm = pl
el = ""
if l <= 125:
b1 |= l
elif l <= 0xFFFF:
b1 |= 126
el = struct.pack("!H", l)
elif l <= 0x7FFFFFFFFFFFFFFF:
b1 |= 127
el = struct.pack("!Q", l)
else:
raise Exception("invalid payload length")
raw = ''.join([chr(b0), chr(b1), el, mv, plm])
if self.logFrames:
frameHeader = FrameHeader(opcode, fin, rsv, l, mask)
self.logTxFrame(frameHeader, payload, payload_len, chopsize, sync)
## send frame octets
##
self.sendData(raw, sync, chopsize)
def sendPing(self, payload = None):
"""
Send out Ping to peer. A peer is expected to Pong back the payload a soon
as "practical". When more than 1 Ping is outstanding at a peer, the peer may
elect to respond only to the last Ping.
Modes: Hybi
:param payload: An optional, arbitrary payload of length < 126 octets.
:type payload: str
"""
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
if self.state != WebSocketProtocol.STATE_OPEN:
return
if payload:
l = len(payload)
if l > 125:
raise Exception("invalid payload for PING (payload length must be <= 125, was %d)" % l)
self.sendFrame(opcode = 9, payload = payload)
else:
self.sendFrame(opcode = 9)
def sendPong(self, payload = None):
"""
Send out Pong to peer. A Pong frame MAY be sent unsolicited.
This serves as a unidirectional heartbeat. A response to an unsolicited pong is "not expected".
Modes: Hybi
:param payload: An optional, arbitrary payload of length < 126 octets.
:type payload: str
"""
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
if self.state != WebSocketProtocol.STATE_OPEN:
return
if payload:
l = len(payload)
if l > 125:
raise Exception("invalid payload for PONG (payload length must be <= 125, was %d)" % l)
self.sendFrame(opcode = 10, payload = payload)
else:
self.sendFrame(opcode = 10)
def sendCloseFrame(self, code = None, reasonUtf8 = None, isReply = False):
"""
Send a close frame and update protocol state. Note, that this is
an internal method which deliberately allows not send close
frame with invalid payload.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, this method is slightly misnamed for historic reasons.
- For Hixie mode, code and reasonUtf8 will be silently ignored.
"""
if self.state == WebSocketProtocol.STATE_CLOSING:
if self.debugCodePaths:
log.msg("ignoring sendCloseFrame since connection is closing")
elif self.state == WebSocketProtocol.STATE_CLOSED:
if self.debugCodePaths:
log.msg("ignoring sendCloseFrame since connection already closed")
elif self.state in [WebSocketProtocol.STATE_PROXY_CONNECTING, WebSocketProtocol.STATE_CONNECTING]:
raise Exception("cannot close a connection not yet connected")
elif self.state == WebSocketProtocol.STATE_OPEN:
if self.websocket_version == 0:
self.sendData("\xff\x00")
else:
## construct Hybi close frame payload and send frame
payload = ""
if code is not None:
payload += struct.pack("!H", code)
if reasonUtf8 is not None:
payload += reasonUtf8
self.sendFrame(opcode = 8, payload = payload)
## update state
self.state = WebSocketProtocol.STATE_CLOSING
self.closedByMe = not isReply
## remember payload of close frame we sent
self.localCloseCode = code
self.localCloseReason = reasonUtf8
## drop connection when timeout on receiving close handshake reply
if self.closedByMe and self.closeHandshakeTimeout > 0:
self.closeHandshakeTimeoutCall = reactor.callLater(self.closeHandshakeTimeout, self.onCloseHandshakeTimeout)
else:
raise Exception("logic error")
def sendClose(self, code = None, reason = None):
"""
Starts a closing handshake.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, code and reason will be silently ignored.
:param code: An optional close status code (:class:`WebSocketProtocol`.CLOSE_STATUS_CODE_NORMAL or 3000-4999).
:type code: int
:param reason: An optional close reason (a string that when present, a status code MUST also be present).
:type reason: str
"""
if code is not None:
if type(code) != int:
raise Exception("invalid type %s for close code" % type(code))
if code != 1000 and not (code >= 3000 and code <= 4999):
raise Exception("invalid close code %d" % code)
if reason is not None:
if code is None:
raise Exception("close reason without close code")
if type(reason) not in [str, unicode]:
raise Exception("invalid type %s for close reason" % type(reason))
reasonUtf8 = reason.encode("UTF-8")
if len(reasonUtf8) + 2 > 125:
raise Exception("close reason too long (%d)" % len(reasonUtf8))
else:
reasonUtf8 = None
self.sendCloseFrame(code = code, reasonUtf8 = reasonUtf8, isReply = False)
def beginMessage(self, opcode = MESSAGE_TYPE_TEXT):
"""
Begin sending new message.
Modes: Hybi, Hixie
:param opcode: Message type, normally either WebSocketProtocol.MESSAGE_TYPE_TEXT (default) or
WebSocketProtocol.MESSAGE_TYPE_BINARY (only Hybi mode).
"""
if self.state != WebSocketProtocol.STATE_OPEN:
return
## check if sending state is valid for this method
##
if self.send_state != WebSocketProtocol.SEND_STATE_GROUND:
raise Exception("WebSocketProtocol.beginMessage invalid in current sending state")
if self.websocket_version == 0:
if opcode != 1:
raise Exception("cannot send non-text message in Hixie mode")
self.sendData('\x00')
self.send_state = WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE
else:
if opcode not in [1, 2]:
raise Exception("use of reserved opcode %d" % opcode)
## remember opcode for later (when sending first frame)
##
self.send_message_opcode = opcode
self.send_state = WebSocketProtocol.SEND_STATE_MESSAGE_BEGIN
def beginMessageFrame(self, length, reserved = 0, mask = None):
"""
Begin sending new message frame.
Modes: Hybi
:param length: Length of frame which is started. Must be >= 0 and <= 2^63.
:type length: int
:param reserved: Reserved bits for frame (an integer from 0 to 7). Note that reserved != 0 is only legal when an extension has been negoiated which defines semantics.
:type reserved: int
:param mask: Optional frame mask. When given, this is used. When None and the peer is a client, a mask will be internally generated. For servers None is default.
:type mask: str
"""
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
if self.state != WebSocketProtocol.STATE_OPEN:
return
## check if sending state is valid for this method
##
if self.send_state not in [WebSocketProtocol.SEND_STATE_MESSAGE_BEGIN, WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE]:
raise Exception("WebSocketProtocol.beginMessageFrame invalid in current sending state")
if (not type(length) in [int, long]) or length < 0 or length > 0x7FFFFFFFFFFFFFFF: # 2**63
raise Exception("invalid value for message frame length")
if type(reserved) is not int or reserved < 0 or reserved > 7:
raise Exception("invalid value for reserved bits")
self.send_message_frame_length = length
if mask:
## explicit mask given
##
assert type(mask) == str
assert len(mask) == 4
self.send_message_frame_mask = mask
elif (not self.isServer and self.maskClientFrames) or (self.isServer and self.maskServerFrames):
## automatic mask:
## - client-to-server masking (if not deactivated)
## - server-to-client masking (if activated)
##
self.send_message_frame_mask = struct.pack("!I", random.getrandbits(32))
else:
## no mask
##
self.send_message_frame_mask = None
## payload masker
##
if self.send_message_frame_mask and length > 0 and self.applyMask:
self.send_message_frame_masker = createXorMasker(self.send_message_frame_mask, length)
else:
self.send_message_frame_masker = XorMaskerNull()
## first byte
##
b0 = (reserved % 8) << 4 # FIN = false .. since with streaming, we don't know when message ends
if self.send_state == WebSocketProtocol.SEND_STATE_MESSAGE_BEGIN:
self.send_state = WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE
b0 |= self.send_message_opcode % 128
else:
pass # message continuation frame
## second byte, payload len bytes and mask
##
b1 = 0
if self.send_message_frame_mask:
b1 |= 1 << 7
mv = self.send_message_frame_mask
else:
mv = ""
el = ""
if length <= 125:
b1 |= length
elif length <= 0xFFFF:
b1 |= 126
el = struct.pack("!H", length)
elif length <= 0x7FFFFFFFFFFFFFFF:
b1 |= 127
el = struct.pack("!Q", length)
else:
raise Exception("invalid payload length")
## write message frame header
##
header = ''.join([chr(b0), chr(b1), el, mv])
self.sendData(header)
## now we are inside message frame ..
##
self.send_state = WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE_FRAME
def sendMessageFrameData(self, payload, sync = False):
"""
Send out data when within message frame (message was begun, frame was begun).
Note that the frame is automatically ended when enough data has been sent
that is, there is no endMessageFrame, since you have begun the frame specifying
the frame length, which implicitly defined the frame end. This is different from
messages, which you begin and end, since a message can contain an unlimited number
of frames.
Modes: Hybi, Hixie
Notes:
- For Hixie mode, this method is slightly misnamed for historic reasons.
:param payload: Data to send.
:returns: int -- Hybi mode: when frame still incomplete, returns outstanding octets, when frame complete, returns <= 0, when < 0, the amount of unconsumed data in payload argument. Hixie mode: returns None.
"""
if self.state != WebSocketProtocol.STATE_OPEN:
return
if self.websocket_version == 0:
## Hixie Mode
##
if self.send_state != WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE:
raise Exception("WebSocketProtocol.sendMessageFrameData invalid in current sending state")
self.sendData(payload, sync = sync)
return None
else:
## Hybi Mode
##
if self.send_state != WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE_FRAME:
raise Exception("WebSocketProtocol.sendMessageFrameData invalid in current sending state")
rl = len(payload)
if self.send_message_frame_masker.pointer() + rl > self.send_message_frame_length:
l = self.send_message_frame_length - self.send_message_frame_masker.pointer()
rest = -(rl - l)
pl = payload[:l]
else:
l = rl
rest = self.send_message_frame_length - self.send_message_frame_masker.pointer() - l
pl = payload
## mask frame payload
##
plm = self.send_message_frame_masker.process(pl)
## send frame payload
##
self.sendData(plm, sync = sync)
## if we are done with frame, move back into "inside message" state
##
if self.send_message_frame_masker.pointer() >= self.send_message_frame_length:
self.send_state = WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE
## when =0 : frame was completed exactly
## when >0 : frame is still uncomplete and that much amount is still left to complete the frame
## when <0 : frame was completed and there was this much unconsumed data in payload argument
##
return rest
def endMessage(self):
"""
End a previously begun message. No more frames may be sent (for that message). You have to
begin a new message before sending again.
Modes: Hybi, Hixie
"""
if self.state != WebSocketProtocol.STATE_OPEN:
return
## check if sending state is valid for this method
##
if self.send_state != WebSocketProtocol.SEND_STATE_INSIDE_MESSAGE:
raise Exception("WebSocketProtocol.endMessage invalid in current sending state [%d]" % self.send_state)
if self.websocket_version == 0:
self.sendData('\x00')
else:
self.sendFrame(opcode = 0, fin = True)
self.send_state = WebSocketProtocol.SEND_STATE_GROUND
def sendMessageFrame(self, payload, reserved = 0, mask = None, sync = False):
"""
When a message has begun, send a complete message frame in one go.
Modes: Hybi
"""
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
if self.state != WebSocketProtocol.STATE_OPEN:
return
if self.websocket_version == 0:
raise Exception("function not supported in Hixie-76 mode")
self.beginMessageFrame(len(payload), reserved, mask)
self.sendMessageFrameData(payload, sync)
def sendMessage(self, payload, binary = False, payload_frag_size = None, sync = False):
"""
Send out a message in one go.
You can send text or binary message, and optionally specifiy a payload fragment size.
When the latter is given, the payload will be split up into frames with
payload <= the payload_frag_size given.
Modes: Hybi, Hixie
"""
if self.trackedTimings:
self.trackedTimings.track("sendMessage")
if self.state != WebSocketProtocol.STATE_OPEN:
return
if self.websocket_version == 0:
if binary:
raise Exception("cannot send binary message in Hixie76 mode")
if payload_frag_size:
raise Exception("cannot fragment messages in Hixie76 mode")
self.sendMessageHixie76(payload, sync)
else:
self.sendMessageHybi(payload, binary, payload_frag_size, sync)
def sendMessageHixie76(self, payload, sync = False):
"""
Hixie76-Variant of sendMessage().
Modes: Hixie
"""
self.sendData('\x00' + payload + '\xff', sync = sync)
def sendMessageHybi(self, payload, binary = False, payload_frag_size = None, sync = False):
"""
Hybi-Variant of sendMessage().
Modes: Hybi
"""
## (initial) frame opcode
##
if binary:
opcode = 2
else:
opcode = 1
## explicit payload_frag_size arguments overrides autoFragmentSize setting
##
if payload_frag_size is not None:
pfs = payload_frag_size
else:
if self.autoFragmentSize > 0:
pfs = self.autoFragmentSize
else:
pfs = None
## send unfragmented
##
if pfs is None or len(payload) <= pfs:
self.sendFrame(opcode = opcode, payload = payload, sync = sync)
## send data message in fragments
##
else:
if pfs < 1:
raise Exception("payload fragment size must be at least 1 (was %d)" % pfs)
n = len(payload)
i = 0
done = False
first = True
while not done:
j = i + pfs
if j > n:
done = True
j = n
if first:
self.sendFrame(opcode = opcode, payload = payload[i:j], fin = done, sync = sync)
first = False
else:
self.sendFrame(opcode = 0, payload = payload[i:j], fin = done, sync = sync)
i += pfs
class PreparedMessage:
"""
Encapsulates a prepared message to be sent later once or multiple
times. This is used for optimizing Broadcast/PubSub.
The message serialization formats currently created internally are:
* Hybi
* Hixie
The construction of different formats is needed, since we support
mixed clients (speaking different protocol versions).
It will also be the place to add a 3rd format, when we support
the deflate extension, since then, the clients will be mixed
between Hybi-Deflate-Unsupported, Hybi-Deflate-Supported and Hixie.
"""
def __init__(self, payload, binary, masked):
"""
Ctor for a prepared message.
:param payload: The message payload.
:type payload: str
:param binary: Provide `True` for binary payload.
:type binary: bool
:param masked: Provide `True` if WebSocket message is to be masked (required for client to server WebSocket messages).
:type masked: bool
"""
self._initHixie(payload, binary)
self._initHybi(payload, binary, masked)
def _initHixie(self, payload, binary):
if binary:
# silently filter out .. probably do something else:
# base64?
# dunno
self.payloadHixie = ''
else:
self.payloadHixie = '\x00' + payload + '\xff'
def _initHybi(self, payload, binary, masked):
l = len(payload)
## first byte
##
b0 = ((1 << 7) | 2) if binary else ((1 << 7) | 1)
## second byte, payload len bytes and mask
##
if masked:
b1 = 1 << 7
mask = struct.pack("!I", random.getrandbits(32))
if l == 0:
plm = payload
else:
plm = createXorMasker(mask, l).process(payload)
else:
b1 = 0
mask = ""
plm = payload
## payload extended length
##
el = ""
if l <= 125:
b1 |= l
elif l <= 0xFFFF:
b1 |= 126
el = struct.pack("!H", l)
elif l <= 0x7FFFFFFFFFFFFFFF:
b1 |= 127
el = struct.pack("!Q", l)
else:
raise Exception("invalid payload length")
## raw WS message (single frame)
##
self.payloadHybi = ''.join([chr(b0), chr(b1), el, mask, plm])
class WebSocketFactory:
"""
Mixin for
:class:`autobahn.websocket.WebSocketClientFactory` and
:class:`autobahn.websocket.WebSocketServerFactory`.
"""
def prepareMessage(self, payload, binary = False, masked = None):
"""
Prepare a WebSocket message. This can be later used on multiple
instances of :class:`autobahn.websocket.WebSocketProtocol` using
:meth:`autobahn.websocket.WebSocketProtocol.sendPreparedMessage`.
By doing so, you can avoid the (small) overhead of framing the
*same* payload into WS messages when that payload is to be sent
out on multiple connections.
Caveats:
1. Only use when you know what you are doing. I.e. calling
:meth:`autobahn.websocket.WebSocketProtocol.sendPreparedMessage`
on the *same* protocol instance multiples times with the *same*
prepared message might break the spec, since i.e. the frame mask
will be the same!
2. Treat the object returned as opaque. It may change!
Modes: Hybi, Hixie
:param payload: The message payload.
:type payload: str
:param binary: Provide `True` for binary payload.
:type binary: bool
:param masked: Provide `True` if WebSocket message is to be
masked (required for client-to-server WebSocket messages).
:type masked: bool
:returns: obj -- The prepared message.
"""
if masked is None:
masked = not self.isServer
return PreparedMessage(payload, binary, masked)
class WebSocketServerProtocol(WebSocketProtocol):
"""
A Twisted protocol for WebSocket servers.
"""
def onConnect(self, connectionRequest):
"""
Callback fired during WebSocket opening handshake when new WebSocket client
connection is about to be established.
Throw HttpException when you don't want to accept the WebSocket
connection request. For example, throw a
`HttpException(httpstatus.HTTP_STATUS_CODE_UNAUTHORIZED[0], "You are not authorized for this!")`.
When you want to accept the connection, return the accepted protocol
from list of WebSocket (sub)protocols provided by client or None to
speak no specific one or when the client list was empty.
You may also return a pair of `(protocol, headers)` to send additional HTTP `headers`.
:param connectionRequest: WebSocket connection request information.
:type connectionRequest: instance of :class:`autobahn.websocket.ConnectionRequest`
"""
return None
def connectionMade(self):
"""
Called by Twisted when new TCP connection from client was accepted. Default
implementation will prepare for initial WebSocket opening handshake.
When overriding in derived class, make sure to call this base class
implementation *before* your code.
"""
self.isServer = True
WebSocketProtocol.connectionMade(self)
self.factory.countConnections += 1
if self.debug:
log.msg("connection accepted from peer %s" % self.peerstr)
def connectionLost(self, reason):
"""
Called by Twisted when established TCP connection from client was lost. Default
implementation will tear down all state properly.
When overriding in derived class, make sure to call this base class
implementation *after* your code.
"""
WebSocketProtocol.connectionLost(self, reason)
self.factory.countConnections -= 1
if self.debug:
log.msg("connection from %s lost" % self.peerstr)
def processProxyConnect(self):
raise Exception("Autobahn isn't a proxy server")
def parseHixie76Key(self, key):
"""
Parse Hixie76 opening handshake key provided by client.
"""
return int(filter(lambda x: x.isdigit(), key)) / key.count(" ")
def processHandshake(self):
"""
Process WebSocket opening handshake request from client.
"""
## only proceed when we have fully received the HTTP request line and all headers
##
end_of_header = self.data.find("\x0d\x0a\x0d\x0a")
if end_of_header >= 0:
self.http_request_data = self.data[:end_of_header + 4]
if self.debug:
log.msg("received HTTP request:\n\n%s\n\n" % self.http_request_data)
## extract HTTP status line and headers
##
(self.http_status_line, self.http_headers, http_headers_cnt) = parseHttpHeader(self.http_request_data)
## validate WebSocket opening handshake client request
##
if self.debug:
log.msg("received HTTP status line in opening handshake : %s" % str(self.http_status_line))
log.msg("received HTTP headers in opening handshake : %s" % str(self.http_headers))
## HTTP Request line : METHOD, VERSION
##
rl = self.http_status_line.split()
if len(rl) != 3:
return self.failHandshake("Bad HTTP request status line '%s'" % self.http_status_line)
if rl[0].strip() != "GET":
return self.failHandshake("HTTP method '%s' not allowed" % rl[0], HTTP_STATUS_CODE_METHOD_NOT_ALLOWED[0])
vs = rl[2].strip().split("/")
if len(vs) != 2 or vs[0] != "HTTP" or vs[1] not in ["1.1"]:
return self.failHandshake("Unsupported HTTP version '%s'" % rl[2], HTTP_STATUS_CODE_UNSUPPORTED_HTTP_VERSION[0])
## HTTP Request line : REQUEST-URI
##
self.http_request_uri = rl[1].strip()
try:
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(self.http_request_uri)
## FIXME: check that if absolute resource URI is given,
## the scheme/netloc matches the server
if scheme != "" or netloc != "":
pass
## Fragment identifiers are meaningless in the context of WebSocket
## URIs, and MUST NOT be used on these URIs.
if fragment != "":
return self.failHandshake("HTTP requested resource contains a fragment identifier '%s'" % fragment)
## resource path and query parameters .. this will get forwarded
## to onConnect()
self.http_request_path = path
self.http_request_params = urlparse.parse_qs(query)
except:
return self.failHandshake("Bad HTTP request resource - could not parse '%s'" % rl[1].strip())
## Host
##
if not self.http_headers.has_key("host"):
return self.failHandshake("HTTP Host header missing in opening handshake request")
if http_headers_cnt["host"] > 1:
return self.failHandshake("HTTP Host header appears more than once in opening handshake request")
self.http_request_host = self.http_headers["host"].strip()
if self.http_request_host.find(":") >= 0:
(h, p) = self.http_request_host.split(":")
try:
port = int(str(p.strip()))
except:
return self.failHandshake("invalid port '%s' in HTTP Host header '%s'" % (str(p.strip()), str(self.http_request_host)))
if port != self.factory.externalPort:
return self.failHandshake("port %d in HTTP Host header '%s' does not match server listening port %s" % (port, str(self.http_request_host), self.factory.externalPort))
self.http_request_host = h
else:
if not ((self.factory.isSecure and self.factory.externalPort == 443) or (not self.factory.isSecure and self.factory.externalPort == 80)):
return self.failHandshake("missing port in HTTP Host header '%s' and server runs on non-standard port %d (wss = %s)" % (str(self.http_request_host), self.factory.externalPort, self.factory.isSecure))
## Upgrade
##
if not self.http_headers.has_key("upgrade"):
## When no WS upgrade, render HTML server status page
##
if self.webStatus:
if self.http_request_params.has_key('redirect') and len(self.http_request_params['redirect']) > 0:
## To specifiy an URL for redirection, encode the URL, i.e. from JavaScript:
##
## var url = encodeURIComponent("http://autobahn.ws/python");
##
## and append the encoded string as a query parameter 'redirect'
##
## http://localhost:9000?redirect=http%3A%2F%2Fautobahn.ws%2Fpython
## https://localhost:9000?redirect=https%3A%2F%2Ftwitter.com%2F
##
## This will perform an immediate HTTP-303 redirection. If you provide
## an additional parameter 'after' (int >= 0), the redirection happens
## via Meta-Refresh in the rendered HTML status page, i.e.
##
## https://localhost:9000/?redirect=https%3A%2F%2Ftwitter.com%2F&after=3
##
url = self.http_request_params['redirect'][0]
if self.http_request_params.has_key('after') and len(self.http_request_params['after']) > 0:
after = int(self.http_request_params['after'][0])
if self.debugCodePaths:
log.msg("HTTP Upgrade header missing : render server status page and meta-refresh-redirecting to %s after %d seconds" % (url, after))
self.sendServerStatus(url, after)
else:
if self.debugCodePaths:
log.msg("HTTP Upgrade header missing : 303-redirecting to %s" % url)
self.sendRedirect(url)
else:
if self.debugCodePaths:
log.msg("HTTP Upgrade header missing : render server status page")
self.sendServerStatus()
self.dropConnection(abort = False)
return
else:
return self.failHandshake("HTTP Upgrade header missing", HTTP_STATUS_CODE_UPGRADE_REQUIRED[0])
upgradeWebSocket = False
for u in self.http_headers["upgrade"].split(","):
if u.strip().lower() == "websocket":
upgradeWebSocket = True
break
if not upgradeWebSocket:
return self.failHandshake("HTTP Upgrade headers do not include 'websocket' value (case-insensitive) : %s" % self.http_headers["upgrade"])
## Connection
##
if not self.http_headers.has_key("connection"):
return self.failHandshake("HTTP Connection header missing")
connectionUpgrade = False
for c in self.http_headers["connection"].split(","):
if c.strip().lower() == "upgrade":
connectionUpgrade = True
break
if not connectionUpgrade:
return self.failHandshake("HTTP Connection headers do not include 'upgrade' value (case-insensitive) : %s" % self.http_headers["connection"])
## Sec-WebSocket-Version PLUS determine mode: Hybi or Hixie
##
if not self.http_headers.has_key("sec-websocket-version"):
if self.debugCodePaths:
log.msg("Hixie76 protocol detected")
if self.allowHixie76:
version = 0
else:
return self.failHandshake("WebSocket connection denied - Hixie76 protocol mode disabled.")
else:
if self.debugCodePaths:
log.msg("Hybi protocol detected")
if http_headers_cnt["sec-websocket-version"] > 1:
return self.failHandshake("HTTP Sec-WebSocket-Version header appears more than once in opening handshake request")
try:
version = int(self.http_headers["sec-websocket-version"])
except:
return self.failHandshake("could not parse HTTP Sec-WebSocket-Version header '%s' in opening handshake request" % self.http_headers["sec-websocket-version"])
if version not in self.versions:
## respond with list of supported versions (descending order)
##
sv = sorted(self.versions)
sv.reverse()
svs = ','.join([str(x) for x in sv])
return self.failHandshake("WebSocket version %d not supported (supported versions: %s)" % (version, svs),
HTTP_STATUS_CODE_BAD_REQUEST[0],
[("Sec-WebSocket-Version", svs)])
else:
## store the protocol version we are supposed to talk
self.websocket_version = version
## Sec-WebSocket-Protocol
##
if self.http_headers.has_key("sec-websocket-protocol"):
protocols = [str(x.strip()) for x in self.http_headers["sec-websocket-protocol"].split(",")]
# check for duplicates in protocol header
pp = {}
for p in protocols:
if pp.has_key(p):
return self.failHandshake("duplicate protocol '%s' specified in HTTP Sec-WebSocket-Protocol header" % p)
else:
pp[p] = 1
# ok, no duplicates, save list in order the client sent it
self.websocket_protocols = protocols
else:
self.websocket_protocols = []
## Origin / Sec-WebSocket-Origin
## http://tools.ietf.org/html/draft-ietf-websec-origin-02
##
if self.websocket_version < 13 and self.websocket_version != 0:
# Hybi, but only < Hybi-13
websocket_origin_header_key = 'sec-websocket-origin'
else:
# RFC6455, >= Hybi-13 and Hixie
websocket_origin_header_key = "origin"
self.websocket_origin = None
if self.http_headers.has_key(websocket_origin_header_key):
if http_headers_cnt[websocket_origin_header_key] > 1:
return self.failHandshake("HTTP Origin header appears more than once in opening handshake request")
self.websocket_origin = self.http_headers[websocket_origin_header_key].strip()
else:
# non-browser clients are allowed to omit this header
pass
## Sec-WebSocket-Extensions
##
## extensions requested by client
self.websocket_extensions = []
## extensions selected by server
self.websocket_extensions_in_use = []
if self.http_headers.has_key("sec-websocket-extensions"):
if self.websocket_version == 0:
return self.failHandshake("Sec-WebSocket-Extensions header specified for Hixie-76")
extensions = [x.strip() for x in self.http_headers["sec-websocket-extensions"].split(',')]
if len(extensions) > 0:
self.websocket_extensions = extensions
if self.debug:
log.msg("client requested extensions we don't support (%s)" % str(extensions))
## Sec-WebSocket-Key (Hybi) or Sec-WebSocket-Key1/Sec-WebSocket-Key2 (Hixie-76)
##
if self.websocket_version == 0:
for kk in ['Sec-WebSocket-Key1', 'Sec-WebSocket-Key2']:
k = kk.lower()
if not self.http_headers.has_key(k):
return self.failHandshake("HTTP %s header missing" % kk)
if http_headers_cnt[k] > 1:
return self.failHandshake("HTTP %s header appears more than once in opening handshake request" % kk)
try:
key1 = self.parseHixie76Key(self.http_headers["sec-websocket-key1"].strip())
key2 = self.parseHixie76Key(self.http_headers["sec-websocket-key2"].strip())
except:
return self.failHandshake("could not parse Sec-WebSocket-Key1/2")
else:
if not self.http_headers.has_key("sec-websocket-key"):
return self.failHandshake("HTTP Sec-WebSocket-Key header missing")
if http_headers_cnt["sec-websocket-key"] > 1:
return self.failHandshake("HTTP Sec-WebSocket-Key header appears more than once in opening handshake request")
key = self.http_headers["sec-websocket-key"].strip()
if len(key) != 24: # 16 bytes => (ceil(128/24)*24)/6 == 24
return self.failHandshake("bad Sec-WebSocket-Key (length must be 24 ASCII chars) '%s'" % key)
if key[-2:] != "==": # 24 - ceil(128/6) == 2
return self.failHandshake("bad Sec-WebSocket-Key (invalid base64 encoding) '%s'" % key)
for c in key[:-2]:
if c not in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/":
return self.failHandshake("bad character '%s' in Sec-WebSocket-Key (invalid base64 encoding) '%s'" (c, key))
## For Hixie-76, we need 8 octets of HTTP request body to complete HS!
##
if self.websocket_version == 0:
if len(self.data) < end_of_header + 4 + 8:
return
else:
key3 = self.data[end_of_header + 4:end_of_header + 4 + 8]
if self.debug:
log.msg("received HTTP request body containing key3 for Hixie-76: %s" % key3)
## Ok, got complete HS input, remember rest (if any)
##
if self.websocket_version == 0:
self.data = self.data[end_of_header + 4 + 8:]
else:
self.data = self.data[end_of_header + 4:]
## WebSocket handshake validated => produce opening handshake response
## Now fire onConnect() on derived class, to give that class a chance to accept or deny
## the connection. onConnect() may throw, in which case the connection is denied, or it
## may return a protocol from the protocols provided by client or None.
##
connectionRequest = ConnectionRequest(self.peer,
self.peerstr,
self.http_headers,
self.http_request_host,
self.http_request_path,
self.http_request_params,
self.websocket_version,
self.websocket_origin,
self.websocket_protocols,
self.websocket_extensions)
## onConnect() will return the selected subprotocol or None
## or a pair (protocol, headers) or raise an HttpException
##
protocol = maybeDeferred(self.onConnect, connectionRequest)
if self.websocket_version == 0:
key = key1, key2, key3
protocol.addCallback(self._processHandshake_buildResponse, key)
protocol.addErrback(self._processHandshake_failed)
def _processHandshake_buildResponse(self, res, key):
"""
Callback for Deferred returned by self.onConnect. Generates the response for the handshake.
"""
protocol = None
headers = {}
if type(res) == tuple:
if len(res) > 0:
protocol = res[0]
if len(res) > 1:
headers = res[1]
else:
protocol = res
if protocol is not None and not (protocol in self.websocket_protocols):
raise Exception("protocol accepted must be from the list client sent or None")
self.websocket_protocol_in_use = protocol
if self.websocket_version == 0:
key1, key2, key3 = key
## build response to complete WebSocket handshake
##
response = "HTTP/1.1 %d Switching Protocols\x0d\x0a" % HTTP_STATUS_CODE_SWITCHING_PROTOCOLS[0]
if self.factory.server is not None and self.factory.server != "":
response += "Server: %s\x0d\x0a" % self.factory.server.encode("utf-8")
response += "Upgrade: WebSocket\x0d\x0a"
response += "Connection: Upgrade\x0d\x0a"
## optional, user supplied additional HTTP headers
##
## headers from factory
for uh in self.factory.headers.items():
response += "%s: %s\x0d\x0a" % (uh[0].encode("utf-8"), uh[1].encode("utf-8"))
## headers from onConnect
for uh in headers.items():
response += "%s: %s\x0d\x0a" % (uh[0].encode("utf-8"), uh[1].encode("utf-8"))
if self.websocket_protocol_in_use is not None:
response += "Sec-WebSocket-Protocol: %s\x0d\x0a" % str(self.websocket_protocol_in_use)
if self.websocket_version == 0:
if self.websocket_origin:
## browser client provide the header, and expect it to be echo'ed
response += "Sec-WebSocket-Origin: %s\x0d\x0a" % str(self.websocket_origin)
if self.debugCodePaths:
log.msg('factory isSecure = %s port = %s' % (self.factory.isSecure, self.factory.externalPort))
if (self.factory.isSecure and self.factory.externalPort != 443) or ((not self.factory.isSecure) and self.factory.externalPort != 80):
if self.debugCodePaths:
log.msg('factory running on non-default port')
response_port = ':' + str(self.factory.externalPort)
else:
if self.debugCodePaths:
log.msg('factory running on default port')
response_port = ''
## FIXME: check this! But see below ..
if False:
response_host = str(self.factory.host)
response_path = str(self.factory.path)
else:
response_host = str(self.http_request_host)
response_path = str(self.http_request_uri)
location = "%s://%s%s%s" % ('wss' if self.factory.isSecure else 'ws', response_host, response_port, response_path)
# Safari is very picky about this one
response += "Sec-WebSocket-Location: %s\x0d\x0a" % location
## end of HTTP response headers
response += "\x0d\x0a"
## compute accept body
##
accept_val = struct.pack(">II", key1, key2) + key3
accept = hashlib.md5(accept_val).digest()
response_body = str(accept)
else:
## compute Sec-WebSocket-Accept
##
sha1 = hashlib.sha1()
sha1.update(key + WebSocketProtocol._WS_MAGIC)
sec_websocket_accept = base64.b64encode(sha1.digest())
response += "Sec-WebSocket-Accept: %s\x0d\x0a" % sec_websocket_accept
if len(self.websocket_extensions_in_use) > 0:
response += "Sec-WebSocket-Extensions: %s\x0d\x0a" % ','.join(self.websocket_extensions_in_use)
## end of HTTP response headers
response += "\x0d\x0a"
response_body = ''
if self.debug:
log.msg("sending HTTP response:\n\n%s%s\n\n" % (response, binascii.b2a_hex(response_body)))
## save and send out opening HS data
##
self.http_response_data = response + response_body
self.sendData(self.http_response_data)
## opening handshake completed, move WebSocket connection into OPEN state
##
self.state = WebSocketProtocol.STATE_OPEN
## cancel any opening HS timer if present
##
if self.openHandshakeTimeoutCall is not None:
if self.debugCodePaths:
log.msg("openHandshakeTimeoutCall.cancel")
self.openHandshakeTimeoutCall.cancel()
self.openHandshakeTimeoutCall = None
## init state
##
self.inside_message = False
if self.websocket_version != 0:
self.current_frame = None
## fire handler on derived class
##
if self.trackedTimings:
self.trackedTimings.track("onOpen")
self.onOpen()
## process rest, if any
##
if len(self.data) > 0:
self.consumeData()
def _processHandshake_failed(self, failure):
"""
Errback for Deferred returned by self.onConnect. Generates a HTTP error response for the handshake.
"""
e = failure.value
if failure.check(HttpException):
return self.failHandshake(e.reason, e.code)
else:
log.msg("Exception raised in onConnect() - %s" % str(e))
return self.failHandshake("Internal Server Error", HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR[0])
def failHandshake(self, reason, code = HTTP_STATUS_CODE_BAD_REQUEST[0], responseHeaders = []):
"""
During opening handshake the client request was invalid, we send a HTTP
error response and then drop the connection.
"""
if self.debug:
log.msg("failing WebSocket opening handshake ('%s')" % reason)
self.sendHttpErrorResponse(code, reason, responseHeaders)
self.dropConnection(abort = False)
def sendHttpErrorResponse(self, code, reason, responseHeaders = []):
"""
Send out HTTP error response.
"""
response = "HTTP/1.1 %d %s\x0d\x0a" % (code, reason.encode("utf-8"))
for h in responseHeaders:
response += "%s: %s\x0d\x0a" % (h[0], h[1].encode("utf-8"))
response += "\x0d\x0a"
self.sendData(response)
def sendHtml(self, html):
"""
Send HTML page HTTP response.
"""
raw = html.encode("utf-8")
response = "HTTP/1.1 %d %s\x0d\x0a" % (HTTP_STATUS_CODE_OK[0], HTTP_STATUS_CODE_OK[1])
if self.factory.server is not None and self.factory.server != "":
response += "Server: %s\x0d\x0a" % self.factory.server.encode("utf-8")
response += "Content-Type: text/html; charset=UTF-8\x0d\x0a"
response += "Content-Length: %d\x0d\x0a" % len(raw)
response += "\x0d\x0a"
response += raw
self.sendData(response)
def sendRedirect(self, url):
"""
Send HTTP Redirect (303) response.
"""
response = "HTTP/1.1 %d\x0d\x0a" % HTTP_STATUS_CODE_SEE_OTHER[0]
#if self.factory.server is not None and self.factory.server != "":
# response += "Server: %s\x0d\x0a" % self.factory.server.encode("utf-8")
response += "Location: %s\x0d\x0a" % url.encode("utf-8")
response += "\x0d\x0a"
self.sendData(response)
def sendServerStatus(self, redirectUrl = None, redirectAfter = 0):
"""
Used to send out server status/version upon receiving a HTTP/GET without
upgrade to WebSocket header (and option serverStatus is True).
"""
if redirectUrl:
redirect = """<meta http-equiv="refresh" content="%d;URL='%s'">""" % (redirectAfter, redirectUrl)
else:
redirect = ""
html = """
<!DOCTYPE html>
<html>
<head>
%s
<style>
body {
color: #fff;
background-color: #027eae;
font-family: "Segoe UI", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
}
a, a:visited, a:hover {
color: #fff;
}
</style>
</head>
<body>
<h1>AutobahnPython %s</h1>
<p>
I am not Web server, but a WebSocket endpoint.
You can talk to me using the WebSocket <a href="http://tools.ietf.org/html/rfc6455">protocol</a>.
</p>
<p>
For more information, please visit <a href="http://autobahn.ws/python">my homepage</a>.
</p>
</body>
</html>
""" % (redirect, __version__)
self.sendHtml(html)
class WebSocketServerFactory(protocol.ServerFactory, WebSocketFactory):
"""
A Twisted factory for WebSocket server protocols.
"""
protocol = WebSocketServerProtocol
"""
The protocol to be spoken. Must be derived from :class:`autobahn.websocket.WebSocketServerProtocol`.
"""
def __init__(self, url = None, protocols = [], server = "AutobahnPython/%s" % __version__, headers = {}, externalPort = None, debug = False, debugCodePaths = False):
"""
Create instance of WebSocket server factory.
Note that you MUST provide URL either here or using
:meth:`autobahn.websocket.WebSocketServerFactory.setSessionParameters`
*before* the factory is started.
:param url: WebSocket listening URL - ("ws:" | "wss:") "//" host [ ":" port ].
:type url: str
:param protocols: List of subprotocols the server supports. The subprotocol used is the first from the list of subprotocols announced by the client that is contained in this list.
:type protocols: list of strings
:param server: Server as announced in HTTP response header during opening handshake or None (default: "AutobahnWebSocket/x.x.x").
:type server: str
:param headers: An optional mapping of additional HTTP headers to send during the WebSocket opening handshake.
:type headers: dict
:param externalPort: Optionally, the external visible port this server will be reachable under (i.e. when running behind a L2/L3 forwarding device).
:type externalPort: int
:param debug: Debug mode (default: False).
:type debug: bool
:param debugCodePaths: Debug code paths mode (default: False).
:type debugCodePaths: bool
"""
self.debug = debug
self.debugCodePaths = debugCodePaths
self.logOctets = debug
self.logFrames = debug
self.trackTimings = False
self.isServer = True
## seed RNG which is used for WS frame masks generation
random.seed()
## default WS session parameters
##
self.setSessionParameters(url, protocols, server, headers, externalPort)
## default WebSocket protocol options
##
self.resetProtocolOptions()
## number of currently connected clients
##
self.countConnections = 0
def setSessionParameters(self, url = None, protocols = [], server = None, headers = {}, externalPort = None):
"""
Set WebSocket session parameters.
:param url: WebSocket listening URL - ("ws:" | "wss:") "//" host [ ":" port ].
:type url: str
:param protocols: List of subprotocols the server supports. The subprotocol used is the first from the list of subprotocols announced by the client that is contained in this list.
:type protocols: list of strings
:param server: Server as announced in HTTP response header during opening handshake.
:type server: str
:param headers: An optional mapping of additional HTTP headers to send during the WebSocket opening handshake.
:type headers: dict
:param externalPort: Optionally, the external visible port this server will be reachable under (i.e. when running behind a L2/L3 forwarding device).
:type externalPort: int
"""
if url is not None:
## parse WebSocket URI into components
(isSecure, host, port, resource, path, params) = parseWsUrl(url)
if path != "/":
raise Exception("path specified for server WebSocket URL")
if len(params) > 0:
raise Exception("query parameters specified for server WebSocket URL")
self.url = url
self.isSecure = isSecure
self.host = host
self.port = port
else:
self.url = None
self.isSecure = None
self.host = None
self.port = None
self.protocols = protocols
self.server = server
self.headers = headers
self.externalPort = externalPort if externalPort is not None else self.port
def resetProtocolOptions(self):
"""
Reset all WebSocket protocol options to defaults.
"""
self.versions = WebSocketProtocol.SUPPORTED_PROTOCOL_VERSIONS
self.allowHixie76 = WebSocketProtocol.DEFAULT_ALLOW_HIXIE76
self.webStatus = True
self.utf8validateIncoming = True
self.requireMaskedClientFrames = True
self.maskServerFrames = False
self.applyMask = True
self.maxFramePayloadSize = 0
self.maxMessagePayloadSize = 0
self.autoFragmentSize = 0
self.failByDrop = True
self.echoCloseCodeReason = False
self.openHandshakeTimeout = 5
self.closeHandshakeTimeout = 1
self.tcpNoDelay = True
def setProtocolOptions(self,
versions = None,
allowHixie76 = None,
webStatus = None,
utf8validateIncoming = None,
maskServerFrames = None,
requireMaskedClientFrames = None,
applyMask = None,
maxFramePayloadSize = None,
maxMessagePayloadSize = None,
autoFragmentSize = None,
failByDrop = None,
echoCloseCodeReason = None,
openHandshakeTimeout = None,
closeHandshakeTimeout = None,
tcpNoDelay = None):
"""
Set WebSocket protocol options used as defaults for new protocol instances.
:param versions: The WebSocket protocol versions accepted by the server (default: WebSocketProtocol.SUPPORTED_PROTOCOL_VERSIONS).
:type versions: list of ints
:param allowHixie76: Allow to speak Hixie76 protocol version.
:type allowHixie76: bool
:param webStatus: Return server status/version on HTTP/GET without WebSocket upgrade header (default: True).
:type webStatus: bool
:param utf8validateIncoming: Validate incoming UTF-8 in text message payloads (default: True).
:type utf8validateIncoming: bool
:param maskServerFrames: Mask server-to-client frames (default: False).
:type maskServerFrames: bool
:param requireMaskedClientFrames: Require client-to-server frames to be masked (default: True).
:type requireMaskedClientFrames: bool
:param applyMask: Actually apply mask to payload when mask it present. Applies for outgoing and incoming frames (default: True).
:type applyMask: bool
:param maxFramePayloadSize: Maximum frame payload size that will be accepted when receiving or 0 for unlimited (default: 0).
:type maxFramePayloadSize: int
:param maxMessagePayloadSize: Maximum message payload size (after reassembly of fragmented messages) that will be accepted when receiving or 0 for unlimited (default: 0).
:type maxMessagePayloadSize: int
:param autoFragmentSize: Automatic fragmentation of outgoing data messages (when using the message-based API) into frames with payload length <= this size or 0 for no auto-fragmentation (default: 0).
:type autoFragmentSize: int
:param failByDrop: Fail connections by dropping the TCP connection without performaing closing handshake (default: True).
:type failbyDrop: bool
:param echoCloseCodeReason: Iff true, when receiving a close, echo back close code/reason. Otherwise reply with code == NORMAL, reason = "" (default: False).
:type echoCloseCodeReason: bool
:param openHandshakeTimeout: Opening WebSocket handshake timeout, timeout in seconds or 0 to deactivate (default: 0).
:type openHandshakeTimeout: float
:param closeHandshakeTimeout: When we expect to receive a closing handshake reply, timeout in seconds (default: 1).
:type closeHandshakeTimeout: float
:param tcpNoDelay: TCP NODELAY ("Nagle") socket option (default: True).
:type tcpNoDelay: bool
"""
if allowHixie76 is not None and allowHixie76 != self.allowHixie76:
self.allowHixie76 = allowHixie76
if versions is not None:
for v in versions:
if v not in WebSocketProtocol.SUPPORTED_PROTOCOL_VERSIONS:
raise Exception("invalid WebSocket protocol version %s (allowed values: %s)" % (v, str(WebSocketProtocol.SUPPORTED_PROTOCOL_VERSIONS)))
if v == 0 and not self.allowHixie76:
raise Exception("use of Hixie-76 requires allowHixie76 == True")
if set(versions) != set(self.versions):
self.versions = versions
if webStatus is not None and webStatus != self.webStatus:
self.webStatus = webStatus
if utf8validateIncoming is not None and utf8validateIncoming != self.utf8validateIncoming:
self.utf8validateIncoming = utf8validateIncoming
if requireMaskedClientFrames is not None and requireMaskedClientFrames != self.requireMaskedClientFrames:
self.requireMaskedClientFrames = requireMaskedClientFrames
if maskServerFrames is not None and maskServerFrames != self.maskServerFrames:
self.maskServerFrames = maskServerFrames
if applyMask is not None and applyMask != self.applyMask:
self.applyMask = applyMask
if maxFramePayloadSize is not None and maxFramePayloadSize != self.maxFramePayloadSize:
self.maxFramePayloadSize = maxFramePayloadSize
if maxMessagePayloadSize is not None and maxMessagePayloadSize != self.maxMessagePayloadSize:
self.maxMessagePayloadSize = maxMessagePayloadSize
if autoFragmentSize is not None and autoFragmentSize != self.autoFragmentSize:
self.autoFragmentSize = autoFragmentSize
if failByDrop is not None and failByDrop != self.failByDrop:
self.failByDrop = failByDrop
if echoCloseCodeReason is not None and echoCloseCodeReason != self.echoCloseCodeReason:
self.echoCloseCodeReason = echoCloseCodeReason
if openHandshakeTimeout is not None and openHandshakeTimeout != self.openHandshakeTimeout:
self.openHandshakeTimeout = openHandshakeTimeout
if closeHandshakeTimeout is not None and closeHandshakeTimeout != self.closeHandshakeTimeout:
self.closeHandshakeTimeout = closeHandshakeTimeout
if tcpNoDelay is not None and tcpNoDelay != self.tcpNoDelay:
self.tcpNoDelay = tcpNoDelay
def getConnectionCount(self):
"""
Get number of currently connected clients.
:returns: int -- Number of currently connected clients.
"""
return self.countConnections
def startFactory(self):
"""
Called by Twisted before starting to listen on port for incoming connections.
Default implementation does nothing. Override in derived class when appropriate.
"""
pass
def stopFactory(self):
"""
Called by Twisted before stopping to listen on port for incoming connections.
Default implementation does nothing. Override in derived class when appropriate.
"""
pass
class WebSocketClientProtocol(WebSocketProtocol):
"""
Client protocol for WebSocket.
"""
def onConnect(self, connectionResponse):
"""
Callback fired directly after WebSocket opening handshake when new WebSocket server
connection was established.
:param connectionResponse: WebSocket connection response information.
:type connectionResponse: instance of :class:`autobahn.websocket.ConnectionResponse`
"""
pass
def connectionMade(self):
"""
Called by Twisted when new TCP connection to server was established. Default
implementation will start the initial WebSocket opening handshake (or proxy connect).
When overriding in derived class, make sure to call this base class
implementation _before_ your code.
"""
self.isServer = False
WebSocketProtocol.connectionMade(self)
if self.debug:
log.msg("connection to %s established" % self.peerstr)
if not self.isServer and self.factory.proxy is not None:
## start by doing a HTTP/CONNECT for explicit proxies
self.startProxyConnect()
else:
## immediately start with the WebSocket opening handshake
self.startHandshake()
def connectionLost(self, reason):
"""
Called by Twisted when established TCP connection to server was lost. Default
implementation will tear down all state properly.
When overriding in derived class, make sure to call this base class
implementation _after_ your code.
"""
WebSocketProtocol.connectionLost(self, reason)
if self.debug:
log.msg("connection to %s lost" % self.peerstr)
def startProxyConnect(self):
"""
Connect to explicit proxy.
"""
## construct proxy connect HTTP request
##
request = "CONNECT %s:%d HTTP/1.1\x0d\x0a" % (self.factory.host.encode("utf-8"), self.factory.port)
request += "Host: %s:%d\x0d\x0a" % (self.factory.host.encode("utf-8"), self.factory.port)
request += "\x0d\x0a"
if self.debug:
log.msg(request)
self.sendData(request)
def processProxyConnect(self):
"""
Process HTTP/CONNECT response from server.
"""
## only proceed when we have fully received the HTTP request line and all headers
##
end_of_header = self.data.find("\x0d\x0a\x0d\x0a")
if end_of_header >= 0:
http_response_data = self.data[:end_of_header + 4]
if self.debug:
log.msg("received HTTP response:\n\n%s\n\n" % http_response_data)
## extract HTTP status line and headers
##
(http_status_line, http_headers, http_headers_cnt) = parseHttpHeader(http_response_data)
## validate proxy connect response
##
if self.debug:
log.msg("received HTTP status line for proxy connect request : %s" % str(http_status_line))
log.msg("received HTTP headers for proxy connect request : %s" % str(http_headers))
## Response Line
##
sl = http_status_line.split()
if len(sl) < 2:
return self.failProxyConnect("Bad HTTP response status line '%s'" % http_status_line)
## HTTP version
##
http_version = sl[0].strip()
if http_version != "HTTP/1.1":
return self.failProxyConnect("Unsupported HTTP version ('%s')" % http_version)
## HTTP status code
##
try:
status_code = int(sl[1].strip())
except:
return self.failProxyConnect("Bad HTTP status code ('%s')" % sl[1].strip())
if not (status_code >= 200 and status_code < 300):
## FIXME: handle redirects
## FIXME: handle authentication required
if len(sl) > 2:
reason = " - %s" % ''.join(sl[2:])
else:
reason = ""
return self.failProxyConnect("HTTP proxy connect failed (%d%s)" % (status_code, reason))
## Ok, got complete response for HTTP/CONNECT, remember rest (if any)
##
self.data = self.data[end_of_header + 4:]
## opening handshake completed, move WebSocket connection into OPEN state
##
self.state = WebSocketProtocol.STATE_CONNECTING
## process rest of buffered data, if any
##
if len(self.data) > 0:
self.consumeData()
## now start WebSocket opening handshake
##
self.startHandshake()
def failProxyConnect(self, reason):
"""
During initial explicit proxy connect, the server response indicates some failure and we drop the
connection.
"""
if self.debug:
log.msg("failing proxy connect ('%s')" % reason)
self.dropConnection(abort = True)
def createHixieKey(self):
"""
Supposed to implement the crack smoker algorithm below. Well, crack
probably wasn't the stuff they smoked - dog poo?
http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#page-21
Items 16 - 22
"""
spaces1 = random.randint(1, 12)
max1 = int(4294967295L / spaces1)
number1 = random.randint(0, max1)
product1 = number1 * spaces1
key1 = str(product1)
rchars = filter(lambda x: (x >= 0x21 and x <= 0x2f) or (x >= 0x3a and x <= 0x7e), range(0,127))
for i in xrange(random.randint(1, 12)):
p = random.randint(0, len(key1) - 1)
key1 = key1[:p] + chr(random.choice(rchars)) + key1[p:]
for i in xrange(spaces1):
p = random.randint(1, len(key1) - 2)
key1 = key1[:p] + ' ' + key1[p:]
return (key1, number1)
def startHandshake(self):
"""
Start WebSocket opening handshake.
"""
## construct WS opening handshake HTTP header
##
request = "GET %s HTTP/1.1\x0d\x0a" % self.factory.resource.encode("utf-8")
if self.factory.useragent is not None and self.factory.useragent != "":
request += "User-Agent: %s\x0d\x0a" % self.factory.useragent.encode("utf-8")
request += "Host: %s:%d\x0d\x0a" % (self.factory.host.encode("utf-8"), self.factory.port)
request += "Upgrade: WebSocket\x0d\x0a"
request += "Connection: Upgrade\x0d\x0a"
## this seems to prohibit some non-compliant proxies from removing the
## connection "Upgrade" header
## See also:
## http://www.ietf.org/mail-archive/web/hybi/current/msg09841.html
## http://code.google.com/p/chromium/issues/detail?id=148908
##
request += "Pragma: no-cache\x0d\x0a"
request += "Cache-Control: no-cache\x0d\x0a"
## optional, user supplied additional HTTP headers
##
for uh in self.factory.headers.items():
request += "%s: %s\x0d\x0a" % (uh[0].encode("utf-8"), uh[1].encode("utf-8"))
## handshake random key
##
if self.version == 0:
(self.websocket_key1, number1) = self.createHixieKey()
(self.websocket_key2, number2) = self.createHixieKey()
self.websocket_key3 = os.urandom(8)
accept_val = struct.pack(">II", number1, number2) + self.websocket_key3
self.websocket_expected_challenge_response = hashlib.md5(accept_val).digest()
## Safari does NOT set Content-Length, even though the body is
## non-empty, and the request unchunked. We do it.
## See also: http://www.ietf.org/mail-archive/web/hybi/current/msg02149.html
request += "Content-Length: %s\x0d\x0a" % len(self.websocket_key3)
## First two keys.
request += "Sec-WebSocket-Key1: %s\x0d\x0a" % self.websocket_key1
request += "Sec-WebSocket-Key2: %s\x0d\x0a" % self.websocket_key2
else:
self.websocket_key = base64.b64encode(os.urandom(16))
request += "Sec-WebSocket-Key: %s\x0d\x0a" % self.websocket_key
## optional origin announced
##
if self.factory.origin:
if self.version > 10 or self.version == 0:
request += "Origin: %s\x0d\x0a" % self.factory.origin.encode("utf-8")
else:
request += "Sec-WebSocket-Origin: %s\x0d\x0a" % self.factory.origin.encode("utf-8")
## optional list of WS subprotocols announced
##
if len(self.factory.protocols) > 0:
request += "Sec-WebSocket-Protocol: %s\x0d\x0a" % ','.join(self.factory.protocols)
## set WS protocol version depending on WS spec version
##
if self.version != 0:
request += "Sec-WebSocket-Version: %d\x0d\x0a" % WebSocketProtocol.SPEC_TO_PROTOCOL_VERSION[self.version]
request += "\x0d\x0a"
if self.version == 0:
## Write HTTP request body for Hixie-76
request += self.websocket_key3
self.http_request_data = request
if self.debug:
log.msg(self.http_request_data)
self.sendData(self.http_request_data)
def processHandshake(self):
"""
Process WebSocket opening handshake response from server.
"""
## only proceed when we have fully received the HTTP request line and all headers
##
end_of_header = self.data.find("\x0d\x0a\x0d\x0a")
if end_of_header >= 0:
self.http_response_data = self.data[:end_of_header + 4]
if self.debug:
log.msg("received HTTP response:\n\n%s\n\n" % self.http_response_data)
## extract HTTP status line and headers
##
(self.http_status_line, self.http_headers, http_headers_cnt) = parseHttpHeader(self.http_response_data)
## validate WebSocket opening handshake server response
##
if self.debug:
log.msg("received HTTP status line in opening handshake : %s" % str(self.http_status_line))
log.msg("received HTTP headers in opening handshake : %s" % str(self.http_headers))
## Response Line
##
sl = self.http_status_line.split()
if len(sl) < 2:
return self.failHandshake("Bad HTTP response status line '%s'" % self.http_status_line)
## HTTP version
##
http_version = sl[0].strip()
if http_version != "HTTP/1.1":
return self.failHandshake("Unsupported HTTP version ('%s')" % http_version)
## HTTP status code
##
try:
status_code = int(sl[1].strip())
except:
return self.failHandshake("Bad HTTP status code ('%s')" % sl[1].strip())
if status_code != HTTP_STATUS_CODE_SWITCHING_PROTOCOLS[0]:
## FIXME: handle redirects
## FIXME: handle authentication required
if len(sl) > 2:
reason = " - %s" % ''.join(sl[2:])
else:
reason = ""
return self.failHandshake("WebSocket connection upgrade failed (%d%s)" % (status_code, reason))
## Upgrade
##
if not self.http_headers.has_key("upgrade"):
return self.failHandshake("HTTP Upgrade header missing")
if self.http_headers["upgrade"].strip().lower() != "websocket":
return self.failHandshake("HTTP Upgrade header different from 'websocket' (case-insensitive) : %s" % self.http_headers["upgrade"])
## Connection
##
if not self.http_headers.has_key("connection"):
return self.failHandshake("HTTP Connection header missing")
connectionUpgrade = False
for c in self.http_headers["connection"].split(","):
if c.strip().lower() == "upgrade":
connectionUpgrade = True
break
if not connectionUpgrade:
return self.failHandshake("HTTP Connection header does not include 'upgrade' value (case-insensitive) : %s" % self.http_headers["connection"])
## compute Sec-WebSocket-Accept
##
if self.version != 0:
if not self.http_headers.has_key("sec-websocket-accept"):
return self.failHandshake("HTTP Sec-WebSocket-Accept header missing in opening handshake reply")
else:
if http_headers_cnt["sec-websocket-accept"] > 1:
return self.failHandshake("HTTP Sec-WebSocket-Accept header appears more than once in opening handshake reply")
sec_websocket_accept_got = self.http_headers["sec-websocket-accept"].strip()
sha1 = hashlib.sha1()
sha1.update(self.websocket_key + WebSocketProtocol._WS_MAGIC)
sec_websocket_accept = base64.b64encode(sha1.digest())
if sec_websocket_accept_got != sec_websocket_accept:
return self.failHandshake("HTTP Sec-WebSocket-Accept bogus value : expected %s / got %s" % (sec_websocket_accept, sec_websocket_accept_got))
## handle "extensions in use" - if any
##
self.websocket_extensions_in_use = []
if self.version != 0:
if self.http_headers.has_key("sec-websocket-extensions"):
if http_headers_cnt["sec-websocket-extensions"] > 1:
return self.failHandshake("HTTP Sec-WebSocket-Extensions header appears more than once in opening handshake reply")
exts = self.http_headers["sec-websocket-extensions"].strip()
##
## we don't support any extension, but if we did, we needed
## to set self.websocket_extensions_in_use here, and don't fail the handshake
##
return self.failHandshake("server wants to use extensions (%s), but no extensions implemented" % exts)
## handle "subprotocol in use" - if any
##
self.websocket_protocol_in_use = None
if self.http_headers.has_key("sec-websocket-protocol"):
if http_headers_cnt["sec-websocket-protocol"] > 1:
return self.failHandshake("HTTP Sec-WebSocket-Protocol header appears more than once in opening handshake reply")
sp = str(self.http_headers["sec-websocket-protocol"].strip())
if sp != "":
if sp not in self.factory.protocols:
return self.failHandshake("subprotocol selected by server (%s) not in subprotocol list requested by client (%s)" % (sp, str(self.factory.protocols)))
else:
## ok, subprotocol in use
##
self.websocket_protocol_in_use = sp
## For Hixie-76, we need 16 octets of HTTP request body to complete HS!
##
if self.version == 0:
if len(self.data) < end_of_header + 4 + 16:
return
else:
challenge_response = self.data[end_of_header + 4:end_of_header + 4 + 16]
if challenge_response != self.websocket_expected_challenge_response:
return self.failHandshake("invalid challenge response received from server (Hixie-76)")
## Ok, got complete HS input, remember rest (if any)
##
if self.version == 0:
self.data = self.data[end_of_header + 4 + 16:]
else:
self.data = self.data[end_of_header + 4:]
## opening handshake completed, move WebSocket connection into OPEN state
##
self.state = WebSocketProtocol.STATE_OPEN
self.inside_message = False
if self.version != 0:
self.current_frame = None
self.websocket_version = self.version
## we handle this symmetrical to server-side .. that is, give the
## client a chance to bail out .. i.e. on no subprotocol selected
## by server
try:
connectionResponse = ConnectionResponse(self.peer,
self.peerstr,
self.http_headers,
None, # FIXME
self.websocket_protocol_in_use,
self.websocket_extensions_in_use)
self.onConnect(connectionResponse)
except Exception, e:
## immediately close the WS connection
##
self.failConnection(1000, str(e))
else:
## fire handler on derived class
##
if self.trackedTimings:
self.trackedTimings.track("onOpen")
self.onOpen()
## process rest, if any
##
if len(self.data) > 0:
self.consumeData()
def failHandshake(self, reason):
"""
During opening handshake the server response is invalid and we drop the
connection.
"""
if self.debug:
log.msg("failing WebSocket opening handshake ('%s')" % reason)
self.dropConnection(abort = True)
class WebSocketClientFactory(protocol.ClientFactory, WebSocketFactory):
"""
A Twisted factory for WebSocket client protocols.
"""
protocol = WebSocketClientProtocol
"""
The protocol to be spoken. Must be derived from :class:`autobahn.websocket.WebSocketClientProtocol`.
"""
def __init__(self, url = None, origin = None, protocols = [], useragent = "AutobahnPython/%s" % __version__, headers = {}, proxy = None, debug = False, debugCodePaths = False):
"""
Create instance of WebSocket client factory.
Note that you MUST provide URL either here or set using
:meth:`autobahn.websocket.WebSocketClientFactory.setSessionParameters`
*before* the factory is started.
:param url: WebSocket URL to connect to - ("ws:" | "wss:") "//" host [ ":" port ] path [ "?" query ].
:type url: str
:param origin: The origin to be sent in WebSocket opening handshake or None (default: None).
:type origin: str
:param protocols: List of subprotocols the client should announce in WebSocket opening handshake (default: []).
:type protocols: list of strings
:param useragent: User agent as announced in HTTP request header or None (default: "AutobahnWebSocket/x.x.x").
:type useragent: str
:param headers: An optional mapping of additional HTTP headers to send during the WebSocket opening handshake.
:type headers: dict
:param proxy: Explicit proxy server to use (hostname:port or IP:port), e.g. "192.168.1.100:8080".
:type proxy: str
:param debug: Debug mode (default: False).
:type debug: bool
:param debugCodePaths: Debug code paths mode (default: False).
:type debugCodePaths: bool
"""
self.debug = debug
self.debugCodePaths = debugCodePaths
self.logOctets = debug
self.logFrames = debug
self.trackTimings = False
self.isServer = False
## seed RNG which is used for WS opening handshake key and WS frame masks generation
random.seed()
## default WS session parameters
##
self.setSessionParameters(url, origin, protocols, useragent, headers, proxy)
## default WebSocket protocol options
##
self.resetProtocolOptions()
def setSessionParameters(self, url = None, origin = None, protocols = [], useragent = None, headers = {}, proxy = None):
"""
Set WebSocket session parameters.
:param url: WebSocket URL to connect to - ("ws:" | "wss:") "//" host [ ":" port ] path [ "?" query ].
:type url: str
:param origin: The origin to be sent in opening handshake.
:type origin: str
:param protocols: List of WebSocket subprotocols the client should announce in opening handshake.
:type protocols: list of strings
:param useragent: User agent as announced in HTTP request header during opening handshake.
:type useragent: str
:param headers: An optional mapping of additional HTTP headers to send during the WebSocket opening handshake.
:type headers: dict
"""
if url is not None:
## parse WebSocket URI into components
(isSecure, host, port, resource, path, params) = parseWsUrl(url)
self.url = url
self.isSecure = isSecure
self.host = host
self.port = port
self.resource = resource
self.path = path
self.params = params
else:
self.url = None
self.isSecure = None
self.host = None
self.port = None
self.resource = None
self.path = None
self.params = None
self.origin = origin
self.protocols = protocols
self.useragent = useragent
self.headers = headers
self.proxy = proxy
def resetProtocolOptions(self):
"""
Reset all WebSocket protocol options to defaults.
"""
self.version = WebSocketProtocol.DEFAULT_SPEC_VERSION
self.allowHixie76 = WebSocketProtocol.DEFAULT_ALLOW_HIXIE76
self.utf8validateIncoming = True
self.acceptMaskedServerFrames = False
self.maskClientFrames = True
self.applyMask = True
self.maxFramePayloadSize = 0
self.maxMessagePayloadSize = 0
self.autoFragmentSize = 0
self.failByDrop = True
self.echoCloseCodeReason = False
self.serverConnectionDropTimeout = 1
self.openHandshakeTimeout = 5
self.closeHandshakeTimeout = 1
self.tcpNoDelay = True
def setProtocolOptions(self,
version = None,
allowHixie76 = None,
utf8validateIncoming = None,
acceptMaskedServerFrames = None,
maskClientFrames = None,
applyMask = None,
maxFramePayloadSize = None,
maxMessagePayloadSize = None,
autoFragmentSize = None,
failByDrop = None,
echoCloseCodeReason = None,
serverConnectionDropTimeout = None,
openHandshakeTimeout = None,
closeHandshakeTimeout = None,
tcpNoDelay = None):
"""
Set WebSocket protocol options used as defaults for _new_ protocol instances.
:param version: The WebSocket protocol spec (draft) version to be used (default: WebSocketProtocol.DEFAULT_SPEC_VERSION).
:type version: int
:param allowHixie76: Allow to speak Hixie76 protocol version.
:type allowHixie76: bool
:param utf8validateIncoming: Validate incoming UTF-8 in text message payloads (default: True).
:type utf8validateIncoming: bool
:param acceptMaskedServerFrames: Accept masked server-to-client frames (default: False).
:type acceptMaskedServerFrames: bool
:param maskClientFrames: Mask client-to-server frames (default: True).
:type maskClientFrames: bool
:param applyMask: Actually apply mask to payload when mask it present. Applies for outgoing and incoming frames (default: True).
:type applyMask: bool
:param maxFramePayloadSize: Maximum frame payload size that will be accepted when receiving or 0 for unlimited (default: 0).
:type maxFramePayloadSize: int
:param maxMessagePayloadSize: Maximum message payload size (after reassembly of fragmented messages) that will be accepted when receiving or 0 for unlimited (default: 0).
:type maxMessagePayloadSize: int
:param autoFragmentSize: Automatic fragmentation of outgoing data messages (when using the message-based API) into frames with payload length <= this size or 0 for no auto-fragmentation (default: 0).
:type autoFragmentSize: int
:param failByDrop: Fail connections by dropping the TCP connection without performing closing handshake (default: True).
:type failbyDrop: bool
:param echoCloseCodeReason: Iff true, when receiving a close, echo back close code/reason. Otherwise reply with code == NORMAL, reason = "" (default: False).
:type echoCloseCodeReason: bool
:param serverConnectionDropTimeout: When the client expects the server to drop the TCP, timeout in seconds (default: 1).
:type serverConnectionDropTimeout: float
:param openHandshakeTimeout: Opening WebSocket handshake timeout, timeout in seconds or 0 to deactivate (default: 0).
:type openHandshakeTimeout: float
:param closeHandshakeTimeout: When we expect to receive a closing handshake reply, timeout in seconds (default: 1).
:type closeHandshakeTimeout: float
:param tcpNoDelay: TCP NODELAY ("Nagle") socket option (default: True).
:type tcpNoDelay: bool
"""
if allowHixie76 is not None and allowHixie76 != self.allowHixie76:
self.allowHixie76 = allowHixie76
if version is not None:
if version not in WebSocketProtocol.SUPPORTED_SPEC_VERSIONS:
raise Exception("invalid WebSocket draft version %s (allowed values: %s)" % (version, str(WebSocketProtocol.SUPPORTED_SPEC_VERSIONS)))
if version == 0 and not self.allowHixie76:
raise Exception("use of Hixie-76 requires allowHixie76 == True")
if version != self.version:
self.version = version
if utf8validateIncoming is not None and utf8validateIncoming != self.utf8validateIncoming:
self.utf8validateIncoming = utf8validateIncoming
if acceptMaskedServerFrames is not None and acceptMaskedServerFrames != self.acceptMaskedServerFrames:
self.acceptMaskedServerFrames = acceptMaskedServerFrames
if maskClientFrames is not None and maskClientFrames != self.maskClientFrames:
self.maskClientFrames = maskClientFrames
if applyMask is not None and applyMask != self.applyMask:
self.applyMask = applyMask
if maxFramePayloadSize is not None and maxFramePayloadSize != self.maxFramePayloadSize:
self.maxFramePayloadSize = maxFramePayloadSize
if maxMessagePayloadSize is not None and maxMessagePayloadSize != self.maxMessagePayloadSize:
self.maxMessagePayloadSize = maxMessagePayloadSize
if autoFragmentSize is not None and autoFragmentSize != self.autoFragmentSize:
self.autoFragmentSize = autoFragmentSize
if failByDrop is not None and failByDrop != self.failByDrop:
self.failByDrop = failByDrop
if echoCloseCodeReason is not None and echoCloseCodeReason != self.echoCloseCodeReason:
self.echoCloseCodeReason = echoCloseCodeReason
if serverConnectionDropTimeout is not None and serverConnectionDropTimeout != self.serverConnectionDropTimeout:
self.serverConnectionDropTimeout = serverConnectionDropTimeout
if openHandshakeTimeout is not None and openHandshakeTimeout != self.openHandshakeTimeout:
self.openHandshakeTimeout = openHandshakeTimeout
if closeHandshakeTimeout is not None and closeHandshakeTimeout != self.closeHandshakeTimeout:
self.closeHandshakeTimeout = closeHandshakeTimeout
if tcpNoDelay is not None and tcpNoDelay != self.tcpNoDelay:
self.tcpNoDelay = tcpNoDelay
def clientConnectionFailed(self, connector, reason):
"""
Called by Twisted when the connection to server has failed. Default implementation
does nothing. Override in derived class when appropriate.
"""
pass
def clientConnectionLost(self, connector, reason):
"""
Called by Twisted when the connection to server was lost. Default implementation
does nothing. Override in derived class when appropriate.
"""
pass
| {
"content_hash": "3b6989df61ed128c7082d3cd705d96ff",
"timestamp": "",
"source": "github",
"line_count": 4020,
"max_line_length": 214,
"avg_line_length": 38.8681592039801,
"alnum_prop": 0.603584,
"repo_name": "elenaoat/AutobahnPython",
"id": "001899f06418ff0f14b9f4f6c68ea20180dab022",
"size": "157037",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "autobahn/autobahn/websocket.py",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of source files.
#
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'MIX Blockchain'
author = u'Jonathan Brown'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0'
# The full version, including alpha/beta/rc tags.
release = u'1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
# today = ''
#
# Else, today_fmt is used as the format for a strftime call.
#
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'Link Blockchain v1.0'
# A shorter title for the navigation bar. Default is the same as html_title.
#
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
# html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#
# html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
#
# html_last_updated_fmt = None
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#
# html_additional_pages = {}
# If false, no module index is generated.
#
# html_domain_indices = True
# If false, no index is generated.
#
# html_use_index = True
# If true, the index is split into individual pages for each letter.
#
# html_split_index = False
# If true, links to the reST sources are added to the pages.
#
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
#
# html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
#
# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'LinkBlockchaindoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'LinkBlockchain.tex', u'MIX Blockchain Documentation',
u'Jonathan Brown \\textless{}jbrown@mix-blockchain.org\\textgreater{}', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#
# latex_use_parts = False
# If true, show page references after internal links.
#
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
#
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
#
# latex_appendices = []
# It false, will not define \strong, \code, itleref, \crossref ... but only
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
# packages.
#
# latex_keep_old_macro_names = True
# If false, no module index is generated.
#
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'linkblockchain', u'MIX Blockchain Documentation',
[author], 1)
]
# If true, show URL addresses after external links.
#
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'LinkBlockchain', u'MIX Blockchain Documentation',
author, 'LinkBlockchain', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#
# texinfo_appendices = []
# If false, no module index is generated.
#
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#
# texinfo_no_detailmenu = False
| {
"content_hash": "56a859f7d9b34794f742b8cdf64a4235",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 87,
"avg_line_length": 28.781045751633986,
"alnum_prop": 0.6920631315998638,
"repo_name": "mix-blockchain/mix-docs",
"id": "c6983bbd0680d2feb46d65a30917ff093da9d33a",
"size": "9865",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "conf.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "7638"
},
{
"name": "Python",
"bytes": "9865"
}
],
"symlink_target": ""
} |
package factory.pattern;
public class RadomPepperoniPizza extends Pizza {
private String type = "Radom Pepperoni";
public RadomPepperoniPizza() {
System.out.println(type);
}
}
| {
"content_hash": "e7c2ec52bdde3652885b12b393657e75",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 48,
"avg_line_length": 18.5,
"alnum_prop": 0.7513513513513513,
"repo_name": "jarzi/AbstractFactoryPattern",
"id": "d00d25da178dea25c305b15e43015203b90f25bc",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/factory/pattern/RadomPepperoniPizza.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2946"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BusRoutesWeb")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BusRoutesWeb")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3f2e5865-de45-450b-847f-265e1095e99b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "e8d0084f20ed3f74f50f4950955c0ea9",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 84,
"avg_line_length": 38.77142857142857,
"alnum_prop": 0.7487103905674282,
"repo_name": "jonnycundall/TravelDataLoader",
"id": "f347d9cb8e4e9fac53eb5feaf63b6207fe1f4f46",
"size": "1360",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BusRoutesWeb/BusRoutesWeb/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "103"
},
{
"name": "C#",
"bytes": "22694"
},
{
"name": "CSS",
"bytes": "16266"
},
{
"name": "JavaScript",
"bytes": "297083"
}
],
"symlink_target": ""
} |
// flow-typed signature: b6a25c533704de861c76000134986a10
// flow-typed version: <<STUB>>/@babel/plugin-proposal-class-properties_v7.1.0/flow_v0.87.0
/**
* This is an autogenerated libdef stub for:
*
* '@babel/plugin-proposal-class-properties'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module '@babel/plugin-proposal-class-properties' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module '@babel/plugin-proposal-class-properties/lib/index' {
declare module.exports: any;
}
// Filename aliases
declare module '@babel/plugin-proposal-class-properties/lib/index.js' {
declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib/index'>;
}
| {
"content_hash": "31040e7d85148244b4b96f552a288875",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 91,
"avg_line_length": 31.8125,
"alnum_prop": 0.7367387033398821,
"repo_name": "mineral-ui/mineral-ui",
"id": "2842f545a35ab6268f1dc093545519269bc6f857",
"size": "1018",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flow-typed/npm/@babel/plugin-proposal-class-properties_vx.x.x.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9584"
},
{
"name": "HTML",
"bytes": "6548"
},
{
"name": "JavaScript",
"bytes": "2408689"
}
],
"symlink_target": ""
} |
(function () {
'use strict';
var module = angular.module('pnc.common.pnc-client.rsql');
/**
* @ngdoc service
* @kind function
* @name pnc.common.pnc-client.rsql:selector
* @description
* This is an internal class used by rsqlQuery, see that for usage instructions.
*
* @author Alex Creasy
*/
module.factory('selector', [
function () {
/*
* For selecting a field to operate on e.g. `.where('name')`
*/
return function selector(ctx) {
var that = {};
that.where = function (field) {
ctx.addToQuery(field);
return ctx.next();
};
that.brackets = function (query) {
ctx.addToQuery('(' + query + ')');
return ctx.jumpTo('operator');
};
return that;
};
}
]);
})();
| {
"content_hash": "5ef1044114fbf67dbc1d6916d57dda59",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 82,
"avg_line_length": 21.17948717948718,
"alnum_prop": 0.5314769975786925,
"repo_name": "alexcreasy/pnc",
"id": "8149f08b7d8d13a31d5f5d3107b033d6108fe9d0",
"size": "1533",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ui/app/common/pnc-client/rsql/selector.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "113413"
},
{
"name": "HTML",
"bytes": "394550"
},
{
"name": "Java",
"bytes": "4283733"
},
{
"name": "JavaScript",
"bytes": "3099544"
},
{
"name": "TSQL",
"bytes": "47567"
}
],
"symlink_target": ""
} |
UniverseDisplay::UniverseDisplay(QWidget *parent)
: GridWidget(parent)
, m_sources(MAX_DMX_ADDRESS, sACNMergedAddress())
, m_flickerFinder(false)
, m_showChannelPriority(false)
{
memset(m_flickerFinderLevels, 0, MAX_DMX_ADDRESS);
memset(m_flickerFinderHasChanged, 0, MAX_DMX_ADDRESS);
}
void UniverseDisplay::setShowChannelPriority(bool enable)
{
if (m_showChannelPriority == enable)
return;
m_showChannelPriority = enable;
emit showChannelPriorityChanged(enable);
m_cellHeight = m_showChannelPriority ? (18 * 2) : 18;
// Refresh
levelsChanged();
}
void UniverseDisplay::setUniverse(int universe)
{
m_listener = sACNManager::getInstance()->getListener(universe);
connect(m_listener.data(), SIGNAL(levelsChanged()), this, SLOT(levelsChanged()));
levelsChanged();
}
void UniverseDisplay::pause()
{
m_listener->disconnect(this);
}
void UniverseDisplay::levelsChanged()
{
if(!m_listener)
return;
Preferences *p = Preferences::getInstance();
m_sources = m_listener->mergedLevels();
for(int i=0; i<m_sources.count(); i++)
{
if(m_sources[i].winningSource && i < m_sources[i].winningSource->slot_count)
{
QString cellText(p->GetFormattedValue(m_sources[i].level));
if (m_showChannelPriority)
{
cellText.append('\n');
cellText.append(QString::number(m_sources[i].winningSource->priority_array[i]));
}
setCellValue(i, cellText);
if(m_flickerFinder)
{
if(m_sources[i].level > m_flickerFinderLevels[i])
{
setCellColor(i, flickerHigherColor);
m_flickerFinderHasChanged[i] = true;
}
else if( m_sources[i].level < m_flickerFinderLevels[i])
{
setCellColor(i, flickerLowerColor);
m_flickerFinderHasChanged[i] = true;
}
else if(m_flickerFinderHasChanged[i])
{
setCellColor(i, flickerChangedColor);
}
else
{
setCellColor(i, Qt::white);
}
}
else
{
setCellColor(i, Preferences::getInstance()->colorForCID(m_sources[i].winningSource->src_cid));
}
}
else
{
setCellColor(i, Qt::white);
setCellValue(i, QString());
}
}
update();
}
void UniverseDisplay::setFlickerFinder(bool on)
{
if(!m_listener) return;
m_flickerFinder = on;
if(on)
{
for(int i=0; i<MAX_DMX_ADDRESS; i++)
{
m_flickerFinderLevels[i] = m_listener->mergedLevels().at(i).level;
m_flickerFinderHasChanged[i] = false;
setCellColor(i, Qt::white);
}
}
else
{
levelsChanged();
}
update();
}
| {
"content_hash": "44ade014cb903feaf4ae7a278459a4a4",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 110,
"avg_line_length": 28.37735849056604,
"alnum_prop": 0.5485372340425532,
"repo_name": "marcusbirkin/sacnview",
"id": "c3e912c0f4405342cbb1b7c1d040178569cb4987",
"size": "3682",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/universedisplay.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AppleScript",
"bytes": "1998"
},
{
"name": "C",
"bytes": "267341"
},
{
"name": "C++",
"bytes": "570236"
},
{
"name": "CSS",
"bytes": "9239"
},
{
"name": "HTML",
"bytes": "195"
},
{
"name": "JavaScript",
"bytes": "3422"
},
{
"name": "Makefile",
"bytes": "3583"
},
{
"name": "NSIS",
"bytes": "17370"
},
{
"name": "Objective-C",
"bytes": "12700"
},
{
"name": "Python",
"bytes": "6491"
},
{
"name": "QMake",
"bytes": "17002"
},
{
"name": "Ruby",
"bytes": "516"
},
{
"name": "Shell",
"bytes": "8705"
}
],
"symlink_target": ""
} |
PDSA: Probabilistic Data Structures and Algorithms in Python
==================================================================
.. image:: https://img.shields.io/github/license/gakhov/pdsa.svg?style=flat-square
:target: https://github.com/gakhov/pdsa/blob/master/LICENSE.txt
:alt: MIT License
.. image:: https://img.shields.io/github/release/gakhov/pdsa/all.svg?style=flat-square
:target: https://github.com/gakhov/pdsa/releases
:alt: Current Release Version
.. image:: https://img.shields.io/pypi/v/pdsa.svg?style=flat-square
:target: https://pypi.python.org/pypi/pdsa
:alt: pypi Version
.. image:: https://readthedocs.org/projects/pdsa/badge/?version=latest&style=flat-square
:target: http://pdsa.readthedocs.io/en/latest/
:alt: Documentation Version
.. image:: https://img.shields.io/pypi/pyversions/pdsa.svg?style=flat-square
:target: https://github.com/gakhov/pdsa
:alt: Python versions
Probabilistic data structures is a common name of data structures
based on different hashing techniques.
Unlike regular (or deterministic) data structures, they always give you
approximated answers and usually provide reliable ways to estimate
the error probability.
The potential losses or errors are fully compensated by extremely
low memory requirements, constant query time and scaling.
GitHub repository: `<https://github.com/gakhov/pdsa>`_
.. toctree::
:maxdepth: 2
quickstart
cardinality/index
frequency/index
membership/index
rank/index
| {
"content_hash": "11cd2e6b09b9e5de02241bbe52f55486",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 88,
"avg_line_length": 34.25,
"alnum_prop": 0.7179827471798275,
"repo_name": "gakhov/pdsa",
"id": "d7106ab24397bc914520ae57e12018c2b194e89e",
"size": "1507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/index.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1108"
},
{
"name": "C++",
"bytes": "12508"
},
{
"name": "Makefile",
"bytes": "720"
},
{
"name": "Python",
"bytes": "149628"
}
],
"symlink_target": ""
} |
<?php defined('SYSPATH') OR die('No direct script access.');
class Fusion_View_Auctions_View extends Views
{
public $title = 'Auction';
/**
* Stores the auction
* @var Model_User_Auction
*/
public $auction = false;
/**
* Stores the last bid
* @var Model_User_Auction_Bid
*/
public $bid = false;
/**
* Stores the auction's item
* @var Model_User_Item
*/
public $item = false;
/**
* @var integer|false Stores the auction's auto_buy
*/
public $auto_buy = false;
/**
* Stores the navigation
* @var string
*/
public $menu = false;
/**
* Simplify lot data
* @return array
*/
public function lot()
{
if($this->auction->until > time())
{
$span = Date::span(time(), $this->auction->until, 'days,hours,minutes,seconds');
$until = '';
foreach($span as $type => $val)
{
if($val > 0)
{
$type = ($val > 1) ? $type : Inflector::singular($type);
$until .= $val . ' ' . $type . ' ';
}
}
}
else
{
$until = 'ended';
}
return array(
'id' => $this->auction->id,
'item' => [
'name' => $this->item->item->name,
'img' => $this->item->img()
],
'username' => $this->auction->user->username,
'user_profile' => Route::url('user.profile', array('name' => $this->auction->user->username)),
'until' => $until,
'start_bid' => $this->auction->start_bid,
'increment' => $this->auction->min_increment,
'auto_buy' => $this->auction->auto_buy,
'bid_link' => Route::url('auctions.bid', ['auction_id' => $this->auction->id])
);
}
/**
* Simplify bid data
* @return array|bool
*/
public function bid()
{
if($this->has_bid())
{
return array (
'points' => $this->bid->points,
'next_bid' => $this->auction->min_increment + $this->bid->points,
'username' => $this->bid->user->username,
'user_profile' => Route::url('user.profile', array('name' => $this->bid->user->username)),
);
}
return false;
}
/**
* Check if the auction has a last made bid
* @return bool
*/
public function has_bid()
{
return $this->bid != false && $this->bid->loaded();
}
/**
* Count all the bids that were made on this auction
* @return integer
*/
public function total_bids()
{
return DB::select([DB::expr('COUNT(id)', 'total')])
->from('logs')
->where('alias_id', '=', $this->auction->id)
->where('alias', '=', 'auction.bid')
->execute()
->get('total');
}
/**
* Check if the user can make a bid (if he's not the owner or last bidder)
* @return bool
*/
public function can_bid()
{
$users = [$this->auction->user_id];
if($this->has_bid())
{
$users[] = $this->bid->user_id;
}
return !in_array(Fusion::$user->id, $users);
}
/**
* Check if there's an auto buy option
* @return bool
*/
public function auto_buy()
{
return $this->auction->auto_buy > 0;
}
}
| {
"content_hash": "99f11ddc7bd61695adce82c3a4e789e1",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 106,
"avg_line_length": 24.184931506849313,
"alnum_prop": 0.4562446898895497,
"repo_name": "fusionFramework/economy",
"id": "1c42840a9c2e4426c8bca51d27a3c8982e08f71f",
"size": "3689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "classes/Fusion/View/Auctions/View.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "11289"
},
{
"name": "PHP",
"bytes": "236588"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_252) on Fri Aug 20 17:47:57 BST 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class psidev.psi.mi.jami.binary.expansion.InteractionEvidenceMatrixExpansion (PSI :: JAMI - Java framework for molecular interactions 3.2.12 API)</title>
<meta name="date" content="2021-08-20">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class psidev.psi.mi.jami.binary.expansion.InteractionEvidenceMatrixExpansion (PSI :: JAMI - Java framework for molecular interactions 3.2.12 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../../../../../../psidev/psi/mi/jami/binary/expansion/InteractionEvidenceMatrixExpansion.html" title="class in psidev.psi.mi.jami.binary.expansion">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></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>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?psidev/psi/mi/jami/binary/expansion/class-use/InteractionEvidenceMatrixExpansion.html" target="_top">Frames</a></li>
<li><a href="InteractionEvidenceMatrixExpansion.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">
<h2 title="Uses of Class psidev.psi.mi.jami.binary.expansion.InteractionEvidenceMatrixExpansion" class="title">Uses of Class<br>psidev.psi.mi.jami.binary.expansion.InteractionEvidenceMatrixExpansion</h2>
</div>
<div class="classUseContainer">No usage of psidev.psi.mi.jami.binary.expansion.InteractionEvidenceMatrixExpansion</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../../../../../../psidev/psi/mi/jami/binary/expansion/InteractionEvidenceMatrixExpansion.html" title="class in psidev.psi.mi.jami.binary.expansion">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></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>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?psidev/psi/mi/jami/binary/expansion/class-use/InteractionEvidenceMatrixExpansion.html" target="_top">Frames</a></li>
<li><a href="InteractionEvidenceMatrixExpansion.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 © 2021. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "b73c5176b5e444ea4cad8e750fc2961e",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 203,
"avg_line_length": 40.611111111111114,
"alnum_prop": 0.6284932577682236,
"repo_name": "MICommunity/psi-jami",
"id": "4df1120cc3bb0c719f97a87e894548d377f3dc84",
"size": "5117",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/psidev/psi/mi/jami/binary/expansion/class-use/InteractionEvidenceMatrixExpansion.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3953"
},
{
"name": "HTML",
"bytes": "2996"
},
{
"name": "Java",
"bytes": "20488264"
},
{
"name": "JavaScript",
"bytes": "22224"
},
{
"name": "XSLT",
"bytes": "25595"
}
],
"symlink_target": ""
} |
'use strict';
const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
var Menu = require("menu");
var http = require('http');
var express = require("express");
var RED = require("node-red");
// Create an Express app
var red_app = express();
// Add a simple route for static content served from 'public'
//red_app.use("/",express.static("public"));
// Create a server
var server = http.createServer(red_app);
// Create the settings object - see default settings.js file for other options
var settings = {
httpAdminRoot:"/admin",
httpNodeRoot: "/",
userDir: __dirname,
flowFile: "flows.json",
functionGlobalContext: { } // enables global context
};
// Initialise the runtime with a server and settings
RED.init(server,settings);
// Serve the editor UI from /red
red_app.use(settings.httpAdminRoot,RED.httpAdmin);
// Serve the http nodes UI from /api
red_app.use(settings.httpNodeRoot,RED.httpNode);
server.listen(8000);
// Start the runtime
RED.start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
autoHideMenuBar: false,
webPreferences: {
nodeIntegration: false
},
width: 1024,
height: 768,
icon: __dirname + "/nodered.png"
});
mainWindow.loadURL("http://localhost:8000/ui");
var webContents = mainWindow.webContents;
webContents.on('did-get-response-details', function(event, status, newURL, originalURL, httpResponseCode) {
if (httpResponseCode == 404) {
setTimeout(webContents.reload, 200);
}
});
// Open the DevTools.
//mainWindow.webContents.openDevTools();
// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', createWindow);
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow();
}
// Create the Application's main menu
var template = [{
label: "Application",
submenu: [
{ label: "About Application", selector: "orderFrontStandardAboutPanel:" },
{ type: "separator" },
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
]}, {
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ type: "separator" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
});
| {
"content_hash": "e8651d73882fc43d578903b22449d4b4",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 109,
"avg_line_length": 30.669354838709676,
"alnum_prop": 0.6634236129371549,
"repo_name": "mooglics/electronapps",
"id": "3c8c9ec72839a68fd9aafd2dabb6064abb67195d",
"size": "3803",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node-red/main.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "678"
},
{
"name": "HTML",
"bytes": "54664"
},
{
"name": "JavaScript",
"bytes": "483159"
}
],
"symlink_target": ""
} |
package io.netty.example.http.helloworld;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpRequest;
import static io.netty.handler.codec.http.HttpHeaders.Names.*;
import static io.netty.handler.codec.http.HttpHeaders.*;
import static io.netty.handler.codec.http.HttpResponseStatus.*;
import static io.netty.handler.codec.http.HttpVersion.*;
public class HttpHelloWorldServerHandler extends ChannelHandlerAdapter {
private static final byte[] CONTENT = { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
ctx.flush();
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof HttpRequest) {
HttpRequest req = (HttpRequest) msg;
if (is100ContinueExpected(req)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE));
}
boolean keepAlive = isKeepAlive(req);
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(CONTENT));
response.headers().set(CONTENT_TYPE, "text/plain");
response.headers().set(CONTENT_LENGTH, response.content().readableBytes());
if (!keepAlive) {
ctx.write(response).addListener(ChannelFutureListener.CLOSE);
} else {
response.headers().set(CONNECTION, Values.KEEP_ALIVE);
ctx.write(response);
}
}
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
cause.printStackTrace();
ctx.close();
}
}
| {
"content_hash": "7a9f098038f6dadb8704abf2f22fd380",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 115,
"avg_line_length": 37.61538461538461,
"alnum_prop": 0.6753578732106339,
"repo_name": "daschl/netty",
"id": "ad33ff8ed31076773104d1fc6f05a6c42995312c",
"size": "2590",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServerHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "51273"
},
{
"name": "CSS",
"bytes": "49"
},
{
"name": "Java",
"bytes": "6895151"
},
{
"name": "Shell",
"bytes": "3562"
}
],
"symlink_target": ""
} |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* @package dashboard
* @author Syahril Hermana
*/
class sumber_verifikasi extends CI_Controller {
protected $model;
protected $direct;
public function __construct() {
parent::__construct();
// init twiggy
$this->twiggy->title($this->config->item('application'));
$this->twiggy->meta('keywords', 'codeigniter-plus');
$this->twiggy->meta('description', 'CodeIgniter Plus');
$this->twiggy->meta('viewport', 'width=device-width, initial-scale=1, maximum-scale=1');
// generate csrf
$this->twiggy->set('_csrf', $this->security->get_csrf_token_name());
$this->twiggy->set('_token', $this->security->get_csrf_hash());
$this->direct = base_url('ms/sumber_verifikasi');
$this->guard->is_access();
}
public function index(){
$page = (!$this->input->get('page')) ? 1 : $this->input->get('page');
$this->twiggy->set('this_page', $page);
$this->twiggy->template('master/sumber-verifikasi/index')->display();
}
public function list_data()
{
// get pagable data
$page = (!$this->input->get('page')) ? 1 : $this->input->get('page');
$limit = 25;
$offset = (($page-1)*$limit);
$search = "";
$this->model = new SumberVerifikasiEntity();
$list = $this->model->get_sumber_verifikasi($offset, $limit, $search, null, null);
$total = $this->model->get_sumber_verifikasi_count($search);
$this->twiggy->set('list', $list->result());
$this->twiggy->set('total', $total);
$this->twiggy->set('totalPage', ceil($total/$limit));
$this->twiggy->set('size', $list->num_rows());
$this->twiggy->set('page', $page);
$this->twiggy->template('master/sumber-verifikasi/list')->display();
}
public function form($id=null){
if ($id != null) {
$this->model = SumberVerifikasiEntity::find($id);
$this->twiggy->set('object', $this->model);
}
$this->twiggy->template('master/sumber-verifikasi/form')->display();
}
public function delete($id){
if($this->input->is_ajax_request())
{
if ($id == null) {
redirect($this->direct, 'location', 303);
}
SumberVerifikasiEntity::delete($id);
redirect($this->direct, 'location', 303);
}
}
public function submit(){
try {
if ($this->input->post('id') == null) {
$this->model = new SumberVerifikasiEntity();
} else {
$this->model = SumberVerifikasiEntity::find($this->input->post('id'));
}
$this->model->mst_sumber_verifikasi_name = $this->input->post('name');
$this->model->save();
redirect($this->direct, 'location', 303);
} catch(Exception $e) {
$e->getMessage();
redirect($this->direct, 'location', 303);
}
}
}
| {
"content_hash": "55a0716023b7ae98461f6f7383dc1ae6",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 90,
"avg_line_length": 26.858585858585858,
"alnum_prop": 0.6239187664535539,
"repo_name": "syahrilhermana/ci-plus",
"id": "14b702ece1da837ecc152b46c976ce7dc09aee51",
"size": "2659",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/modules/ms/controllers/sumber_verifikasi.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "421"
},
{
"name": "CSS",
"bytes": "863375"
},
{
"name": "HTML",
"bytes": "2468972"
},
{
"name": "JavaScript",
"bytes": "3592131"
},
{
"name": "PHP",
"bytes": "2192710"
},
{
"name": "Shell",
"bytes": "1490"
}
],
"symlink_target": ""
} |
package listener;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
/**
* Application Lifecycle Listener implementation class Analytics
*
*/
@WebListener
public class Analytics implements ServletRequestAttributeListener, HttpSessionAttributeListener {
/**
* Default constructor.
*/
public Analytics() {
}
/**
* @see HttpSessionAttributeListener#attributeRemoved(HttpSessionBindingEvent)
*/
public void attributeRemoved(HttpSessionBindingEvent arg0) {
}
/**
* @see HttpSessionAttributeListener#attributeAdded(HttpSessionBindingEvent)
*/
public void attributeAdded(HttpSessionBindingEvent arg0) {
calculateAvgItemTime(arg0);
}
/**
* @see ServletRequestAttributeListener#attributeAdded(ServletRequestAttributeEvent)
*/
public void attributeAdded(ServletRequestAttributeEvent evt) {
if(evt.getName().equals("po_file")){
Long now = (new Date()).getTime();
HttpServletRequest req= (HttpServletRequest) evt.getServletRequest();
HttpSession sess =req.getSession();
Map<String, Long> checkout_times= (Map<String, Long>) sess.getServletContext().getAttribute("checkout_times");
Long totalTime;
Long checkouts;
if(checkout_times==null){
checkout_times = new HashMap<String, Long>();
totalTime = 0L;
checkouts = 0L;
} else {
totalTime = checkout_times.get("time");
checkouts = checkout_times.get("checkouts");
}
Long diff = now -sess.getCreationTime();
totalTime = totalTime + diff;
checkouts++;
checkout_times.put("time", totalTime);
checkout_times.put("checkouts", checkouts);
// System.out.println("Average Time: "+ ((double)totalTime/(double)checkouts));
sess.getServletContext().setAttribute("checkout_times", checkout_times);
}
}
/**
* @see HttpSessionAttributeListener#attributeReplaced(HttpSessionBindingEvent)
*/
public void attributeReplaced(HttpSessionBindingEvent arg0) {
calculateAvgItemTime(arg0);
}
/**
* @see ServletRequestAttributeListener#attributeRemoved(ServletRequestAttributeEvent)
*/
public void attributeRemoved(ServletRequestAttributeEvent arg0) {
// TODO Auto-generated method stub
}
/**
* @see ServletRequestAttributeListener#attributeReplaced(ServletRequestAttributeEvent)
*/
public void attributeReplaced(ServletRequestAttributeEvent arg0) {
// TODO Auto-generated method stub
}
private void calculateAvgItemTime(HttpSessionBindingEvent event){
if(event.getName().equals("shopping_cart")){
//To calculate average we need the last time we added stuff to it
//We can use the session for this purpose
Long lastAdded = (Long) event.getSession().getAttribute("last_cart_update_time");
Long now = (new Date()).getTime();
if(lastAdded == null){
lastAdded = event.getSession().getCreationTime();
}
//Calculate time difference
Long diff = now - lastAdded;
Map<String, Long> shopping_times= (Map<String, Long>) event.getSession().getServletContext().getAttribute("shopping_times");
Long totalTime;
Long items;
if(shopping_times==null){
shopping_times = new HashMap<String, Long>();
totalTime = 0L;
items = 0L;
} else {
totalTime = shopping_times.get("time");
items = shopping_times.get("items");
}
totalTime = totalTime + diff;
items++;
shopping_times.put("time", totalTime);
shopping_times.put("items", items);
// System.out.println("Average Time: "+ ((double)totalTime/(double)items));
event.getSession().setAttribute("last_cart_update_time", now);
event.getSession().getServletContext().setAttribute("shopping_times", shopping_times);
}
}
}
| {
"content_hash": "5ccb3d71aa630c78947fca22d58c2a66",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 130,
"avg_line_length": 32.52238805970149,
"alnum_prop": 0.6686553464892152,
"repo_name": "twistedR/sushi-project-c",
"id": "5494b29d82a8b475b6cfa70745a3d74c1685c3e5",
"size": "4358",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/listener/Analytics.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "149403"
},
{
"name": "Java",
"bytes": "57620"
},
{
"name": "JavaScript",
"bytes": "72"
},
{
"name": "XSLT",
"bytes": "3148"
}
],
"symlink_target": ""
} |
'use strict';
var Metalsmith = require('metalsmith');
var templates = require('metalsmith-hbs');
var assets = require('metalsmith-assets');
var markdown = require('metalsmith-markdownit');
var each = require('metalsmith-each');
var extname = require('path').extname;
var dirname = require('path').dirname;
var cheerio = require('cheerio');
var handlebars = require('handlebars');
var helpers = require('handlebars-helpers');
var inspect = require('util').inspect;
var path = require('path');
var _ = require('lodash');
var clone = require('clone');
helpers.register(handlebars, {marked:{}}); //注册更多有用的 helper
//Processing flow is There!!!
var metalsmith = Metalsmith(__dirname)
.source('./contents')
.destination('./_site')
//将 README 文件重命名为 index ,也就是目录默认的 index 页面
.use(each(function(file, filename){
filename = filename.toLowerCase().replace(/[\\\/]+/g, '/');
if(/readme/i.test(filename)) {
filename = filename.replace(/readme/ig, 'index');
}
return filename;
}))
//为网站增加一个首页 index 页面
.use(function(files, metalsmith, done){
files['index.md'] = {
contents: new Buffer(''),
template: 'marketing'
};
done();
})
//Parsing Markdown...
.use(markdown({html: true}))
//提取每个文档页面的标题、简介等
.use(each(function(file, filename){
if(!/docs/.test(filename)) return;
var contents = file.contents.toString();
var $ = cheerio.load(contents, {decodeEntities: false});
file['title'] = $('h1').first().text();
file['description'] = $('h1').next('ul').first().text();
}))
//应用模板
.use(templates({
'handlebars': handlebars,
'defaultTemplate': 'docs',
'pattern': '**/*.html',
'beautify': true
}))
// 将文件路径改为 `目录/index.html` 模式
.use(each(function(file, filename){
if(!is_html(filename)) return;
if(/index\.html$/.test(filename)) return; //index 页面无需修改
filename = filename.replace(/\.html$/, '/index.html');
return filename;
}))
//将文档中的绝对路径修改为相对路径
.use(each(function(file, filename){
setImmediate(function(){
var contents = file.contents.toString();
var $ = cheerio.load(contents, {decodeEntities: false});
function relative(from, to) {
var dir = dirname(from);
if(/^\//.test(to)) {
to = path.relative(path.join('/', dir), to);
if(to === '') to = './';
}
return to.replace(/\\+/g, '/');
}
$('a[href], link[href]').each(function(i, ele){
var href = $(this).attr('href');
if(this.name === 'a' && /^https?:\/\//.test(href)) {
$(this).attr('target', '_blank');
return;
}
href = href.replace(/(readme)?\.md$/i, '').toLowerCase();
href = relative(filename, href)
if(this.name == 'a') {
href = path.normalize(path.join(href, '/')).replace(/[\\\/]+/g, '/');
}
$(this).attr('href', href);
});
$('script[src], img[src]').each(function(i, ele){
var src = $(this).attr('src');
$(this).attr('src', relative(filename, src));
});
file.contents = new Buffer($.html());
});
}))
//复制资源文件
.use(assets({
'source': './assets'
}))
.build(function(err){
if(err) throw err;
});
function is_html(file){
return /(\.html|\.htm)$/.test(extname(file));
}
function is_markdown(file){
return /(\.md|\.markdown)$/i.test(extname(file));
} | {
"content_hash": "049df1aca15c096c0be4b4e584e16015",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 24.175675675675677,
"alnum_prop": 0.5452766908887646,
"repo_name": "wangsai/www.gulpjs.com.cn",
"id": "84ad7d893ef08ae977205d666953cb1a604eef7c",
"size": "3766",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21401"
},
{
"name": "HTML",
"bytes": "16654"
},
{
"name": "JavaScript",
"bytes": "6374"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text;
namespace Argus.IO.Compression
{
class ZipConstants
{
public const UInt32 EndOfCentralDirectorySignature = 0x06054b50;
public const int ZipEntrySignature = 0x04034b50;
public const int ZipEntryDataDescriptorSignature = 0x08074b50;
public const int ZipDirEntrySignature = 0x02014b50;
}
}
| {
"content_hash": "a43fc02dc118219f530d9d4039dbb603",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 28.5,
"alnum_prop": 0.7418546365914787,
"repo_name": "blakepell/Argus",
"id": "31921b0edb59798ee2f1399c0f27876c6bba2bf4",
"size": "399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Argus/Argus.Core/IO/Compression/Constants.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "68"
},
{
"name": "C#",
"bytes": "1363885"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
What's Jekyll? · Poole
</title>
<link rel="stylesheet" href="/styles.css">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-precomposed.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<link rel="alternate" type="application/atom+xml" title="Poole" href="/atom.xml">
</head>
<body>
<div class="container content">
<header class="masthead">
<h3 class="masthead-title">
<a href="/" title="Home">Poole</a>
<small>The Jekyll Butler</small>
</h3>
</header>
<main>
<article class="post">
<h1 class="post-title">What's Jekyll?</h1>
<time datetime="2016-01-01T00:00:00+05:00" class="post-date">01 Jan 2016</time>
<p><a href="http://jekyllrb.com">Jekyll</a> is a static site generator, an open-source tool for creating simple yet powerful websites of all shapes and sizes. From <a href="https://github.com/jekyll/jekyll/blob/master/README.markdown">the project’s readme</a>:</p>
<blockquote>
<p>Jekyll is a simple, blog aware, static site generator. It takes a template directory […] and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind GitHub Pages, which you can use to host your project’s page or blog right here from GitHub.</p>
</blockquote>
<p>It’s an immensely useful tool. Find out more by <a href="https://github.com/jekyll/jekyll">visiting the project on GitHub</a>.</p>
</article>
<aside class="related">
<h3>Related posts</h3>
<ul class="related-posts">
<li>
<a href="/2016/01/03/introduction/">
Introduction
<small><time datetime="2016-01-03T00:00:00+05:00">03 Jan 2016</time></small>
</a>
</li>
<li>
<a href="/2016/01/02/example-content/">
Example content
<small><time datetime="2016-01-02T00:00:00+05:00">02 Jan 2016</time></small>
</a>
</li>
</ul>
</aside>
</main>
<footer class="footer">
<small>
© <time datetime="2017-01-02T15:09:54+05:00">2017</time>. All rights reserved.
</small>
</footer>
</div>
</body>
</html>
| {
"content_hash": "ab9a34599eca43158f06258edef646be",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 323,
"avg_line_length": 30.481012658227847,
"alnum_prop": 0.6237541528239202,
"repo_name": "angrishenko/angrishenko.github.io",
"id": "5111fa99a957fe4d9ce76df0ec931cb72423abfe",
"size": "2416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_site/2016/01/01/whats-jekyll/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32600"
},
{
"name": "HTML",
"bytes": "43182"
}
],
"symlink_target": ""
} |
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii message' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'Management' => 'จัดการ',
];
| {
"content_hash": "bcc0b479890df74e9651acdc4022a381",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 76,
"avg_line_length": 33.95238095238095,
"alnum_prop": 0.7251051893408135,
"repo_name": "dixonsatit/yii2-workshop",
"id": "2bbc396282288ba9df65478b75f8c65318eb1c3f",
"size": "725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/messages/th/backend.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "2728"
},
{
"name": "PHP",
"bytes": "129085"
}
],
"symlink_target": ""
} |
/**
* web-T::Framework Popup module
* @author goshi
*/
webtFramework.inject({
_popup : [],
_popup_tout : [],
/**
* universal info/error UI popup
* @param css_class
* @param text
* @param parent
* @param autohide
* @returns {{hidePopup: hidePopup}}
*/
popup : function(css_class, text, parent, autohide){
if (typeof autohide == 'undefined')
autohide = true;
var id = this._popup.length;
this._popup[id] = $('<div class="subPopup" style="display: none"><div id="webtpopup-'+id+'-content" class="content"></div><div class="tb"></div></div>');
$('body').append(this._popup[id]);
var self = this;
var setClass = function(id, css_class){
if (typeof self._popup[id] != 'undefined' && self._popup[id]){
self._popup[id].addClass(css_class);
}
};
var setContent = function(id, content){
if (typeof self._popup[id] != 'undefined' && self._popup[id]){
self._popup[id].find('.content').html(content);
}
};
setClass(id, css_class);
setContent(id, text);
// detect position of the element
if (typeof parent != 'undefined' && parent){
var pos = $(parent).offset();
if (pos){
this._popup[id].css('left', pos.left);
this._popup[id].css('top', pos.top + $(parent).outerHeight() + 7);
}
}
this._popup[id].show(100);
var hidePopup = function(pid, callback){
if (typeof self._popup[pid] != 'undefined' && self._popup[pid]){
if (self._popup_tout[pid]){
clearTimeout(self._popup_tout[pid]);
self._popup_tout[pid] = null;
}
self._popup[pid].hide(200, function(){
$(self._popup[pid]).remove();
self._popup[pid] = null;
if (typeof callback == 'function'){
callback();
}
});
}
};
if (autohide){
this._popup_tout[id] = setTimeout(function(){
hidePopup(id);
}, 8000);
}
return {
__pid : id,
getId : function(){
return this.__pid;
},
setClass: function(css_class){
setClass(this.__pid, css_class);
},
setContent: function(content){
setContent(this.__pid, content);
},
destroy : function(callback){
hidePopup(this.__pid, callback);
}
}
},
}); | {
"content_hash": "6864baa762428cf20756cdcc844e1831",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 161,
"avg_line_length": 26.09433962264151,
"alnum_prop": 0.4522776572668113,
"repo_name": "web-T/js-framework",
"id": "092cf6ad3cbb831d3a491ad0dec7d1362ed2aa94",
"size": "2766",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/popup.module.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2939"
},
{
"name": "JavaScript",
"bytes": "22335"
}
],
"symlink_target": ""
} |
param($stuff)
$stuff
#$tse.Title = $stuff.ToString()
#$tse.Title = "[Ready] $(Get-Date)"
#$tse.TextEditor | {
"content_hash": "6ee30d9db4717a71dfbafb4c31d355a5",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 35,
"avg_line_length": 17.833333333333332,
"alnum_prop": 0.6448598130841121,
"repo_name": "dfinke/PowerShellConsole",
"id": "f7b557f4918fb5f831dc80563331c64aad220435",
"size": "109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PowerShellConsole/Scripts/InvokeInitializeConsole.ps1",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "42582"
},
{
"name": "PowerShell",
"bytes": "254"
}
],
"symlink_target": ""
} |
package edu.pdx.cs410J.airlineweb;
import edu.pdx.cs410J.InvokeMainTestCase;
import edu.pdx.cs410J.UncaughtExceptionInMain;
import edu.pdx.cs410J.web.HttpRequestHelper.RestException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import java.io.IOException;
import java.net.HttpURLConnection;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.MethodName;
/**
* An integration test for {@link Project5} that invokes its main method with
* various arguments
*/
@TestMethodOrder(MethodName.class)
class Project5IT extends InvokeMainTestCase {
private static final String HOSTNAME = "localhost";
private static final String PORT = System.getProperty("http.port", "8080");
@Test
void test0RemoveAllMappings() throws IOException {
AirlineRestClient client = new AirlineRestClient(HOSTNAME, Integer.parseInt(PORT));
client.removeAllDictionaryEntries();
}
@Test
void test1NoCommandLineArguments() {
MainMethodResult result = invokeMain( Project5.class );
assertThat(result.getTextWrittenToStandardError(), containsString(Project5.MISSING_ARGS));
}
@Test
void test2EmptyServer() {
MainMethodResult result = invokeMain( Project5.class, HOSTNAME, PORT );
String out = result.getTextWrittenToStandardOut();
assertThat(out, out, containsString(PrettyPrinter.formatWordCount(0)));
}
@Test
void test3NoDefinitionsThrowsAppointmentBookRestException() {
String word = "WORD";
try {
invokeMain(Project5.class, HOSTNAME, PORT, word);
fail("Should have thrown a RestException");
} catch (UncaughtExceptionInMain ex) {
RestException cause = (RestException) ex.getCause();
assertThat(cause.getHttpStatusCode(), equalTo(HttpURLConnection.HTTP_NOT_FOUND));
}
}
@Test
void test4AddDefinition() {
String word = "WORD";
String definition = "DEFINITION";
MainMethodResult result = invokeMain( Project5.class, HOSTNAME, PORT, word, definition );
String out = result.getTextWrittenToStandardOut();
assertThat(out, out, containsString(Messages.definedWordAs(word, definition)));
result = invokeMain( Project5.class, HOSTNAME, PORT, word );
out = result.getTextWrittenToStandardOut();
assertThat(out, out, containsString(PrettyPrinter.formatDictionaryEntry(word, definition)));
result = invokeMain( Project5.class, HOSTNAME, PORT );
out = result.getTextWrittenToStandardOut();
assertThat(out, out, containsString(PrettyPrinter.formatDictionaryEntry(word, definition)));
}
} | {
"content_hash": "c52f494d86a7feee7c887ab230884142",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 100,
"avg_line_length": 37.921052631578945,
"alnum_prop": 0.7227619708535739,
"repo_name": "DavidWhitlock/PortlandStateJava",
"id": "b5cd397959e6bfa3a20748932f1293e761f01df9",
"size": "2882",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "projects-parent/originals-parent/airline-web/src/it/java/edu/pdx/cs410J/airlineweb/Project5IT.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "11316"
},
{
"name": "HTML",
"bytes": "22112"
},
{
"name": "Java",
"bytes": "1308183"
}
],
"symlink_target": ""
} |
package com.spotify.heroic.metric;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.auto.value.AutoValue;
import com.google.common.hash.Hasher;
import com.tdunning.math.stats.TDigest;
import org.jetbrains.annotations.NotNull;
@JsonSerialize(using = TdigestPointSerializer.class)
@JsonDeserialize(using = TdigestPointDeserialize.class)
@AutoValue
public abstract class TdigestPoint implements Metric {
public abstract long getTimestamp();
public abstract TDigest value();
@JsonCreator
public static TdigestPoint create(@JsonProperty("value")final TDigest value,
@JsonProperty("timestamp")final long timestamp) {
return new AutoValue_TdigestPoint(timestamp, value);
}
@Override
public boolean valid() {
return true;
}
@Override
public void hash(@NotNull Hasher hasher) {
hasher.putInt(this.hashCode());
}
}
| {
"content_hash": "a12bd68c03810f69bf0d6955975fae44",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 87,
"avg_line_length": 29.63157894736842,
"alnum_prop": 0.7397868561278863,
"repo_name": "spotify/heroic",
"id": "cd3bb84862701df8f970efc004363dd6b47debc6",
"size": "1970",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "heroic-component/src/main/java/com/spotify/heroic/metric/TdigestPoint.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4623"
},
{
"name": "Dockerfile",
"bytes": "646"
},
{
"name": "Java",
"bytes": "2650760"
},
{
"name": "Kotlin",
"bytes": "491219"
},
{
"name": "Python",
"bytes": "7820"
},
{
"name": "Shell",
"bytes": "1807"
}
],
"symlink_target": ""
} |
from django.conf.urls import (
include,
url,
)
from . import views
app_name = 'tags'
tag_views = [
url('^$', views.view_tag, name='view_tag'),
url('^(?P<page>\d+)/$', views.view_tag, name='view_tag'),
url('^favorite/', views.favorite_tag, name='favorite_tag'),
url('^unfavorite', views.unfavorite_tag, name='unfavorite_tag'),
url('^block/', views.block_tag, name='block_tag'),
url('^unblock/', views.unblock_tag, name='unblock_tag'),
]
tags_views = [
url('^$', views.list_tags, name='list_tags'),
url('^favorites/$', views.list_submissions_with_favorite_tags,
name='list_submissions_with_favorite_tags'),
url('^favorites/(?P<page>\d+)/$',
views.list_submissions_with_favorite_tags,
name='list_submissions_with_favorite_tags'),
url('^tag/(?P<tag_slug>[-\w]+)/', include(tag_views)),
]
categories_views = [
url('^$', views.list_tags, name='XXX-changeme')
]
urlpatterns = [
url('^tags/', include(tags_views)),
url('^categories/', include(categories_views)),
]
| {
"content_hash": "c82cdebe0fdc8bcd9e436ca340d40b96",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 31.636363636363637,
"alnum_prop": 0.6149425287356322,
"repo_name": "OpenFurry/honeycomb",
"id": "055ed7f2b3f4401dbeebd6121be2da3e6cd5f30d",
"size": "1044",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tags/urls.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10435"
},
{
"name": "HTML",
"bytes": "206456"
},
{
"name": "JavaScript",
"bytes": "1248"
},
{
"name": "Makefile",
"bytes": "5175"
},
{
"name": "Python",
"bytes": "530905"
},
{
"name": "Shell",
"bytes": "712"
}
],
"symlink_target": ""
} |
{% if page.author and site.data.authors[page.author] %}
{% assign author = site.data.authors[page.author] %}
{% else %}
{% assign author = site.author %}
{% endif %}
<div itemscope itemtype="http://schema.org/Person">
{% if author.avatar %}
<div class="author__avatar">
{% if author.avatar contains "://" %}
<img src="{{ author.avatar }}" alt="{{ author.name }}" itemprop="image">
{% else %}
<img src="{{ author.avatar | absolute_url }}" class="author__avatar" alt="{{ author.name }}" itemprop="image">
{% endif %}
</div>
{% endif %}
<div class="author__content">
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
{% if author.bio %}
<p class="author__bio" itemprop="description">
{{ author.bio }}
</p>
{% endif %}
</div>
<div class="author__urls-wrapper">
<button class="btn btn--inverse">{{ site.data.ui-text[site.locale].follow_label | remove: ":" | default: "Follow" }}</button>
<ul class="author__urls social-icons">
{% if author.location %}
<li itemprop="homeLocation" itemscope itemtype="http://schema.org/Place">
<i class="zmdi zmdi-pin zmdi-hc mdc-text-grey-600 hvr-grow" aria-hidden="true"></i> <span itemprop="name">{{ author.location }}</span>
</li>
{% endif %}
{% if author.uri %}
<li>
<a href="{{ author.uri }}" itemprop="url">
<i class="fa fa-fw fa-chain" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].website_label | default: "Website" }}
</a>
</li>
{% endif %}
{% if author.email %}
<li>
<a href="mailto:{{ author.email }}">
<meta itemprop="email" content="{{ author.email }}" />
<i class="fa fa-fw fa-envelope-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].email_label | default: "Email" }}
</a>
</li>
{% endif %}
{% if author.keybase %}
<li>
<a href="https://keybase.io/{{ author.keybase }}" itemprop="sameAs">
<i class="fa fa-fw fa-key" aria-hidden="true"></i> Keybase
</a>
</li>
{% endif %}
{% if author.twitter %}
<li>
<a href="https://twitter.com/{{ author.twitter }}" itemprop="sameAs">
<i class="zmdi zmdi-twitter-box zmdi-hc mdc-text-grey-600 hvr-grow" aria-hidden="true"></i> Twitter
</a>
</li>
{% endif %}
{% if author.facebook %}
<li>
<a href="https://www.facebook.com/{{ author.facebook }}" itemprop="sameAs">
<i class="fa fa-fw fa-facebook-square" aria-hidden="true"></i> Facebook
</a>
</li>
{% endif %}
{% if author.google_plus %}
<li>
<a href="https://plus.google.com/+{{ author.google_plus }}" itemprop="sameAs">
<i class="fa fa-fw fa-google-plus-square" aria-hidden="true"></i> Google+
</a>
</li>
{% endif %}
{% if author.linkedin %}
<li>
<a href="https://www.linkedin.com/in/{{ author.linkedin }}" itemprop="sameAs">
<i class="zmdi zmdi-linkedin-box zmdi-hc mdc-text-grey-600 hvr-grow" aria-hidden="true"></i> LinkedIn
</a>
</li>
{% endif %}
{% if author.xing %}
<li>
<a href="https://www.xing.com/profile/{{ author.xing }}" itemprop="sameAs">
<i class="fa fa-fw fa-xing-square" aria-hidden="true"></i> XING
</a>
</li>
{% endif %}
{% if author.instagram %}
<li>
<a href="https://instagram.com/{{ author.instagram }}" itemprop="sameAs">
<i class="fa fa-fw fa-instagram" aria-hidden="true"></i> Instagram
</a>
</li>
{% endif %}
{% if author.tumblr %}
<li>
<a href="https://{{ author.tumblr }}.tumblr.com" itemprop="sameAs">
<i class="fa fa-fw fa-tumblr-square" aria-hidden="true"></i> Tumblr
</a>
</li>
{% endif %}
{% if author.bitbucket %}
<li>
<a href="https://bitbucket.org/{{ author.bitbucket }}" itemprop="sameAs">
<i class="fa fa-fw fa-bitbucket" aria-hidden="true"></i> Bitbucket
</a>
</li>
{% endif %}
{% if author.github %}
<li>
<a href="https://github.com/{{ author.github }}" itemprop="sameAs">
<i class="zmdi zmdi-github zmdi-hc mdc-text-grey-600 hvr-grow" aria-hidden="true"></i> GitHub
</a>
</li>
{% endif %}
{% if author.stackoverflow %}
<li>
<a href="https://www.stackoverflow.com/users/{{ author.stackoverflow }}" itemprop="sameAs">
<i class="fa fa-fw fa-stack-overflow" aria-hidden="true"></i> Stackoverflow
</a>
</li>
{% endif %}
{% if author.lastfm %}
<li>
<a href="https://last.fm/user/{{ author.lastfm }}" itemprop="sameAs">
<i class="fa fa-fw fa-lastfm-square" aria-hidden="true"></i> Last.fm
</a>
</li>
{% endif %}
{% if author.dribbble %}
<li>
<a href="https://dribbble.com/{{ author.dribbble }}" itemprop="sameAs">
<i class="fa fa-fw fa-dribbble" aria-hidden="true"></i> Dribbble
</a>
</li>
{% endif %}
{% if author.pinterest %}
<li>
<a href="https://www.pinterest.com/{{ author.pinterest }}" itemprop="sameAs">
<i class="fa fa-fw fa-pinterest" aria-hidden="true"></i> Pinterest
</a>
</li>
{% endif %}
{% if author.foursquare %}
<li>
<a href="https://foursquare.com/{{ author.foursquare }}" itemprop="sameAs">
<i class="fa fa-fw fa-foursquare" aria-hidden="true"></i> Foursquare
</a>
</li>
{% endif %}
{% if author.steam %}
<li>
<a href="https://steamcommunity.com/id/{{ author.steam }}" itemprop="sameAs">
<i class="fa fa-fw fa-steam-square" aria-hidden="true"></i> Steam
</a>
</li>
{% endif %}
{% if author.youtube %}
{% if author.youtube contains "://" %}
<li>
<a href="{{ author.youtube }}" itemprop="sameAs">
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
</a>
</li>
{% else author.youtube %}
<li>
<a href="https://www.youtube.com/user/{{ author.youtube }}" itemprop="sameAs">
<i class="fa fa-fw fa-youtube-square" aria-hidden="true"></i> YouTube
</a>
</li>
{% endif %}
{% endif %}
{% if author.soundcloud %}
<li>
<a href="https://soundcloud.com/{{ author.soundcloud }}" itemprop="sameAs">
<i class="fa fa-fw fa-soundcloud" aria-hidden="true"></i> Soundcloud
</a>
</li>
{% endif %}
{% if author.weibo %}
<li>
<a href="https://www.weibo.com/{{ author.weibo }}" itemprop="sameAs">
<i class="fa fa-fw fa-weibo" aria-hidden="true"></i> Weibo
</a>
</li>
{% endif %}
{% if author.flickr %}
<li>
<a href="https://www.flickr.com/{{ author.flickr }}" itemprop="sameAs">
<i class="fa fa-fw fa-flickr" aria-hidden="true"></i> Flickr
</a>
</li>
{% endif %}
{% if author.codepen %}
<li>
<a href="https://codepen.io/{{ author.codepen }}" itemprop="sameAs">
<i class="fa fa-fw fa-codepen" aria-hidden="true"></i> CodePen
</a>
</li>
{% endif %}
{% if author.vine %}
<li>
<a href="https://vine.co/u/{{ author.vine }}" itemprop="sameAs">
<i class="fa fa-fw fa-vine" aria-hidden="true"></i> Vine
</a>
</li>
{% endif %}
{% include author-profile-custom-links.html %}
</ul>
</div>
</div>
| {
"content_hash": "e6d34515237bfba2f460c16e88a77200",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 144,
"avg_line_length": 33.273858921161825,
"alnum_prop": 0.49844120214490584,
"repo_name": "baarbeh/baarbeh.github.io",
"id": "25808d0bb071e38fd4c30b16b8faa28669a7ed35",
"size": "8019",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/author-profile.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "80408"
},
{
"name": "HTML",
"bytes": "89576"
},
{
"name": "JavaScript",
"bytes": "4736"
},
{
"name": "Ruby",
"bytes": "2999"
}
],
"symlink_target": ""
} |
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "The Art of Continuous Improvement"
Type = "talk"
Speakers = ["megan-tischler"]
youtube = "xPN0lc3T5pI"
+++
Behaviors evolve as habits for a person, a team, and eventually a service supported by a team. Let's talk about using Confidence Reports to drive continuous improvement of services via meaningful data points.
| {
"content_hash": "d148e68e7861d42dc63f553dd5bac46b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 208,
"avg_line_length": 35,
"alnum_prop": 0.7376623376623377,
"repo_name": "gomex/devopsdays-web",
"id": "51c6e5c4e96a1a1a1d047ee01e6ff8732e4af6a9",
"size": "385",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "content/events/2019-minneapolis/program/megan-tischler.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1568"
},
{
"name": "HTML",
"bytes": "1937025"
},
{
"name": "JavaScript",
"bytes": "14313"
},
{
"name": "PowerShell",
"bytes": "291"
},
{
"name": "Ruby",
"bytes": "650"
},
{
"name": "Shell",
"bytes": "12282"
}
],
"symlink_target": ""
} |
<?php
/**
* @namespace
*/
namespace Zend\GData\EXIF\Extension;
/**
* Represents the exif:distance element used by the Gdata Exif extensions.
*
* @uses \Zend\GData\EXIF
* @uses \Zend\GData\Extension
* @category Zend
* @package Zend_Gdata
* @subpackage Exif
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Distance extends \Zend\GData\Extension
{
protected $_rootNamespace = 'exif';
protected $_rootElement = 'distance';
/**
* Constructs a new Zend_Gdata_Exif_Extension_Distance object.
*
* @param string $text (optional) The value to use for this element.
*/
public function __construct($text = null)
{
$this->registerAllNamespaces(\Zend\GData\EXIF::$namespaces);
parent::__construct();
$this->setText($text);
}
}
| {
"content_hash": "16f47dcc48251e2eba50762f34f31415",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 87,
"avg_line_length": 24.736842105263158,
"alnum_prop": 0.6393617021276595,
"repo_name": "triggertoo/whatsup",
"id": "6db45354232efa812eef1ba044f8eb2d34693b78",
"size": "1631",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/vendor/zend/library/Zend/GData/EXIF/Extension/Distance.php",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
namespace App\Http\Controllers\API;
use App\Http\Requests\CreateLeague;
use App\League;
use App\Transformers\LeagueTransformer;
use App\Transformers\TeamTransformer;
use Illuminate\Support\Facades\Input;
/**
* @SWG\Swagger(
* schemes={"http"},
* host="",
* basePath="/",
* @SWG\Info(
* version="1.0.0",
* title="GGF",
* description="This is a sample server GGF",
* @SWG\Contact(
* email=""
* )
* )
* )
*/
class LeagueController extends Controller
{
/**
* @SWG\Get(
* tags={"League"},
* path="/api/v1/leagues",
* description="Returns all leagues from the database",
* operationId="catalogue",
* produces={"application/json"},
* @SWG\Response(
* response="200",
* description="Successfully get list of leagues"
* )
* )
*/
public function catalogue()
{
return $this->response->collection(League::all(), new LeagueTransformer(), 'leagues');
}
/**
* @SWG\Post(
* tags={"League"},
* path="/api/v1/leagues",
* description="Add new league to database",
* operationId="store",
* produces={"application/json"},
* @SWG\Parameter(
* description="League name",
* in="formData",
* name="league[name]",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* description="Path to league logo",
* in="formData",
* name="league[logoPath]",
* required=false,
* type="file"
* ),
* @SWG\Response(
* response="200",
* description="Successfully add new league"
* )
* )
* @param CreateLeague $request
* @return array
*/
public function store(CreateLeague $request)
{
$league = new League();
$league = $league->addLeague($request);
$league = League::where(['id' => $league->id])->get();
return $this->response->collection($league, new LeagueTransformer(), 'leagues');
}
/**
* @SWG\Get(
* tags={"League"},
* path="/api/v1/leagueTeams",
* description="Returns all teams from the specified league",
* operationId="teams",
* produces={"application/json"},
* @SWG\Parameter(
* description="ID of league which teams we need",
* in="query",
* name="leagueId",
* required=true,
* type="integer"
* ),
* @SWG\Response(
* response="200",
* description="Successfully get list of leagues"
* )
* )
*/
public function teams()
{
$collection = League::findOrFail(Input::get('leagueId'))->teams();
return $this->response->collection($collection->get(), new TeamTransformer(), 'leagueTeams');
}
}
| {
"content_hash": "3ef8ea235b0183ed1e505f74960f8eb2",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 101,
"avg_line_length": 27.587155963302752,
"alnum_prop": 0.5094778849351513,
"repo_name": "nixsolutions/ggf",
"id": "cdc78ffbb48548b6ca9f2bfb5cb48aadfbc877e3",
"size": "3007",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Http/Controllers/API/LeagueController.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "412"
},
{
"name": "CSS",
"bytes": "4948"
},
{
"name": "HTML",
"bytes": "27239"
},
{
"name": "JavaScript",
"bytes": "68381"
},
{
"name": "Nginx",
"bytes": "1181"
},
{
"name": "PHP",
"bytes": "286917"
},
{
"name": "Shell",
"bytes": "6021"
}
],
"symlink_target": ""
} |
import {Component, Input} from '@angular/core';
import {animate, state, style, transition, trigger} from '@angular/animations';
import {GameTile} from "../../interfaces/games-intf";
import {GameService} from "../../providers/game.service";
/* *********************************************************************************************************************
flip flap game board tile
see https://angular.io/docs/ts/latest/guide/animations.html#!#states-and-transitions
*/
@Component({
selector: 'board-tile',
templateUrl: 'board-tile.html',
animations: [trigger('flipflap',
[
state('back, void', style({ transform: 'rotateY(180deg)' })),
state('front', style({ transform: 'rotateY(0deg)' })),
transition('front <=> back', [animate('0.85s ease-in')]),
])]
})
export class BoardTileComponent {
private static TextFontStyle = { "font-family":"Noto Sans", "font-size": "1.25em"};
@Input() tile : GameTile;
public get frontState(): string { return this.gameService.isOver && !this.tile.matched ? this.tile.backState : this.tile.frontState};
public get backState(): string { return this.gameService.isOver && !this.tile.matched ? this.tile.frontState : this.tile.backState};
public get frontText(): string { return this.tile.frontText};
public get matched(): boolean { return this.tile.matched};
public get isLetter(): boolean { return this.tile.isLetter};
public get isText(): boolean { return this.tile.isText};
/* ..................................................................................................................
*
*/
constructor(private gameService: GameService ) {
}
/* ..................................................................................................................
*
*/
public frontStyle(): object {
if (this.tile.isText) {
return this.tile.frontTextStyle || BoardTileComponent.TextFontStyle;
} else {
return this.tile.frontStyle || BoardTileComponent.TextFontStyle;
}
}
/* ..................................................................................................................
*
*/
public Toggle(): void {
// console.log('Toggle ',this._tile);
this.gameService.clickTile(this.tile);
}
}
| {
"content_hash": "7af15a1ab1b070fc2d836db24c613633",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 135,
"avg_line_length": 38.96551724137931,
"alnum_prop": 0.531858407079646,
"repo_name": "cdecu/yamg",
"id": "521aebf565f23fee656ed334121444e83df760d5",
"size": "2260",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pages/board/board-tile.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4792"
},
{
"name": "HTML",
"bytes": "3958"
},
{
"name": "JavaScript",
"bytes": "1445"
},
{
"name": "TypeScript",
"bytes": "36553"
}
],
"symlink_target": ""
} |
<!--
Safe sample
input : get the field userData from the variable $_GET via an object, which store it in a array
Uses a full_special_chars_filter via filter_var function
File : use of untrusted data in a quoted event handler in a script
-->
<!--Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.-->
<!DOCTYPE html>
<html>
<head/>
<body>
<?php
class Input{
private $input;
public function getInput(){
return $this->input['realOne'];
}
public function __construct(){
$this->input = array();
$this->input['test']= 'safe' ;
$this->input['realOne']= $_GET['UserData'] ;
$this->input['trap']= 'safe' ;
}
}
$temp = new Input();
$tainted = $temp->getInput();
$sanitized = filter_var($tainted, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$tainted = $sanitized ;
echo "<div onmouseover=\"x='". $tainted ."'\>";
?>
<h1>Hello World!</h1>
</div>
</body>
</html> | {
"content_hash": "11c866c88b50ba2679237d8efebef538",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 95,
"avg_line_length": 23.527027027027028,
"alnum_prop": 0.7191269385410684,
"repo_name": "stivalet/PHP-Vulnerability-test-suite",
"id": "431327c15fc8b35a08fd48c67111d87ef6788ad6",
"size": "1741",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "XSS/CWE_79/safe/CWE_79__object-indexArray__func_FILTER-CLEANING-full_special_chars_filter__Use_untrusted_data_script-quoted_Event_Handler.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "64184004"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types = 1);
namespace Sop\JWX\Parameter;
/**
* Base class for JWT and JWK parameters.
*/
abstract class Parameter
{
/**
* Parameter name.
*
* @var string
*/
protected $_name;
/**
* Parameter value.
*
* @var mixed
*/
protected $_value;
/**
* Get the parameter name.
*/
public function name(): string
{
return $this->_name;
}
/**
* Get the parameter value.
*
* @return mixed
*/
public function value()
{
return $this->_value;
}
}
| {
"content_hash": "cf322ad1d401d62488646463698395a9",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 41,
"avg_line_length": 13.744186046511627,
"alnum_prop": 0.494077834179357,
"repo_name": "sop/jwx",
"id": "4e9eec1b7aa4edcaae0b05a01827ffc711bc52a6",
"size": "591",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/JWX/Parameter/Parameter.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "601516"
}
],
"symlink_target": ""
} |
package com.huawei.esdk.fusionmanager.local.impl.autogen.net;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="req" type="{http://request.model.cutover.soap.business.net.north.galaxmanager.com/xsd}CreateVPCForCutoverReq" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"req"
})
@XmlRootElement(name = "createVPCForCutover")
public class CreateVPCForCutover {
protected CreateVPCForCutoverReq req;
/**
* Gets the value of the req property.
*
* @return
* possible object is
* {@link CreateVPCForCutoverReq }
*
*/
public CreateVPCForCutoverReq getReq() {
return req;
}
/**
* Sets the value of the req property.
*
* @param value
* allowed object is
* {@link CreateVPCForCutoverReq }
*
*/
public void setReq(CreateVPCForCutoverReq value) {
this.req = value;
}
}
| {
"content_hash": "b0ed0b86976e328658621f1dbd3b33a7",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 154,
"avg_line_length": 24.85483870967742,
"alnum_prop": 0.6443867618429591,
"repo_name": "eSDK/esdk_cloud_fm_r3_native_java",
"id": "db4f539e1b736fbe8c6a7a9a11ddb22297a0f0f9",
"size": "1541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/FM/V1R3/esdk_fm_native_java/src/main/java/com/huawei/esdk/fusionmanager/local/impl/autogen/net/CreateVPCForCutover.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "66248"
},
{
"name": "HTML",
"bytes": "464839"
},
{
"name": "Java",
"bytes": "7087779"
},
{
"name": "JavaScript",
"bytes": "417865"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "202008edd31a15546924f94e0a4cce6d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "18ce20b9d2bd4f20135fa71c9bc8dccec1da9464",
"size": "192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Polygonaceae/Rumex/Rumex gmelinii/Rumex gmelinii latus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
angular.module('cgForm.standardForm', ['cgForm.formElement', 'cgForm.formConfig', 'cgForm.formService', 'cgForm.lodash', 'ui.router', 'cgForm.schemaFactory', 'cgForm.joelpurra'])
.directive('standardForm', function (FormConfig, _, SchemaFactory, $state, FormService, $rootScope, JoelPurra) {
return {
templateUrl: 'template/standardForm/standardForm.html',
restrict: 'E',
replace: true,
scope: {
options: '=',
randomtotal: '@',
randomsize: '@',
formdata: '='
},
link: function postLink(scope, element, attrs) {
Date.prototype.today = function () {
return this.getFullYear() + '-' + (((this.getMonth() + 1) < 10) ? '0' : '') + (this.getMonth() + 1) + '-' + ((this.getDate() < 10) ? '0' : '') + this.getDate();
};
Date.prototype.timeNow = function () {
return ((this.getHours() < 10) ? '0' : '') + this.getHours() + ':' + ((this.getMinutes() < 10) ? '0' : '') + this.getMinutes() + ':' + ((this.getSeconds() < 10) ? '0' : '') + this.getSeconds();
};
var newDate = new Date();
$rootScope.timestamp = newDate.today() + ' ' + newDate.timeNow();
/* Load Json Schema for current state if not supplied through attributes */
scope.schema = angular.copy(scope.options) || angular.copy(SchemaFactory.get($state.current.name));
/* Generates a random form */
var randoms = [];
var randomProperties = [];
scope.randomsize = angular.isDefined(scope.randomsize) ? scope.randomsize : 0;
for (var i = 0; i < scope.randomsize; i++) {
randoms.push(getRandomNumber());
}
if (scope.randomsize > 0 && scope.randomtotal > 0) {
/* Push all hidden properties */
angular.forEach(scope.schema.properties, function (property, index) {
if (property.type === 'hidden') {
randomProperties.push(property);
//scope.schema.properties.splice(index,1);
}
});
_.remove(scope.schema.properties, {type: 'hidden'});
angular.forEach(randoms, function (randomItem) {
randomProperties.push(scope.schema.properties[randomItem]);
});
scope.schema.properties = randomProperties;
}
function mathRandom() {
return Math.floor((Math.random() * (scope.randomtotal)) + 1);
}
function getRandomNumber() {
var randomNumber;
while (1) {
randomNumber = mathRandom();
if (!_.contains(randoms, randomNumber)) {
break;
}
}
return randomNumber;
}
console.log('random properties');
console.log(scope.schema.properties);
/* Initialize data in scope to save all form data*/
scope.data = scope.formdata || {};
/* Extend the current schema with default config */
scope.schema = _.extend(scope.schema, FormConfig);
/* Load lookup data if any and add initFocus attr to every elem to disable initFocus attribute */
angular.forEach(scope.schema.properties, function (elem) {
elem.initFocus = false;
elem.scrollTop = false;
if (elem.type === 'lookup') {
FormService.getLookupData(elem.lookup).then(function (resp) {
elem.type = 'radio';
elem.items = resp.data;
});
}
});
/* Evaluate information in hidden fields */
angular.forEach(scope.schema.properties, function (elem) {
if (elem.name !== 'datastore' && elem.type === 'hidden') {
elem.value = $rootScope.$eval(elem.value);
}
if (elem.type === 'hidden') {
scope.data[elem.name] = elem.value;
}
});
/* Initialize checkbox element's data with empty objects in scope.data */
var multipleSelectElements = _.filter(scope.schema.properties, {
type: 'checkbox'
});
_.each(multipleSelectElements, function (item) {
scope.data[item.name] = {};
});
/* Store datastore value in scope.data */
scope.data.datastore = _.find(scope.schema.properties, {
name: 'datastore'
}).value;
/* Bind Enter as Tab and Validation to form */
element.plusAsTab();
element.bValidator();
},
controller: function ($scope, $element, $state, $stateParams) {
$scope.onSubmit = function (data) {
/* Validate form before submit */
if (!$element.data('bValidator').validate()) {
return;
}
postData(data);
};
/* Posts data to Sever */
function postData(data) {
var done = function () {
$state.go($scope.schema.onSave, $stateParams);
};
var fail = function () {
throw new Error('Failed to post data');
};
FormService.postResource(data).then(done, fail);
}
/* Get GPS */
$scope.getGps = function () {
$scope.data.gps_latitude = '12.7435';
$scope.data.gps_longitude = '17.9872';
};
}
};
}); | {
"content_hash": "f429c4b9c11186b6de34bf3e930308f2",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 213,
"avg_line_length": 38.8719512195122,
"alnum_prop": 0.4472156862745098,
"repo_name": "cghr/cgForm",
"id": "5090015714391b570e576c1fa59fe892836bc049",
"size": "6375",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/standardForm/standardForm.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7774"
},
{
"name": "JavaScript",
"bytes": "725472"
}
],
"symlink_target": ""
} |
'use strict';
var AttributeParser = function (str) {
/**
* format: fieldName/attributeType:value
*/
this.str = str;
/**
* Retrieve field,option string from query string
*
* @returns {string}
*/
this.getNameAndOptions = function () {
var str = this.str;
var array = str.split(":");
return array[0];
};
/**
* Retrieve attributeValue
*
* @returns {string}
*/
this.getValue = function() {
var str = this.str;
var array = str.split(":");
var value = null;
if (array.length == 2) {
value = array[1];
} else if (array.length >= 3) {
value = array.slice(1, array.length).join(":");
}
return value;
};
/**
* Retrieve attributeName
*
* @returns {string}
*/
this.getName = function() {
var str = this.getNameAndOptions();
if (str.indexOf("/")) {
var arr = str.split("/");
str = arr[0];
}
return str;
};
/**
* Retrieve attributeType S|N
*
* @returns {string}
*/
this.getType = function() {
var str = this.getNameAndOptions();
if (str.match(/\/s/i)) {
return 'S';
}
if (str.match(/\/n/i)) {
return 'N';
}
return 'S'; // default
};
};
module.exports = AttributeParser;
| {
"content_hash": "0189ff2de5342c1119d4bb940d339352",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 59,
"avg_line_length": 20.585714285714285,
"alnum_prop": 0.46426092990978485,
"repo_name": "inouet/bikke",
"id": "d96900d845e67fd50d9fdbd8201b683bad76699b",
"size": "1441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/bikke/attribute_parser.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "23937"
}
],
"symlink_target": ""
} |
ConVar template_debug( "template_debug", "0" );
// This is appended to key's values that will need to be unique in template instances
const char *ENTITYIO_FIXUP_STRING = "&0000";
int MapEntity_GetNumKeysInEntity( const char *pEntData );
struct TemplateEntityData_t
{
const char *pszName;
char *pszMapData;
string_t iszMapData;
int iMapDataLength;
bool bNeedsEntityIOFixup; // If true, this template has entity I/O in its mapdata that needs fixup before spawning.
char *pszFixedMapData; // A single copy of this template that we used to fix up the Entity I/O whenever someone wants a fixed version of this template
DECLARE_SIMPLE_DATADESC();
};
BEGIN_SIMPLE_DATADESC( TemplateEntityData_t )
//DEFINE_FIELD( pszName, FIELD_STRING ), // Saved custom, see below
//DEFINE_FIELD( pszMapData, FIELD_STRING ), // Saved custom, see below
DEFINE_FIELD( iszMapData, FIELD_STRING ),
DEFINE_FIELD( iMapDataLength, FIELD_INTEGER ),
DEFINE_FIELD( bNeedsEntityIOFixup, FIELD_BOOLEAN ),
//DEFINE_FIELD( pszFixedMapData, FIELD_STRING ), // Not saved at all
END_DATADESC()
struct grouptemplate_t
{
CEntityMapData *pMapDataParser;
char pszName[MAPKEY_MAXLENGTH];
int iIndex;
bool bChangeTargetname;
};
static CUtlVector<TemplateEntityData_t *> g_Templates;
int g_iCurrentTemplateInstance;
//-----------------------------------------------------------------------------
// Purpose: Saves the given entity's keyvalue data for later use by a spawner.
// Returns the index into the templates.
//-----------------------------------------------------------------------------
int Templates_Add(CBaseEntity *pEntity, const char *pszMapData, int nLen)
{
const char *pszName = STRING(pEntity->GetEntityName());
if ((!pszName) || (!strlen(pszName)))
{
DevWarning(1, "RegisterTemplateEntity: template entity with no name, class %s\n", pEntity->GetClassname());
return -1;
}
TemplateEntityData_t *pEntData = (TemplateEntityData_t *)malloc(sizeof(TemplateEntityData_t));
pEntData->pszName = strdup( pszName );
// We may modify the values of the keys in this mapdata chunk later on to fix Entity I/O
// connections. For this reason, we need to ensure we have enough memory to do that.
int iKeys = MapEntity_GetNumKeysInEntity( pszMapData );
int iExtraSpace = (strlen(ENTITYIO_FIXUP_STRING)+1) * iKeys;
// Extra 1 because the mapdata passed in isn't null terminated
pEntData->iMapDataLength = nLen + iExtraSpace + 1;
pEntData->pszMapData = (char *)malloc( pEntData->iMapDataLength );
memcpy(pEntData->pszMapData, pszMapData, nLen + 1);
pEntData->pszMapData[nLen] = '\0';
// We don't alloc these suckers right now because that gives us no time to
// tweak them for Entity I/O purposes.
pEntData->iszMapData = NULL_STRING;
pEntData->bNeedsEntityIOFixup = false;
pEntData->pszFixedMapData = NULL;
return g_Templates.AddToTail(pEntData);
}
//-----------------------------------------------------------------------------
// Purpose: Returns true if the specified index needs to be fixed up to be unique
// when the template is spawned.
//-----------------------------------------------------------------------------
bool Templates_IndexRequiresEntityIOFixup( int iIndex )
{
Assert( iIndex < g_Templates.Count() );
return g_Templates[iIndex]->bNeedsEntityIOFixup;
}
//-----------------------------------------------------------------------------
// Purpose: Looks up a template entity by its index in the templates
// Used by point_templates because they often have multiple templates with the same name
//-----------------------------------------------------------------------------
string_t Templates_FindByIndex( int iIndex )
{
Assert( iIndex < g_Templates.Count() );
// First time through we alloc the mapdata onto the pool.
// It's safe to do it now because this isn't called until post Entity I/O cleanup.
if ( g_Templates[iIndex]->iszMapData == NULL_STRING )
{
g_Templates[iIndex]->iszMapData = AllocPooledString( g_Templates[iIndex]->pszMapData );
}
return g_Templates[iIndex]->iszMapData;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int Templates_GetStringSize( int iIndex )
{
Assert( iIndex < g_Templates.Count() );
return g_Templates[iIndex]->iMapDataLength;
}
//-----------------------------------------------------------------------------
// Purpose: Looks up a template entity by name, returning the map data blob as
// a null-terminated string containing key/value pairs.
// NOTE: This can't handle multiple templates with the same targetname.
//-----------------------------------------------------------------------------
string_t Templates_FindByTargetName(const char *pszName)
{
int nCount = g_Templates.Count();
for (int i = 0; i < nCount; i++)
{
TemplateEntityData_t *pTemplate = g_Templates.Element(i);
if ( !stricmp(pTemplate->pszName, pszName) )
return Templates_FindByIndex( i );
}
return NULL_STRING;
}
//-----------------------------------------------------------------------------
// Purpose: A CPointTemplate has asked us to reconnect all the entity I/O links
// inside it's templates. Go through the keys and add look for values
// that match a name within the group's entity names. Append %d to any
// found values, which will later be filled out by a unique identifier
// whenever the template is instanced.
//-----------------------------------------------------------------------------
void Templates_ReconnectIOForGroup( CPointTemplate *pGroup )
{
int iCount = pGroup->GetNumTemplates();
if ( !iCount )
return;
// First assemble a list of the targetnames of all the templates in the group.
// We need to store off the original names here, because we're going to change
// them as we go along.
CUtlVector< grouptemplate_t > GroupTemplates;
int i;
for ( i = 0; i < iCount; i++ )
{
grouptemplate_t newGroupTemplate;
newGroupTemplate.iIndex = pGroup->GetTemplateIndexForTemplate(i);
newGroupTemplate.pMapDataParser = new CEntityMapData( g_Templates[ newGroupTemplate.iIndex ]->pszMapData, g_Templates[ newGroupTemplate.iIndex ]->iMapDataLength );
Assert( newGroupTemplate.pMapDataParser );
newGroupTemplate.pMapDataParser->ExtractValue( "targetname", newGroupTemplate.pszName );
newGroupTemplate.bChangeTargetname = false;
GroupTemplates.AddToTail( newGroupTemplate );
}
if (pGroup->AllowNameFixup())
{
char keyName[MAPKEY_MAXLENGTH];
char value[MAPKEY_MAXLENGTH];
char valueclipped[MAPKEY_MAXLENGTH];
// Now go through all the entities in the group and parse their mapdata keyvalues.
// We're looking for any values that match targetnames of any of the group entities.
for ( i = 0; i < iCount; i++ )
{
// We need to know what instance of each key we're changing.
// Store a table of the count of the keys we've run into.
CUtlDict< int, int > KeyInstanceCount;
CEntityMapData *mapData = GroupTemplates[i].pMapDataParser;
// Loop through our keys
if ( !mapData->GetFirstKey(keyName, value) )
continue;
do
{
// Ignore targetnames
if ( !stricmp( keyName, "targetname" ) )
continue;
// Add to the count for this
int idx = KeyInstanceCount.Find( keyName );
if ( idx == KeyInstanceCount.InvalidIndex() )
{
idx = KeyInstanceCount.Insert( keyName, 0 );
}
KeyInstanceCount[idx]++;
// Entity I/O values are stored as "Targetname,<data>", so we need to see if there's a ',' in the string
char *sValue = value;
// FIXME: This is very brittle. Any key with a , will not be found.
char *s = strchr( value, ',' );
if ( s )
{
// Grab just the targetname of the receiver
Q_strncpy( valueclipped, value, (s - value+1) );
sValue = valueclipped;
}
// Loop through our group templates
for ( int iTName = 0; iTName < iCount; iTName++ )
{
char *pName = GroupTemplates[iTName].pszName;
if ( stricmp( pName, sValue ) )
continue;
if ( template_debug.GetInt() )
{
Msg("Template Connection Found: Key %s (\"%s\") in entity named \"%s\"(%d) matches entity %d's targetname\n", keyName, sValue, GroupTemplates[i].pszName, i, iTName );
}
char newvalue[MAPKEY_MAXLENGTH];
// Get the current key instance. (-1 because it's this one we're changing)
int nKeyInstance = KeyInstanceCount[idx] - 1;
// Add our IO value to the targetname
// We need to append it if this isn't an Entity I/O value, or prepend it to the ',' if it is
if ( s )
{
Q_strncpy( newvalue, valueclipped, MAPKEY_MAXLENGTH );
Q_strncat( newvalue, ENTITYIO_FIXUP_STRING, sizeof(newvalue), COPY_ALL_CHARACTERS );
Q_strncat( newvalue, s, sizeof(newvalue), COPY_ALL_CHARACTERS );
mapData->SetValue( keyName, newvalue, nKeyInstance );
}
else
{
Q_strncpy( newvalue, sValue, MAPKEY_MAXLENGTH );
Q_strncat( newvalue, ENTITYIO_FIXUP_STRING, sizeof(newvalue), COPY_ALL_CHARACTERS );
mapData->SetValue( keyName, newvalue, nKeyInstance );
}
// Remember we changed this targetname
GroupTemplates[iTName].bChangeTargetname = true;
// Set both entity's flags telling them their template needs fixup when it's spawned
g_Templates[ GroupTemplates[i].iIndex ]->bNeedsEntityIOFixup = true;
g_Templates[ GroupTemplates[iTName].iIndex ]->bNeedsEntityIOFixup = true;
}
}
while ( mapData->GetNextKey(keyName, value) );
}
// Now change targetnames for all entities that need them changed
for ( i = 0; i < iCount; i++ )
{
char value[MAPKEY_MAXLENGTH];
if ( GroupTemplates[i].bChangeTargetname )
{
CEntityMapData *mapData = GroupTemplates[i].pMapDataParser;
mapData->ExtractValue( "targetname", value );
Q_strncat( value, ENTITYIO_FIXUP_STRING, sizeof(value), COPY_ALL_CHARACTERS );
mapData->SetValue( "targetname", value );
}
}
}
// Delete our group parsers
for ( i = 0; i < iCount; i++ )
{
delete GroupTemplates[i].pMapDataParser;
}
GroupTemplates.Purge();
}
//-----------------------------------------------------------------------------
// Purpose: Someone's about to start instancing a new group of entities.
// Generate a unique identifier for this group.
//-----------------------------------------------------------------------------
void Templates_StartUniqueInstance( void )
{
g_iCurrentTemplateInstance++;
// Make sure there's enough room to fit it into the string
int iMax = (int)pow(10.0f, (int)((strlen(ENTITYIO_FIXUP_STRING) - 1))); // -1 for the &
if ( g_iCurrentTemplateInstance >= iMax )
{
// We won't hit this.
Assert(0);
// Hopefully there were still be instance number 0 around.
g_iCurrentTemplateInstance = 0;
}
}
//-----------------------------------------------------------------------------
// Purpose: Someone wants to spawn an instance of a template that requires
// entity IO fixup. Fill out the pMapData with a copy of the template
// with unique key/values where the template requires them.
//-----------------------------------------------------------------------------
char *Templates_GetEntityIOFixedMapData( int iIndex )
{
Assert( Templates_IndexRequiresEntityIOFixup( iIndex ) );
// First time through?
if ( !g_Templates[iIndex]->pszFixedMapData )
{
g_Templates[iIndex]->pszFixedMapData = new char[g_Templates[iIndex]->iMapDataLength];
Q_strncpy( g_Templates[iIndex]->pszFixedMapData, g_Templates[iIndex]->pszMapData, g_Templates[iIndex]->iMapDataLength );
}
int iFixupSize = strlen(ENTITYIO_FIXUP_STRING);
char *sOurFixup = new char[iFixupSize];
Q_snprintf( sOurFixup, iFixupSize, "%c%.4d", ENTITYIO_FIXUP_STRING[0], g_iCurrentTemplateInstance );
// Now rip through the map data string and replace any instances of the fixup string with our unique identifier
char *c = g_Templates[iIndex]->pszFixedMapData;
do
{
if ( *c == ENTITYIO_FIXUP_STRING[0] )
{
// Make sure it's our fixup string
bool bValid = true;
for ( int i = 1; i < iFixupSize; i++ )
{
// Look for any number, because we've already used this string
if ( !(*(c+i) >= '0' && *(c+i) <= '9') )
{
// Some other string
bValid = false;
break;
}
}
// Stomp it with our unique string
if ( bValid )
{
memcpy( c, sOurFixup, iFixupSize );
c += iFixupSize;
}
}
c++;
} while (*c);
return g_Templates[iIndex]->pszFixedMapData;
}
//-----------------------------------------------------------------------------
// Purpose: Frees all the template data. Called on level shutdown.
//-----------------------------------------------------------------------------
void Templates_RemoveAll(void)
{
int nCount = g_Templates.Count();
for (int i = 0; i < nCount; i++)
{
TemplateEntityData_t *pTemplate = g_Templates.Element(i);
free((void *)pTemplate->pszName);
free(pTemplate->pszMapData);
if ( pTemplate->pszFixedMapData )
{
free(pTemplate->pszFixedMapData);
}
free(pTemplate);
}
g_Templates.RemoveAll();
}
//-----------------------------------------------------------------------------
// Purpose: Hooks in the template manager's callbacks.
//-----------------------------------------------------------------------------
class CTemplatesHook : public CAutoGameSystem
{
public:
CTemplatesHook( char const *name ) : CAutoGameSystem( name )
{
}
virtual void LevelShutdownPostEntity( void )
{
Templates_RemoveAll();
}
};
CTemplatesHook g_TemplateEntityHook( "CTemplatesHook" );
//-----------------------------------------------------------------------------
// TEMPLATE SAVE / RESTORE
//-----------------------------------------------------------------------------
static short TEMPLATE_SAVE_RESTORE_VERSION = 1;
class CTemplate_SaveRestoreBlockHandler : public CDefSaveRestoreBlockHandler
{
public:
const char *GetBlockName()
{
return "Templates";
}
//---------------------------------
void Save( ISave *pSave )
{
pSave->WriteInt( &g_iCurrentTemplateInstance );
short nCount = g_Templates.Count();
pSave->WriteShort( &nCount );
for ( int i = 0; i < nCount; i++ )
{
TemplateEntityData_t *pTemplate = g_Templates[i];
pSave->WriteAll( pTemplate );
pSave->WriteString( pTemplate->pszName );
pSave->WriteString( pTemplate->pszMapData );
}
}
//---------------------------------
void WriteSaveHeaders( ISave *pSave )
{
pSave->WriteShort( &TEMPLATE_SAVE_RESTORE_VERSION );
}
//---------------------------------
void ReadRestoreHeaders( IRestore *pRestore )
{
// No reason why any future version shouldn't try to retain backward compatability. The default here is to not do so.
short version;
pRestore->ReadShort( &version );
m_fDoLoad = ( version == TEMPLATE_SAVE_RESTORE_VERSION );
}
//---------------------------------
void Restore( IRestore *pRestore, bool createPlayers )
{
if ( m_fDoLoad )
{
Templates_RemoveAll();
g_Templates.Purge();
g_iCurrentTemplateInstance = pRestore->ReadInt();
int iTemplates = pRestore->ReadShort();
while ( iTemplates-- )
{
TemplateEntityData_t *pNewTemplate = (TemplateEntityData_t *)malloc(sizeof(TemplateEntityData_t));
pRestore->ReadAll( pNewTemplate );
int sizeData = 0;//pRestore->SkipHeader();
char szName[MAPKEY_MAXLENGTH];
pRestore->ReadString( szName, MAPKEY_MAXLENGTH, sizeData );
pNewTemplate->pszName = strdup( szName );
//sizeData = pRestore->SkipHeader();
pNewTemplate->pszMapData = (char *)malloc( pNewTemplate->iMapDataLength );
pRestore->ReadString( pNewTemplate->pszMapData, pNewTemplate->iMapDataLength, sizeData );
// Set this to NULL so it'll be created the first time it gets used
pNewTemplate->pszFixedMapData = NULL;
g_Templates.AddToTail( pNewTemplate );
}
}
}
private:
bool m_fDoLoad;
};
//-----------------------------------------------------------------------------
CTemplate_SaveRestoreBlockHandler g_Template_SaveRestoreBlockHandler;
//-------------------------------------
ISaveRestoreBlockHandler *GetTemplateSaveRestoreBlockHandler()
{
return &g_Template_SaveRestoreBlockHandler;
}
| {
"content_hash": "92ccb0a9f13802f1cc882a07c574297d",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 172,
"avg_line_length": 33.59958506224066,
"alnum_prop": 0.6140784192652053,
"repo_name": "scen/ionlib",
"id": "556a93c36273f8b6c7de4a124142a8df48c156db",
"size": "17349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/sdk/hl2_ob/game/server/TemplateEntities.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9790968"
},
{
"name": "C++",
"bytes": "149439667"
},
{
"name": "D",
"bytes": "81870968"
},
{
"name": "Objective-C",
"bytes": "376824"
},
{
"name": "Perl",
"bytes": "77795"
},
{
"name": "Python",
"bytes": "2596"
},
{
"name": "Shell",
"bytes": "2289"
},
{
"name": "Squirrel",
"bytes": "4289"
}
],
"symlink_target": ""
} |
package tsg;
import java.io.*;
import java.util.*;
import settings.Parameters;
import tsg.corpora.*;
import tsg.parser.*;
import util.*;
import util.file.FileUtil;
public class CFSG <T extends Number> {
public Hashtable<String, T> lexRules, internalRules;
public CFSG() {
Parameters.newRun(this);
lexRules = new Hashtable<String, T>();
internalRules = new Hashtable<String, T>();
}
public CFSG(Hashtable<String, T> lex, Hashtable<String, T> gram) {
this.lexRules = lex;
this.internalRules = gram;
}
public void readCFGFromCorpus() {
for(TSNode TreeLine : Parameters.trainingCorpus.treeBank) {
readCFGFromTreeLine(TreeLine);
}
String log = "Read rules from corups. \n # Internal Rules: " + internalRules.size()
+ "\n # Lex Rules: " + lexRules.size();
FileUtil.appendReturn(log, Parameters.logFile);
}
public void readCFGFromTreeLine(TSNode TreeLine) {
if (Parameters.toNormalForm) TreeLine.toNormalForm();
List<TSNode> nonLexicalNodes = TreeLine.collectNonLexicalNodes();
for(TSNode nonTerminal : nonLexicalNodes) {
Hashtable<String, T> table = (nonTerminal.isPrelexical()) ? lexRules : internalRules;
String rule = nonTerminal.toCFG(false);
Utility.increaseStringInteger(table, rule, 1);
}
}
public Hashtable<String,Hashtable<String,T>> buildLexCatTable() {
Hashtable<String,Hashtable<String,T>> lexCat = new Hashtable<String,Hashtable<String,T>>();
for (Enumeration<String> e = lexRules.keys(); e.hasMoreElements() ;) {
String rule = (String)e.nextElement();
T count = lexRules.get(rule);
String[] category_lexicon = rule.split(" ");
String cat = category_lexicon[0];
String lex = category_lexicon[1];
Hashtable<String,T> lexTable = lexCat.get(lex);
if (lexTable == null) {
lexTable = new Hashtable<String,T>();
lexCat.put(lex, lexTable);
}
if (lexTable.put(cat, count)!=null) System.out.println("Error!!");
}
return lexCat;
}
/**
* Print out two files lex_ambiguous and lex_ambiguous containing
* the words in the training corpus with ambiguous POS and unambiguous POS respectively.
*/
public void processLexicon() {
File ambiguousFile = new File(Parameters.outputPath + "lex_ambiguous");
File unambiguousFile = new File(Parameters.outputPath + "lex_unambiguous");
PrintWriter amb = FileUtil.getPrintWriter(ambiguousFile);
PrintWriter unamb = FileUtil.getPrintWriter(unambiguousFile);
Hashtable<String,Hashtable<String,T>> lexCat = buildLexCatTable();
for (Enumeration<String> e = lexCat.keys(); e.hasMoreElements() ;) {
String lex = e.nextElement();
Hashtable<String,T> lexTable = lexCat.get(lex);
HashSet<String> categories = new HashSet<String>();
for (Enumeration<String> f = lexTable.keys(); f.hasMoreElements() ;) {
String cat = f.nextElement();
cat = cat.replaceAll("@\\d+", "");
categories.add(cat);
}
if (categories.size()==1) unamb.write(lex + "\n");
else amb.write(lex + "\n");
}
amb.close();
unamb.close();
}
/**
* Check if the internal and lexical frequency tables contains
* negative frequencies.
*/
public void checkNegativeFrequencies() {
for(int i=0; i<2; i++) {
Hashtable<String,T> table = (i==0) ? internalRules : lexRules;
for (Enumeration<String> e = table.keys(); e.hasMoreElements() ;) {
String rule = (String)e.nextElement();
T count = table.get(rule);
boolean negative;
if (count.getClass().isInstance(new Long(0))) negative = (Long)count<0;
else negative = (Integer)count<0;
if (negative) System.err.println("Negative frequency in : " + rule);
}
}
}
/**
* Print a unique file `FullGrammar` containing the full grammar
* The file contains all the internal rules, an empty line and
* all the lexical production rules.
*/
public void printFullGrammar() {
File fullGrammarFile = new File(Parameters.outputPath + "FullGrammar");
PrintWriter grammar = FileUtil.getPrintWriter(fullGrammarFile);
for(int i=0; i<2; i++) {
Hashtable<String,T> table = (i==0) ? internalRules : lexRules;
for (Enumeration<String> e = table.keys(); e.hasMoreElements() ;) {
String rule = (String)e.nextElement();
T count = table.get(rule);
String line = count.toString() + " " + rule;
grammar.write(line + "\n");
}
if (i==0) grammar.write("\n");
}
grammar.close();
String log = "Printed full grammar";
FileUtil.appendReturn(log, Parameters.logFile);
}
/**
* Method to implement printLexiconAndGrammarFiles
* @return
*/
private Hashtable<String, String[]> buildCompactLexicon() {
Hashtable<String, String[]> compactLexicon = new Hashtable<String, String[]>();
for (Enumeration<String> e = this.lexRules.keys(); e.hasMoreElements() ;) {
String rule = e.nextElement();
Object count = this.lexRules.get(rule);
String[] ruleSplit = rule.split(" ");
String word = ruleSplit[1];
String posTag = ruleSplit[0];
String[] posTags = compactLexicon.get(word);
if (posTags==null) {
posTags = new String[]{""};
compactLexicon.put(word, posTags);
}
if (posTags[0].length()>0) posTags[0] += "\t";
posTags[0] += posTag + " " + count;
}
return compactLexicon;
}
/**
* Print two files `lexicon` and `grammar` containing the lexical production
* rules and the internal rules respectively.
*/
public void printLexiconAndGrammarFiles() {
File lexiconFile = new File(Parameters.outputPath + "lexicon");
File grammarFile = new File(Parameters.outputPath + "grammar");
PrintWriter grammar = FileUtil.getPrintWriter(grammarFile);
TreeSet<String> orderedInternal = new TreeSet<String>(internalRules.keySet());
for (String rule : orderedInternal) {
Object count = internalRules.get(rule);
String line = count.toString() + "\t" + rule;
grammar.write(line + "\n");
}
grammar.close();
PrintWriter lexicon = FileUtil.getPrintWriter(lexiconFile);
Hashtable<String, String[]> compactLexicon = this.buildCompactLexicon();
TreeSet<String> orderedLexical = new TreeSet<String>(compactLexicon.keySet());
for (String word : orderedLexical) {
String posTags = compactLexicon.get(word)[0];
String line = word + "\t" + posTags;
lexicon.write(line + "\n");
}
lexicon.close();
String log = "Printed `lexicon` and `grammar` files";
FileUtil.appendReturn(log, Parameters.logFile);
}
/**
* Print the training corpus in the output directory
*/
public void printTrainingCorpusToFile() {
Parameters.printTrainingCorpusToFile();
}
/**
* Print the test corpus in the output directory
*/
public void printTestCorpusToFile() {
Parameters.printTestCorpusToFile();
}
private Hashtable<String, Integer> buildDaughterParentTable() {
boolean countUnary = false;
Hashtable<String, Integer> daughterParentTable = new Hashtable<String, Integer>();
for(TSNode TreeLine : Parameters.trainingCorpus.treeBank) {
List<TSNode> allNodes = TreeLine.collectAllNodes();
for(TSNode n : allNodes) {
if (n.isTerminal()) continue;
if (n.isUniqueDaughter() && !countUnary) continue;
TSNode parent = n.parent;
if (parent==null) continue;
String daugherParent = n.label + " " + parent.label;
Utility.increaseStringInteger(daughterParentTable, daugherParent, 1);
}
}
return daughterParentTable;
}
public void assignHeadAnnotations(boolean allowPunctuation, boolean onlyExternalChoices) {
Parameters.trainingCorpus.removeHeadAnnotations();
Hashtable<String, Integer> daughterParentTable = buildDaughterParentTable();
int totalAmbiguity=0, totalChoices=0;
for(TSNode TreeLine : Parameters.trainingCorpus.treeBank) {
List<TSNode> allNodes = TreeLine.collectAllNodes();
for(TSNode n : allNodes) {
if (n.isLexical || n.isPrelexical()) continue;
if (n.prole()==1) {
n.firstDaughter().headMarked = true;
continue;
}
totalChoices++;
int maxCount = -1;
TSNode bestDaughter = null;
boolean ambiguity = false;
for(TSNode d : n.daughters) {
if (!allowPunctuation && d.isPrelexical() &&
Utility.isPunctuation(d.firstDaughter().label)) continue;
if (onlyExternalChoices && !(d==n.firstDaughter() || d==n.lastDaughter())) continue;
String daugherParent = d.label + " " + n.label;
int count = daughterParentTable.get(daugherParent);
if (count>=maxCount) {
if (count==maxCount) ambiguity = true;
bestDaughter = d;
maxCount = count;
}
}
if (bestDaughter==null) {
//all punctuation
System.out.println("All punctuation daughter in " + n);
n.daughters[n.prole()-1].headMarked=true;
}
else {
bestDaughter.headMarked = true;
if (ambiguity) totalAmbiguity++;
}
}
}
float ratio = ((float) totalAmbiguity) / totalChoices;
String report = "Ambiguity on head assignment: [" +
totalAmbiguity + " | " + totalChoices + "] -> " + ratio;
System.out.println(report);
FileUtil.appendReturn(report, Parameters.logFile);
}
public static void rulesStatistics() {
//Parameters.trainingCorpus = new Corpus(new File(Wsj.WsjOriginalCollins99 + "wsj-02-21.mrg"),"noProcess");
//Parameters.corpusName = "noProcess";
Parameters.corpusName = "Wsj";
Parameters.lengthLimitTraining = 1000;
Parameters.lengthLimitTest = 1000;
Parameters.semanticTags = false;
Parameters.outputPath = Parameters.resultsPath + "TSG/CFG/RuleStatistics/";
//int[] excluded = new int[]{0};
CFSG<Integer> Grammar = new CFSG<Integer>();
int threshold = 1;
int sentenceBelowThreshold = 0;
Hashtable<String, Integer> parentCategoryBelowThreshold = new Hashtable<String, Integer>();
for(TSNode treeLine : Parameters.trainingCorpus.treeBank) {
treeLine.removeNumberInLabels();
List<TSNode> nonLexicalNodes = treeLine.collectNonLexicalNodes();
for(TSNode nT : nonLexicalNodes) {
if (!nT.isPrelexical()) {
//Utility.increaseStringInteger(Grammar.internalRules, nT.toCFGCompl(false, excluded), 1);
Utility.increaseStringInteger(Grammar.internalRules, nT.toCFG(false), 1);
}
}
}
for(TSNode treeLine : Parameters.trainingCorpus.treeBank) {
treeLine.removeNumberInLabels();
List<TSNode> nonLexicalNodes = treeLine.collectNonLexicalNodes();
boolean sentenceUncovered = false;
for(TSNode nT : nonLexicalNodes) {
if (!nT.isPrelexical()) {
String rule = nT.toCFG(false);
int count = Grammar.internalRules.get(rule);
if (count<=threshold) {
if (!sentenceUncovered) {
sentenceUncovered=true;
sentenceBelowThreshold++;
}
Utility.increaseStringInteger(parentCategoryBelowThreshold, nT.label, 1);
}
}
}
}
//Set<String> internalRulesTrainingSet = Grammar.internalRules.keySet();
Utility.hashtableOrderedToFile(Grammar.internalRules, new File(Parameters.outputPath + "CFG_freq"));
Utility.hashtableRankedToFile(Grammar.internalRules, new File(Parameters.outputPath + "CFG_rank"));
Utility.hashtableOrderedToFile(parentCategoryBelowThreshold,
new File(Parameters.outputPath + "catStat_below_" + threshold));
int trainTotalTypes = Utility.countTotalTypesInTable(Grammar.internalRules);
int trainTotalTokens = Utility.countTotalTokensInTable(Grammar.internalRules);
String report = "\nRULES STATITSTICS:\n" +
"Training Corpus initial total types|tokens:\t" +
trainTotalTypes + "\t" + trainTotalTokens + "\n" +
"Sentence below threshold (" + threshold + ")|total:\t" + sentenceBelowThreshold +
"\t" + Parameters.trainingCorpus.size() + "\n";
//"Excluded children: " + excluded[0] + "\n";
System.out.println(report);
FileUtil.appendReturn(report, Parameters.logFile);
}
public static void checkCoverage() {
Parameters.corpusName = "Wsj"; //Wsj, Negra, Parc, Tiger
Parameters.lengthLimitTraining = 1000;
Parameters.lengthLimitTest = 1000;
Parameters.semanticTags = false;
Wsj.testSet = "22"; //00 01 22 23 24
Parameters.toNormalForm = false;
Parameters.outputPath = Parameters.resultsPath + "TSG/CFG/Coverage/";
CFSG<Integer> Grammar = new CFSG<Integer>();
Grammar.readCFGFromCorpus();
Hashtable<String, Integer> internalRulesTraining = Grammar.internalRules;
Set<String> internalRulesTrainingSet = internalRulesTraining.keySet();
Hashtable<String, Integer> internalRulesTesting = new Hashtable<String, Integer>();
int unmatchedSentences = 0;
ArrayList<Integer> unmatchedSentencesLength = new ArrayList<Integer>();
for(TSNode treeLine : Parameters.testCorpus.treeBank) {
Grammar.internalRules = new Hashtable<String, Integer>();
Grammar.readCFGFromTreeLine(treeLine);
Utility.addAll(Grammar.internalRules, internalRulesTesting);
for(String rule : Grammar.internalRules.keySet()) {
if (!internalRulesTrainingSet.contains(rule)) {
unmatchedSentences++;
unmatchedSentencesLength.add(treeLine.countLexicalNodes());
break;
}
}
}
int trainTotalTypes = Utility.countTotalTypesInTable(internalRulesTraining);
int trainTotalTokens = Utility.countTotalTokensInTable(internalRulesTraining);
int testTotalTypes = Utility.countTotalTypesInTable(internalRulesTesting);
int testTotalTokens = Utility.countTotalTokensInTable(internalRulesTesting);
Utility.hashtableOrderedToFile(internalRulesTraining, new File(Parameters.outputPath + "CFG_train"));
Utility.hashtableOrderedToFile(internalRulesTesting, new File(Parameters.outputPath + "CFG_test"));
internalRulesTesting.keySet().removeAll(internalRulesTraining.keySet());
Utility.hashtableOrderedToFile(internalRulesTesting, new File(Parameters.outputPath + "CFG_test_unmatched"));
int unmatchedEvalTotalTypes = Utility.countTotalTypesInTable(internalRulesTesting);
int unmatchedEvalTotalTokens = Utility.countTotalTokensInTable(internalRulesTesting);
float unmatchedEvalPercentTypes = (float) unmatchedEvalTotalTypes / testTotalTypes;
float unmatchedEvalPercentTokens = (float) unmatchedEvalTotalTokens / testTotalTokens;
String report = "\nCOVERAGE ANALYSIS:\n" +
"Training Corpus initial total types|tokens: " +
trainTotalTypes + "|" + trainTotalTokens + "\n" +
"Test Corpus initial total types|tokens: " +
testTotalTypes + "|" + testTotalTokens + "\n" +
"Test Corpus unmatched total types|tokens: " +
unmatchedEvalTotalTypes + "|" + unmatchedEvalTotalTokens + "\n" +
"Test Corpus unmatched % types|tokens: " +
unmatchedEvalPercentTypes + "|" + unmatchedEvalPercentTokens + "\n"+
"Test Corpus unmatched sentences|total: " +
unmatchedSentences + "|" + Parameters.testCorpus.size() + "\n" +
"Unmatched Sentences Length classes :\n" +
Utility.printIntegerListClasses(unmatchedSentencesLength, 10);
System.out.println(report);
FileUtil.appendReturn(report, Parameters.logFile);
}
public static void main(String args[]) {
Parameters.setDefaultParam();
Parameters.lengthLimitTraining = 40;
Parameters.lengthLimitTest = 40;
Parameters.outputPath = Parameters.resultsPath + "TSG/CFSG/";
CFSG<Integer> Grammar = new CFSG<Integer>();
Grammar.readCFGFromCorpus();
Grammar.printLexiconAndGrammarFiles();
Grammar.printTrainingCorpusToFile();
Grammar.printTestCorpusToFile();
//new Parser(Grammar);
//checkCoverage();
//rulesStatistics();
}
}
| {
"content_hash": "07cb36507b9b41c807aea940fdf1f1ea",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 113,
"avg_line_length": 37.52068126520681,
"alnum_prop": 0.6993709876142922,
"repo_name": "kercos/TreeGrammars",
"id": "005b63f07198fc1c0e59abc0ca6b7082aa4c7aa9",
"size": "15421",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TreeGrammars/src/tsg/CFSG.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "6376678"
}
],
"symlink_target": ""
} |
/**
* Helper definition for the d3-linear-scale helper
*/
import {scaleLinear} from 'd3-scale'
import Ember from 'ember'
const {Helper} = Ember
export function linearScale () {
return function ({domain, range}) {
return scaleLinear().domain(domain).range(range)
}
}
export default Helper.helper(linearScale)
| {
"content_hash": "29ede885254544930822c8f11df3932c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 21.4,
"alnum_prop": 0.7165109034267912,
"repo_name": "ciena-frost/ember-frost-chart",
"id": "1903fb05588e9bc771404ac6dca037907a840cb4",
"size": "321",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "addon/helpers/d3-linear-scale.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3623"
},
{
"name": "HTML",
"bytes": "12555"
},
{
"name": "JavaScript",
"bytes": "76048"
},
{
"name": "Shell",
"bytes": "1751"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>T799083598263373824</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,600">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/custom.css">
<link rel="shortcut icon" href="https://micro.blog/curt/favicon.png" type="image/x-icon" />
<link rel="alternate" type="application/rss+xml" title="Curt Clifton" href="http://microblog.curtclifton.net/feed.xml" />
<link rel="alternate" type="application/json" title="Curt Clifton" href="http://microblog.curtclifton.net/feed.json" />
<link rel="EditURI" type="application/rsd+xml" href="/rsd.xml" />
<link rel="me" href="https://micro.blog/curt" />
<link rel="me" href="https://twitter.com/curtclifton" />
<link rel="authorization_endpoint" href="https://micro.blog/indieauth/auth" />
<link rel="token_endpoint" href="https://micro.blog/indieauth/token" />
<link rel="micropub" href="https://micro.blog/micropub" />
<link rel="webmention" href="https://micro.blog/webmention" />
<link rel="subscribe" href="https://micro.blog/users/follow" />
</head>
<body>
<div class="container">
<header class="masthead">
<h1 class="masthead-title--small">
<a href="/">Curt Clifton</a>
</h1>
</header>
<div class="content post h-entry">
<div class="post-date">
<time class="dt-published" datetime="2016-11-16 18:55:50 -0800">16 Nov 2016</time>
</div>
<div class="e-content">
<p>OK, Washington. Looks like we have more calls to make tomorrow. Find your state senators and representatives here: <a href="https://t.co/CCMIecb246">https://t.co/CCMIecb246</a> <a href="https://t.co/Kj5GSM97MU">https://t.co/Kj5GSM97MU</a></p>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "7f4b9fbe2e093caeae10680d6b9c9ef5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 247,
"avg_line_length": 37.56,
"alnum_prop": 0.6725239616613419,
"repo_name": "curtclifton/curtclifton.github.io",
"id": "11f8b8ce147d125ddc14f6102660a2f240f553a1",
"size": "1878",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_site/2016/11/16/t799083598263373824.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9029"
},
{
"name": "HTML",
"bytes": "3523910"
}
],
"symlink_target": ""
} |
"""
This script is (was) for tuning the genetic algorithm for mimicking sounds.
"""
import audiosegment as asg
import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas
import sys
import logging
sys.path.append(os.path.abspath("../../Artie/experiment"))
sys.path.append(os.path.abspath("../../Artie"))
import experiment.configuration as configuration # pylint: disable=locally-disabled, import-error
import internals.motorcortex.motorcortex as mc # pylint: disable=locally-disabled, import-error
import output.voice.synthesizer as synth # pylint: disable=locally-disabled, import-error
#################################################################
####### Globals ########
#################################################################
sample_rate_hz = 16000.0 # 16kHz sample rate
bytewidth = 2 # 16-bit samples
nchannels = 1 # mono
nart_groups = 5 # The number of articulator groups
#################################################################
def _plot_history(fname):
"""
Reads in the CSV at `fname` and plots it as a history of the gene pools.
"""
df = pandas.read_csv(fname)
df = df.drop(['GenerationIndex'], axis=1)
df.plot()
plt.title(fname)
plt.show()
def _load_audiofile(fname):
"""
Load the given audio file and resample it to the correct parameters.
"""
return asg.from_file(fname).resample(sample_rate_hz, bytewidth, nchannels).to_numpy_array().astype(float)
def _plot_wave_forms(waveforms):
"""
Plots the given list of wave forms.
"""
for i, wf in enumerate(waveforms):
plt.subplot(len(waveforms), 1, i + 1)
plt.plot(wf)
plt.show()
def _plot_specs(pretrainfpath, trainfpath, targetset):
"""
Plot the three audio segments as spectrograms side by side.
"""
pretrain = asg.from_file(pretrainfpath).resample(sample_rate_hz, bytewidth, nchannels)
train = asg.from_file(trainfpath).resample(sample_rate_hz, bytewidth, nchannels)
# Plot the pretraining spectrogram
fs, ts, amps = pretrain.spectrogram(0, 0.5, window_length_s=0.03, overlap=0.2, window=('tukey', 0.25))
plt.subplot(1, 3, 1)
plt.title("Pretraining")
plt.pcolormesh(ts, fs, amps)
# Plot the training spectrogram
fs, ts, amps = train.spectrogram(0, 0.5, window_length_s=0.03, overlap=0.2, window=('tukey', 0.25))
plt.subplot(1, 3, 2)
plt.title("Training")
plt.pcolormesh(ts, fs, amps)
# Plot the target spectrogram
fs, ts, amps = target.spectrogram(0, 0.5, window_length_s=0.03, overlap=0.2, window=('tukey', 0.25))
plt.subplot(1, 3, 3)
plt.title("Target")
plt.pcolormesh(ts, fs, amps)
plt.show()
def _plot_articulators(model):
"""
Plot how each articulator changed over time in the genetic algorithm.
"""
# Get the list of best agents
bests = model.best_agents_phase1
# Reshape each agent into a matrix of (articulator, time point)
bests = [np.reshape(agent, (model._narticulators, -1)) for agent in bests]
# Concatenate each matrix to (articulator, (time-points) * nagents)
articulatormatrix = np.hstack(bests)
print("Articulators over time:\n", articulatormatrix)
# Plot the matrix, with the articulator names being the labels for the y axis
ntimepoints = len(model._articulation_time_points_ms)
ncols = int(articulatormatrix.shape[1] / ntimepoints)
plt.title("Articulator Activations for Best Agents across Simulation")
for row, art in enumerate(synth.articularizers):
for col in range(ncols):
plt.subplot(model._narticulators, ncols, (row * ncols) + col + 1)
if col == 0:
plt.ylabel(art, rotation='horizontal')
plt.ylim(-1.0, 1.0)
plt.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False)
plt.tick_params(axis='y', which='both', right=False, left=False, labelleft=False)
start = col * ntimepoints
end = start + ntimepoints
plt.plot(articulatormatrix[row, start:end])
plt.tight_layout()
plt.show()
def analyze(model, target, ngroups):
"""
Analyze the results of training the model. `target` is the resampled
target AudioSegment that the mdoel has tried to learn to pronounce.
`ngroups` is the number of articulator groups.
"""
# Plot line graphs showing the progress through training
_plot_history("Phase0OutputSound.csv")
for i in range(ngroups):
_plot_history("Phase1Output_{}.csv".format(i))
# Load the output wave forms
pretraining_output = _load_audiofile("Phase0OutputSound.wav")
waveforms = [pretraining_output]
for i in range(ngroups):
training_output = _load_audiofile("Phase1Output_{}.wav".format(i))
waveforms.append(training_output)
target = target.to_numpy_array().astype(float)
waveforms.append(target)
# Show the raw outputs vs target
_plot_wave_forms(waveforms)
# Show the spectrogram representations of the three sounds
_plot_specs("Phase0OutputSound.wav", "Phase1Output_{}.wav".format(ngroups - 1), target)
# Plot how each articulator's activations changed over the course of the genetic algorithm
#_plot_articulators(model)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("target", help="The target WAV file to mimic")
parser.add_argument("-p", "--pretrain", action="store_true", help="Should we pretrain to make noise before training to mimic?")
args = parser.parse_args()
# Set up the logging configuration
logging.basicConfig(filename="tune.log", filemode='w', level=logging.INFO)
## Load the configuration file
config = configuration.load("Tuning", fpath="tuneconfig.cfg")
## Load the target wav file and resample
target = asg.from_file(args.target).resample(sample_rate_hz, bytewidth, nchannels)
# Build the model and train
model = mc.SynthModel(config)
if args.pretrain:
print("Pretraining...")
model.pretrain()
print("Training...")
model.train(target, savefpath="Phase1Output.wav")
# Analyze stuff
analyze(model, target, nart_groups)
print("Don't forget to check tune.log for the best agent after each phase (and subphase).")
| {
"content_hash": "ef19be99022697ff3eefd1d60c17808b",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 131,
"avg_line_length": 37.26744186046512,
"alnum_prop": 0.6455538221528861,
"repo_name": "MaxStrange/ArtieInfant",
"id": "ea2515d54cbe8079fe195e6a839cebcec79c660d",
"size": "6410",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Artie/experiment/analysis/synthesis/tune.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "10204"
},
{
"name": "CSS",
"bytes": "49"
},
{
"name": "Elixir",
"bytes": "103224"
},
{
"name": "HTML",
"bytes": "1688"
},
{
"name": "JavaScript",
"bytes": "4293"
},
{
"name": "Makefile",
"bytes": "25868"
},
{
"name": "PowerShell",
"bytes": "116"
},
{
"name": "Python",
"bytes": "578138"
},
{
"name": "Shell",
"bytes": "25195"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_graph" />
</LinearLayout> | {
"content_hash": "61d0a83263108467408358bf6b5f9e63",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 39.625,
"alnum_prop": 0.7018927444794952,
"repo_name": "Tortel/DeployTrack",
"id": "7f3488f6fb0c0a1c5cb13c7b82143c506d52dc1a",
"size": "634",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/activity_main.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1698"
},
{
"name": "Java",
"bytes": "140382"
}
],
"symlink_target": ""
} |
The project has the following structure:
```
data-512-a1/
|- analysis/
|- README.md
|- analysis.png
|- data_clean/
|- README.md
|- en-wikipedia_traffic_200801-201709.csv
|- data_raw/
|- README.md
|- pagecounts_desktop-site_200801-201608.json
|- pagecounts_mobile-site_201410-201608.json
|- pageviews_desktop_201507-201709.json
|- pageviews_mobile-app_201507-201709.json
|- pageviews_mobile-web_201507-201709.json
|- src/
|- README.md
|- hcds-a1-data-curation.ipynb
```
### Goal
The goal of this assignment is to construct, analyze, and publish a dataset of monthly traffic on English Wikipedia from January 1 2008 through September 30 2017.
### License and link
Data was gathered from the Wikimedia REST API, Wikimedia Foundation, 2017. CC-BY-SA 3.0
https://wikimediafoundation.org/wiki/Terms_of_Use/en
### Relevant API documentation
1. The legacy __Pagecounts API__ ([documentation](https://wikitech.wikimedia.org/wiki/Analytics/AQS/Legacy_Pagecounts), <a href="https://wikimedia.org/api/rest_v1/#!/Pagecounts_data_(legacy)/get_metrics_legacy_pagecounts_aggregate_project_access_site_granularity_start_end">endpoint</a>) provides access to desktop and mobile traffic data from January 2008 through July 2016.
Data accessible via this endpoint is available under the CC0 1.0 license.
2. The __Pageviews API__ ([documentation](https://wikitech.wikimedia.org/wiki/Analytics/AQS/Pageviews), [endpoint](https://wikimedia.org/api/rest_v1/#!/Pageviews_data/get_metrics_pageviews_aggregate_project_access_agent_granularity_start_end)) provides access to desktop, mobile web, and mobile app traffic data from July 2015 through September 2017.
Data accessible via this endpoint is available under the CC0 1.0 license.
### Cleaned data
The [cleaned data](/data_clean) file is in a `.csv` format and contains eight columns in the following format:
column name | value
--- | ---
year | YYYY
month | MM
pagecount_all_views | int
pagecount_desktop_views | int
pagecount_mobile_views | int
pageview_all_vies | int
pageview_desktop_views | int
pageview_mobile_views | int
The integers for each column other than 'year' and 'month' represent the number of views for the respective column. For dates where no data was given for a particular API pull, a value of 0 will be used.
### Issues/special considerations
The pagecounts (legacy) data includes spiders/crawlers, whereas the pageviews data does not include spiders/crawlers.
While the data requested from the API pull spans 01/01/2008 to 10/01/2017 (MM/DD/YYYY), the pagecounts data only spans 01/01/2008 to 08/01/2016. During this final month, the number of views appear significantly lower such that they could be deemed an outlier as the API pull may not have pulled views for the entire month of 08/2016 (MM/YYYY). As such, this month was included in the cleaned data, but is removed when visualizing during the analysis.
| {
"content_hash": "5fecb184f73cb491b7c3ee3f183587de",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 450,
"avg_line_length": 46.1875,
"alnum_prop": 0.75,
"repo_name": "drjordy66/data-512-a1",
"id": "bba4a29f904d5019a5dfe528d531232fb5c95f54",
"size": "3005",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "101448"
}
],
"symlink_target": ""
} |
package amerifrance.guideapi.api;
import amerifrance.guideapi.api.impl.Book;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public interface IGuideBook {
/**
* Build your guide book here. The returned book will be registered for you. The book created here can be modified
* later, so make sure to keep a reference for yourself.
*
* @return a built book to be registered.
*/
@Nullable
Book buildBook();
/**
* Use this to handle setting the model of your book. Only exists on the client.
*
* @param bookStack - The ItemStack assigned to your book.
*/
@SideOnly(Side.CLIENT)
default void handleModel(@Nonnull ItemStack bookStack) {
GuideAPI.setModel(((IGuideItem) bookStack.getItem()).getBook(bookStack));
}
/**
* An IRecipe to use for your book. Called from {@link net.minecraftforge.event.RegistryEvent.Register<IRecipe>}
*
* @return an IRecipe to register for your book or null to not include one.
*/
@Nullable
default IRecipe getRecipe(@Nonnull ItemStack bookStack) {
return null;
}
/**
* Called during Post Initialization.
*/
default void handlePost(@Nonnull ItemStack bookStack) {
// No-op
}
}
| {
"content_hash": "064d4fdf33e1faddad3acf1ed6327959",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 118,
"avg_line_length": 29.755102040816325,
"alnum_prop": 0.6872427983539094,
"repo_name": "TeamAmeriFrance/Guide-API",
"id": "21c6da380cae559bb118675feecc93257e3cbe31",
"size": "1458",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.12",
"path": "src/main/java/amerifrance/guideapi/api/IGuideBook.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "211174"
}
],
"symlink_target": ""
} |
@interface RSMenuViewController () <RSMenuViewDelegate>
@end
@implementation RSMenuViewController
{
UILabel *nameLabel;
UIImageView *avatarView;
RSMenuView *menuView;
NSUInteger count;
NSTimer *testTimer;
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"menu_pattern"]];
CGSize size = self.view.bounds.size;
CGFloat height = 44.f;
CGFloat margin = 7.f;
CGFloat avatarWidth = height - margin * 2;
RSRowBackgroundView *headerView = [[RSRowBackgroundView alloc] initWithFrame:CGRectMake(0, 0, size.width, height)];
headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self.view addSubview:headerView];
avatarView = [[UIImageView alloc] initWithFrame:CGRectMake(margin, margin, avatarWidth, avatarWidth)];
[headerView addSubview:avatarView];
UIFont *font = [UIFont systemFontOfSize:20];
nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(height, (height - font.lineHeight) / 2, size.width - height, font.lineHeight)];
nameLabel.backgroundColor = [UIColor clearColor];
nameLabel.font = font;
nameLabel.textColor = [UIColor colorWithWhite:.7 alpha:1];
nameLabel.shadowColor = [UIColor blackColor];
nameLabel.shadowOffset = CGSizeMake(0, 1);
[headerView addSubview:nameLabel];
menuView = [[RSMenuView alloc] initWithFrame:CGRectMake(0, height, size.width, size.height - height)];
menuView.delegate = self;
menuView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
menuView.highlightedTextColor = [UIColor colorWithRed:.93f green:.5f blue:.21f alpha:1];
menuView.rowEdgeInsets = UIEdgeInsetsMake(0, 1.5, 0, 16);
[self.view addSubview:menuView];
nameLabel.text = @"Author: Rex Sheng";
NSString *configFile = [[NSBundle mainBundle] pathForResource:@"Menu" ofType:@"plist"];
[menuView setItems:[NSArray arrayWithContentsOfFile:configFile]];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
count = 0;
testTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(step) userInfo:nil repeats:YES];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[testTimer invalidate];
testTimer = nil;
}
- (void)step
{
count += 2;
[[NSNotificationCenter defaultCenter] postNotificationName:@"saved[0].count" object:@(count)];
[[NSNotificationCenter defaultCenter] postNotificationName:@"saved[1].count" object:@(count / 2)];
[[NSNotificationCenter defaultCenter] postNotificationName:@"messages.scheduled.count" object:@(count / 4)];
}
- (void)viewDidUnload
{
[super viewDidUnload];
nameLabel = nil;
avatarView = nil;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (UIFont *)menuView:(RSMenuView *)menuView fontForTextAtIndent:(NSUInteger)indent
{
if (indent) {
return [UIFont systemFontOfSize:15.1f];
} else {
return [UIFont boldSystemFontOfSize:17.15f];
}
}
@end
| {
"content_hash": "f35205605f79a90ea0383b199d4352bf",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 134,
"avg_line_length": 32.255319148936174,
"alnum_prop": 0.7598944591029023,
"repo_name": "b051/RSMenuView",
"id": "9407f6078e50b2579ad4365d15b75b4250033d46",
"size": "3266",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/RSMenu Example/RSMenuViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "50325"
},
{
"name": "Ruby",
"bytes": "489"
}
],
"symlink_target": ""
} |
module TmuxStatus
module Wrappers
class AcpiBattery
def percentage
return 100 if charged?
output.scan(/(\d{1,3})%/).flatten.first.to_i
end
def charged?
output.include? 'Full'
end
def charging?
output.include? 'Charging'
end
def discharging?
output.include? 'Discharging'
end
def output
@output ||= %x[ acpi --battery 2>&1 ]
end
end
end
end
| {
"content_hash": "38b03eca3d3b2cdf043e1a1413c61034",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 52,
"avg_line_length": 17.22222222222222,
"alnum_prop": 0.5483870967741935,
"repo_name": "jumski/tmux_status",
"id": "f917ebf10eeee42fd0492f81cbc0537c87abfa21",
"size": "466",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/tmux_status/wrappers/acpi_battery.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "26639"
}
],
"symlink_target": ""
} |
import Layer from '../../Layer'
/**
* SpatialDropout3D layer class
* Note that this layer is here only for compatibility purposes,
* as it's only active during training phase.
*/
export default class SpatialDropout3D extends Layer {
/**
* Creates an SpatialDropout3D layer
* @param {number} attrs.p - fraction of the input units to drop (between 0 and 1)
* @param {number} [attrs.dimOrdering] - `tf` or `th`
*/
constructor(attrs = {}) {
super(attrs)
this.layerClass = 'SpatialDropout3D'
const { p = 0.5, dimOrdering = 'tf' } = attrs
this.p = Math.min(Math.max(0, p), 1)
this.dimOrdering = dimOrdering
}
/**
* Method for layer computational logic
* @param {Tensor} x
* @returns {Tensor} x
*/
call(x) {
return x
}
}
| {
"content_hash": "da52f0a1b4b3f3635c68bdd69fe1330e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 84,
"avg_line_length": 24.4375,
"alnum_prop": 0.6368286445012787,
"repo_name": "qinwf-nuan/keras-js",
"id": "665a25391c0a4d22703254f99701844aaa7eb89a",
"size": "782",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/layers/core/SpatialDropout3D.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "49430"
},
{
"name": "HTML",
"bytes": "10847"
},
{
"name": "JavaScript",
"bytes": "2406515"
},
{
"name": "Jupyter Notebook",
"bytes": "2340361"
},
{
"name": "Python",
"bytes": "2970"
}
],
"symlink_target": ""
} |
.. include:: ../../Includes.txt
=====================================================
Feature: #44127 - Introduced two new Hooks for OpenID
=====================================================
See :issue:`44127`
Description
===========
Two hooks were added to the OpenIdService. They make it possible to modify the request sent to the OpenID Server,
or to modify/create backend users on the fly during OpenID login.
Hooks
=====
The following hooks were introduced:
- `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['openid']['getUserRecord']`
Modifies the userRecord after it has been fetched (or none was found).
Can be used to e.g. create a new record if none was found or update an existing one.
The following parameters are passed to the hook: `record`, `response`, `authInfo`.
- `$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['openid']['authRequest']`
Modifies the Authentication Request, before it's sent.
Can be used to e.g. request additional attributes like a nickname from the OpenID Server.
The following parameters are passed to the hook: `authRequest`, `authInfo`.
| {
"content_hash": "754f1423ca986a2397220639a0b75c5e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 113,
"avg_line_length": 36.2,
"alnum_prop": 0.6602209944751382,
"repo_name": "ahmedRguei/blogTypo",
"id": "4b36b083b305389a7b08fce489ac2280ac342cc3",
"size": "1087",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "typo3/sysext/core/Documentation/Changelog/7.6/Feature-44127-HooksForOpenIdToAutomaticallyCreateUserAccounts.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3425"
},
{
"name": "CSS",
"bytes": "1591892"
},
{
"name": "HTML",
"bytes": "617019"
},
{
"name": "JavaScript",
"bytes": "3011598"
},
{
"name": "PHP",
"bytes": "25967799"
},
{
"name": "PLpgSQL",
"bytes": "3957"
},
{
"name": "Shell",
"bytes": "7244"
},
{
"name": "Smarty",
"bytes": "302"
},
{
"name": "TypeScript",
"bytes": "122147"
},
{
"name": "XSLT",
"bytes": "27654"
}
],
"symlink_target": ""
} |
/**
* Remove footer area.
*/
jQuery( document ).ready( function( $ ) {
$( '#wpfooter, #footer-upgrade' ).remove();
} );
| {
"content_hash": "b91b391acb6d731f84ebf132bf7ad16a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 44,
"avg_line_length": 20.5,
"alnum_prop": 0.5691056910569106,
"repo_name": "kittn/generator-kittn",
"id": "c18f307db11f61c17b53867254c0ca6407c3aea3",
"size": "123",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "generators/app/templates/src/skeletons/wordpress_contentbuilder/structure/plugins/adminimize/js/remove_footer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "534158"
},
{
"name": "HTML",
"bytes": "581422"
},
{
"name": "JavaScript",
"bytes": "641411"
},
{
"name": "PHP",
"bytes": "2456458"
},
{
"name": "Shell",
"bytes": "39691"
},
{
"name": "Vue",
"bytes": "163"
}
],
"symlink_target": ""
} |
# SoundMetrics.Dataflow
This assembly brings easy assembly of TPL dataflow graphs.
It's written in F#, but given some examples you should pick
it up.
## Example
This little program builds a graph with three branches.
Note that the end of each branch is terminated with a `leaf` node.
```F#
open SoundMetrics.Dataflow.Graph
let intToString i = i.ToString()
let intToFloat i = float i
let gtZero i = i > 0
let perCent i = float i / 100.0
let makeGraph () =
let graph =
buffer 100 ^|>
tee [
buffer 10 ^|> transform intToString ^|> leaf(printfn "string %s")
buffer 10 ^|> transform perCent ^|> leaf(printfn "/100 %f")
buffer 10 ^|> filter gtZero ^|> leaf(printfn ">0 %d")
]
new GraphHandle<_>(graph)
[<EntryPoint>]
let main _argv =
use gh = makeGraph()
seq { -1 .. +1 } |> Seq.iter (fun i -> gh.Post(i) |> ignore)
Thread.Sleep(1000)
let sw = Stopwatch.StartNew()
if (gh.CompleteAndWait(TimeSpan.FromSeconds(0.5))) then
printfn "Time to complete: %A" sw.Elapsed
else
eprintfn "Timed out waiting for completion."
0
```
| {
"content_hash": "c576bfb3a7da2e302ecabade21ac7a47",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 81,
"avg_line_length": 23.93877551020408,
"alnum_prop": 0.6104006820119352,
"repo_name": "SoundMetrics/aris-integration-sdk",
"id": "4862f241185a7749c3c11b860089c4a3f14426d7",
"size": "1175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/platform-dotnet/SoundMetrics.Dataflow/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "7646"
},
{
"name": "C",
"bytes": "34209"
},
{
"name": "C#",
"bytes": "203158"
},
{
"name": "C++",
"bytes": "1735433"
},
{
"name": "CMake",
"bytes": "91648"
},
{
"name": "F#",
"bytes": "544126"
},
{
"name": "HLSL",
"bytes": "2294"
},
{
"name": "Makefile",
"bytes": "801"
},
{
"name": "Objective-C",
"bytes": "1592"
},
{
"name": "Objective-C++",
"bytes": "6690"
},
{
"name": "PowerShell",
"bytes": "9448"
},
{
"name": "Python",
"bytes": "59663"
},
{
"name": "Roff",
"bytes": "3012"
},
{
"name": "Shell",
"bytes": "1071"
}
],
"symlink_target": ""
} |
#ifndef BlynkApiArduino_h
#define BlynkApiArduino_h
#include <Blynk/BlynkApi.h>
#include <Arduino.h>
#if defined(__AVR_ATmega168__)
#define BLYNK_INFO_CPU "ATmega168"
#elif defined(__AVR_ATmega328P__)
#define BLYNK_INFO_CPU "ATmega328P"
#elif defined(__AVR_ATmega1280__)
#define BLYNK_INFO_CPU "ATmega1280"
#elif defined(__AVR_ATmega1284__)
#define BLYNK_INFO_CPU "ATmega1284"
#elif defined(__AVR_ATmega2560__)
#define BLYNK_INFO_CPU "ATmega2560"
#elif defined(__AVR_ATmega32U4__)
#define BLYNK_INFO_CPU "ATmega32U4"
#elif defined(__SAM3X8E__)
#define BLYNK_INFO_CPU "AT91SAM3X8E"
#endif
#ifndef BLYNK_INFO_DEVICE
#if defined(ENERGIA)
#define BLYNK_INFO_DEVICE "Energia"
#elif defined(SPARK) || defined(PARTICLE)
#define BLYNK_INFO_DEVICE "Particle"
#else
#define BLYNK_INFO_DEVICE "Arduino"
#endif
#endif
template<class Proto>
void BlynkApi<Proto>::Init()
{
}
#ifdef BLYNK_NO_INFO
template<class Proto>
BLYNK_FORCE_INLINE
void BlynkApi<Proto>::sendInfo() {}
#else
template<class Proto>
BLYNK_FORCE_INLINE
void BlynkApi<Proto>::sendInfo()
{
static const char profile[] BLYNK_PROGMEM =
BLYNK_PARAM_KV("ver" , BLYNK_VERSION)
BLYNK_PARAM_KV("h-beat" , TOSTRING(BLYNK_HEARTBEAT))
BLYNK_PARAM_KV("buff-in", TOSTRING(BLYNK_MAX_READBYTES))
#ifdef BLYNK_INFO_DEVICE
BLYNK_PARAM_KV("dev" , BLYNK_INFO_DEVICE)
#endif
#ifdef BLYNK_INFO_CPU
BLYNK_PARAM_KV("cpu" , BLYNK_INFO_CPU)
#endif
#ifdef BLYNK_INFO_CONNECTION
BLYNK_PARAM_KV("con" , BLYNK_INFO_CONNECTION)
#endif
BLYNK_PARAM_KV("build" , __DATE__ " " __TIME__)
;
const size_t profile_len = sizeof(profile)-1;
#ifdef BLYNK_HAS_PROGMEM
char mem[profile_len];
memcpy_P(mem, profile, profile_len);
static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_HARDWARE_INFO, 0, mem, profile_len);
#else
static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_HARDWARE_INFO, 0, profile, profile_len);
#endif
return;
}
#endif
template<class Proto>
BLYNK_FORCE_INLINE
void BlynkApi<Proto>::processCmd(const void* buff, size_t len)
{
BlynkParam param((void*)buff, len);
BlynkParam::iterator it = param.begin();
if (it >= param.end())
return;
const char* cmd = it.asStr();
const uint16_t cmd16 = *(uint16_t*)cmd;
if (++it >= param.end())
return;
#if defined(analogInputToDigitalPin)
// Good! Analog pins can be referenced on this device by name.
const uint8_t pin = (it.asStr()[0] == 'A') ?
analogInputToDigitalPin(atoi(it.asStr()+1)) :
it.asInt();
#else
#warning "analogInputToDigitalPin not defined => Named analog pins will not work"
const uint8_t pin = it.asInt();
#endif
switch(cmd16) {
#ifndef BLYNK_NO_BUILTIN
case BLYNK_HW_PM: {
while (it < param.end()) {
++it;
//BLYNK_LOG("pinMode %u -> %s", pin, it.asStr());
if (!strcmp(it.asStr(), "in")) {
pinMode(pin, INPUT);
} else if (!strcmp(it.asStr(), "out") || !strcmp(it.asStr(), "pwm")) {
pinMode(pin, OUTPUT);
#ifdef INPUT_PULLUP
} else if (!strcmp(it.asStr(), "pu")) {
pinMode(pin, INPUT_PULLUP);
#endif
#ifdef INPUT_PULLDOWN
} else if (!strcmp(it.asStr(), "pd")) {
pinMode(pin, INPUT_PULLDOWN);
#endif
} else {
#ifdef BLYNK_DEBUG
BLYNK_LOG("Invalid pinMode %u -> %s", pin, it.asStr());
#endif
}
++it;
}
} break;
case BLYNK_HW_DR: {
char mem[16];
BlynkParam rsp(mem, 0, sizeof(mem));
rsp.add("dw");
rsp.add(pin);
rsp.add(digitalRead(pin));
static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_HARDWARE, 0, rsp.getBuffer(), rsp.getLength()-1);
} break;
case BLYNK_HW_DW: {
// Should be 1 parameter (value)
if (++it >= param.end())
return;
//BLYNK_LOG("digitalWrite %d -> %d", pin, it.asInt());
#ifdef ESP8266
// Disable PWM...
analogWrite(pin, 0);
#endif
#ifndef BLYNK_MINIMIZE_PINMODE_USAGE
pinMode(pin, OUTPUT);
#endif
digitalWrite(pin, it.asInt() ? HIGH : LOW);
} break;
case BLYNK_HW_AR: {
char mem[16];
BlynkParam rsp(mem, 0, sizeof(mem));
rsp.add("aw");
rsp.add(pin);
rsp.add(analogRead(pin));
static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_HARDWARE, 0, rsp.getBuffer(), rsp.getLength()-1);
} break;
case BLYNK_HW_AW: {
// Should be 1 parameter (value)
if (++it >= param.end())
return;
//BLYNK_LOG("analogWrite %d -> %d", pin, it.asInt());
#ifndef BLYNK_MINIMIZE_PINMODE_USAGE
pinMode(pin, OUTPUT);
#endif
analogWrite(pin, it.asInt());
} break;
#endif
case BLYNK_HW_VR: {
BlynkReq req = { pin };
WidgetReadHandler handler = GetReadHandler(pin);
if (handler && (handler != BlynkWidgetRead)) {
handler(req);
} else {
BlynkWidgetReadDefault(req);
}
} break;
case BLYNK_HW_VW: {
++it;
char* start = (char*)it.asStr();
BlynkParam param2(start, len - (start - (char*)buff));
BlynkReq req = { pin };
WidgetWriteHandler handler = GetWriteHandler(pin);
if (handler && (handler != BlynkWidgetWrite)) {
handler(req, param2);
} else {
BlynkWidgetWriteDefault(req, param2);
}
} break;
default:
BLYNK_LOG("Invalid HW cmd: %s", cmd);
static_cast<Proto*>(this)->sendCmd(BLYNK_CMD_RESPONSE, static_cast<Proto*>(this)->currentMsgId, NULL, BLYNK_ILLEGAL_COMMAND);
}
}
#endif
| {
"content_hash": "4594765872407dfe021b94704bee1e8b",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 133,
"avg_line_length": 28.106796116504853,
"alnum_prop": 0.5837651122625216,
"repo_name": "myDevicesIoT/Cayenne-Arduino-Library",
"id": "2c88a95b648808f94db258055b390faeee1fd5d2",
"size": "6026",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "BlynkApiArduino.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2034"
},
{
"name": "C",
"bytes": "32580"
},
{
"name": "C++",
"bytes": "138198"
},
{
"name": "Python",
"bytes": "20980"
},
{
"name": "Shell",
"bytes": "5722"
}
],
"symlink_target": ""
} |
@interface FileInZipInfo : NSObject {
@private
NSUInteger _length;
ZipCompressionLevel _level;
BOOL _crypted;
NSUInteger _size;
NSDate * _date;
NSUInteger _crc32;
NSString * _name;
}
- (id) initWithName:(NSString *)name length:(NSUInteger)length level:(ZipCompressionLevel)level crypted:(BOOL)crypted size:(NSUInteger)size date:(NSDate *)date crc32:(NSUInteger)crc32;
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSUInteger length;
@property (nonatomic, readonly) ZipCompressionLevel level;
@property (nonatomic, readonly) BOOL crypted;
@property (nonatomic, readonly) NSUInteger size;
@property (nonatomic, readonly) NSDate *date;
@property (nonatomic, readonly) NSUInteger crc32;
@end
| {
"content_hash": "11990d51ee322927da0d9d9315fb52da",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 184,
"avg_line_length": 31.91304347826087,
"alnum_prop": 0.771117166212534,
"repo_name": "ChronicStim/ssziparchive",
"id": "8605946a84261765442565a72aeb9ef9d034b7a1",
"size": "2498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Objective-Zip/FileInZipInfo.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "385710"
},
{
"name": "C++",
"bytes": "5194"
},
{
"name": "Objective-C",
"bytes": "148302"
},
{
"name": "Ruby",
"bytes": "1555"
},
{
"name": "Swift",
"bytes": "7469"
}
],
"symlink_target": ""
} |
<!--
Copyright 2015 Google Inc. All Rights Reserved.
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>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.gaefirebaseeventproxy</groupId>
<artifactId>gaefirebaseeventproxy</artifactId>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>doc-samples</artifactId>
<version>1.0.0</version>
<relativePath>../../..</relativePath>
</parent>
<properties>
<app.id>gae-firebase-event-proxy</app.id>
<app.version>1</app.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.sdk.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-server-sdk</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.5</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${appengine.sdk.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${appengine.sdk.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.sdk.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<version>${app.version}</version>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "c7202e1a11b36ea5dd5289377cda5ae2",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 112,
"avg_line_length": 36.20388349514563,
"alnum_prop": 0.610083132207026,
"repo_name": "jetty-project/java-docs-samples",
"id": "3b60bee0b7ffb0376b91bbff2ab6cdbece81eb1f",
"size": "3729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "appengine/firebase-event-proxy/gae-firebase-event-proxy/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1592"
},
{
"name": "HTML",
"bytes": "14359"
},
{
"name": "Java",
"bytes": "988385"
},
{
"name": "JavaScript",
"bytes": "5292"
},
{
"name": "Protocol Buffer",
"bytes": "3596"
},
{
"name": "Python",
"bytes": "1282"
},
{
"name": "Shell",
"bytes": "5773"
},
{
"name": "XSLT",
"bytes": "1055"
}
],
"symlink_target": ""
} |
package org.faudroids.distributedmemory.core;
import android.os.Handler;
import android.os.Looper;
import com.fasterxml.jackson.databind.JsonNode;
import org.faudroids.distributedmemory.network.BroadcastMessage;
import org.faudroids.distributedmemory.network.ConnectionHandler;
import org.faudroids.distributedmemory.utils.Assert;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import timber.log.Timber;
@Singleton
public final class HostGameManager implements HostStateTransitionListener {
public static final String TOTAL_CARD_IMAGES = "totalCardImages";
private final HostGameStateManager gameStateManager;
private final Map<Integer, Card> closedCards = new HashMap<>();
private final List<Card> selectedCards = new LinkedList<>();
private final Map<Integer, Card> matchedCards = new HashMap<>();
private final int totalCardImages;
private int usedCardImages;
private final MessageWriter messageWriter;
private final MessageReader messageReader;
private final TreeMap<Integer, ConnectionHandler<JsonNode>> connectionHandlers = new TreeMap<>();
private final TreeMap<Integer, Device> devices = new TreeMap<>();
private final List<HostGameListener> hostGameListeners = new LinkedList<>();
private int currentPlayerIdx;
private final List<Player> players = new LinkedList<>();
private final List<Integer> playerPoints = new LinkedList<>();
// used to postpone execution of tasks that should run on the same thread (UI / main thread)
private final Handler handler = new Handler(Looper.getMainLooper());
@Inject
public HostGameManager(
HostGameStateManager gameStateManager,
MessageWriter messageWriter,
MessageReader messageReader,
@Named(TOTAL_CARD_IMAGES) int totalCardImages) {
this.gameStateManager = gameStateManager;
this.gameStateManager.registerStateTransitionListener(this);
this.messageWriter = messageWriter;
this.messageReader = messageReader;
this.totalCardImages = totalCardImages;
}
public void initGame() {
gameStateManager.reset();
closedCards.clear();
selectedCards.clear();
matchedCards.clear();
connectionHandlers.clear();
devices.clear();
players.clear();
playerPoints.clear();
}
/**
* Registers a device with this manager.
* State {@link GameState#CONNECTING}.
*/
public void addDevice(ConnectionHandler<JsonNode> connectionHandler) {
assertValidState(GameState.CONNECTING);
int deviceId = connectionHandlers.size();
connectionHandlers.put(deviceId, connectionHandler);
connectionHandler.registerMessageListener(new HostMessageListener(deviceId, connectionHandler), handler);
connectionHandler.start();
connectionHandler.sendMessage(messageWriter.createAck()); // chicken and egg problem otherwise?
Timber.d("Adding connection handler with id " + deviceId);
}
/**
* Setup and distribute the cards after all devices have been connected.
* Will change state from {@link GameState#CONNECTING} {@link GameState#SETUP}.
*/
public void startGame() {
assertValidState(GameState.CONNECTING);
gameStateManager.changeState(GameState.SETUP); // manual new game state, no ack from clients required
for (HostGameListener listener : hostGameListeners) listener.onGameStarted();
// setup players
currentPlayerIdx = 0;
for(int i = 0; i < players.size(); ++i) {
playerPoints.add(0);
}
// setup cards locally
int pairsCount = 0;
for (Device device : devices.values()) pairsCount += device.getPairsCount();
Timber.d("Pairs: " + pairsCount);
// create card ids such that they can be shuffled afterwards
LinkedList<Integer> cardIds = new LinkedList<>();
for (int cardId = 0; cardId < pairsCount*2; ++cardId) {
cardIds.add(cardId);
}
Collections.shuffle(cardIds);
int cardValue = 0;
for(int i = 0; i < pairsCount; ++i) {
int cardId = cardIds.removeFirst();
closedCards.put(cardId, new Card(cardId, cardValue));
cardId = cardIds.removeFirst();
closedCards.put(cardId, new Card(cardId, cardValue));
cardValue = (cardValue + 1) % usedCardImages;
}
// TODO race condition between connections being added and clients sending device info
// send card details to devices
int currentCardCount = 0;
List<Card> allCards = new ArrayList<>(closedCards.values());
Collections.shuffle(allCards);
List<JsonNode> cardDetailMessages = new LinkedList<>();
for (Integer id : devices.keySet()) {
Device device = devices.get(id);
Map<Integer, Integer> selectedCards = new HashMap<>();
for (int i = 0; i < device.getPairsCount() * 2; ++i) {
Card card = allCards.get(currentCardCount);
++currentCardCount;
selectedCards.put(card.getId(), card.getValue());
}
cardDetailMessages.add(messageWriter.createSetupMessage(new GameSetupInfo(selectedCards, currentPlayerIdx, players)));
}
transitionState(GameState.SELECT_1ST_CARD, cardDetailMessages);
}
public void stopGame() {
for (ConnectionHandler<JsonNode> handler : connectionHandlers.values()) handler.stop();
for (HostGameListener listener : hostGameListeners) listener.onGameStopped();
}
/**
* Returns true if {@link #startGame()} has been called and the game is not yet finished,
* false otherwise.
*/
public boolean isGameRunning() {
return gameStateManager.getState() != GameState.CONNECTING && gameStateManager.getState() != GameState.FINISHED;
}
public List<Device> getConnectedDevices() {
return new LinkedList<>(devices.values());
}
public List<Player> getPlayers() {
return new LinkedList<>(players);
}
public void setUsedCardImages(int count) {
usedCardImages = count;
}
public void registerHostGameListener(HostGameListener listener) {
Assert.assertTrue(!hostGameListeners.contains(listener), "already registered");
hostGameListeners.add(listener);
}
public void unregisterHostGameListener(HostGameListener listener) {
Assert.assertTrue(hostGameListeners.contains(listener), "not registered");
hostGameListeners.remove(listener);
}
public void addPlayer(Player player) {
assertValidState(GameState.CONNECTING);
players.add(player);
}
private void selectCard(int cardId, GameState selectionState) {
assertValidState(selectionState);
Card card = closedCards.remove(cardId);
selectedCards.add(card);
}
/**
* Compare the two cards that were selected and update internal card data structures
* accordingly.
* @return true if the selected cards matched, false otherwise
*/
private boolean evaluateCardSelection() {
assertValidState(GameState.UPDATE_CARDS);
if (selectedCards.get(0).getValue() == selectedCards.get(1).getValue()) {
Timber.d("first value: " + selectedCards.get(0).getValue() + " second value: " +
selectedCards.get(1).getValue());
for (Card card : selectedCards) matchedCards.put(card.getId(), card);
selectedCards.clear();
return true;
} else {
for (Card card : selectedCards) closedCards.put(card.getId(), card);
selectedCards.clear();
return false;
}
}
private void assertValidState(GameState state) {
if (!gameStateManager.getState().equals(state)) throw new IllegalStateException("must be in state " + state + " to perform this action");
}
@Override
public void onTransitionFinished(GameState nextState) {
Timber.d("Finished host game state transition to " + nextState);
switch (nextState) {
case UPDATE_CARDS:
// once all clients have acked the last selected card evaluate selection
boolean match = evaluateCardSelection();
// update players
if (match) {
playerPoints.set(currentPlayerIdx, playerPoints.get(currentPlayerIdx) + 1);
} else {
currentPlayerIdx = (currentPlayerIdx + 1) % players.size();
}
// send response and handle end of game
JsonNode responseMsg;
GameState responseState;
if (match && closedCards.size() == 0) {
responseMsg = messageWriter.createEvaluationMessage(new Evaluation(true, false, currentPlayerIdx, playerPoints));
responseState = GameState.FINISHED;
} else if (match) {
responseMsg = messageWriter.createEvaluationMessage(new Evaluation(true, true, currentPlayerIdx, playerPoints));
responseState = GameState.SELECT_1ST_CARD;
// include next player
} else {
responseMsg = messageWriter.createEvaluationMessage(new Evaluation(false, true, currentPlayerIdx, playerPoints));
responseState = GameState.SELECT_1ST_CARD;
}
transitionState(responseState, responseMsg);
Timber.d("Remaining open pairs: " + closedCards.size()/2);
break;
case FINISHED:
stopGame();
break;
}
}
private void transitionState(GameState nextState, JsonNode message) {
gameStateManager.startStateTransition(new BroadcastMessage<>(connectionHandlers.values(), message), nextState);
}
private void transitionState(GameState nextState, List<JsonNode> messages) {
gameStateManager.startStateTransition(new BroadcastMessage<>(connectionHandlers.values(), messages), nextState);
}
private final class HostMessageListener implements ConnectionHandler.MessageListener<JsonNode> {
private final int deviceId;
private final ConnectionHandler<JsonNode> connectionHandler;
public HostMessageListener(int deviceId, ConnectionHandler<JsonNode> connectionHandler) {
this.deviceId = deviceId;
this.connectionHandler = connectionHandler;
}
@Override
public void onNewMessage(JsonNode msg) {
Timber.d("Host received message: " + msg);
// if ack than take note and do nothing
if (messageReader.isAck(msg)) {
gameStateManager.onAckReceived();
return;
}
// message other than ack while others might not have sent ack --> backoff
if (!gameStateManager.isStateTransitionComplete()) {
connectionHandler.sendMessage(messageWriter.createBackoffMessage());
return;
}
switch(gameStateManager.getState()) {
case CONNECTING:
Device device = messageReader.readDeviceInfoMessage(msg);
devices.put(deviceId, device);
for (HostGameListener listener : hostGameListeners) listener.onClientAdded(device);
break;
case SETUP:
// nothing to do, clients will only send ack
break;
case SELECT_1ST_CARD:
int firstCardId = messageReader.readCardIdMessage(msg);
Timber.d("Received first card " + firstCardId);
selectCard(firstCardId, GameState.SELECT_1ST_CARD);
transitionState(GameState.SELECT_2ND_CARD, msg);
break;
case SELECT_2ND_CARD:
int secondCardId = messageReader.readCardIdMessage(msg);
Timber.d("Received second card " + secondCardId);
selectCard(secondCardId, GameState.SELECT_2ND_CARD);
transitionState(GameState.UPDATE_CARDS, msg);
break;
case UPDATE_CARDS:
// nothing to do, client will only send ack
break;
}
}
@Override
public void onConnectionError() {
// if already finished this is expected as connections are being closed
if (gameStateManager.getState() == GameState.FINISHED) return;
for (HostGameListener listener : hostGameListeners) listener.onClientLost(devices.get(deviceId));
}
}
}
| {
"content_hash": "f3587dd145ce5e6fffbba2f46c749993",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 139,
"avg_line_length": 31.9,
"alnum_prop": 0.724486241727621,
"repo_name": "FauDroids/FlippyPairs",
"id": "33fb47b41814bed02e7177d5a853ab68da1c097d",
"size": "11484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/org/faudroids/distributedmemory/core/HostGameManager.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "130792"
},
{
"name": "Shell",
"bytes": "265"
}
],
"symlink_target": ""
} |
chef_gem 'azure' do
version node['microsoft_azure']['azure_gem_version']
action :install
compile_time true
end
chef_gem 'azure_mgmt_compute' do
version node['microsoft_azure']['arm_compute_gem_version']
action :install
compile_time true
end
require 'azure'
require 'azure_mgmt_compute'
| {
"content_hash": "0ae0ff39ab39c0d6148f9eaf1f03c13e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 21.428571428571427,
"alnum_prop": 0.7366666666666667,
"repo_name": "chef-partners/azure-cookbook",
"id": "93c3bbe56b05d77863a11f8cc44554a66fcaf099",
"size": "1141",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "recipes/default.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "18891"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AttributeBuilder {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AttributeBuilder.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to This expression is not supported. Only expressions of type New or MemberInit are supported..
/// </summary>
internal static string UnSupportedExpression {
get {
return ResourceManager.GetString("UnSupportedExpression", resourceCulture);
}
}
}
}
| {
"content_hash": "ef9e44c3c9def2d0324ebf2bd1aaf5b1",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 171,
"avg_line_length": 44.916666666666664,
"alnum_prop": 0.5967841682127396,
"repo_name": "michielvoo/Attribute-Builder",
"id": "dad2f38e590224632e0df20c713840c9d372bfe8",
"size": "3236",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/AttributeBuilder/Resources.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "44504"
}
],
"symlink_target": ""
} |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pendulum.model;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author jdev
*/
public class ModelTest
{
public ModelTest ()
{
}
@BeforeClass
public static void setUpClass ()
{
}
@AfterClass
public static void tearDownClass ()
{
}
@Before
public void setUp ()
{
}
@After
public void tearDown ()
{
}
/**
* Test of calcPeriodTime method, of class Model.
*/
@Test
public void testCalcPeriodTime ()
{
System.out.println ("calcPeriodTime");
Model instance = new Model ();
instance.setStringLength (42);
instance.setGravityAcceleration (9.81);
double expResult = 13.00079;
double result = instance.calcPeriodTime ();
assertEquals (expResult, result, 0.001);
}
/**
* Test of convertDegreeToRadian method, of class Model.
*/
@Test
public void testConvertDegreeToRadian ()
{
System.out.println ("convertDegreeToRadian");
double angle = 90;
double expResult = 90 * (Math.PI / 180);;
double result = Model.convertDegreeToRadian (angle);
assertEquals (expResult, result, 0.01);
}
/**
* Test of convertRadianToDegree method, of class Model.
*/
@Test
public void testConvertRadianToDegree ()
{
System.out.println ("convertRadianToDegree");
double angle = 90;
double expResult = angle * (180 / Math.PI);
double result = Model.convertRadianToDegree (angle);
assertEquals (expResult, result, 0.01);
}
@Test
public void testConversionToSin ()
{
System.out.println ("testConversionToSin");
double angle = Math.toRadians (0);
double expResult = Math.sin (angle);
double result = Math.sin (Model.convertDegreeToRadian (0));
assertEquals (expResult, result, 0.1);
}
@Test
public void testConversionToCos ()
{
System.out.println ("testConversionToCos");
double angle = Math.toRadians (0);
double expResult = Math.cos (angle);
double result = Math.cos (Model.convertDegreeToRadian (0));
assertEquals (expResult, result, 0.1);
}
}
| {
"content_hash": "f7fd9e43aa1318b8cae4e78cef6ff38e",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 22.30188679245283,
"alnum_prop": 0.6679357021996616,
"repo_name": "ria8246/Java2_VirtualPhysicsLab",
"id": "ccbabda11130c744189ad2ee42d211234fbdc42b",
"size": "2364",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/pendulum/model/ModelTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "908"
},
{
"name": "Java",
"bytes": "61232"
}
],
"symlink_target": ""
} |
layout: post
title: "Welcome to Jekyll!"
date: 2017-04-28 01:38:06 +0800
categories: jekyll update
---
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
| {
"content_hash": "2e4d7b1382797ac9f9de55e529f1ddb1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 295,
"avg_line_length": 49.958333333333336,
"alnum_prop": 0.7389491242702252,
"repo_name": "mattzeunert/glasswing",
"id": "e9103d4ef98e63e5b601cad71a7e1454a016cbbf",
"size": "1207",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/_posts/2017-04-28-welcome-to-jekyll.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "404"
},
{
"name": "HTML",
"bytes": "11409"
},
{
"name": "JavaScript",
"bytes": "140873"
},
{
"name": "Shell",
"bytes": "617"
}
],
"symlink_target": ""
} |
/**
* RequirementsTest.java
*/
package uk.co.bluettduncanj;
import java.io.FileNotFoundException;
import org.junit.Test;
import uk.co.bluettduncanj.controller.FileAnalyser;
/**
* @author Jonathan Bluett-Duncan
*/
public class OtherRequirementsTest {
@Test
public void testRequirementS1() throws NullPointerException, FileNotFoundException {
// Set up output for first file
FileAnalyser fileAnalyser = new FileAnalyser();
fileAnalyser.setFilePath("test/uk/co/bluettduncanj/test.txt");
fileAnalyser.setOptions(new boolean[]{ false, false, false }, null);
fileAnalyser.process();
// Please make sure datStructPrint() is not commented out before testing!
System.out.println(fileAnalyser.datStructPrint());
// Set up output for second file
fileAnalyser.setFilePath("test/uk/co/bluettduncanj/test2.txt");
fileAnalyser.process();
System.out.println(fileAnalyser.datStructPrint());
}
}
| {
"content_hash": "55e12ae568a40f0cee5dd45c6cfa12fb",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 86,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.7326315789473684,
"repo_name": "jbduncan/java-textualyser",
"id": "70e6af284efd6bdebf45cc68abaea8a14415852a",
"size": "950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java-textualyser/test/uk/co/bluettduncanj/OtherRequirementsTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "101896"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('erp_test', '0011_auto_20150424_1026'),
]
operations = [
migrations.AddField(
model_name='servertemplate',
name='cpu_qty',
field=models.PositiveSmallIntegerField(default=1),
),
migrations.AddField(
model_name='servertemplate',
name='cpu_socket',
field=models.ForeignKey(related_name='cpu_socket_opts', default=1, to='erp_test.PropertyOption'),
preserve_default=False,
),
migrations.AddField(
model_name='servertemplate',
name='ram_qty',
field=models.PositiveSmallIntegerField(default=1),
),
migrations.AddField(
model_name='servertemplate',
name='ram_standard',
field=models.ForeignKey(related_name='ram_standard_opts', default=1, to='erp_test.PropertyOption'),
preserve_default=False,
),
]
| {
"content_hash": "092f67bac51f180a2ecaba462b34c12d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 111,
"avg_line_length": 31.142857142857142,
"alnum_prop": 0.5880733944954128,
"repo_name": "baffolobill/mb_test_1",
"id": "db83272443050098aaae71f6d1b88b939b296abf",
"size": "1114",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/mbtest1/erp_test/migrations/0012_auto_20150424_1050.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "228768"
},
{
"name": "HTML",
"bytes": "54315"
},
{
"name": "JavaScript",
"bytes": "3483943"
},
{
"name": "Makefile",
"bytes": "135"
},
{
"name": "Python",
"bytes": "305003"
},
{
"name": "Shell",
"bytes": "187"
}
],
"symlink_target": ""
} |
package com.gentics.mesh.changelog.changes;
import static com.tinkerpop.blueprints.Direction.OUT;
import java.util.Iterator;
import com.gentics.mesh.changelog.AbstractChange;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
/**
* Changelog entry which updates the release edges.
*/
public class UpdateReleaseSchemaEdge extends AbstractChange {
@Override
public String getName() {
return "Update release schema edges";
}
@Override
public String getDescription() {
return "Checks whether the release schema edge needs to be active or not";
}
@Override
public void applyInTx() {
Vertex meshRoot = getMeshRootVertex();
Vertex projectRoot = meshRoot.getVertices(Direction.OUT, "HAS_PROJECT_ROOT").iterator().next();
for (Vertex project : projectRoot.getVertices(Direction.OUT, "HAS_PROJECT")) {
Iterator<Vertex> it = project.getVertices(Direction.OUT, "HAS_RELEASE_ROOT").iterator();
if (it.hasNext()) {
Vertex releaseRoot = it.next();
// Iterate over all releases
for (Vertex release : releaseRoot.getVertices(Direction.OUT, "HAS_RELEASE")) {
processRelease(release);
}
}
}
}
/**
* Add the new properties to the schema and microschema version edges
*
* @param release
*/
private void processRelease(Vertex release) {
for (Edge edge : release.getEdges(OUT, "HAS_SCHEMA_VERSION")) {
edge.setProperty("active", true);
edge.setProperty("migrationStatus", "COMPLETED");
}
for (Edge edge : release.getEdges(OUT, "HAS_MICROSCHEMA_VERSION")) {
edge.setProperty("active", true);
edge.setProperty("migrationStatus", "COMPLETED");
}
}
@Override
public String getUuid() {
return "988F3FCC0FEB42E48F3FCC0FEB72E49C";
}
@Override
public boolean requiresReindex() {
return true;
}
}
| {
"content_hash": "6da29bd385d100e5f7669392053236f0",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 97,
"avg_line_length": 26.314285714285713,
"alnum_prop": 0.7242128121606949,
"repo_name": "gentics/mesh",
"id": "dafd012a2d1b4efe9be5fab92e0c2b8485cac41e",
"size": "1842",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "changelog-system/src/main/java/com/gentics/mesh/changelog/changes/UpdateReleaseSchemaEdge.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "40221"
},
{
"name": "Dockerfile",
"bytes": "5309"
},
{
"name": "Erlang",
"bytes": "4651"
},
{
"name": "HTML",
"bytes": "3848"
},
{
"name": "Handlebars",
"bytes": "6515"
},
{
"name": "Java",
"bytes": "9074233"
},
{
"name": "JavaScript",
"bytes": "1130"
},
{
"name": "Shell",
"bytes": "3757"
}
],
"symlink_target": ""
} |
package chav1961.purelib.sql.junit;
import java.lang.reflect.Array;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import chav1961.purelib.basic.GettersAndSettersFactory.GetterAndSetter;
import chav1961.purelib.basic.GettersAndSettersFactory.ObjectGetterAndSetter;
import chav1961.purelib.basic.Utils;
import chav1961.purelib.basic.exceptions.ContentException;
import chav1961.purelib.sql.AbstractResultSetMetaData;
import chav1961.purelib.sql.RsMetaDataElement;
class JUnitTableImpl<T> extends JUnitEntityImpl {
private final String schemaName;
private final String tableName;
private final Class<T> rowType;
private final ObjectGetterAndSetter<T[]> access;
private final JUnitFieldImpl[] fields;
private final ResultSetMetaData rsmd;
JUnitTableImpl(final String schemaName, final String tableName, final Class<T> rowType, final ObjectGetterAndSetter<T[]> access, final JUnitFieldImpl... fields) {
final int nullIndex;
if (schemaName == null || schemaName.isEmpty()) {
throw new IllegalArgumentException("Schema name can't be null or empty");
}
else if (tableName == null || tableName.isEmpty()) {
throw new IllegalArgumentException("Table name for schema ["+schemaName+"] can't be null or empty");
}
else if (rowType == null) {
throw new NullPointerException("Row type descriptor for table ["+tableName+"] can't be null");
}
else if (access == null) {
throw new NullPointerException("Getter/setter for table ["+tableName+"] can't be null");
}
else if (fields == null || fields.length == 0) {
throw new IllegalArgumentException("Field list for table ["+tableName+"] can't be null or empty array");
}
else if ((nullIndex = Utils.checkArrayContent4Nulls(fields)) >= 0) {
throw new NullPointerException("Field's list for table ["+tableName+"] contains null at index ["+nullIndex+"]");
}
else {
final RsMetaDataElement[] content = new RsMetaDataElement[fields.length];
this.schemaName = schemaName;
this.tableName = tableName;
this.rowType = rowType;
this.access = access;
this.fields = fields;
for (int index = 0; index < content.length; index++) {
content[index] = fields[index].getMetaData();
}
this.rsmd = new AbstractResultSetMetaData(content,false) {
@Override
public String getTableName(int column) throws SQLException {
return JUnitTableImpl.this.getTableName();
}
@Override
public String getSchemaName(int column) throws SQLException {
return JUnitTableImpl.this.getSchemaName();
}
@Override
public String getCatalogName(int column) throws SQLException {
return null;
}
};
}
}
@Override
public JUnitEntityType getType() {
return JUnitEntityType.TABLE;
}
public String getSchemaName() {
return schemaName;
}
public String getTableName() {
return tableName;
}
public ResultSetMetaData getMetadata() {
return null;
}
public int getRowCount(final Object instance) throws ContentException {
if (instance == null) {
throw new NullPointerException("Intance can't be null");
}
else {
return Array.getLength(access.get(instance));
}
}
public <T> T getRow(final Object instance, final int rowId) throws ContentException {
if (instance == null) {
throw new NullPointerException("Intance can't be null");
}
else if (rowId < 0 || rowId >= Array.getLength(access.get(instance))) {
throw new IllegalArgumentException("Row id ["+rowId+"] out of range 0.."+(Array.getLength(access.get(instance))-1));
}
else {
return (T)Array.get(access.get(instance),rowId);
}
}
public void insert(final Object instance, final T newRow) throws ContentException {
if (instance == null) {
throw new NullPointerException("Intance can't be null");
}
else if (newRow == null) {
throw new NullPointerException("Row to insert can't be null");
}
else {
final Object[] oldContent = (Object[]) access.get(instance);
final Object[] newContent = (Object[]) Array.newInstance(rowType,oldContent.length+1);
System.arraycopy(oldContent,0,newContent,0,oldContent.length);
Array.set(newContent,oldContent.length,newRow);
access.set(instance,(T[])newContent);
}
}
public void delete(final Object instance, final int rowId) throws ContentException {
if (instance == null) {
throw new NullPointerException("Intance can't be null");
}
else if (rowId < 0 || rowId >= Array.getLength(access.get(instance))) {
throw new IllegalArgumentException("Row id ["+rowId+"] out of range 0.."+(Array.getLength(access.get(instance))-1));
}
else {
final Object[] oldContent = (Object[]) access.get(instance);
final Object[] newContent = (Object[]) Array.newInstance(rowType,oldContent.length-1);
if (rowId != 0) {
System.arraycopy(oldContent,0,newContent,0,rowId);
}
System.arraycopy(oldContent,rowId+1,newContent,rowId,oldContent.length-rowId);
access.set(instance,(T[])newContent);
}
}
public JUnitFieldImpl getFieldDesc(final int columnNumber) {
if (columnNumber < 0 || columnNumber >= fields.length) {
throw new IllegalArgumentException("Column number ["+columnNumber+"] out of range 0.."+(fields.length-1));
}
else {
return fields[columnNumber];
}
}
} | {
"content_hash": "3c91555f512f6aeea11a97f1f84b1598",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 163,
"avg_line_length": 33.782051282051285,
"alnum_prop": 0.711954459203036,
"repo_name": "chav1961/purelib",
"id": "aec3df6006ed3a551d73a632e1c5efac589656e1",
"size": "5270",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/chav1961/purelib/sql/junit/JUnitTableImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "462"
},
{
"name": "CSS",
"bytes": "1379"
},
{
"name": "HTML",
"bytes": "18100"
},
{
"name": "Java",
"bytes": "8175532"
},
{
"name": "JavaScript",
"bytes": "279"
},
{
"name": "Roff",
"bytes": "2"
}
],
"symlink_target": ""
} |
```bash
git fetch origin
git reset --hard origin/master
``` | {
"content_hash": "9c8560eaa770e0a542a8c90867b29427",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 30,
"avg_line_length": 14.75,
"alnum_prop": 0.711864406779661,
"repo_name": "Brayyy/til",
"id": "7e4477df49d7ec19902ad7fb2402c3a90b893135",
"size": "105",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Git/pull-new-and-replace.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "1616"
}
],
"symlink_target": ""
} |
/* file.h
* Ferdinand Saufler
* 06.11.2014
*/
int file_exists(const char *path);
int directory_exists(const char* path);
unsigned long get_filesize(const char *path);
void get_format_size(unsigned long size, char* buf);
| {
"content_hash": "e211f8a0c5e6de0b88d5aafb137bfc3a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 52,
"avg_line_length": 24.88888888888889,
"alnum_prop": 0.7232142857142857,
"repo_name": "derwilly/c-examples",
"id": "606bd34d1b7ae515840d3116f2c375c67bd4bd69",
"size": "224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/file.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "89538"
},
{
"name": "C++",
"bytes": "945"
},
{
"name": "Makefile",
"bytes": "8959"
}
],
"symlink_target": ""
} |
/// {
/// description: 'Implementation details shouldn’t be visible to user',
/// stdout: '[object global]|globalVar|arg1|arg2|promised'
/// }
var Vow = require("vow");
var globalVar = "globalVar";
var main = async(function(arg1, arg2) {
// check that builtin identifiers are not corrupted:
var __builder = 1, __state = 2, __continue = 4;
// add some locals
var local0, local1 = global + "|" + globalVar + "|" + arg1;
// reference `arguments`
local1 += "|" + arguments[1];
// reference `this`
local1 += "|" + await(Vow.fulfill("promised"));
console.log(local1);
[ 0 ].forEach(function(this_should_not_be_included_in_scope) {
var this_either = this_should_not_be_included_in_scope;
this.dont_remap_this = 1;
but_this_should = 1;
__this = 1;
});
});
main("arg1", "arg2");
| {
"content_hash": "a2f5d1ac0932c68298e126ca718aacd4",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 31.77777777777778,
"alnum_prop": 0.5920745920745921,
"repo_name": "omgtehlion/asjs",
"id": "4aafd8d030c2c6d1fc77d30faf5e02ee8c31fbed",
"size": "862",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/00-misc/04-identifiers.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "JavaScript",
"bytes": "139870"
}
],
"symlink_target": ""
} |
require 'formula'
class Irrlicht < Formula
homepage 'http://irrlicht.sourceforge.net/'
head 'https://irrlicht.svn.sourceforge.net/svnroot/irrlicht/trunk'
url 'https://downloads.sourceforge.net/irrlicht/irrlicht-1.8.1.zip'
sha1 '231cd2cf2eefe43bde7c40537ece055a3d6e09cb'
depends_on :xcode
def install
xcodebuild "-project", "source/Irrlicht/MacOSX/MacOSX.xcodeproj",
"-configuration", "Release",
"-target", "libIrrlicht.a",
"SYMROOT=build",
"-sdk", "macosx#{MacOS.version}"
lib.install "source/Irrlicht/MacOSX/build/Release/libIrrlicht.a"
include.install "include" => "irrlicht"
end
end
| {
"content_hash": "160be6982f8aa58af3871ae2fe3b2762",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 33.75,
"alnum_prop": 0.674074074074074,
"repo_name": "knowtheory/homebrew",
"id": "1774c0a44493bde0193f98f7fa3cb859af6ed18a",
"size": "675",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "Library/Formula/irrlicht.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.