code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
--- layout: base --- {% include header.html type="page" %} <div class="container" role="main"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> {{ content }} {% if page.comments %} <div class="disqus-comments"> {% include disqus.html %} </div> {% include fb-comment.html %} <div class="staticman-comments"> {% include staticman-comments.html %} </div> {% endif %} </div> </div> </div>
taddison/tjaddison.com
_layouts/page.html
HTML
mit
508
require 'asciidoctor/extensions' Asciidoctor::Extensions.register do treeprocessor do process do |doc| doc end end end
feelpp/www.feelpp.org
_plugins/asciidoctor-extensions.rb
Ruby
mit
138
package com.artfulbits.utils; import android.text.TextUtils; import java.io.UnsupportedEncodingException; import java.util.logging.Logger; /** Common string routine. */ public final class StringUtils { /* [ CONSTANTS ] ======================================================================================================================================= */ /** Our own class Logger instance. */ private final static Logger _log = LogEx.getLogger(StringUtils.class); /** Default strings encoding. */ public final static String UTF8 = "UTF-8"; /* [ CONSTRUCTORS ] ==================================================================================================================================== */ /** Hidden constructor. */ private StringUtils() { throw new AssertionError(); } /* [ STATIC METHODS ] ================================================================================================================================== */ /** * Convert string to utf 8 bytes. * * @param value the value to convert * @return the bytes in UTF8 encoding. */ public static byte[] toUtf8Bytes(final String value) { ValidUtils.isEmpty(value, "Expected not null value."); // try to avoid NULL values, better to return empty array byte[] buffer = new byte[]{}; if (!TextUtils.isEmpty(value)) { try { buffer = value.getBytes(StringUtils.UTF8); } catch (final UnsupportedEncodingException e) { _log.severe(LogEx.dump(e)); } } return buffer; } }
OleksandrKucherenko/spacefish
_libs/artfulbits-sdk/src/main/com/artfulbits/utils/StringUtils.java
Java
mit
1,547
// Copyright (c) 2011-2016 The Cryptonote developers // Copyright (c) 2014-2017 XDN-project developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <string.h> #include "context.h" void makecontext(uctx *ucp, void (*func)(void), intptr_t arg) { long *sp; memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext); ucp->uc_mcontext.mc_rdi = (long)arg; sp = (long*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(long); sp -= 1; sp = (void*)((uintptr_t)sp - (uintptr_t)sp%16); /* 16-align for OS X */ *--sp = 0; /* return address */ ucp->uc_mcontext.mc_rip = (long)func; ucp->uc_mcontext.mc_rsp = (long)sp; } int swapcontext(uctx *oucp, const uctx *ucp) { if(getcontext(oucp) == 0) setcontext(ucp); return 0; }
xdn-project/digitalnote
src/Platform/OSX/System/Context.c
C
mit
844
package main import ( "testing" "github.com/k0kubun/pp" _ "bitbucket.org/ikeikeikeike/antenna/conf/inits" libm "bitbucket.org/ikeikeikeike/antenna/lib/models" "bitbucket.org/ikeikeikeike/antenna/models" "bitbucket.org/ikeikeikeike/antenna/models/character" _ "bitbucket.org/ikeikeikeike/antenna/routers" ) func TestQuery1(t *testing.T) { models.Pictures().Filter("characters__character__name", "悟空").Count() for _, c := range character.CachedCharacters() { if c.Id > 0 && len([]rune(c.Name)) > 2 && !libm.ReHK3.MatchString(c.Name) { pp.Println(c.Name) } } }
ikeikeikeike/gocuration
tests/query_test.go
GO
mit
584
from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.management import call_command from django.db import models, connections, transaction from django.urls import reverse from django_tenants.clone import CloneSchema from .postgresql_backend.base import _check_schema_name from .signals import post_schema_sync, schema_needs_to_be_sync from .utils import get_creation_fakes_migrations, get_tenant_base_schema from .utils import schema_exists, get_tenant_domain_model, get_public_schema_name, get_tenant_database_alias class TenantMixin(models.Model): """ All tenant models must inherit this class. """ auto_drop_schema = False """ USE THIS WITH CAUTION! Set this flag to true on a parent class if you want the schema to be automatically deleted if the tenant row gets deleted. """ auto_create_schema = True """ Set this flag to false on a parent class if you don't want the schema to be automatically created upon save. """ schema_name = models.CharField(max_length=63, unique=True, db_index=True, validators=[_check_schema_name]) domain_url = None """ Leave this as None. Stores the current domain url so it can be used in the logs """ domain_subfolder = None """ Leave this as None. Stores the subfolder in subfolder routing was used """ _previous_tenant = [] class Meta: abstract = True def __enter__(self): """ Syntax sugar which helps in celery tasks, cron jobs, and other scripts Usage: with Tenant.objects.get(schema_name='test') as tenant: # run some code in tenant test # run some code in previous tenant (public probably) """ connection = connections[get_tenant_database_alias()] self._previous_tenant.append(connection.tenant) self.activate() return self def __exit__(self, exc_type, exc_val, exc_tb): connection = connections[get_tenant_database_alias()] connection.set_tenant(self._previous_tenant.pop()) def activate(self): """ Syntax sugar that helps at django shell with fast tenant changing Usage: Tenant.objects.get(schema_name='test').activate() """ connection = connections[get_tenant_database_alias()] connection.set_tenant(self) @classmethod def deactivate(cls): """ Syntax sugar, return to public schema Usage: test_tenant.deactivate() # or simpler Tenant.deactivate() """ connection = connections[get_tenant_database_alias()] connection.set_schema_to_public() def save(self, verbosity=1, *args, **kwargs): connection = connections[get_tenant_database_alias()] is_new = self.pk is None has_schema = hasattr(connection, 'schema_name') if has_schema and is_new and connection.schema_name != get_public_schema_name(): raise Exception("Can't create tenant outside the public schema. " "Current schema is %s." % connection.schema_name) elif has_schema and not is_new and connection.schema_name not in (self.schema_name, get_public_schema_name()): raise Exception("Can't update tenant outside it's own schema or " "the public schema. Current schema is %s." % connection.schema_name) super().save(*args, **kwargs) if has_schema and is_new and self.auto_create_schema: try: self.create_schema(check_if_exists=True, verbosity=verbosity) post_schema_sync.send(sender=TenantMixin, tenant=self.serializable_fields()) except Exception: # We failed creating the tenant, delete what we created and # re-raise the exception self.delete(force_drop=True) raise elif is_new: # although we are not using the schema functions directly, the signal might be registered by a listener schema_needs_to_be_sync.send(sender=TenantMixin, tenant=self.serializable_fields()) elif not is_new and self.auto_create_schema and not schema_exists(self.schema_name): # Create schemas for existing models, deleting only the schema on failure try: self.create_schema(check_if_exists=True, verbosity=verbosity) post_schema_sync.send(sender=TenantMixin, tenant=self.serializable_fields()) except Exception: # We failed creating the schema, delete what we created and # re-raise the exception self._drop_schema() raise def serializable_fields(self): """ in certain cases the user model isn't serializable so you may want to only send the id """ return self def _drop_schema(self, force_drop=False): """ Drops the schema""" connection = connections[get_tenant_database_alias()] has_schema = hasattr(connection, 'schema_name') if has_schema and connection.schema_name not in (self.schema_name, get_public_schema_name()): raise Exception("Can't delete tenant outside it's own schema or " "the public schema. Current schema is %s." % connection.schema_name) if has_schema and schema_exists(self.schema_name) and (self.auto_drop_schema or force_drop): self.pre_drop() cursor = connection.cursor() cursor.execute('DROP SCHEMA "%s" CASCADE' % self.schema_name) def pre_drop(self): """ This is a routine which you could override to backup the tenant schema before dropping. :return: """ def delete(self, force_drop=False, *args, **kwargs): """ Deletes this row. Drops the tenant's schema if the attribute auto_drop_schema set to True. """ self._drop_schema(force_drop) super().delete(*args, **kwargs) def create_schema(self, check_if_exists=False, sync_schema=True, verbosity=1): """ Creates the schema 'schema_name' for this tenant. Optionally checks if the schema already exists before creating it. Returns true if the schema was created, false otherwise. """ # safety check connection = connections[get_tenant_database_alias()] _check_schema_name(self.schema_name) cursor = connection.cursor() if check_if_exists and schema_exists(self.schema_name): return False fake_migrations = get_creation_fakes_migrations() if sync_schema: if fake_migrations: # copy tables and data from provided model schema base_schema = get_tenant_base_schema() clone_schema = CloneSchema() clone_schema.clone_schema(base_schema, self.schema_name) call_command('migrate_schemas', tenant=True, fake=True, schema_name=self.schema_name, interactive=False, verbosity=verbosity) else: # create the schema cursor.execute('CREATE SCHEMA "%s"' % self.schema_name) call_command('migrate_schemas', tenant=True, schema_name=self.schema_name, interactive=False, verbosity=verbosity) connection.set_schema_to_public() def get_primary_domain(self): """ Returns the primary domain of the tenant """ try: domain = self.domains.get(is_primary=True) return domain except get_tenant_domain_model().DoesNotExist: return None def reverse(self, request, view_name): """ Returns the URL of this tenant. """ http_type = 'https://' if request.is_secure() else 'http://' domain = get_current_site(request).domain url = ''.join((http_type, self.schema_name, '.', domain, reverse(view_name))) return url def get_tenant_type(self): """ Get the type of tenant. Will only work for multi type tenants :return: str """ return getattr(self, settings.MULTI_TYPE_DATABASE_FIELD) class DomainMixin(models.Model): """ All models that store the domains must inherit this class """ domain = models.CharField(max_length=253, unique=True, db_index=True) tenant = models.ForeignKey(settings.TENANT_MODEL, db_index=True, related_name='domains', on_delete=models.CASCADE) # Set this to true if this is the primary domain is_primary = models.BooleanField(default=True, db_index=True) @transaction.atomic def save(self, *args, **kwargs): # Get all other primary domains with the same tenant domain_list = self.__class__.objects.filter(tenant=self.tenant, is_primary=True).exclude(pk=self.pk) # If we have no primary domain yet, set as primary domain by default self.is_primary = self.is_primary or (not domain_list.exists()) if self.is_primary: # Remove primary status of existing domains for tenant domain_list.update(is_primary=False) super().save(*args, **kwargs) class Meta: abstract = True
tomturner/django-tenants
django_tenants/models.py
Python
mit
9,732
/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef HIP_INCLUDE_HIP_HIP_PROFILE_H #define HIP_INCLUDE_HIP_HIP_PROFILE_H #define HIP_SCOPED_MARKER(markerName, group) #define HIP_BEGIN_MARKER(markerName, group) #define HIP_END_MARKER() #endif
ROCm-Developer-Tools/HIP
include/hip/hip_profile.h
C
mit
1,304
package server import ( "io" "io/ioutil" "log" "net/http" ) type Rest struct { channels map[string]*Channel } func NewRestServer(server *Server) *Rest { return &Rest{server.channels} } func (self *Rest) PostOnly(h http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if r.Method == "POST" { h(w, r) return } http.Error(w, "post only", http.StatusMethodNotAllowed) } } func (self *Rest) restHandler(w http.ResponseWriter, r *http.Request) { body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1048576)) if err != nil { panic(err) } if err := r.Body.Close(); err != nil { panic(err) } channel := r.URL.Query().Get("channel") //get the session id from header session := r.Header.Get("session"); log.Printf("SessionID: %s", session) msg := &Message{Channel: channel, Body: string(body), session: session} if ch, ok := self.channels[channel]; ok { ch.sendAll <- msg } log.Printf("[REST] body: %s, channel: %s", body, channel) } func (self *Rest) ListenRest() { log.Println("Listening server(REST)...") http.HandleFunc("/rest", self.PostOnly(self.restHandler)) }
nkostadinov/websocket
server/rest.go
GO
mit
1,150
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for DSA-2885-1 # # Security announcement date: 2014-03-26 00:00:00 UTC # Script generation date: 2017-01-01 21:06:52 UTC # # Operating System: Debian 7 (Wheezy) # Architecture: x86_64 # # Vulnerable packages fix on version: # - libyaml-libyaml-perl:0.38-3+deb7u2 # # Last versions recommanded by security team: # - libyaml-libyaml-perl:0.38-3+deb7u3 # # CVE List: # - CVE-2014-2525 # # More details: # - https://www.cyberwatch.fr/vulnerabilites # # Licence: Released under The MIT License (MIT), See LICENSE FILE sudo apt-get install --only-upgrade libyaml-libyaml-perl=0.38-3+deb7u3 -y
Cyberwatch/cbw-security-fixes
Debian_7_(Wheezy)/x86_64/2014/DSA-2885-1.sh
Shell
mit
650
//===================================================================== // Copyright 2016 (c), Advanced Micro Devices, Inc. All rights reserved. // /// \author AMD Developer Tools Team /// \file osSynchronizationObjectLocker.h /// //===================================================================== //------------------------------ osSynchronizationObjectLocker.h ------------------------------ #ifndef __OSSYNCHRONIZATIONOBJECTLOCKER #define __OSSYNCHRONIZATIONOBJECTLOCKER #pragma once // Local: #include <AMDTOSWrappers/Include/osSynchronizationObject.h> // ---------------------------------------------------------------------------------- // Class Name: OS_API osSynchronizationObjectLocker // General Description: // Aid class that enables "exception safe" locking of a synchronization object. // Its constructor locks the synchronization object and destructor unlocks the // synchronization object. // This causes synchronization object unlocking in case of an exception. // Example: // void foo(osSynchronizationObject& mySyncObj) // { // osSynchronizationObjectLocker syncObjLucker(mySyncObj); // // < doing something > // // } // // In the above example, the synchronization object will be unlocked in the following scenarios: // a. The thread exits the function: Exiting the function executes the syncObjLucker // destructor, which unlocks the synchronization object. // b. An exception is thrown while < doing something > is executed. // If there is no exception handler in the function, the exception will be "thrown out" // of the function, calling all the destructors of the function stack variables. // Among these destructors is the syncObjLucker destructor, which will unlocks the // synchronization object. // // The user can also call unlockSyncObj() manually to unlock the synchronization object // before the osSynchronizationObjectLocker destructor is called. // // Author: AMD Developer Tools Team // Creation Date: 29/3/2004 // ---------------------------------------------------------------------------------- class OS_API osSynchronizationObjectLocker { public: osSynchronizationObjectLocker(osSynchronizationObject& syncObj); ~osSynchronizationObjectLocker(); bool unlockSyncObj(); private: // Disallow use of default constructor, copy constructor and assignment operator: osSynchronizationObjectLocker() = delete; osSynchronizationObjectLocker(const osSynchronizationObjectLocker&) = delete; osSynchronizationObjectLocker& operator=(const osSynchronizationObjectLocker&) = delete; private: // The synchronization object on which this class operates: osSynchronizationObject& _syncObj; // Contains true iff the synchronization object was already unlocked by this class: bool _wasSyncObjUnlocked; }; #endif // __OSSYNCHRONIZATIONOBJECTLOCKER
ilangal-amd/CodeXL
Common/Src/AMDTOSWrappers/Include/osSynchronizationObjectLocker.h
C
mit
2,944
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>支付网关管理系统后台beta</title> <!-- Bootstrap Core CSS --> <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- MetisMenu CSS --> <link href="../vendor/metisMenu/metisMenu.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="../dist/css/sb-admin-2.css" rel="stylesheet"> <!-- Morris Charts CSS --> <link href="../vendor/morrisjs/morris.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">SB Admin v2.0</a> </div> <!-- /.navbar-header --> <ul class="nav navbar-top-links navbar-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-messages"> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>Read All Messages</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-messages --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-tasks"> <li> <a href="#"> <div> <p> <strong>Task 1</strong> <span class="pull-right text-muted">40% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete (success)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 2</strong> <span class="pull-right text-muted">20% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% Complete</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 3</strong> <span class="pull-right text-muted">60% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% Complete (warning)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 4</strong> <span class="pull-right text-muted">80% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete (danger)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>See All Tasks</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-tasks --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-alerts"> <li> <a href="#"> <div> <i class="fa fa-comment fa-fw"></i> New Comment <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-twitter fa-fw"></i> 3 New Followers <span class="pull-right text-muted small">12 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-envelope fa-fw"></i> Message Sent <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-tasks fa-fw"></i> New Task <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-upload fa-fw"></i> Server Rebooted <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>See All Alerts</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-alerts --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a> </li> <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a> </li> <li class="divider"></li> <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a> </li> </ul> <!-- /.dropdown-user --> </li> <!-- /.dropdown --> </ul> <!-- /.navbar-top-links --> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse"> <ul class="nav" id="side-menu"> <li class="sidebar-search"> <div class="input-group custom-search-form"> <input type="text" class="form-control" placeholder="Search..."> <span class="input-group-btn"> <button class="btn btn-default" type="button"> <i class="fa fa-search"></i> </button> </span> </div> <!-- /input-group --> </li> <li> <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> </li> <li> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="flot.html">Flot Charts</a> </li> <li> <a href="morris.html">Morris.js Charts</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a> </li> <li> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> </li> <li> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="panels-wells.html">Panels and Wells</a> </li> <li> <a href="buttons.html">Buttons</a> </li> <li> <a href="notifications.html">Notifications</a> </li> <li> <a href="typography.html">Typography</a> </li> <li> <a href="icons.html"> Icons</a> </li> <li> <a href="grid.html">Grid</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-sitemap fa-fw"></i> Multi-Level Dropdown<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="#">Second Level Item</a> </li> <li> <a href="#">Second Level Item</a> </li> <li> <a href="#">Third Level <span class="fa arrow"></span></a> <ul class="nav nav-third-level"> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> </ul> <!-- /.nav-third-level --> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-files-o fa-fw"></i> Sample Pages<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="blank.html">Blank Page</a> </li> <li> <a href="login.html">Login Page</a> </li> </ul> <!-- /.nav-second-level --> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Flot</h1> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Line Chart Example </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="flot-chart"> <div class="flot-chart-content" id="flot-line-chart"></div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-12 --> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Pie Chart Example </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="flot-chart"> <div class="flot-chart-content" id="flot-pie-chart"></div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Multiple Axes Line Chart Example </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="flot-chart"> <div class="flot-chart-content" id="flot-line-chart-multi"></div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Moving Line Chart Example </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="flot-chart"> <div class="flot-chart-content" id="flot-line-chart-moving"></div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-6"> <div class="panel panel-default"> <div class="panel-heading"> Bar Chart Example </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="flot-chart"> <div class="flot-chart-content" id="flot-bar-chart"></div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Flot Charts Usage </div> <!-- /.panel-heading --> <div class="panel-body"> <p>Flot is a pure JavaScript plotting library for jQuery, with a focus on simple usage, attractive looks, and interactive features. In SB Admin, we are using the most recent version of Flot along with a few plugins to enhance the user experience. The Flot plugins being used are the tooltip plugin for hoverable tooltips, and the resize plugin for fully responsive charts. The documentation for Flot Charts is available on their website, <a target="_blank" href="http://www.flotcharts.org/">http://www.flotcharts.org/</a>.</p> <a target="_blank" class="btn btn-default btn-lg btn-block" href="http://www.flotcharts.org/">View Flot Charts Documentation</a> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> </div> <!-- /.row --> </div> <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="../vendor/jquery/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="../vendor/bootstrap/js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="../vendor/metisMenu/metisMenu.min.js"></script> <!-- Flot Charts JavaScript --> <script src="../vendor/flot/excanvas.min.js"></script> <script src="../vendor/flot/jquery.flot.js"></script> <script src="../vendor/flot/jquery.flot.pie.js"></script> <script src="../vendor/flot/jquery.flot.resize.js"></script> <script src="../vendor/flot/jquery.flot.time.js"></script> <script src="../vendor/flot-tooltip/jquery.flot.tooltip.min.js"></script> <script src="../data/flot-data.js"></script> <!-- Custom Theme JavaScript --> <script src="../dist/js/sb-admin-2.js"></script> </body> </html>
nimotsang/dashboard
pages/archive/flot.html
HTML
mit
24,577
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class HistorialC extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('date'); $this->load->model('HistorialM'); if (!$this->session->userdata("login")) { redirect(base_url()); } } public function index(){ $data['regs'] = $this->HistorialM->lista(); $this->load->view('historialV', $data); } }
euphoz/correosusers
application/controllers/HistorialC.php
PHP
mit
506
using System; using System.Collections.Generic; using System.Linq; using RiotSharp.MatchEndpoint.Enums; namespace RiotSharp.Misc { static class Util { public static DateTime BaseDateTime = new DateTime(1970, 1, 1); public static DateTime ToDateTimeFromMilliSeconds(this long millis) { return BaseDateTime.AddMilliseconds(millis); } public static long ToLong(this DateTime dateTime) { var span = dateTime - BaseDateTime; return (long)span.TotalMilliseconds; } public static string BuildIdsString(List<int> ids) { return string.Join(",", ids); } public static string BuildIdsString(List<long> ids) { return string.Join(",", ids); } public static string BuildNamesString(List<string> names) { return string.Join(",", names.Select(Uri.EscapeDataString)); } public static string BuildQueuesString(List<string> queues) { return string.Join(",", queues); } public static string BuildSeasonString(List<Season> seasons) { return string.Join(",", seasons.Select(s => s.ToCustomString())); } } }
frederickrogan/RiotSharp
RiotSharp/Misc/Util.cs
C#
mit
1,281
'use strict'; describe('Controller: MainCtrl', function () { // load the controller's module beforeEach(module('pillzApp')); var MainCtrl, scope, $httpBackend; // Initialize the controller and a mock scope beforeEach(inject(function (_$httpBackend_, $controller, $rootScope) { $httpBackend = _$httpBackend_; $httpBackend.expectGET('/api/awesomeThings') .respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']); scope = $rootScope.$new(); MainCtrl = $controller('MainCtrl', { $scope: scope }); })); it('should attach a list of awesomeThings to the scope', function () { expect(scope.awesomeThings).toBeUndefined(); $httpBackend.flush(); expect(scope.awesomeThings.length).toBe(4); }); });
captDaylight/pillz
test/client/spec/controllers/main.js
JavaScript
mit
769
Confl ===== Load or reload configuration! [![Build Status](http://img.shields.io/travis/teambition/confl.svg?style=flat-square)](https://travis-ci.org/teambition/confl) [![Coverage Status](http://img.shields.io/coveralls/teambition/confl.svg?style=flat-square)](https://coveralls.io/r/teambition/confl) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/teambition/confl/master/LICENSE) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/teambition/confl) ## Features * Simple API for use * Used as a library * Care about updates of configuration * Support Auto-Reload ## Getting Started ### Install #### Install confl ```shell go get -u -v github.com/teambition/confl ``` ### Usage #### Watch a configuration file ```go package main import ( "fmt" "github.com/teambition/confl" "github.com/teambition/confl/examples/config" "gopkg.in/yaml.v2" ) func main() { watcher, err := confl.NewFileWatcher(&config.Config{}, "./default.yaml", yaml.Unmarshal) if err != nil { panic(err) } defer watcher.Close() watcher.OnError(func(err error) { fmt.Println("your error handler start") fmt.Println(err) }) // add hook for update events // perhaps you need reload something that depends the configuration watcher.AddHook(func(oc, nc interface{}) { ocfg := oc.(config.Config) ncfg := nc.(config.Config) // use cfg fmt.Printf("old config: %#v\n", ocfg) fmt.Printf("new config: %#v\n", ncfg) }) // get configuration from watcher cfg := watcher.Config().(config.Config) // use cfg fmt.Printf("load config: %#v\n", cfg) // start watch // it is a blocking method choose run with `go` by situation watcher.Watch() } ``` More [example](./examples)
teambition/confl
README.md
Markdown
mit
1,807
<?php use Symfony\Component\Routing\Exception\MethodNotAllowedException; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\RequestContext; /** * appDevUrlMatcher * * This class has been auto-generated * by the Symfony Routing Component. */ class appDevUrlMatcher extends Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher { /** * Constructor. */ public function __construct(RequestContext $context) { $this->context = $context; } public function match($pathinfo) { $allow = array(); $pathinfo = rawurldecode($pathinfo); if (0 === strpos($pathinfo, '/_')) { // _wdt if (0 === strpos($pathinfo, '/_wdt') && preg_match('#^/_wdt/(?P<token>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_wdt')), array ( '_controller' => 'web_profiler.controller.profiler:toolbarAction',)); } if (0 === strpos($pathinfo, '/_profiler')) { // _profiler_home if (rtrim($pathinfo, '/') === '/_profiler') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', '_profiler_home'); } return array ( '_controller' => 'web_profiler.controller.profiler:homeAction', '_route' => '_profiler_home',); } if (0 === strpos($pathinfo, '/_profiler/search')) { // _profiler_search if ($pathinfo === '/_profiler/search') { return array ( '_controller' => 'web_profiler.controller.profiler:searchAction', '_route' => '_profiler_search',); } // _profiler_search_bar if ($pathinfo === '/_profiler/search_bar') { return array ( '_controller' => 'web_profiler.controller.profiler:searchBarAction', '_route' => '_profiler_search_bar',); } } // _profiler_purge if ($pathinfo === '/_profiler/purge') { return array ( '_controller' => 'web_profiler.controller.profiler:purgeAction', '_route' => '_profiler_purge',); } if (0 === strpos($pathinfo, '/_profiler/i')) { // _profiler_info if (0 === strpos($pathinfo, '/_profiler/info') && preg_match('#^/_profiler/info/(?P<about>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_info')), array ( '_controller' => 'web_profiler.controller.profiler:infoAction',)); } // _profiler_import if ($pathinfo === '/_profiler/import') { return array ( '_controller' => 'web_profiler.controller.profiler:importAction', '_route' => '_profiler_import',); } } // _profiler_export if (0 === strpos($pathinfo, '/_profiler/export') && preg_match('#^/_profiler/export/(?P<token>[^/\\.]++)\\.txt$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_export')), array ( '_controller' => 'web_profiler.controller.profiler:exportAction',)); } // _profiler_phpinfo if ($pathinfo === '/_profiler/phpinfo') { return array ( '_controller' => 'web_profiler.controller.profiler:phpinfoAction', '_route' => '_profiler_phpinfo',); } // _profiler_search_results if (preg_match('#^/_profiler/(?P<token>[^/]++)/search/results$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_search_results')), array ( '_controller' => 'web_profiler.controller.profiler:searchResultsAction',)); } // _profiler if (preg_match('#^/_profiler/(?P<token>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler')), array ( '_controller' => 'web_profiler.controller.profiler:panelAction',)); } // _profiler_router if (preg_match('#^/_profiler/(?P<token>[^/]++)/router$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_router')), array ( '_controller' => 'web_profiler.controller.router:panelAction',)); } // _profiler_exception if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception')), array ( '_controller' => 'web_profiler.controller.exception:showAction',)); } // _profiler_exception_css if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception\\.css$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception_css')), array ( '_controller' => 'web_profiler.controller.exception:cssAction',)); } } if (0 === strpos($pathinfo, '/_configurator')) { // _configurator_home if (rtrim($pathinfo, '/') === '/_configurator') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', '_configurator_home'); } return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::checkAction', '_route' => '_configurator_home',); } // _configurator_step if (0 === strpos($pathinfo, '/_configurator/step') && preg_match('#^/_configurator/step/(?P<index>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_configurator_step')), array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::stepAction',)); } // _configurator_final if ($pathinfo === '/_configurator/final') { return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::finalAction', '_route' => '_configurator_final',); } } } if (0 === strpos($pathinfo, '/collection')) { // lien_collection if (rtrim($pathinfo, '/') === '/collection') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_collection'); } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::indexAction', '_route' => 'lien_collection',); } // lien_collection_show if (preg_match('#^/collection/(?P<id>[^/]++)/(?P<slug>[^/]++)(?:/(?P<page>[^/]++))?$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_collection_show')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::showAction', 'page' => 1,)); } // lien_collection_new if ($pathinfo === '/collection/new') { return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::newAction', '_route' => 'lien_collection_new',); } // lien_collection_create if ($pathinfo === '/collection/create') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_collection_create; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::createAction', '_route' => 'lien_collection_create',); } not_lien_collection_create: // lien_collection_edit if (0 === strpos($pathinfo, '/collection/edit') && preg_match('#^/collection/edit/(?P<id>[^/]++)/?$#s', $pathinfo, $matches)) { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_collection_edit'); } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_collection_edit')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::editAction',)); } // lien_collection_update if (preg_match('#^/collection/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) { $allow = array_merge($allow, array('POST', 'PUT')); goto not_lien_collection_update; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_collection_update')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::updateAction',)); } not_lien_collection_update: // lien_collection_delete if (preg_match('#^/collection/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) { $allow = array_merge($allow, array('POST', 'DELETE')); goto not_lien_collection_delete; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_collection_delete')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\CollectionController::deleteAction',)); } not_lien_collection_delete: } if (0 === strpos($pathinfo, '/avis')) { // lien_avis if (rtrim($pathinfo, '/') === '/avis') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_avis'); } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::indexAction', '_route' => 'lien_avis',); } // lien_avis_show if (preg_match('#^/avis/(?P<id>[^/]++)/show$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_avis_show')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::showAction',)); } // lien_avis_new if ($pathinfo === '/avis/new') { return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::newAction', '_route' => 'lien_avis_new',); } // lien_avis_create if ($pathinfo === '/avis/create') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_avis_create; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::createAction', '_route' => 'lien_avis_create',); } not_lien_avis_create: // lien_avis_edit if (preg_match('#^/avis/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_avis_edit')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::editAction',)); } // lien_avis_update if (preg_match('#^/avis/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) { $allow = array_merge($allow, array('POST', 'PUT')); goto not_lien_avis_update; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_avis_update')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::updateAction',)); } not_lien_avis_update: // lien_avis_delete if (preg_match('#^/avis/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) { $allow = array_merge($allow, array('POST', 'DELETE')); goto not_lien_avis_delete; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_avis_delete')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\AvisUserLivreController::deleteAction',)); } not_lien_avis_delete: } if (0 === strpos($pathinfo, '/livre')) { // lien_livre if (rtrim($pathinfo, '/') === '/livre') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_livre'); } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::indexAction', '_route' => 'lien_livre',); } // lien_livre_read if (0 === strpos($pathinfo, '/livre/read') && preg_match('#^/livre/read/(?P<collection>[^/]++)/(?P<auteur>[^/]++)/(?P<id>\\d+)/(?P<titre>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_read')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::readAction',)); } // lien_livre_show if (preg_match('#^/livre/(?P<collection>[^/]++)/(?P<auteur>[^/]++)/(?P<id>\\d+)/(?P<titre>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_show')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::showAction',)); } // lien_livre_all if (0 === strpos($pathinfo, '/livre/liste') && preg_match('#^/livre/liste(?:/(?P<page>[^/]++))?$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_all')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::allAction', 'page' => 1,)); } // lien_livre_show_all if (0 === strpos($pathinfo, '/livre/catalogue') && preg_match('#^/livre/catalogue(?:/(?P<page>[^/]++))?$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_show_all')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::showAllAction', 'page' => 1,)); } // lien_livre_find if ($pathinfo === '/livre/recherche') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_livre_find; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::findAction', '_route' => 'lien_livre_find',); } not_lien_livre_find: // lien_livre_new if ($pathinfo === '/livre/new') { return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::newAction', '_route' => 'lien_livre_new',); } // lien_livre_create if ($pathinfo === '/livre/create') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_livre_create; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::createAction', '_route' => 'lien_livre_create',); } not_lien_livre_create: // lien_livre_edit if (preg_match('#^/livre/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_edit')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::editAction',)); } // lien_livre_update if (preg_match('#^/livre/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) { $allow = array_merge($allow, array('POST', 'PUT')); goto not_lien_livre_update; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_update')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::updateAction',)); } not_lien_livre_update: // lien_livre_delete if (preg_match('#^/livre/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) { $allow = array_merge($allow, array('POST', 'DELETE')); goto not_lien_livre_delete; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_livre_delete')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\LivreController::deleteAction',)); } not_lien_livre_delete: } if (0 === strpos($pathinfo, '/user')) { // lien_user if (rtrim($pathinfo, '/') === '/user') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_user'); } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::indexAction', '_route' => 'lien_user',); } // lien_user_show if (preg_match('#^/user/(?P<id>[^/]++)/show$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_show')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::showAction',)); } // lien_user_new if ($pathinfo === '/user/new') { return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::newAction', '_route' => 'lien_user_new',); } // lien_user_create if ($pathinfo === '/user/create') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_user_create; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::createAction', '_route' => 'lien_user_create',); } not_lien_user_create: // lien_user_modif if ($pathinfo === '/user/modif') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_user_modif; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::modifAction', '_route' => 'lien_user_modif',); } not_lien_user_modif: // lien_user_edit if (0 === strpos($pathinfo, '/user/edit') && preg_match('#^/user/edit/(?P<id>[^/]++)/?$#s', $pathinfo, $matches)) { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', 'lien_user_edit'); } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_edit')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::editAction',)); } // lien_user_edit_admin if (preg_match('#^/user/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_edit_admin')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::editAdminAction',)); } // lien_user_update if (preg_match('#^/user/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) { $allow = array_merge($allow, array('POST', 'PUT')); goto not_lien_user_update; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_update')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::updateAction',)); } not_lien_user_update: // lien_user_update_admin if (preg_match('#^/user/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) { $allow = array_merge($allow, array('POST', 'PUT')); goto not_lien_user_update_admin; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_update_admin')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::updateAdminAction',)); } not_lien_user_update_admin: // lien_user_delete if (preg_match('#^/user/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) { if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) { $allow = array_merge($allow, array('POST', 'DELETE')); goto not_lien_user_delete; } return $this->mergeDefaults(array_replace($matches, array('_route' => 'lien_user_delete')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::deleteAction',)); } not_lien_user_delete: if (0 === strpos($pathinfo, '/user/log')) { // lien_user_login if ($pathinfo === '/user/login') { if ($this->context->getMethod() != 'POST') { $allow[] = 'POST'; goto not_lien_user_login; } return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::loginAction', '_route' => 'lien_user_login',); } not_lien_user_login: // lien_user_logout if ($pathinfo === '/user/logout') { return array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\UserController::logoutAction', '_route' => 'lien_user_logout',); } } } // lsi_biblio_homepage if (0 === strpos($pathinfo, '/hello') && preg_match('#^/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => 'lsi_biblio_homepage')), array ( '_controller' => 'Lsi\\BiblioBundle\\Controller\\DefaultController::indexAction',)); } // _welcome if (rtrim($pathinfo, '/') === '') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', '_welcome'); } return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\WelcomeController::indexAction', '_route' => '_welcome',); } if (0 === strpos($pathinfo, '/demo')) { if (0 === strpos($pathinfo, '/demo/secured')) { if (0 === strpos($pathinfo, '/demo/secured/log')) { if (0 === strpos($pathinfo, '/demo/secured/login')) { // _demo_login if ($pathinfo === '/demo/secured/login') { return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::loginAction', '_route' => '_demo_login',); } // _security_check if ($pathinfo === '/demo/secured/login_check') { return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::securityCheckAction', '_route' => '_security_check',); } } // _demo_logout if ($pathinfo === '/demo/secured/logout') { return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::logoutAction', '_route' => '_demo_logout',); } } if (0 === strpos($pathinfo, '/demo/secured/hello')) { // acme_demo_secured_hello if ($pathinfo === '/demo/secured/hello') { return array ( 'name' => 'World', '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloAction', '_route' => 'acme_demo_secured_hello',); } // _demo_secured_hello if (preg_match('#^/demo/secured/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_secured_hello')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloAction',)); } // _demo_secured_hello_admin if (0 === strpos($pathinfo, '/demo/secured/hello/admin') && preg_match('#^/demo/secured/hello/admin/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_secured_hello_admin')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\SecuredController::helloadminAction',)); } } } // _demo if (rtrim($pathinfo, '/') === '/demo') { if (substr($pathinfo, -1) !== '/') { return $this->redirect($pathinfo.'/', '_demo'); } return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::indexAction', '_route' => '_demo',); } // _demo_hello if (0 === strpos($pathinfo, '/demo/hello') && preg_match('#^/demo/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { return $this->mergeDefaults(array_replace($matches, array('_route' => '_demo_hello')), array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::helloAction',)); } // _demo_contact if ($pathinfo === '/demo/contact') { return array ( '_controller' => 'Acme\\DemoBundle\\Controller\\DemoController::contactAction', '_route' => '_demo_contact',); } } throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); } }
sekouzed/Libraire-biblioth-ques-en-ligne-avec-Symfony
app/cache/dev/appDevUrlMatcher.php
PHP
mit
27,519
'use strict'; var assert = require('power-assert'); var resetStorage = require('./'); var dbName = 'test-item'; describe('#localStorage', function () { beforeEach(function (done) { localStorage.clear(); done(); }); it('should save value', function () { var expected = { foo: 'bar', goo: 'nuu' }; localStorage.setItem('item', JSON.stringify(expected)); assert.deepEqual(expected, JSON.parse(localStorage.getItem('item'))); }); it('should clear value', function (done) { var input = { foo: 'bar', goo: 'nuu' }; localStorage.setItem('item', JSON.stringify(input)); resetStorage .localStorage() .then(function () { assert.equal(null, localStorage.getItem('item')); done(); }); }); }); describe('#indexedDB', function () { var db; beforeEach(function (done) { var req = indexedDB.deleteDatabase('test-item'); req.onsuccess = function() { done(); }; }); // http://dev.classmethod.jp/ria/html5/html5-indexed-database-api/ it('should save value', function (done) { if (!indexedDB) { throw new Error('Your browser doesn\'t support a stable version of IndexedDB.'); } var openRequest = indexedDB.open(dbName, 2); var key = 'foo'; var value = 'bar'; var expected = {}; expected[key] = value; openRequest.onerror = function(event) { throw new Error(event.toString); }; openRequest.onupgradeneeded = function(event) { db = event.target.result; var store = db.createObjectStore('mystore', { keyPath: 'mykey'}); store.createIndex('myvalueIndex', 'myvalue'); }; openRequest.onsuccess = function() { db = openRequest.result; var transaction = db.transaction(['mystore'], 'readwrite'); var store = transaction.objectStore('mystore'); var request = store.put({ mykey: key, myvalue: value }); request.onsuccess = function () { var transaction = db.transaction(['mystore'], 'readwrite'); var store = transaction.objectStore('mystore'); var request = store.get(key); request.onsuccess = function (event) { assert.equal(value, event.target.result.myvalue); db.close(); done(); }; request.onerror = function (event) { db.close(); throw new Error(event.toString); }; }; request.onerror = function(event) { db.close(); throw new Error(event.toString); }; }; }); it.skip('should clear value. Writing this test is too hard for me.', function (done) { if (true) {// eslint-disable-line no-constant-condition throw new Error(); } if (!indexedDB) { throw new Error('Your browser doesn\'t support a stable version of IndexedDB.'); } var openRequest = indexedDB.open(dbName, 2); var key = 'foo'; var value = 'bar'; var expected = {}; expected[key] = value; openRequest.onerror = function(event) { throw new Error(event.toString); }; openRequest.onupgradeneeded = function(event) { db = event.target.result; var store = db.createObjectStore('mystore', { keyPath: 'mykey'}); store.createIndex('myvalueIndex', 'myvalue'); }; openRequest.onsuccess = function() { db = openRequest.result; var transaction = db.transaction(['mystore'], 'readwrite'); var store = transaction.objectStore('mystore'); var request = store.put({ mykey: key, myvalue: value }); request.onsuccess = function () { db.close(); var openRequest = indexedDB.open(dbName, 2); openRequest.onerror = function(event) { throw new Error(event.toString); }; openRequest.onsuccess = function() { var db = openRequest.result; var transaction = db.transaction(['mystore'], 'readwrite'); var store = transaction.objectStore('mystore'); var request = store.get(key); request.onsuccess = function (event) { assert.equal(value, event.target.result.myvalue); db.close(); done(); }; request.onerror = function (event) { db.close(); throw new Error(event.toString); }; }; }; request.onerror = function(event) { db.close(); throw new Error(event.toString); }; }; }); });
pandawing/node-reset-storage
test.js
JavaScript
mit
4,421
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Xml; using System.Xml.XPath; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Data.SqlTypes; using alby.core.threadpool ; namespace alby.codegen.generator { public partial class ViewGeneratorParameters { public Program p ; public string fqview ; public Exception exception ; } // end class public partial class ViewGeneratorThreadPoolItem : MyThreadPoolItemBase { protected ViewGeneratorParameters _vgp ; public ViewGeneratorThreadPoolItem( ViewGeneratorParameters vgp ) { _vgp = vgp ; } public override void Run() { Helper h = new Helper() ; try { DoView( _vgp.p, _vgp.fqview ) ; } catch( Exception ex ) { _vgp.exception = ex ; h.Message( "[DoTable() EXCEPTION]\n{0}", ex ) ; } } protected void DoView( Program p, string fqview ) { Helper h = new Helper() ; ColumnInfo ci = new ColumnInfo() ; Tuple<string,string> schemaview = h.SplitSchemaFromTable( fqview ) ; string thedatabase = h.GetCsharpClassName( null, null, p._databaseName ) ; string csharpnamespace = p._namespace + "." + p._viewSubDirectory; string resourcenamespace = p._resourceNamespace + "." + p._viewSubDirectory; string theclass = h.GetCsharpClassName( p._prefixObjectsWithSchema, schemaview.Item1, schemaview.Item2); string csharpfile = p._directory + @"\" + p._viewSubDirectory + @"\" + theclass + ".cs" ; string csharpfactoryfile = csharpfile.Replace(".cs", "Factory.cs"); string thefactoryclass = theclass + "Factory"; // config for this view, if any string xpath = "/CodeGen/Views/View[@Class='" + theclass + "']" ; XmlNode view = p._codegen.SelectSingleNode(xpath); // select sql string selectsql = "select * from {0} t "; // do class h.MessageVerbose( "[{0}]", csharpfile ); using ( StreamWriter sw = new StreamWriter( csharpfile, false, UTF8Encoding.UTF8 ) ) { int tab = 0; // header h.WriteCodeGenHeader(sw); h.WriteUsing(sw); // namespace using (NamespaceBlock nsb = new NamespaceBlock(sw, tab++, csharpnamespace)) { using (ClassBlock cb = new ClassBlock(sw, tab++, theclass, "acr.RowBase")) { List< Tuple<string,string> > columns = ci.GetViewColumns( fqview ) ; // properties and constructor using (RowConstructorBlock conb = new RowConstructorBlock(sw, tab, theclass, columns, null, "")) {} } // end class } // end namespace } // eof // do class factory h.MessageVerbose( "[{0}]", csharpfactoryfile ); using (StreamWriter sw = new StreamWriter(csharpfactoryfile, false, UTF8Encoding.UTF8)) { int tab = 0; // header h.WriteCodeGenHeader(sw); h.WriteUsing(sw, p._namespace ); // namespace using (NamespaceBlock nsb = new NamespaceBlock(sw, tab++, csharpnamespace)) { using (ClassBlock cb = new ClassBlock(sw, tab++, thefactoryclass, "acr.FactoryBase< " + theclass + ", " + "ns." + p._databaseSubDirectory + "." + thedatabase + "DatabaseSingletonHelper, " + "ns." + p._databaseSubDirectory + "." + thedatabase + "Database >" ) ) { // constructor using (ViewFactoryConstructorBlock conb = new ViewFactoryConstructorBlock( sw, tab, fqview, selectsql, thefactoryclass)) {} // default load all method List<string> parameters = new List<string>(); Dictionary<string, string> parameterdictionary = new Dictionary<string, string>(); parameters = new List<string>() ; parameters.Add("connˡ" ); parameters.Add("topNˡ" ); parameters.Add("orderByˡ" ); parameters.Add("tranˡ" ); parameterdictionary.Add("connˡ", "sds.SqlConnection"); parameterdictionary.Add("topNˡ", "int?"); parameterdictionary.Add("orderByˡ", "scg.List<acr.CodeGenOrderBy>"); parameterdictionary.Add("tranˡ", "sds.SqlTransaction"); // method h.MessageVerbose("[{0}].[{1}].[{2}]", csharpnamespace, theclass, "Loadˡ"); using (ViewFactoryMethodBlock mb = new ViewFactoryMethodBlock(sw, tab, "Loadˡ", parameters, parameterdictionary, "", theclass, resourcenamespace)) {} // load by where parameters = new List<string>() ; parameters.Add("connˡ" ); parameters.Add("whereˡ" ); parameters.Add("parametersˡ" ); parameters.Add("topNˡ" ); parameters.Add("orderByˡ" ); parameters.Add("tranˡ" ); parameterdictionary = new Dictionary<string, string>(); parameterdictionary.Add("connˡ", "sds.SqlConnection"); parameterdictionary.Add("whereˡ", "string"); parameterdictionary.Add("parametersˡ", "scg.List<sds.SqlParameter>"); parameterdictionary.Add("topNˡ", "int?"); parameterdictionary.Add("orderByˡ", "scg.List<acr.CodeGenOrderBy>"); parameterdictionary.Add("tranˡ", "sds.SqlTransaction"); h.MessageVerbose("[{0}].[{1}].[{2}]", csharpnamespace, theclass, "LoadByWhereˡ"); using (ViewFactoryMethodBlock mb = new ViewFactoryMethodBlock(sw, tab, "LoadByWhereˡ", parameters, parameterdictionary, "", theclass, resourcenamespace)) {} // other methods if ( view != null ) { XmlNodeList xmlmethods = view.SelectNodes("Methods/Method"); foreach ( XmlNode xmlmethod in xmlmethods ) { string themethod = xmlmethod.SelectSingleNode("@Name").InnerText; // where resource string whereresource = xmlmethod.SelectSingleNode("@Where").InnerText; // parameters parameters = new List<string>() ; parameters.Add("connˡ" ); XmlNodeList xmlparameters = xmlmethod.SelectNodes("Parameters/Parameter"); foreach ( XmlNode xmlparameter in xmlparameters ) parameters.Add( xmlparameter.SelectSingleNode("@Name").InnerText ); parameters.Add("topNˡ" ); parameters.Add("orderByˡ" ); parameters.Add("tranˡ" ); parameterdictionary = new Dictionary<string, string>(); parameterdictionary.Add("connˡ", "sds.SqlConnection"); xmlparameters = xmlmethod.SelectNodes("Parameters/Parameter"); foreach ( XmlNode xmlparameter in xmlparameters ) parameterdictionary.Add( xmlparameter.SelectSingleNode("@Name").InnerText, xmlparameter.SelectSingleNode("@Type").InnerText ); parameterdictionary.Add("topNˡ", "int?"); parameterdictionary.Add("orderByˡ", "scg.List<acr.CodeGenOrderBy>"); parameterdictionary.Add("tranˡ", "sds.SqlTransaction"); // method h.MessageVerbose( "[{0}].[{1}].method [{2}]", csharpnamespace, theclass, themethod ); using (ViewFactoryMethodBlock mb = new ViewFactoryMethodBlock(sw, tab, themethod, parameters, parameterdictionary, whereresource, theclass, resourcenamespace)) {} } } } // end class } // end namespace } // eof } // end do view } // end class }
casaletto/alby.codegen.2015
alby.codegen.generator/ViewGeneratorThreadPoolItem.cs
C#
mit
7,334
.progressbar-top { margin-top: -24px; margin-bottom: 24px; width: 70%; margin-left: -24px; position: absolute; } .check-icon { color: #21C9A1; } .overdue-text { color: #ce2424; font-weight: bold; } .alert-icon { color: #ce2424; } .offset-top-mat-icon { margin-top: 17px; } .pointer { cursor: pointer; } .member-initials { background-color: lightgrey; height: 24px; min-width: 25px; font-size: 12px; line-height: 24px; text-align: center; padding: 2px; border-radius: 4px; margin-right: 2px; } .text-area { resize: none; } .margin { margin-right: 5px; }
aicirt2012/icm-webclient
src/app/client/context/tasks/taskDialog/taskDialog.component.css
CSS
mit
605
// Copyright (c) 2016-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <chainparams.h> #include <chainparamsbase.h> #include <logging.h> #include <util/system.h> #include <util/translation.h> #include <util/url.h> #include <wallet/wallettool.h> #include <functional> const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; UrlDecodeFn* const URL_DECODE = nullptr; static void SetupWalletToolArgs(ArgsManager& argsman) { SetupHelpOptions(argsman); SetupChainParamsBaseOptions(argsman); argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-wallet=<wallet-name>", "Specify wallet name", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS); argsman.AddArg("-debug=<category>", "Output debugging information (default: 0).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); argsman.AddArg("info", "Get wallet info", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); argsman.AddArg("create", "Create new wallet file", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); argsman.AddArg("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); } static bool WalletAppInit(int argc, char* argv[]) { SetupWalletToolArgs(gArgs); std::string error_message; if (!gArgs.ParseParameters(argc, argv, error_message)) { tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error_message); return false; } if (argc < 2 || HelpRequested(gArgs)) { std::string usage = strprintf("%s elements-wallet version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n\n" + "elements-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n" + "By default elements-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n" + "To change the target wallet, use the -datadir, -wallet and -testnet/-regtest arguments.\n\n" + "Usage:\n" + " elements-wallet [options] <command>\n\n" + gArgs.GetHelpMessage(); tfm::format(std::cout, "%s", usage); return false; } // check for printtoconsole, allow -debug LogInstance().m_print_to_console = gArgs.GetBoolArg("-printtoconsole", gArgs.GetBoolArg("-debug", false)); if (!CheckDataDirOption()) { tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")); return false; } // Check for chain settings (Params() calls are only valid after this clause) SelectParams(gArgs.GetChainName()); return true; } int main(int argc, char* argv[]) { #ifdef WIN32 util::WinCmdLineArgs winArgs; std::tie(argc, argv) = winArgs.get(); #endif SetupEnvironment(); RandomInit(); try { if (!WalletAppInit(argc, argv)) return EXIT_FAILURE; } catch (const std::exception& e) { PrintExceptionContinue(&e, "WalletAppInit()"); return EXIT_FAILURE; } catch (...) { PrintExceptionContinue(nullptr, "WalletAppInit()"); return EXIT_FAILURE; } std::string method {}; for(int i = 1; i < argc; ++i) { if (!IsSwitchChar(argv[i][0])) { if (!method.empty()) { tfm::format(std::cerr, "Error: two methods provided (%s and %s). Only one method should be provided.\n", method, argv[i]); return EXIT_FAILURE; } method = argv[i]; } } if (method.empty()) { tfm::format(std::cerr, "No method provided. Run `elements-wallet -help` for valid methods.\n"); return EXIT_FAILURE; } // A name must be provided when creating a file if (method == "create" && !gArgs.IsArgSet("-wallet")) { tfm::format(std::cerr, "Wallet name must be provided when creating a new wallet.\n"); return EXIT_FAILURE; } std::string name = gArgs.GetArg("-wallet", ""); ECCVerifyHandle globalVerifyHandle; ECC_Start(); if (!WalletTool::ExecuteWalletToolFunc(method, name)) return EXIT_FAILURE; ECC_Stop(); return EXIT_SUCCESS; }
ElementsProject/elements
src/bitcoin-wallet.cpp
C++
mit
4,831
<?php namespace App\Common\Models\Order\Mysql; use App\Common\Models\Base\Mysql\Base; class OrderCommon extends Base { /** * 订单-订单扩展信息表管理 * This model is mapped to the table iorder_common */ public function getSource() { return 'iorder_common'; } public function reorganize(array $data) { $data = parent::reorganize($data); // $data['is_smtp'] = $this->changeToBoolean($data['is_smtp']); // $data['access_token_expire'] = $this->changeToValidDate($data['access_token_expire']); return $data; } }
handsomegyr/models
lib/App/Common/Models/Order/Mysql/OrderCommon.php
PHP
mit
613
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Treorisoft.Net.Utilities { /// <summary> /// Provides properties and instance methods for sending files over a <see cref="Winsock"/> objects. /// </summary> [Serializable] public class FileData : ISerializable { /// <summary> /// Initializes a new instance of the <see cref="FileData"/> class. /// </summary> /// <param name="info">A <see cref="FileInfo"/> object that contains data about the file.</param> public FileData(FileInfo info) { Guid = Guid.NewGuid(); FileName = info.Name; FileSize = info.Length; Info = info; } /// <summary> /// Initializes a new instance of the <see cref="FileData"/> class with serialized data. /// </summary> /// <param name="info">The object that holds the serialized object data.</param> /// <param name="context">The contextual information about the source or destination.</param> protected FileData(SerializationInfo info, StreamingContext context) { Guid = (Guid)info.GetValue("guid", typeof(Guid)); FileName = info.GetString("filename"); FileSize = info.GetInt64("filesize"); } /// <summary> /// Implements the <see cref="ISerializable"/> interface and returns the data needed to serialize the <see cref="FileData"/> object. /// </summary> /// <param name="info">A SerializationInfo object containing information required to serialize the FileData object.</param> /// <param name="context">A StreamingContext object containing the source and destination of the serialized stream associated with the FileData object.</param> public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("guid", Guid); info.AddValue("filename", FileName); info.AddValue("filesize", FileSize); } /// <summary> /// Gets a <see cref="Guid"/> identifier for the file. /// </summary> public Guid Guid { get; private set; } /// <summary> /// Gets the name of the file. /// </summary> public string FileName { get; private set; } /// <summary> /// Gets the size, in bytes, of the file. /// </summary> public long FileSize { get; private set; } /// <summary> /// Gets the <see cref="FileInfo"/> of the file being transmitted. /// </summary> /// <remarks> /// During sending this contains the details of the actual file being transmitted. /// During receiving this contains the details of a temporary file, that upon arrival can be moved to another location. /// </remarks> public FileInfo Info { get; internal set; } #region Sending/Receiving Helpers /// <summary> /// Field backing the SyncRoot property. /// </summary> internal object _syncRoot = null; /// <summary> /// Field backing the MetaSize property. /// </summary> internal static int _fileDataMetaSize = -1; /// <summary> /// Gets an object that can be used to synchronize access to the file being read/written. /// </summary> private object SyncRoot { get { if (_syncRoot == null) Interlocked.CompareExchange(ref _syncRoot, new object(), null); return _syncRoot; } } /// <summary> /// Gets a value the estimates the size of an empty <see cref="FileDataPart"/> object. /// </summary> internal static int MetaSize { get { if (_fileDataMetaSize < 0) _fileDataMetaSize = EstimatePartSize(0) + 1; return _fileDataMetaSize; } } /// <summary> /// Gets an estimate of a <see cref="FileDataPart"/> object of the specified data size. /// </summary> /// <param name="size">The size of the data that should be used in the size estimate.</param> /// <returns>The estimated size, in bytes, of a serialized <see cref="FileDataPart"/>.</returns> internal static int EstimatePartSize(int size) { return EstimatePartSize(Guid.Empty, long.MaxValue, size); } /// <summary> /// Gets an estimate of a <see cref="FileDataPart"/>. /// </summary> /// <param name="guid">The <see cref="Guid"/> that should be used in the size estimate.</param> /// <param name="start">The start position that should be used in the size estimate.</param> /// <param name="size">The size of the data that should be used in the size estimate.</param> /// <returns>The estimated size, in bytes, of a serialized <see cref="FileDataPart"/>.</returns> internal static int EstimatePartSize(Guid guid, long start, int size) { var part = new FileDataPart(guid, start, new byte[size]); var bytes = ObjectPacker.Pack(part); return bytes.Length + PacketHeader.HeaderSize(bytes.Length); } #endregion #region Sending /// <summary> /// Gets the total number of bytes sent. /// </summary> internal long SentBytes { get; set; } = 0; /// <summary> /// Gets a boolean value indicating whether if the file has been completely sent or not. /// </summary> internal bool SendCompleted { get { return (SentBytes == FileSize); } } /// <summary> /// Gets the next <see cref="FileDataPart"/> that will be sent over the network. /// </summary> /// <param name="bufferSize">The size of the buffer and amount of data to return.</param> /// <returns>The bufferSize is adjusted by an estimate of how large the metadata would be, so that the size of the serialized <see cref="FileDataPart"/> should be the same as the bufferSize.</returns> internal FileDataPart GetNextPart(int bufferSize) { if (SendCompleted) return null; if (Info == null) throw new NullReferenceException("File information not found."); if (!Info.Exists) throw new FileNotFoundException(Info.FullName); bufferSize -= MetaSize; byte[] buffer = new byte[bufferSize]; lock (SyncRoot) { using (FileStream fs = new FileStream(Info.FullName, FileMode.Open, FileAccess.Read)) { fs.Seek(SentBytes, SeekOrigin.Begin); int readSize = fs.Read(buffer, 0, bufferSize); byte[] sizedBuffer = ArrayMethods.Shrink(ref buffer, readSize); var part = new FileDataPart(Guid, SentBytes, sizedBuffer); SentBytes += readSize; return part; } } } /// <summary> /// Gets the total size of all the parts of the file at the given buffer size. /// </summary> /// <param name="bufferSize">The size of the buffer and amount of data to estimate with.</param> /// <returns> /// This routine is used by <see cref="SendProgress"/> to help determine the total number of bytes to send, and therefore also the percent completed. /// The bufferSize is adjusted by an estimate of how large the metadata would be, so that the size of the serialized <see cref="FileDataPart"/> should be the same as the bufferSize. /// </returns> internal long GetTotalPartSize(int bufferSize) { long sum = 0; foreach (int size in GetPartSizes(bufferSize)) sum += size; return sum; } /// <summary> /// Gets the sizes of all the parts of the file at the given buffer size. /// </summary> /// <param name="bufferSize">The size of the buffer and amount of data to estimate with.</param> /// <returns> /// Returns an IEnumerable containing the sizes of all the different parts of the file - including the <see cref="FileData"/> header. /// </returns> internal IEnumerable<int> GetPartSizes(int bufferSize) { if (Info == null) throw new NullReferenceException("File information not found."); if (!Info.Exists) throw new FileNotFoundException(Info.FullName); var bytes = ObjectPacker.Pack(this); yield return bytes.Length + PacketHeader.HeaderSize(bytes.Length); bufferSize -= MetaSize; long fileSize = Info.Length; long start = 0; while (fileSize > 0) { if (fileSize > bufferSize) { yield return EstimatePartSize(Guid, start, bufferSize); fileSize -= bufferSize; start += bufferSize; } else { yield return EstimatePartSize(Guid, start, (int)fileSize); fileSize = 0; } } } #endregion #region Receiving /// <summary> /// Gets the total number of received bytes. /// </summary> public long ReceivedBytes { get; private set; } = 0; /// <summary> /// Gets a boolean value indicating if the file has been completely received or not. /// </summary> public bool ReceiveCompleted { get { return (ReceivedBytes == FileSize); } } /// <summary> /// Gets the size of the last received <see cref="FileDataPart"/>. /// </summary> /// <remarks>This is used to help setup the <see cref="ReceiveProgressEventArgs"/> that is raised.</remarks> internal int LastReceivedSize { get; set; } /// <summary> /// Receives the <see cref="FileDataPart"/> into the specified file. /// </summary> /// <param name="fileName">The fully qualified name of the file, or the relative file name. Do not end the path with the directory separator character.</param> /// <param name="part">The <see cref="FileDataPart"/> to be received.</param> internal void ReceivePart(string fileName, FileDataPart part) { ReceivePart(new FileInfo(fileName), part); } /// <summary> /// Receives the <see cref="FileDataPart"/> into the specified file. /// </summary> /// <param name="file">A <see cref="FileInfo"/> object containing the fully qualified name of the file to receiving the data to.</param> /// <param name="part">The <see cref="FileDataPart"/> to be received.</param> internal void ReceivePart(FileInfo file, FileDataPart part) { if (ReceiveCompleted) throw new InvalidOperationException("Receive operation for this file has already been completed."); lock (SyncRoot) { using (FileStream fs = new FileStream(file.FullName, FileMode.OpenOrCreate, FileAccess.Write)) { fs.Seek(part.Start, SeekOrigin.Begin); fs.Write(part.Data, 0, part.Data.Length); } LastReceivedSize = part.Data.Length; ReceivedBytes += part.Data.Length; } } #endregion } }
Borvik/Winsock.Net
Winsock/Utilities/FileData.cs
C#
mit
11,804
package main import "fmt" func main() { fmt.Println("go" + "lang") fmt.Println("1+1 =", 1+1) fmt.Println("7.0/3.0 =", 7.0/3.0) fmt.Println(true && false) fmt.Println(true || false) fmt.Println(!true) }
csaura/go_examples
values/values.go
GO
mit
217
import React from 'react' import DocumentTitle from 'react-document-title' import ReactHeight from 'react-height' import Header from './header/header' import Content from './content/content' import Footer from './footer/footer' import { APP_NAME } from '../constants' class Layout extends React.Component { render() { const hfStyle = { flex: 'none' } const contentStyle = { flex: 1 } const containerStyle = { display: 'flex', minHeight: window.innerHeight, flexDirection: 'column' } return ( <div style={containerStyle}> <DocumentTitle title={APP_NAME}/> <Header style={hfStyle}/> <Content style={contentStyle}/> <Footer style={hfStyle}/> </div> ) } } export default Layout
HendrikCrause/crossword-creator
src/components/layout.js
JavaScript
mit
792
import Graph from 'graphology-types'; export default function mergePath(graph: Graph, nodes: Array<unknown>): void;
graphology/graphology
src/utils/merge-path.d.ts
TypeScript
mit
117
var i18n = require('i18n'); var _ = require('lodash'); exports.register = function (plugin, options, next) { i18n.configure(options); plugin.ext('onPreResponse', function (request, extNext) { // If is an error message if(request.response.isBoom) { i18n.setLocale(getLocale(request, options)); request.response.output.payload.message = i18n.__(request.response.output.payload.message); return extNext(request.response); } extNext(); }); next(); }; var getLocale = function(request, options) { i18n.init(request.raw.req); if(_.contains(_.keys(i18n.getCatalog()), request.raw.req.language)) { return request.raw.req.language; } else { return options.defaultLocale; } };
jozzhart/josepoo
lib/index.js
JavaScript
mit
731
--- layout: page title: Drift Daily FAQ permalink: /daily/ show_in_nav: true links: - title: How do I sign up? url: "#getting-started" - title: FAQ url: "#faq" links: - title: What value does the Drift Daily bring? url: "#Why-use-daily" - title: What does “Signed up” mean? url: "#signed-up" - title: What does Drift Daily do that my other system doesn’t? url: "#differentiation" - title: How do integrations work? url: "#integrations" - title: How does the Slack integration work? url: "#slack" - title: Is my data secure? url: "#security" - title: Is there an API? url: "#api" - title: Can I route contacts to specific people? url: "#routing" - title: Can I modify CRM records? url: "#syncing" - title: Contact us url: "#contact" --- <div id="getting-started"></div> ### Getting started Get started with the Drift Daily by signing up at drift.com/daily [you can do so here](http://drift.com/daily). --- <div id="faq"></div> <div id="Why-use-daily"></div> ### What value does Drift Daily bring? Drift Daily helps you learn more about your new leads, subscribers, and customers via email and slack. It shows you all of your new contacts from the previous day, with VIPs at the top. It provides a rich profile for each new contact including LinkedIn & Twitter profiles, as well as company information. Rather than logging into your CRM to get emails and then have to go digging for this information, we serve it right up to your email. This lets your team get right on the phone to follow-up, rather than have to do this digging themselves. <div id="signed-up"></div> ##### What does “Signed up” mean? How do I know if a new contact is from a manual entry vs. a form fill? Right now we can’t discern between a sales representative manually entering a new contact, and a prospect who came to your site and filled out a form. In the future, we plan on giving you more information, when possible, about the source of the contact. <div id="differentiation"></div> ##### What does Drift Daily do that my other system doesn’t? Today, you have to log into your system(s), scan a list of new contacts, and even then you only see names. Drift Daily comes straight to your email, and provides a rich profile for each new contact based on LinkedIn and Twitter profiles, as well as company information. It helps you get to know your contacts as people so you and your reps are ready to pick up the phone and call, instead of go digging to find that information first. <div id="integrations"></div> ##### How do integrations work? After you connect your account, we monitor any time a new contact is added into the database. Whenever one is, we grab their data from the system you connected it to and enrich it with our own data. <div id="slack"></div> ##### How does the Slack integration work? If you want real-time updates each time you get a new lead, you’ll want to integrate with Slack. Once you authorize Drift Daily to work with Slack, you’ll be asked to choose a #room to display your new leads. Each time a new contact is collected, we’ll post that person’s information, along with their company information, right in that slack channel. <div id="security"></div> ##### How are you handling my data? How do I know my contact database is secure? For all of our integrations, we’re using the authentication process that each company provides, which creates the most secure connection between Drift and your data. At anytime, for any reason at all, you can go into your application and revoke Drift’s access. If you’d like to learn more about how we use industry best practices at Drift, [you can do so here](http://help.driftt.com/security/). <div id="api"></div> ##### Is there an API we can access to get the data and modify the presentation for our needs? We do have a Zapier integration, which you could use to pipe the data from Drift into hundreds of other applications. If you’d like to get setup with this, send us a note at hello@drift.com In the future we plan to add an API. Please send us an email at hello@drift.com if you'd like to be notified when it's ready. We are also adding support for Segment and Zapier. <div id="routing"></div> ##### Is there a way to route specific new contacts to specific sales reps? Right now Drift Daily sends all contacts to all users who are subscribed. We’d love to learn more about how exactly you’d like to customize these notifications, so please reach out to us at hello@drift.com <div id="syncing"></div> ##### If I interact with customer data in Drift Daily, will that sync and modify records in my CRM? Not today but we plan on adding that support in the future. Please reach out to us at hello@drift.com if you’d like to be the first to know when it’s ready. * * * <div id="contact"></div> _If you have any questions at all, please feel free to reach out to use at hello@drift.com. We’re happy to talk with you!_
Driftt/driftt.github.io
daily.md
Markdown
mit
5,133
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <title>Henge: b_ine</title> <link rel="stylesheet" href="/vendor/bootstrap-3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="/css/site.css"> </head> <body> <div id="staticBody"> <header> <h1><img src="/imgs/logo.svg" alt="henge"></h1> </header> <h2>#436 b_ine</h2> <ul id="words"> <li>baseline</li> <li>beeline</li> <li>benedictine</li> <li>benzine</li> <li>bloodline</li> <li>borderline</li> <li>bovine</li> <li>bowline</li> <li>brigantine</li> <li>brine</li> <li>byline</li> <li>byzantine</li> </ul> </div> <div id="CircleApp" data-floor="37" data-floor-pos="3"></div> <script type="text/javascript" src="/CircleApp.bundle.js"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-631498-5', 'auto'); ga('send', 'pageview'); </script> </body> </html>
henge-tech/henge-tech
docs/circles/b_ine.html
HTML
mit
1,203
from nintendo import dauth, switch from anynet import http import pytest CHALLENGE_REQUEST = \ "POST /v6/challenge HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" \ "Accept: */*\r\n" \ "X-Nintendo-PowerState: FA\r\n" \ "Content-Length: 17\r\n" \ "Content-Type: application/x-www-form-urlencoded\r\n\r\n" \ "key_generation=11" TOKEN_REQUEST = \ "POST /v6/device_auth_token HTTP/1.1\r\n" \ "Host: 127.0.0.1:12345\r\n" \ "User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\r\n" \ "Accept: */*\r\n" \ "X-Nintendo-PowerState: FA\r\n" \ "Content-Length: 211\r\n" \ "Content-Type: application/x-www-form-urlencoded\r\n\r\n" \ "challenge=vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=&" \ "client_id=8f849b5d34778d8e&ist=false&key_generation=11&" \ "system_version=CusHY#000c0000#C-BynYNPXdQJNBZjx02Hizi8lRUSIKLwPGa5p8EY1uo=&" \ "mac=xRB_6mgnNqrnF9DRsEpYMg" @pytest.mark.anyio async def test_dauth(): async def handler(client, request): if request.path == "/v6/challenge": assert request.encode().decode() == CHALLENGE_REQUEST response = http.HTTPResponse(200) response.json = { "challenge": "vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=", "data": "dlL7ZBNSLmYo1hUlKYZiUA==" } return response else: assert request.encode().decode() == TOKEN_REQUEST response = http.HTTPResponse(200) response.json = { "device_auth_token": "device token" } return response async with http.serve(handler, "127.0.0.1", 12345): keys = switch.KeySet() keys["aes_kek_generation_source"] = bytes.fromhex("485d45ad27c07c7e538c0183f90ee845") keys["master_key_0a"] = bytes.fromhex("37eed242e0f2ce6f8371e783c1a6a0ae") client = dauth.DAuthClient(keys) client.set_url("127.0.0.1:12345") client.set_system_version(1200) client.set_context(None) response = await client.device_token(client.BAAS) token = response["device_auth_token"] assert token == "device token"
Kinnay/NintendoClients
tests/test_dauth.py
Python
mit
2,095
import expect from 'expect'; import createStore from './createStore'; describe('createStore()', () => { let store; beforeEach(() => { store = createStore(); }); it('should write data and return its key when write() is called', () => { const hash = store.write({ hello: 'world' }); expect(hash).toBe(store.keys()[0]); }); it('should return data when read() is called with a valid key', () => { const hash = store.write({ hello: 'world' }); expect(store.read(hash)).toEqual({ hello: 'world' }); }); it('should throw an error when read() is called with an invalid key', () => { store.write({ hello: 'world' }); expect(() => store.read('wrong')).toThrow(/Entry wrong not found/); }); it('should return all keys when keys() is called', () => { const hash1 = store.write({ hello: 'world' }); const hash2 = store.write({ hello2: 'world2' }); expect(store.keys()).toEqual([ hash1, hash2, ]); }); it('should return all store content when toJSON() is called', () => { const hash1 = store.write({ hello: 'world' }); const hash2 = store.write({ hello2: 'world2' }); expect(store.toJSON()).toEqual({ [hash1]: { hello: 'world', }, [hash2]: { hello2: 'world2', }, }); }); it('should init the store if a snapshot is given', () => { const localStore = createStore({ ae3: { hello: 'world', }, }); expect(localStore.read('ae3')).toEqual({ hello: 'world', }); }); it('should write data with the given hash if provided', () => { const hash = store.write({ hello: 'world' }, 'forcedHash'); expect(hash).toBe('forcedHash'); expect(store.keys()[0]).toBe('forcedHash'); expect(store.read('forcedHash')).toEqual({ hello: 'world' }); }); it('should notify any subscriber when something is written into the store', () => { const subscriber1 = expect.createSpy(); store.subscribe(subscriber1); const subscriber2 = expect.createSpy(); store.subscribe(subscriber2); const hash = store.write({ hello: 'world' }); expect(subscriber1).toHaveBeenCalledWith(hash); expect(subscriber2).toHaveBeenCalledWith(hash); store.unsubscribe(subscriber1); const hash2 = store.write({ hello: 'earth' }); expect(subscriber1.calls.length).toBe(1); expect(subscriber2).toHaveBeenCalledWith(hash2); expect(subscriber2.calls.length).toBe(2); }); });
RobinBressan/json-git
src/createStoreSpec.js
JavaScript
mit
2,726
package com.jxtech.distributed.zookeeper.pool; import java.util.NoSuchElementException; import org.apache.commons.pool.ObjectPool; import org.apache.commons.pool.PoolableObjectFactory; import org.apache.commons.pool.impl.StackObjectPool; import org.apache.zookeeper.ZooKeeper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jxtech.distributed.Configuration; /** * ZK实例池管理器 * * @author wmzsoft@gmail.com */ public class ZookeeperPoolManager { private static final Logger LOG = LoggerFactory.getLogger(ZookeeperPoolManager.class); /** 单例 */ protected static ZookeeperPoolManager instance; private ObjectPool pool; /** * 构造方法 */ private ZookeeperPoolManager() { init(); } /** * 返回单例的对象 * * @return */ public static ZookeeperPoolManager getInstance() { if (instance == null) { instance = new ZookeeperPoolManager(); } return instance; } /** * 初始化方法zookeeper连接池 * * @param config */ private void init() { if (pool != null) { LOG.debug("pool is already init"); return; } Configuration config = Configuration.getInstance(); if (!config.isDeploy()) { LOG.info("Can't init , deploy = false."); return; } PoolableObjectFactory factory = new ZookeeperPoolableObjectFactory(config); // 初始化ZK对象池 int maxIdle = config.getMaxIdle(); int initIdleCapacity = config.getInitIdleCapacity(); pool = new StackObjectPool(factory, maxIdle, initIdleCapacity); // 初始化池 for (int i = 0; i < initIdleCapacity; i++) { try { pool.addObject(); } catch (IllegalStateException | UnsupportedOperationException ex) { LOG.error(ex.getMessage(), ex); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); } } } /** * 将ZK对象从对象池中取出 * * @return */ public ZooKeeper borrowObject() { if (pool != null) { try { return (ZooKeeper) pool.borrowObject(); } catch (NoSuchElementException | IllegalStateException ex) { LOG.error(ex.getMessage(), ex); } catch (Exception e) { LOG.error(e.getMessage(), e); } } return null; } /** * 将ZK实例返回对象池 * * @param zk */ public void returnObject(ZooKeeper zk) { if (pool != null && zk != null) { try { pool.returnObject(zk); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); } } } /** * 关闭对象池 */ public void close() { if (pool != null) { try { pool.close(); LOG.info("关闭ZK对象池完成"); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); } } } }
wmzsoft/JXADF
Source/JxADF/JxPlatform/src/main/java/com/jxtech/distributed/zookeeper/pool/ZookeeperPoolManager.java
Java
mit
3,203
// Copyright (c) 2011-2014 The Testcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "paymentserver.h" #include "Testcoinunits.h" #include "guiutil.h" #include "optionsmodel.h" #include "base58.h" #include "chainparams.h" #include "ui_interface.h" #include "util.h" #include "wallet.h" #include <cstdlib> #include <openssl/x509.h> #include <openssl/x509_vfy.h> #include <QApplication> #include <QByteArray> #include <QDataStream> #include <QDateTime> #include <QDebug> #include <QFile> #include <QFileOpenEvent> #include <QHash> #include <QList> #include <QLocalServer> #include <QLocalSocket> #include <QNetworkAccessManager> #include <QNetworkProxy> #include <QNetworkReply> #include <QNetworkRequest> #include <QSslCertificate> #include <QSslError> #include <QSslSocket> #include <QStringList> #include <QTextDocument> #if QT_VERSION < 0x050000 #include <QUrl> #else #include <QUrlQuery> #endif using namespace std; const int Testcoin_IPC_CONNECT_TIMEOUT = 1000; // milliseconds const QString Testcoin_IPC_PREFIX("Testcoin:"); // BIP70 payment protocol messages const char* BIP70_MESSAGE_PAYMENTACK = "PaymentACK"; const char* BIP70_MESSAGE_PAYMENTREQUEST = "PaymentRequest"; // BIP71 payment protocol media types const char* BIP71_MIMETYPE_PAYMENT = "application/Testcoin-payment"; const char* BIP71_MIMETYPE_PAYMENTACK = "application/Testcoin-paymentack"; const char* BIP71_MIMETYPE_PAYMENTREQUEST = "application/Testcoin-paymentrequest"; // BIP70 max payment request size in bytes (DoS protection) const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE = 50000; X509_STORE* PaymentServer::certStore = NULL; void PaymentServer::freeCertStore() { if (PaymentServer::certStore != NULL) { X509_STORE_free(PaymentServer::certStore); PaymentServer::certStore = NULL; } } // // Create a name that is unique for: // testnet / non-testnet // data directory // static QString ipcServerName() { QString name("TestcoinQt"); // Append a simple hash of the datadir // Note that GetDataDir(true) returns a different path // for -testnet versus main net QString ddir(QString::fromStdString(GetDataDir(true).string())); name.append(QString::number(qHash(ddir))); return name; } // // We store payment URIs and requests received before // the main GUI window is up and ready to ask the user // to send payment. static QList<QString> savedPaymentRequests; static void ReportInvalidCertificate(const QSslCertificate& cert) { qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); } // // Load OpenSSL's list of root certificate authorities // void PaymentServer::LoadRootCAs(X509_STORE* _store) { if (PaymentServer::certStore == NULL) atexit(PaymentServer::freeCertStore); else freeCertStore(); // Unit tests mostly use this, to pass in fake root CAs: if (_store) { PaymentServer::certStore = _store; return; } // Normal execution, use either -rootcertificates or system certs: PaymentServer::certStore = X509_STORE_new(); // Note: use "-system-" default here so that users can pass -rootcertificates="" // and get 'I don't like X.509 certificates, don't trust anybody' behavior: QString certFile = QString::fromStdString(GetArg("-rootcertificates", "-system-")); if (certFile.isEmpty()) return; // Empty store QList<QSslCertificate> certList; if (certFile != "-system-") { certList = QSslCertificate::fromPath(certFile); // Use those certificates when fetching payment requests, too: QSslSocket::setDefaultCaCertificates(certList); } else certList = QSslSocket::systemCaCertificates (); int nRootCerts = 0; const QDateTime currentTime = QDateTime::currentDateTime(); foreach (const QSslCertificate& cert, certList) { if (currentTime < cert.effectiveDate() || currentTime > cert.expiryDate()) { ReportInvalidCertificate(cert); continue; } #if QT_VERSION >= 0x050000 if (cert.isBlacklisted()) { ReportInvalidCertificate(cert); continue; } #endif QByteArray certData = cert.toDer(); const unsigned char *data = (const unsigned char *)certData.data(); X509* x509 = d2i_X509(0, &data, certData.size()); if (x509 && X509_STORE_add_cert(PaymentServer::certStore, x509)) { // Note: X509_STORE_free will free the X509* objects when // the PaymentServer is destroyed ++nRootCerts; } else { ReportInvalidCertificate(cert); continue; } } qWarning() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates"; // Project for another day: // Fetch certificate revocation lists, and add them to certStore. // Issues to consider: // performance (start a thread to fetch in background?) // privacy (fetch through tor/proxy so IP address isn't revealed) // would it be easier to just use a compiled-in blacklist? // or use Qt's blacklist? // "certificate stapling" with server-side caching is more efficient } // // Sending to the server is done synchronously, at startup. // If the server isn't already running, startup continues, // and the items in savedPaymentRequest will be handled // when uiReady() is called. // // Warning: ipcSendCommandLine() is called early in init, // so don't use "emit message()", but "QMessageBox::"! // void PaymentServer::ipcParseCommandLine(int argc, char* argv[]) { for (int i = 1; i < argc; i++) { QString arg(argv[i]); if (arg.startsWith("-")) continue; // If the Testcoin: URI contains a payment request, we are not able to detect the // network as that would require fetching and parsing the payment request. // That means clicking such an URI which contains a testnet payment request // will start a mainnet instance and throw a "wrong network" error. if (arg.startsWith(Testcoin_IPC_PREFIX, Qt::CaseInsensitive)) // Testcoin: URI { savedPaymentRequests.append(arg); SendCoinsRecipient r; if (GUIUtil::parseTestcoinURI(arg, &r) && !r.address.isEmpty()) { CTestcoinAddress address(r.address.toStdString()); if (address.IsValid(Params(CBaseChainParams::MAIN))) { SelectParams(CBaseChainParams::MAIN); } else if (address.IsValid(Params(CBaseChainParams::TESTNET))) { SelectParams(CBaseChainParams::TESTNET); } } } else if (QFile::exists(arg)) // Filename { savedPaymentRequests.append(arg); PaymentRequestPlus request; if (readPaymentRequestFromFile(arg, request)) { if (request.getDetails().network() == "main") { SelectParams(CBaseChainParams::MAIN); } else if (request.getDetails().network() == "test") { SelectParams(CBaseChainParams::TESTNET); } } } else { // Printing to debug.log is about the best we can do here, the // GUI hasn't started yet so we can't pop up a message box. qWarning() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg; } } } // // Sending to the server is done synchronously, at startup. // If the server isn't already running, startup continues, // and the items in savedPaymentRequest will be handled // when uiReady() is called. // bool PaymentServer::ipcSendCommandLine() { bool fResult = false; foreach (const QString& r, savedPaymentRequests) { QLocalSocket* socket = new QLocalSocket(); socket->connectToServer(ipcServerName(), QIODevice::WriteOnly); if (!socket->waitForConnected(Testcoin_IPC_CONNECT_TIMEOUT)) { delete socket; socket = NULL; return false; } QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_0); out << r; out.device()->seek(0); socket->write(block); socket->flush(); socket->waitForBytesWritten(Testcoin_IPC_CONNECT_TIMEOUT); socket->disconnectFromServer(); delete socket; socket = NULL; fResult = true; } return fResult; } PaymentServer::PaymentServer(QObject* parent, bool startLocalServer) : QObject(parent), saveURIs(true), uriServer(0), netManager(0), optionsModel(0) { // Verify that the version of the library that we linked against is // compatible with the version of the headers we compiled against. GOOGLE_PROTOBUF_VERIFY_VERSION; // Install global event filter to catch QFileOpenEvents // on Mac: sent when you click Testcoin: links // other OSes: helpful when dealing with payment request files (in the future) if (parent) parent->installEventFilter(this); QString name = ipcServerName(); // Clean up old socket leftover from a crash: QLocalServer::removeServer(name); if (startLocalServer) { uriServer = new QLocalServer(this); if (!uriServer->listen(name)) { // constructor is called early in init, so don't use "emit message()" here QMessageBox::critical(0, tr("Payment request error"), tr("Cannot start Testcoin: click-to-pay handler")); } else { connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection())); connect(this, SIGNAL(receivedPaymentACK(QString)), this, SLOT(handlePaymentACK(QString))); } } } PaymentServer::~PaymentServer() { google::protobuf::ShutdownProtobufLibrary(); } // // OSX-specific way of handling Testcoin: URIs and // PaymentRequest mime types // bool PaymentServer::eventFilter(QObject *object, QEvent *event) { // clicking on Testcoin: URIs creates FileOpen events on the Mac if (event->type() == QEvent::FileOpen) { QFileOpenEvent *fileEvent = static_cast<QFileOpenEvent*>(event); if (!fileEvent->file().isEmpty()) handleURIOrFile(fileEvent->file()); else if (!fileEvent->url().isEmpty()) handleURIOrFile(fileEvent->url().toString()); return true; } return QObject::eventFilter(object, event); } void PaymentServer::initNetManager() { if (!optionsModel) return; if (netManager != NULL) delete netManager; // netManager is used to fetch paymentrequests given in Testcoin: URIs netManager = new QNetworkAccessManager(this); QNetworkProxy proxy; // Query active SOCKS5 proxy if (optionsModel->getProxySettings(proxy)) { netManager->setProxy(proxy); qDebug() << "PaymentServer::initNetManager : Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port(); } else qDebug() << "PaymentServer::initNetManager : No active proxy server found."; connect(netManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(netRequestFinished(QNetworkReply*))); connect(netManager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> &)), this, SLOT(reportSslErrors(QNetworkReply*, const QList<QSslError> &))); } void PaymentServer::uiReady() { initNetManager(); saveURIs = false; foreach (const QString& s, savedPaymentRequests) { handleURIOrFile(s); } savedPaymentRequests.clear(); } void PaymentServer::handleURIOrFile(const QString& s) { if (saveURIs) { savedPaymentRequests.append(s); return; } if (s.startsWith(Testcoin_IPC_PREFIX, Qt::CaseInsensitive)) // Testcoin: URI { #if QT_VERSION < 0x050000 QUrl uri(s); #else QUrlQuery uri((QUrl(s))); #endif if (uri.hasQueryItem("r")) // payment request URI { QByteArray temp; temp.append(uri.queryItemValue("r")); QString decoded = QUrl::fromPercentEncoding(temp); QUrl fetchUrl(decoded, QUrl::StrictMode); if (fetchUrl.isValid()) { qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")"; fetchRequest(fetchUrl); } else { qWarning() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl; emit message(tr("URI handling"), tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()), CClientUIInterface::ICON_WARNING); } return; } else // normal URI { SendCoinsRecipient recipient; if (GUIUtil::parseTestcoinURI(s, &recipient)) { CTestcoinAddress address(recipient.address.toStdString()); if (!address.IsValid()) { emit message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address), CClientUIInterface::MSG_ERROR); } else emit receivedPaymentRequest(recipient); } else emit message(tr("URI handling"), tr("URI cannot be parsed! This can be caused by an invalid Testcoin address or malformed URI parameters."), CClientUIInterface::ICON_WARNING); return; } } if (QFile::exists(s)) // payment request file { PaymentRequestPlus request; SendCoinsRecipient recipient; if (!readPaymentRequestFromFile(s, request)) { emit message(tr("Payment request file handling"), tr("Payment request file cannot be read! This can be caused by an invalid payment request file."), CClientUIInterface::ICON_WARNING); } else if (processPaymentRequest(request, recipient)) emit receivedPaymentRequest(recipient); return; } } void PaymentServer::handleURIConnection() { QLocalSocket *clientConnection = uriServer->nextPendingConnection(); while (clientConnection->bytesAvailable() < (int)sizeof(quint32)) clientConnection->waitForReadyRead(); connect(clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater())); QDataStream in(clientConnection); in.setVersion(QDataStream::Qt_4_0); if (clientConnection->bytesAvailable() < (int)sizeof(quint16)) { return; } QString msg; in >> msg; handleURIOrFile(msg); } // // Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine() // so don't use "emit message()", but "QMessageBox::"! // bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request) { QFile f(filename); if (!f.open(QIODevice::ReadOnly)) { qWarning() << QString("PaymentServer::%1: Failed to open %2").arg(__func__).arg(filename); return false; } // BIP70 DoS protection if (f.size() > BIP70_MAX_PAYMENTREQUEST_SIZE) { qWarning() << QString("PaymentServer::%1: Payment request %2 is too large (%3 bytes, allowed %4 bytes).") .arg(__func__) .arg(filename) .arg(f.size()) .arg(BIP70_MAX_PAYMENTREQUEST_SIZE); return false; } QByteArray data = f.readAll(); return request.parse(data); } bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient) { if (!optionsModel) return false; if (request.IsInitialized()) { const payments::PaymentDetails& details = request.getDetails(); // Payment request network matches client network? if (details.network() != Params().NetworkIDString()) { emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."), CClientUIInterface::MSG_ERROR); return false; } // Expired payment request? if (details.has_expires() && (int64_t)details.expires() < GetTime()) { emit message(tr("Payment request rejected"), tr("Payment request has expired."), CClientUIInterface::MSG_ERROR); return false; } } else { emit message(tr("Payment request error"), tr("Payment request is not initialized."), CClientUIInterface::MSG_ERROR); return false; } recipient.paymentRequest = request; recipient.message = GUIUtil::HtmlEscape(request.getDetails().memo()); request.getMerchant(PaymentServer::certStore, recipient.authenticatedMerchant); QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo(); QStringList addresses; foreach(const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) { // Extract and check destination addresses CTxDestination dest; if (ExtractDestination(sendingTo.first, dest)) { // Append destination address addresses.append(QString::fromStdString(CTestcoinAddress(dest).ToString())); } else if (!recipient.authenticatedMerchant.isEmpty()) { // Insecure payments to custom Testcoin addresses are not supported // (there is no good way to tell the user where they are paying in a way // they'd have a chance of understanding). emit message(tr("Payment request rejected"), tr("Unverified payment requests to custom payment scripts are unsupported."), CClientUIInterface::MSG_ERROR); return false; } // Extract and check amounts CTxOut txOut(sendingTo.second, sendingTo.first); if (txOut.IsDust(::minRelayTxFee)) { emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).") .arg(TestcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)), CClientUIInterface::MSG_ERROR); return false; } recipient.amount += sendingTo.second; } // Store addresses and format them to fit nicely into the GUI recipient.address = addresses.join("<br />"); if (!recipient.authenticatedMerchant.isEmpty()) { qDebug() << "PaymentServer::processPaymentRequest : Secure payment request from " << recipient.authenticatedMerchant; } else { qDebug() << "PaymentServer::processPaymentRequest : Insecure payment request to " << addresses.join(", "); } return true; } void PaymentServer::fetchRequest(const QUrl& url) { QNetworkRequest netRequest; netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTREQUEST); netRequest.setUrl(url); netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str()); netRequest.setRawHeader("Accept", BIP71_MIMETYPE_PAYMENTREQUEST); netManager->get(netRequest); } void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction) { const payments::PaymentDetails& details = recipient.paymentRequest.getDetails(); if (!details.has_payment_url()) return; QNetworkRequest netRequest; netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTACK); netRequest.setUrl(QString::fromStdString(details.payment_url())); netRequest.setHeader(QNetworkRequest::ContentTypeHeader, BIP71_MIMETYPE_PAYMENT); netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str()); netRequest.setRawHeader("Accept", BIP71_MIMETYPE_PAYMENTACK); payments::Payment payment; payment.set_merchant_data(details.merchant_data()); payment.add_transactions(transaction.data(), transaction.size()); // Create a new refund address, or re-use: QString account = tr("Refund from %1").arg(recipient.authenticatedMerchant); std::string strAccount = account.toStdString(); set<CTxDestination> refundAddresses = wallet->GetAccountAddresses(strAccount); if (!refundAddresses.empty()) { CScript s = GetScriptForDestination(*refundAddresses.begin()); payments::Output* refund_to = payment.add_refund_to(); refund_to->set_script(&s[0], s.size()); } else { CPubKey newKey; if (wallet->GetKeyFromPool(newKey)) { CKeyID keyID = newKey.GetID(); wallet->SetAddressBook(keyID, strAccount, "refund"); CScript s = GetScriptForDestination(keyID); payments::Output* refund_to = payment.add_refund_to(); refund_to->set_script(&s[0], s.size()); } else { // This should never happen, because sending coins should have // just unlocked the wallet and refilled the keypool. qWarning() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set"; } } int length = payment.ByteSize(); netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length); QByteArray serData(length, '\0'); if (payment.SerializeToArray(serData.data(), length)) { netManager->post(netRequest, serData); } else { // This should never happen, either. qWarning() << "PaymentServer::fetchPaymentACK : Error serializing payment message"; } } void PaymentServer::netRequestFinished(QNetworkReply* reply) { reply->deleteLater(); // BIP70 DoS protection if (reply->size() > BIP70_MAX_PAYMENTREQUEST_SIZE) { QString msg = tr("Payment request %1 is too large (%2 bytes, allowed %3 bytes).") .arg(reply->request().url().toString()) .arg(reply->size()) .arg(BIP70_MAX_PAYMENTREQUEST_SIZE); qWarning() << QString("PaymentServer::%1:").arg(__func__) << msg; emit message(tr("Payment request DoS protection"), msg, CClientUIInterface::MSG_ERROR); return; } if (reply->error() != QNetworkReply::NoError) { QString msg = tr("Error communicating with %1: %2") .arg(reply->request().url().toString()) .arg(reply->errorString()); qWarning() << "PaymentServer::netRequestFinished: " << msg; emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); return; } QByteArray data = reply->readAll(); QString requestType = reply->request().attribute(QNetworkRequest::User).toString(); if (requestType == BIP70_MESSAGE_PAYMENTREQUEST) { PaymentRequestPlus request; SendCoinsRecipient recipient; if (!request.parse(data)) { qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request"; emit message(tr("Payment request error"), tr("Payment request cannot be parsed!"), CClientUIInterface::MSG_ERROR); } else if (processPaymentRequest(request, recipient)) emit receivedPaymentRequest(recipient); return; } else if (requestType == BIP70_MESSAGE_PAYMENTACK) { payments::PaymentACK paymentACK; if (!paymentACK.ParseFromArray(data.data(), data.size())) { QString msg = tr("Bad response from server %1") .arg(reply->request().url().toString()); qWarning() << "PaymentServer::netRequestFinished : " << msg; emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR); } else { emit receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo())); } } } void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError> &errs) { Q_UNUSED(reply); QString errString; foreach (const QSslError& err, errs) { qWarning() << "PaymentServer::reportSslErrors : " << err; errString += err.errorString() + "\n"; } emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR); } void PaymentServer::setOptionsModel(OptionsModel *optionsModel) { this->optionsModel = optionsModel; } void PaymentServer::handlePaymentACK(const QString& paymentACKMsg) { // currently we don't futher process or store the paymentACK message emit message(tr("Payment acknowledged"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL); }
L5hunter/TestCoin
src/qt/paymentserver.cpp
C++
mit
24,957
<div class="page-actions"> <!-- AUDIO CONTAINER (conditional) --> <?php if ($page->episode_file()->isNotEmpty()) { ?> <div class="audio-holder" itemprop="audio"> <audio preload="none" controls> <source src="/podcasts/<?php echo $page->episode_file() ?>" type="audio/mpeg" /> </audio> </div> <?php } ?> <!-- DOWNLOAD FILE --> <?php if ($page->episode_file() != ""): ?> <a itemprop="audio" class="action download" href="<?= $site->url(); ?>/podcasts/<?php echo $page->episode_file() ?>" download title="Download episode"> <svg viewBox="0 0 100 100"> <path d="M81.2 49.4c0 7.7-6.3 13.9-13.9 13.9h-5.6v-6.1h5.6c4.4 0 7.9-3.6 7.9-7.9 0-5.4-3.6-8.2-7.5-8.2-.2-9-6.1-12.9-11.9-12.9-7.6 0-10.8 5.8-11.5 8-3.1-4.5-11.5-1.1-9.8 4.9-5.3-.9-9.4 3-9.4 8.2 0 4.4 3.6 7.9 8.1 7.9h7.7v6.1h-7.7C25.3 63.3 19 57 19 49.4c0-6.3 4.2-11.7 10-13.4 1.6-5.6 7.5-8.9 13.1-7.4 3.4-4 8.3-6.3 13.6-6.3 8.6 0 16 6.2 17.5 14.5 4.9 2.3 8 7.1 8 12.6zM62.3 68.8h-5.1V57.3H45.1v11.5H40L51.1 80l11.2-11.2z"/> </svg> <span class="label go-right">Download this episode</span> </a> <?php endif; ?> <!-- READ DOCUMENT --> <?php if ($page->document_link() != ""): ?> <a itemprop="citation" class="action read" href="<?php echo $page->document_link() ?>" title="Read <?php echo $page->provider() ?>'s document" target="_blank"> <svg viewBox="0 0 100 100"> <path d="M65.3 57H44.2v-4.6h21l.1 4.6zm0-10H44.2v-4.6h21l.1 4.6zm0-10H44.2v-4.6h21l.1 4.6zM29.1 75.3V24.4h42.8v33.4c0 9.7-11.9 5.8-11.9 5.8s3.6 11.7-5.4 11.7H29.1zM78 58.4V18.3H23v63.1h31.7c10.4 0 23.3-13.6 23.3-23zM37.8 32c-1.5 0-2.7 1.2-2.7 2.7 0 1.5 1.2 2.7 2.7 2.7s2.7-1.2 2.7-2.7c-.1-1.5-1.3-2.7-2.7-2.7zm0 10.1c-1.5 0-2.7 1.2-2.7 2.7 0 1.5 1.2 2.7 2.7 2.7s2.7-1.2 2.7-2.7c-.1-1.5-1.3-2.7-2.7-2.7zm0 9.9c-1.5 0-2.7 1.2-2.7 2.7 0 1.5 1.2 2.7 2.7 2.7s2.7-1.2 2.7-2.7c-.1-1.5-1.3-2.7-2.7-2.7z"/> </svg> <span class="label go-right">Read <?php echo $page->provider() ?>'s document</span> </a> <?php endif ?> <!-- Contribute To The F Plus --> <a class="social contribute" href="/contribute/" title="Contribute To The Podcast"> <svg viewBox="0 0 100 100"> <path d="M50.6 28.3l10.2-3.6L50 20.9l-10.7 3.7M32 36v-1.2l2.3-.7 9.5-3.4L32.7 27l-11.8 4.1v8.2L32 43.6M67.5 27l-9.7 3.6 8.9 2.9 3 1v7.6l9.4-4.1v-6.9M62.1 36.9L51 33.1l-11.4 4.2v9.2l10.4 4 12.1-5.2"/> <path d="M60.9 47.4L50 52.2l-9.2-3.6v24.9l9.2 5.6L60.9 72M33.2 45.6l-10.9-4.2v21L33.2 69M68.5 44v23.1l9.2-6V39.9" /> </svg> <span class="label">Contribute to the Podcast</span> </a> <!-- TWEET THIS --> <a class="social twitter" href="https://twitter.com/intent/tweet?text=<?php echo rawurlencode($page->title()); ?>%0A&url=<?php echo rawurlencode($page->url()); ?>&via=TheFPlus" target="_blank" title="Tweet this"> <svg viewBox="0 0 100 100"> <path d="M80.2 30.5c-2.3 1-4.8 1.8-7.4 2 2.6-1.6 4.7-4.1 5.7-7.1-2.5 1.5-5.2 2.6-8.2 3.2-2.3-2.5-5.7-4.1-9.5-4.1-7.1 0-13 5.8-13 13 0 1 .1 2 .3 2.9-10.8-.6-20.3-5.7-26.7-13.6-1.2 1.9-1.8 4.1-1.8 6.6 0 4.5 2.3 8.5 5.8 10.8-2 0-4.1-.7-5.8-1.6v.1c0 6.3 4.5 11.5 10.4 12.7-1.2.3-2.2.4-3.4.4-.9 0-1.6 0-2.5-.3 1.6 5.1 6.4 8.9 12.1 9-4.5 3.5-10.1 5.5-16 5.5-1 0-2 0-3.1-.1 5.7 3.7 12.6 5.8 20 5.8C61 75.7 74 55.9 74 38.8V37c2.3-1.6 4.5-4 6.2-6.5z"/> </svg> <span class="label">Tweet this episode</span> </a> <!-- FACEBOOK SHARE --> <a class="social facebook" href="https://www.facebook.com/sharer.php?u=<?php echo rawurlencode ($page->url()); ?>" title="Share on Facebook"> <svg viewBox="0 0 100 100"> <path d="M76.8 18.3H21.9c-1.9 0-3.4 1.5-3.4 3.4v54.9c0 1.9 1.5 3.4 3.4 3.4h29.5V56.1h-8v-9.3h8V40c0-7.9 4.9-12.3 12-12.3 3.4 0 6.3.3 7.2.4v8.3h-4.9c-3.9 0-4.6 1.8-4.6 4.5v6h9.2L69 56.3h-7.9v23.9h15.7c1.9 0 3.4-1.5 3.4-3.4v-55c0-1.9-1.5-3.5-3.4-3.5z"/> </svg> <span class="label">Share on Facebook</span> </a> <!-- REDDIT SHARE --> <a class="social reddit" href="https://reddit.com/submit/?<?php echo rawurlencode ($page->url()); ?>" target="_blank" title="Share on Reddit"> <svg viewBox="0 0 100 100"> <path d="M82.7 47.1c0-4.7-3.8-8.5-8.5-8.5-2.7 0-5.3 1.4-6.9 3.5-4.7-2.9-10.6-4.7-17.2-4.9.2-3.2 1.1-8.7 4.3-10.5 2-1.2 4.9-.7 8.6 1.4.4 4.3 4 7.6 8.4 7.6 4.7 0 8.5-3.8 8.5-8.5s-3.8-8.5-8.5-8.5c-3.9 0-7.2 2.7-8.2 6.3-4.1-2-7.5-2.3-10.2-.7-4.7 2.7-5.5 9.9-5.7 12.9-6.6.2-12.6 2-17.3 4.9-1.6-2.2-4.1-3.5-6.9-3.5-4.7 0-8.5 3.8-8.5 8.5 0 3.7 2.4 6.9 5.8 8.1-.1.6-.1 1.2-.1 1.9C20.3 68.1 33 77 48.7 77S77 68 77 57c0-.6-.1-1.3-.1-1.9 3.4-1.1 5.8-4.3 5.8-8zM21 52.4c-2.2-.8-3.7-2.9-3.7-5.3 0-3.1 2.5-5.7 5.7-5.7 1.8 0 3.5.9 4.5 2.3-3.1 2.4-5.4 5.4-6.5 8.7zm10.6.4c0-3.1 2.5-5.7 5.7-5.7 3.1 0 5.7 2.5 5.7 5.7s-2.5 5.7-5.7 5.7-5.7-2.6-5.7-5.7zm27.8 13.6c-3 1.7-6.8 2.7-10.8 2.7-3.9 0-7.8-1-10.8-2.7-.7-.4-.9-1.3-.5-1.9.4-.7 1.3-.9 1.9-.5 5.2 3 13.5 3 18.7 0 .7-.4 1.5-.2 1.9.5.5.7.2 1.5-.4 1.9zm.6-8c-3.1 0-5.7-2.5-5.7-5.7S56.8 47 60 47c3.1 0 5.7 2.5 5.7 5.7s-2.6 5.7-5.7 5.7zm16.2-6c-1.1-3.3-3.4-6.2-6.5-8.7 1.1-1.4 2.7-2.3 4.5-2.3 3.1 0 5.7 2.5 5.7 5.7 0 2.4-1.6 4.4-3.7 5.3z" /> </svg> <span class="label">Share on Reddit</span> </a> <!-- TUMBLR SHARE --> <a class="social tumblr" href="http://www.tumblr.com/share/link?url=<?php echo rawurlencode ($page->url()); ?>&amp;name=<?php echo rawurlencode ($page->title()); ?>&amp;description=<?php echo excerpt($page->text()->xml(), 180) ?>"> <svg viewBox="0 0 100 100"> <path d="M57.3 81.4c6.5 0 13-2.3 15.1-5.1l.4-.6-4-12c0-.1-.1-.2-.3-.2h-9c-.1 0-.2-.1-.3-.2-.1-.4-.2-.9-.2-1.5V47.2c0-.2.1-.3.3-.3H70c.2 0 .3-.1.3-.3v-15c0-.2-.1-.3-.3-.3H59.4c-.2 0-.3-.1-.3-.3V16.5c0-.2-.1-.3-.3-.3H40.2c-1.3 0-2.9 1-3.1 2.8-.9 7.5-4.4 12.1-10.9 14.2l-.7.2c-.1 0-.2.1-.2.3v12.9c0 .2.1.3.3.3H32.3v15.9c0 12.7 8.8 18.6 25 18.6zm12.4-6.1c-2 2-6.2 3.4-10.2 3.5h-.4c-13.2 0-16.7-10.1-16.7-16V44.6c0-.2-.1-.3-.3-.3h-6.4c-.2 0-.3-.1-.3-.3v-8.3c0-.1.1-.2.2-.3 6.8-2.6 10.6-7.9 11.6-16.1.1-.5.4-.5.4-.5h8.5c.2 0 .3.1.3.3v14.6c0 .2.1.3.3.3h10.6c.2 0 .3.1.3.3V44c0 .2-.1.3-.3.3H56.7c-.2 0-.3.1-.3.3v17.3c.1 3.9 2 5.9 5.6 5.9 1.5 0 3.2-.3 4.7-.9.1-.1.3 0 .4.2l2.7 8s0 .1-.1.2z" /> </svg> <span class="label">Post to Tumblr</span> </a> <!-- Save To Pocket --> <?php if ($page->episode_file()->isEmpty()) { ?> <a class="social pocket" href="https://getpocket.com/edit?url=<?=rawurlencode ($page->url()); ?>"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <path d="M67.1 47.8L53.2 61.2c-.8.8-1.8 1.1-2.8 1.1-1 0-2-.4-2.8-1.1l-14-13.4c-1.6-1.5-1.7-4.1-.1-5.7 1.6-1.6 4.1-1.7 5.7-.1l11.1 10.7L61.4 42c1.6-1.6 4.2-1.5 5.7.1 1.7 1.6 1.7 4.1 0 5.7zm12.5-18.6c-.7-2.1-2.8-3.5-5-3.5H26.1c-2.2 0-4.2 1.4-5 3.5-.2.6-.3 1.3-.3 1.9V49l.2 3.6c.9 8.1 5 15.1 11.5 20.1.1.1.2.2.4.3l.1.1c3.5 2.5 7.4 4.3 11.6 5.1 1.9.4 3.9.6 5.9.6 1.8 0 3.7-.2 5.4-.5.2-.1.4-.1.7-.1.1 0 .1 0 .2-.1 4-.9 7.8-2.6 11.1-5l.1-.1.3-.3c6.5-4.9 10.7-12 11.5-20.1L80 49V31c-.1-.6-.2-1.2-.4-1.8z" /> </svg> <span class="label">Save to Pocket</span> </a> <?php } ?> <!-- GitHub Repo --> <?php if ($page->github_repo()->isNotEmpty()) { ?> <a class="social github" href="<?= $page->github_repo(); ?>" title="Fork on GitHub"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <path d="M50 15.3c-19 0-34.3 15.4-34.3 34.3 0 15.2 9.8 28 23.5 32.6 1.7.3 2.3-.7 2.3-1.7v-5.8c-9.5 2.1-11.6-4.6-11.6-4.6-1.6-4-3.8-5-3.8-5-3.1-2.1.2-2.1.2-2.1 3.4.2 5.3 3.5 5.3 3.5 3.1 5.2 8 3.7 10 2.9.3-2.2 1.2-3.7 2.2-4.6-7.6-.9-15.6-3.8-15.6-17 0-3.7 1.3-6.8 3.5-9.2-.4-.9-1.5-4.4.3-9.1 0 0 2.9-.9 9.4 3.5 2.7-.8 5.7-1.1 8.6-1.2 2.9 0 5.9.4 8.6 1.2 6.6-4.4 9.4-3.5 9.4-3.5 1.9 4.7.7 8.2.3 9.1 2.2 2.4 3.5 5.5 3.5 9.2 0 13.2-8 16.1-15.7 16.9 1.2 1.1 2.3 3.2 2.3 6.4v9.4c0 .9.6 2 2.4 1.7 13.6-4.5 23.5-17.4 23.5-32.6C84.3 30.7 69 15.3 50 15.3z"/> </svg> <span class="label">Fork on GitHub</span> </a> <?php } ?> </div>
AhoyLemon/TheFPlus
site/snippets/page-actions.php
PHP
mit
7,943
When /(.*) should receive: (.*) email/ do |email, preference_list| u = User.find_by(email:email) print(u) preference_list.split(",").each do |p| if p[1,p.length-2] == "internal" expect(u.internal).to be(false) end end end When /I should see correct flash message "([^"]*)"$/ do |message| expect(page).to have_css('flashNotice',text: message) end #New tests for iter 2-1 Then /I should receive an email/ do pending end Then /I should see title "([^"]*)"$/ do |title| pending end Then /I should see content "([^"]*)"$/ do |content| pending end Then /the database should( not)? have email with title "([^"]*)" and content "([^"]*)"$/ do |title, content| pending end #New Tests for iter 2-2 Then /I should see a MailRecord object with attribute "([^"]*)" and description "([^"]*)"$/ do |attr, desc| MailRecord.where.not(attr, nil).find_by(description: desc) end
hsp1324/communitygrows
features/step_definitions/email_digest_steps.rb
Ruby
mit
884
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test addressindex generation and fetching # import binascii from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut from test_framework.test_framework import BitcoinTestFramework from test_framework.test_node import ErrorMatch from test_framework.script import CScript, OP_CHECKSIG, OP_DUP, OP_EQUAL, OP_EQUALVERIFY, OP_HASH160 from test_framework.util import assert_equal, connect_nodes class AddressIndexTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 4 def skip_test_if_missing_module(self): self.skip_if_no_wallet() def setup_network(self): self.add_nodes(self.num_nodes) # Nodes 0/1 are "wallet" nodes self.start_node(0, []) self.start_node(1, ["-addressindex"]) # Nodes 2/3 are used for testing self.start_node(2, ["-addressindex"]) self.start_node(3, ["-addressindex"]) connect_nodes(self.nodes[0], 1) connect_nodes(self.nodes[0], 2) connect_nodes(self.nodes[0], 3) self.sync_all() def run_test(self): self.log.info("Test that settings can't be changed without -reindex...") self.stop_node(1) self.nodes[1].assert_start_raises_init_error(["-addressindex=0"], "You need to rebuild the database using -reindex to change -addressindex", match=ErrorMatch.PARTIAL_REGEX) self.start_node(1, ["-addressindex=0", "-reindex"]) connect_nodes(self.nodes[0], 1) self.sync_all() self.stop_node(1) self.nodes[1].assert_start_raises_init_error(["-addressindex"], "You need to rebuild the database using -reindex to change -addressindex", match=ErrorMatch.PARTIAL_REGEX) self.start_node(1, ["-addressindex", "-reindex"]) connect_nodes(self.nodes[0], 1) self.sync_all() self.log.info("Mining blocks...") mining_address = self.nodes[0].getnewaddress() self.nodes[0].generatetoaddress(105, mining_address) self.sync_all() chain_height = self.nodes[1].getblockcount() assert_equal(chain_height, 105) assert_equal(self.nodes[1].getbalance(), 0) assert_equal(self.nodes[2].getbalance(), 0) # Check that balances are correct balance0 = self.nodes[1].getaddressbalance("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB") balance_mining = self.nodes[1].getaddressbalance(mining_address) assert_equal(balance0["balance"], 0) assert_equal(balance_mining["balance"], 105 * 500 * COIN) assert_equal(balance_mining["balance_immature"], 100 * 500 * COIN) assert_equal(balance_mining["balance_spendable"], 5 * 500 * COIN) # Check p2pkh and p2sh address indexes self.log.info("Testing p2pkh and p2sh address index...") txid0 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 10) self.nodes[0].generate(1) txidb0 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 10) self.nodes[0].generate(1) txid1 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 15) self.nodes[0].generate(1) txidb1 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 15) self.nodes[0].generate(1) txid2 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 20) self.nodes[0].generate(1) txidb2 = self.nodes[0].sendtoaddress("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", 20) self.nodes[0].generate(1) self.sync_all() txids = self.nodes[1].getaddresstxids("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4") assert_equal(len(txids), 3) assert_equal(txids[0], txid0) assert_equal(txids[1], txid1) assert_equal(txids[2], txid2) txidsb = self.nodes[1].getaddresstxids("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB") assert_equal(len(txidsb), 3) assert_equal(txidsb[0], txidb0) assert_equal(txidsb[1], txidb1) assert_equal(txidsb[2], txidb2) # Check that limiting by height works self.log.info("Testing querying txids by range of block heights..") height_txids = self.nodes[1].getaddresstxids({ "addresses": ["93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB"], "start": 105, "end": 110 }) assert_equal(len(height_txids), 2) assert_equal(height_txids[0], txidb0) assert_equal(height_txids[1], txidb1) # Check that multiple addresses works multitxids = self.nodes[1].getaddresstxids({"addresses": ["93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB", "yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4"]}) assert_equal(len(multitxids), 6) assert_equal(multitxids[0], txid0) assert_equal(multitxids[1], txidb0) assert_equal(multitxids[2], txid1) assert_equal(multitxids[3], txidb1) assert_equal(multitxids[4], txid2) assert_equal(multitxids[5], txidb2) # Check that balances are correct balance0 = self.nodes[1].getaddressbalance("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB") assert_equal(balance0["balance"], 45 * 100000000) # Check that outputs with the same address will only return one txid self.log.info("Testing for txid uniqueness...") addressHash = binascii.unhexlify("FE30B718DCF0BF8A2A686BF1820C073F8B2C3B37") scriptPubKey = CScript([OP_HASH160, addressHash, OP_EQUAL]) unspent = self.nodes[0].listunspent() tx = CTransaction() tx.vin = [CTxIn(COutPoint(int(unspent[0]["txid"], 16), unspent[0]["vout"]))] tx.vout = [CTxOut(10 * COIN, scriptPubKey), CTxOut(11 * COIN, scriptPubKey)] tx.rehash() signed_tx = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex()) sent_txid = self.nodes[0].sendrawtransaction(signed_tx["hex"], 0) self.nodes[0].generate(1) self.sync_all() txidsmany = self.nodes[1].getaddresstxids("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB") assert_equal(len(txidsmany), 4) assert_equal(txidsmany[3], sent_txid) # Check that balances are correct self.log.info("Testing balances...") balance0 = self.nodes[1].getaddressbalance("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB") assert_equal(balance0["balance"], (45 + 21) * 100000000) # Check that balances are correct after spending self.log.info("Testing balances after spending...") privkey2 = "cU4zhap7nPJAWeMFu4j6jLrfPmqakDAzy8zn8Fhb3oEevdm4e5Lc" address2 = "yeMpGzMj3rhtnz48XsfpB8itPHhHtgxLc3" addressHash2 = binascii.unhexlify("C5E4FB9171C22409809A3E8047A29C83886E325D") scriptPubKey2 = CScript([OP_DUP, OP_HASH160, addressHash2, OP_EQUALVERIFY, OP_CHECKSIG]) self.nodes[0].importprivkey(privkey2) unspent = self.nodes[0].listunspent() tx = CTransaction() tx_fee_sat = 1000 tx.vin = [CTxIn(COutPoint(int(unspent[0]["txid"], 16), unspent[0]["vout"]))] amount = int(unspent[0]["amount"] * 100000000) - tx_fee_sat tx.vout = [CTxOut(amount, scriptPubKey2)] tx.rehash() signed_tx = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex()) spending_txid = self.nodes[0].sendrawtransaction(signed_tx["hex"], 0) self.nodes[0].generate(1) self.sync_all() balance1 = self.nodes[1].getaddressbalance(address2) assert_equal(balance1["balance"], amount) tx = CTransaction() tx.vin = [CTxIn(COutPoint(int(spending_txid, 16), 0))] send_amount = 1 * 100000000 + 12840 change_amount = amount - send_amount - 10000 tx.vout = [CTxOut(change_amount, scriptPubKey2), CTxOut(send_amount, scriptPubKey)] tx.rehash() signed_tx = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex()) sent_txid = self.nodes[0].sendrawtransaction(signed_tx["hex"], 0) self.nodes[0].generate(1) self.sync_all() balance2 = self.nodes[1].getaddressbalance(address2) assert_equal(balance2["balance"], change_amount) # Check that deltas are returned correctly deltas = self.nodes[1].getaddressdeltas({"addresses": [address2], "start": 0, "end": 200}) balance3 = 0 for delta in deltas: balance3 += delta["satoshis"] assert_equal(balance3, change_amount) assert_equal(deltas[0]["address"], address2) assert_equal(deltas[0]["blockindex"], 1) # Check that entire range will be queried deltasAll = self.nodes[1].getaddressdeltas({"addresses": [address2]}) assert_equal(len(deltasAll), len(deltas)) # Check that deltas can be returned from range of block heights deltas = self.nodes[1].getaddressdeltas({"addresses": [address2], "start": 113, "end": 113}) assert_equal(len(deltas), 1) # Check that unspent outputs can be queried self.log.info("Testing utxos...") utxos = self.nodes[1].getaddressutxos({"addresses": [address2]}) assert_equal(len(utxos), 1) assert_equal(utxos[0]["satoshis"], change_amount) # Check that indexes will be updated with a reorg self.log.info("Testing reorg...") best_hash = self.nodes[0].getbestblockhash() self.nodes[0].invalidateblock(best_hash) self.nodes[1].invalidateblock(best_hash) self.nodes[2].invalidateblock(best_hash) self.nodes[3].invalidateblock(best_hash) # Allow some time for the reorg to start self.bump_mocktime(2) self.sync_all() balance4 = self.nodes[1].getaddressbalance(address2) assert_equal(balance4, balance1) utxos2 = self.nodes[1].getaddressutxos({"addresses": [address2]}) assert_equal(len(utxos2), 1) assert_equal(utxos2[0]["satoshis"], amount) # Check sorting of utxos self.nodes[2].generate(150) self.nodes[2].sendtoaddress(address2, 50) self.nodes[2].generate(1) self.nodes[2].sendtoaddress(address2, 50) self.nodes[2].generate(1) self.sync_all() utxos3 = self.nodes[1].getaddressutxos({"addresses": [address2]}) assert_equal(len(utxos3), 3) assert_equal(utxos3[0]["height"], 114) assert_equal(utxos3[1]["height"], 264) assert_equal(utxos3[2]["height"], 265) # Check mempool indexing self.log.info("Testing mempool indexing...") privKey3 = "cRyrMvvqi1dmpiCmjmmATqjAwo6Wu7QTjKu1ABMYW5aFG4VXW99K" address3 = "yWB15aAdpeKuSaQHFVJpBDPbNSLZJSnDLA" addressHash3 = binascii.unhexlify("6C186B3A308A77C779A9BB71C3B5A7EC28232A13") scriptPubKey3 = CScript([OP_DUP, OP_HASH160, addressHash3, OP_EQUALVERIFY, OP_CHECKSIG]) # address4 = "2N8oFVB2vThAKury4vnLquW2zVjsYjjAkYQ" scriptPubKey4 = CScript([OP_HASH160, addressHash3, OP_EQUAL]) unspent = self.nodes[2].listunspent() tx = CTransaction() tx.vin = [CTxIn(COutPoint(int(unspent[0]["txid"], 16), unspent[0]["vout"]))] amount = int(unspent[0]["amount"] * 100000000) - tx_fee_sat tx.vout = [CTxOut(amount, scriptPubKey3)] tx.rehash() signed_tx = self.nodes[2].signrawtransactionwithwallet(tx.serialize().hex()) memtxid1 = self.nodes[2].sendrawtransaction(signed_tx["hex"], 0) self.bump_mocktime(2) tx2 = CTransaction() tx2.vin = [CTxIn(COutPoint(int(unspent[1]["txid"], 16), unspent[1]["vout"]))] amount = int(unspent[1]["amount"] * 100000000) - tx_fee_sat tx2.vout = [ CTxOut(int(amount / 4), scriptPubKey3), CTxOut(int(amount / 4), scriptPubKey3), CTxOut(int(amount / 4), scriptPubKey4), CTxOut(int(amount / 4), scriptPubKey4) ] tx2.rehash() signed_tx2 = self.nodes[2].signrawtransactionwithwallet(tx2.serialize().hex()) memtxid2 = self.nodes[2].sendrawtransaction(signed_tx2["hex"], 0) self.bump_mocktime(2) mempool = self.nodes[2].getaddressmempool({"addresses": [address3]}) assert_equal(len(mempool), 3) assert_equal(mempool[0]["txid"], memtxid1) assert_equal(mempool[0]["address"], address3) assert_equal(mempool[0]["index"], 0) assert_equal(mempool[1]["txid"], memtxid2) assert_equal(mempool[1]["index"], 0) assert_equal(mempool[2]["txid"], memtxid2) assert_equal(mempool[2]["index"], 1) self.nodes[2].generate(1) self.sync_all() mempool2 = self.nodes[2].getaddressmempool({"addresses": [address3]}) assert_equal(len(mempool2), 0) tx = CTransaction() tx.vin = [ CTxIn(COutPoint(int(memtxid2, 16), 0)), CTxIn(COutPoint(int(memtxid2, 16), 1)) ] tx.vout = [CTxOut(int(amount / 2 - 10000), scriptPubKey2)] tx.rehash() self.nodes[2].importprivkey(privKey3) signed_tx3 = self.nodes[2].signrawtransactionwithwallet(tx.serialize().hex()) self.nodes[2].sendrawtransaction(signed_tx3["hex"], 0) self.bump_mocktime(2) mempool3 = self.nodes[2].getaddressmempool({"addresses": [address3]}) assert_equal(len(mempool3), 2) assert_equal(mempool3[0]["prevtxid"], memtxid2) assert_equal(mempool3[0]["prevout"], 0) assert_equal(mempool3[1]["prevtxid"], memtxid2) assert_equal(mempool3[1]["prevout"], 1) # sending and receiving to the same address privkey1 = "cMvZn1pVWntTEcsK36ZteGQXRAcZ8CoTbMXF1QasxBLdnTwyVQCc" address1 = "yM9Eed1bxjy7tYxD3yZDHxjcVT48WdRoB1" address1hash = binascii.unhexlify("0909C84A817651502E020AAD0FBCAE5F656E7D8A") address1script = CScript([OP_DUP, OP_HASH160, address1hash, OP_EQUALVERIFY, OP_CHECKSIG]) self.nodes[0].sendtoaddress(address1, 10) self.nodes[0].generate(1) self.sync_all() utxos = self.nodes[1].getaddressutxos({"addresses": [address1]}) assert_equal(len(utxos), 1) tx = CTransaction() tx.vin = [ CTxIn(COutPoint(int(utxos[0]["txid"], 16), utxos[0]["outputIndex"])) ] amount = int(utxos[0]["satoshis"] - 10000) tx.vout = [CTxOut(amount, address1script)] tx.rehash() self.nodes[0].importprivkey(privkey1) signed_tx = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex()) self.nodes[0].sendrawtransaction(signed_tx["hex"], 0) self.sync_all() mempool_deltas = self.nodes[2].getaddressmempool({"addresses": [address1]}) assert_equal(len(mempool_deltas), 2) self.log.info("Passed") if __name__ == '__main__': AddressIndexTest().main()
thelazier/dash
test/functional/feature_addressindex.py
Python
mit
15,001
# mybot Sample robocode robot
mseminatore/mybot
README.md
Markdown
mit
30
import xml.etree.ElementTree as ET import numpy as np import openmc import pytest from tests.unit_tests import assert_unbounded def test_basic(): c1 = openmc.Cell() c2 = openmc.Cell() c3 = openmc.Cell() u = openmc.Universe(name='cool', cells=(c1, c2, c3)) assert u.name == 'cool' cells = set(u.cells.values()) assert not (cells ^ {c1, c2, c3}) # Test __repr__ repr(u) with pytest.raises(TypeError): u.add_cell(openmc.Material()) with pytest.raises(TypeError): u.add_cells(c1) u.remove_cell(c3) cells = set(u.cells.values()) assert not (cells ^ {c1, c2}) u.clear_cells() assert not set(u.cells) def test_bounding_box(): cyl1 = openmc.ZCylinder(r=1.0) cyl2 = openmc.ZCylinder(r=2.0) c1 = openmc.Cell(region=-cyl1) c2 = openmc.Cell(region=+cyl1 & -cyl2) u = openmc.Universe(cells=[c1, c2]) ll, ur = u.bounding_box assert ll == pytest.approx((-2., -2., -np.inf)) assert ur == pytest.approx((2., 2., np.inf)) u = openmc.Universe() assert_unbounded(u) def test_plot(run_in_tmpdir, sphere_model): m = sphere_model.materials[0] univ = sphere_model.geometry.root_universe colors = {m: 'limegreen'} for basis in ('xy', 'yz', 'xz'): univ.plot( basis=basis, pixels=(10, 10), color_by='material', colors=colors, ) def test_get_nuclides(uo2): c = openmc.Cell(fill=uo2) univ = openmc.Universe(cells=[c]) nucs = univ.get_nuclides() assert nucs == ['U235', 'O16'] def test_cells(): cells = [openmc.Cell() for i in range(5)] cells2 = [openmc.Cell() for i in range(3)] cells[0].fill = openmc.Universe(cells=cells2) u = openmc.Universe(cells=cells) assert not (set(u.cells.values()) ^ set(cells)) all_cells = set(u.get_all_cells().values()) assert not (all_cells ^ set(cells + cells2)) def test_get_all_materials(cell_with_lattice): cells, mats, univ, lattice = cell_with_lattice test_mats = set(univ.get_all_materials().values()) assert not (test_mats ^ set(mats)) def test_get_all_universes(): c1 = openmc.Cell() u1 = openmc.Universe(cells=[c1]) c2 = openmc.Cell() u2 = openmc.Universe(cells=[c2]) c3 = openmc.Cell(fill=u1) c4 = openmc.Cell(fill=u2) u3 = openmc.Universe(cells=[c3, c4]) univs = set(u3.get_all_universes().values()) assert not (univs ^ {u1, u2}) def test_create_xml(cell_with_lattice): cells = [openmc.Cell() for i in range(5)] u = openmc.Universe(cells=cells) geom = ET.Element('geom') u.create_xml_subelement(geom) cell_elems = geom.findall('cell') assert len(cell_elems) == len(cells) assert all(c.get('universe') == str(u.id) for c in cell_elems) assert not (set(c.get('id') for c in cell_elems) ^ set(str(c.id) for c in cells))
wbinventor/openmc
tests/unit_tests/test_universe.py
Python
mit
2,900
HOSTING — 1. PUSH FILES TO GITHUB — Before we can set up a the hosting side of things we need to make sure out github is up to date! — As you remember in steps one and two we set up the git repo and connected it to our github repo. — lets push our files up to that repo: —first initiate push by typing in the terminal: git add . (screen shot of git add .) —then asign a commit log by typing in the terminal: git commit -m “first commit” (screen shot of git commit) —then push it by typing in the terminal: git push master origin (screen shot of push) — your now pushed up to the repo 2. SSH INTO THE SERVER — Next we will need to SSH into the server, so open up a new terminal window. — in the terminal type: ssh root@yourserveraddress — type in your password 3. CLONE GITHUB REPO — Now that we are in the server we need to clone our repo over so that we have all the files. — go to your github page and find the directory address and copy it. — in the Server Terminal type: git clone directoryAddress — once it has cloned, type in ls in the command line and press enter. This should show you if it is in the directory. cd into the folder. 4. RUN NODE.JS FILE — Now that we have our file all set up we need to start our server, run your node file just like you did in step 6. if you need help or reference, here is a link back the step. — Now open up a new terminal and ssh into your server again using #2 in this step. 5. HTTP-SERVER — Once you have your second terminal open and your ssh’d in, its time to start up your server. — In the terminal type in: http-server -p80 — this should start the server and allow you to go to the server address and see your chat app up and running. The -p80 at the end allows you to not have to have a subdomain and make a clean and tidy server address. If any errors occur you can see them on the terminal where you are running the node file and also in the client side browser in the developer tools. 6. SHUTTING DOWN THE SERVER — when you are done or need to fix a bug, press CONTROL + C at anytime to shut the server down. you will need to shut the node file down as well. — then you will fix changes locally, then push up to github. — once they are pushed go into the ssh terminal and you will need to pull the files up. — to do this type in the terminal: git pull master origin — now repeat the steps in #4 and #5.
DavideDaniel/chatAppTutorial
md/Hosting.md
Markdown
mit
2,449
///////////////////////////////////////////////////////////////////////////// // Name: wx/gtk/slider.h // Purpose: // Author: Robert Roebling // Id: $Id: slider.h,v 1.20 2005/08/02 22:57:57 MW Exp $ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKSLIDERH__ #define __GTKSLIDERH__ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface #endif // ---------------------------------------------------------------------------- // wxSlider // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase { public: wxSlider() { } wxSlider(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr) { Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name ); } bool Create(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr); // implement the base class pure virtuals virtual int GetValue() const; virtual void SetValue(int value); virtual void SetRange(int minValue, int maxValue); virtual int GetMin() const; virtual int GetMax() const; virtual void SetLineSize(int lineSize); virtual void SetPageSize(int pageSize); virtual int GetLineSize() const; virtual int GetPageSize() const; virtual void SetThumbLength(int lenPixels); virtual int GetThumbLength() const; static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); // implementation bool IsOwnGtkWindow( GdkWindow *window ); void GtkDisableEvents(); void GtkEnableEvents(); GtkAdjustment *m_adjust; float m_oldPos; private: DECLARE_DYNAMIC_CLASS(wxSlider) }; #endif // __GTKSLIDERH__
SickheadGames/Torsion
code/wxWidgets/include/wx/gtk/slider.h
C
mit
2,514
<?php namespace Braintree\Error; /** * * Validation Error codes and messages * * ErrorCodes class provides constants for validation errors. * The constants should be used to check for a specific validation * error in a ValidationErrorCollection. * The error messages returned from the server may change; * but the codes will remain the same. * * @package Braintree * @subpackage Errors * @category Validation */ class Codes { const ADDRESS_CANNOT_BE_BLANK = '81801'; const ADDRESS_COMPANY_IS_INVALID = '91821'; const ADDRESS_COMPANY_IS_TOO_LONG = '81802'; const ADDRESS_COUNTRY_CODE_ALPHA2_IS_NOT_ACCEPTED = '91814'; const ADDRESS_COUNTRY_CODE_ALPHA3_IS_NOT_ACCEPTED = '91816'; const ADDRESS_COUNTRY_CODE_NUMERIC_IS_NOT_ACCEPTED = '91817'; const ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED = '91803'; const ADDRESS_EXTENDED_ADDRESS_IS_INVALID = '91823'; const ADDRESS_EXTENDED_ADDRESS_IS_TOO_LONG = '81804'; const ADDRESS_FIRST_NAME_IS_INVALID = '91819'; const ADDRESS_FIRST_NAME_IS_TOO_LONG = '81805'; const ADDRESS_INCONSISTENT_COUNTRY = '91815'; const ADDRESS_LAST_NAME_IS_INVALID = '91820'; const ADDRESS_LAST_NAME_IS_TOO_LONG = '81806'; const ADDRESS_LOCALITY_IS_INVALID = '91824'; const ADDRESS_LOCALITY_IS_TOO_LONG = '81807'; const ADDRESS_POSTAL_CODE_INVALID_CHARACTERS = '81813'; const ADDRESS_POSTAL_CODE_IS_INVALID = '91826'; const ADDRESS_POSTAL_CODE_IS_REQUIRED = '81808'; const ADDRESS_POSTAL_CODE_IS_TOO_LONG = '81809'; const ADDRESS_REGION_IS_INVALID = '91825'; const ADDRESS_REGION_IS_TOO_LONG = '81810'; const ADDRESS_STATE_IS_INVALID_FOR_SELLER_PROTECTION = '81827'; const ADDRESS_STREET_ADDRESS_IS_INVALID = '91822'; const ADDRESS_STREET_ADDRESS_IS_REQUIRED = '81811'; const ADDRESS_STREET_ADDRESS_IS_TOO_LONG = '81812'; const ADDRESS_TOO_MANY_ADDRESSES_PER_CUSTOMER = '91818'; const APPLE_PAY_CARDS_ARE_NOT_ACCEPTED = '83501'; const APPLE_PAY_CUSTOMER_ID_IS_REQUIRED_FOR_VAULTING = '83502'; const APPLE_PAY_TOKEN_IS_IN_USE = '93503'; const APPLE_PAY_PAYMENT_METHOD_NONCE_CONSUMED = '93504'; const APPLE_PAY_PAYMENT_METHOD_NONCE_UNKNOWN = '93505'; const APPLE_PAY_PAYMENT_METHOD_NONCE_UNLOCKED = '93506'; const APPLE_PAY_PAYMENT_METHOD_NONCE_CARD_TYPE_IS_NOT_ACCEPTED = '83518'; const APPLE_PAY_CANNOT_UPDATE_APPLE_PAY_CARD_USING_PAYMENT_METHOD_NONCE = '93507'; const APPLE_PAY_NUMBER_IS_REQUIRED = '93508'; const APPLE_PAY_EXPIRATION_MONTH_IS_REQUIRED = '93509'; const APPLE_PAY_EXPIRATION_YEAR_IS_REQUIRED = '93510'; const APPLE_PAY_CRYPTOGRAM_IS_REQUIRED = '93511'; const APPLE_PAY_DECRYPTION_FAILED = '83512'; const APPLE_PAY_DISABLED = '93513'; const APPLE_PAY_MERCHANT_NOT_CONFIGURED = '93514'; const APPLE_PAY_MERCHANT_KEYS_ALREADY_CONFIGURED = '93515'; const APPLE_PAY_MERCHANT_KEYS_NOT_CONFIGURED = '93516'; const APPLE_PAY_CERTIFICATE_INVALID = '93517'; const APPLE_PAY_CERTIFICATE_MISMATCH = '93519'; const APPLE_PAY_INVALID_TOKEN = '83520'; const APPLE_PAY_PRIVATE_KEY_MISMATCH = '93521'; const APPLE_PAY_KEY_MISMATCH_STORING_CERTIFICATE = '93522'; const AUTHORIZATION_FINGERPRINT_INVALID_CREATED_AT = '93204'; const AUTHORIZATION_FINGERPRINT_INVALID_FORMAT = '93202'; const AUTHORIZATION_FINGERPRINT_INVALID_PUBLIC_KEY = '93205'; const AUTHORIZATION_FINGERPRINT_INVALID_SIGNATURE = '93206'; const AUTHORIZATION_FINGERPRINT_MISSING_FINGERPRINT = '93201'; const AUTHORIZATION_FINGERPRINT_OPTIONS_NOT_ALLOWED_WITHOUT_CUSTOMER = '93207'; const AUTHORIZATION_FINGERPRINT_SIGNATURE_REVOKED = '93203'; const CLIENT_TOKEN_CUSTOMER_DOES_NOT_EXIST = '92804'; const CLIENT_TOKEN_FAIL_ON_DUPLICATE_PAYMENT_METHOD_REQUIRES_CUSTOMER_ID = '92803'; const CLIENT_TOKEN_MAKE_DEFAULT_REQUIRES_CUSTOMER_ID = '92801'; const CLIENT_TOKEN_PROXY_MERCHANT_DOES_NOT_EXIST = '92805'; const CLIENT_TOKEN_UNSUPPORTED_VERSION = '92806'; const CLIENT_TOKEN_VERIFY_CARD_REQUIRES_CUSTOMER_ID = '92802'; const CLIENT_TOKEN_MERCHANT_ACCOUNT_DOES_NOT_EXIST = '92807'; const CREDIT_CARD_BILLING_ADDRESS_CONFLICT = '91701'; const CREDIT_CARD_BILLING_ADDRESS_FORMAT_IS_INVALID = '91744'; const CREDIT_CARD_BILLING_ADDRESS_ID_IS_INVALID = '91702'; const CREDIT_CARD_CANNOT_UPDATE_CARD_USING_PAYMENT_METHOD_NONCE = '91735'; const CREDIT_CARD_CARDHOLDER_NAME_IS_TOO_LONG = '81723'; const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED = '81703'; const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED_BY_SUBSCRIPTION_MERCHANT_ACCOUNT = '81718'; const CREDIT_CARD_CUSTOMER_ID_IS_INVALID = '91705'; const CREDIT_CARD_CUSTOMER_ID_IS_REQUIRED = '91704'; const CREDIT_CARD_CVV_IS_INVALID = '81707'; const CREDIT_CARD_CVV_IS_REQUIRED = '81706'; const CREDIT_CARD_CVV_VERIFICATION_FAILED = '81736'; const CREDIT_CARD_DUPLICATE_CARD_EXISTS = '81724'; const CREDIT_CARD_EXPIRATION_DATE_CONFLICT = '91708'; const CREDIT_CARD_EXPIRATION_DATE_IS_INVALID = '81710'; const CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED = '81709'; const CREDIT_CARD_EXPIRATION_DATE_YEAR_IS_INVALID = '81711'; const CREDIT_CARD_EXPIRATION_MONTH_IS_INVALID = '81712'; const CREDIT_CARD_EXPIRATION_YEAR_IS_INVALID = '81713'; const CREDIT_CARD_INVALID_PARAMS_FOR_CREDIT_CARD_UPDATE = '91745'; const CREDIT_CARD_INVALID_VENMO_SDK_PAYMENT_METHOD_CODE = '91727'; const CREDIT_CARD_NUMBER_INVALID_LENGTH = '81716'; const CREDIT_CARD_NUMBER_IS_INVALID = '81715'; const CREDIT_CARD_NUMBER_IS_PROHIBITED = '81750'; const CREDIT_CARD_NUMBER_IS_REQUIRED = '81714'; const CREDIT_CARD_NUMBER_LENGTH_IS_INVALID = '81716'; const CREDIT_CARD_NUMBER_MUST_BE_TEST_NUMBER = '81717'; const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_IS_INVALID = '91723'; const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_NOT_ALLOWED = '91729'; const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_CANNOT_BE_NEGATIVE = '91739'; const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_FORMAT_IS_INVALID = '91740'; const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_IS_TOO_LARGE = '91752'; const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_NOT_SUPPORTED_BY_PROCESSOR = '91741'; const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91728'; const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_IS_FORBIDDEN = '91743'; const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_IS_SUSPENDED = '91742'; const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_CANNOT_BE_SUB_MERCHANT_ACCOUNT = '91755'; const CREDIT_CARD_PAYMENT_METHOD_CONFLICT = '81725'; const CREDIT_CARD_PAYMENT_METHOD_IS_NOT_A_CREDIT_CARD = '91738'; const CREDIT_CARD_PAYMENT_METHOD_NONCE_CARD_TYPE_IS_NOT_ACCEPTED = '91734'; const CREDIT_CARD_PAYMENT_METHOD_NONCE_CONSUMED = '91731'; const CREDIT_CARD_PAYMENT_METHOD_NONCE_LOCKED = '91733'; const CREDIT_CARD_PAYMENT_METHOD_NONCE_UNKNOWN = '91732'; const CREDIT_CARD_POSTAL_CODE_VERIFICATION_FAILED = '81737'; const CREDIT_CARD_TOKEN_FORMAT_IS_INVALID = '91718'; const CREDIT_CARD_TOKEN_INVALID = '91718'; const CREDIT_CARD_TOKEN_IS_IN_USE = '91719'; const CREDIT_CARD_TOKEN_IS_NOT_ALLOWED = '91721'; const CREDIT_CARD_TOKEN_IS_REQUIRED = '91722'; const CREDIT_CARD_TOKEN_IS_TOO_LONG = '91720'; const CREDIT_CARD_VENMO_SDK_PAYMENT_METHOD_CODE_CARD_TYPE_IS_NOT_ACCEPTED = '91726'; const CREDIT_CARD_VERIFICATION_NOT_SUPPORTED_ON_THIS_MERCHANT_ACCOUNT = '91730'; const CUSTOMER_COMPANY_IS_TOO_LONG = '81601'; const CUSTOMER_CUSTOM_FIELD_IS_INVALID = '91602'; const CUSTOMER_CUSTOM_FIELD_IS_TOO_LONG = '81603'; const CUSTOMER_EMAIL_FORMAT_IS_INVALID = '81604'; const CUSTOMER_EMAIL_IS_INVALID = '81604'; const CUSTOMER_EMAIL_IS_REQUIRED = '81606'; const CUSTOMER_EMAIL_IS_TOO_LONG = '81605'; const CUSTOMER_FAX_IS_TOO_LONG = '81607'; const CUSTOMER_FIRST_NAME_IS_TOO_LONG = '81608'; const CUSTOMER_ID_IS_INVAILD = '91610'; //Deprecated const CUSTOMER_ID_IS_INVALID = '91610'; const CUSTOMER_ID_IS_IN_USE = '91609'; const CUSTOMER_ID_IS_NOT_ALLOWED = '91611'; const CUSTOMER_ID_IS_REQUIRED = '91613'; const CUSTOMER_ID_IS_TOO_LONG = '91612'; const CUSTOMER_LAST_NAME_IS_TOO_LONG = '81613'; const CUSTOMER_PHONE_IS_TOO_LONG = '81614'; const CUSTOMER_VAULTED_PAYMENT_INSTRUMENT_NONCE_BELONGS_TO_DIFFERENT_CUSTOMER = '91617'; const CUSTOMER_WEBSITE_FORMAT_IS_INVALID = '81616'; const CUSTOMER_WEBSITE_IS_INVALID = '81616'; const CUSTOMER_WEBSITE_IS_TOO_LONG = '81615'; const DESCRIPTOR_NAME_FORMAT_IS_INVALID = '92201'; const DESCRIPTOR_PHONE_FORMAT_IS_INVALID = '92202'; const DESCRIPTOR_INTERNATIONAL_NAME_FORMAT_IS_INVALID = '92204'; const DESCRIPTOR_DYNAMIC_DESCRIPTORS_DISABLED = '92203'; const DESCRIPTOR_INTERNATIONAL_PHONE_FORMAT_IS_INVALID = '92205'; const DESCRIPTOR_URL_FORMAT_IS_INVALID = '92206'; const DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_OPEN_DISPUTE = '95701'; const DISPUTE_CAN_ONLY_REMOVE_EVIDENCE_FROM_OPEN_DISPUTE = '95702'; const DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_DISPUTE = '95703'; const DISPUTE_CAN_ONLY_ACCEPT_OPEN_DISPUTE = '95704'; const DISPUTE_CAN_ONLY_FINALIZE_OPEN_DISPUTE = '95705'; const DISPUTE_CAN_ONLY_CREATE_EVIDENCE_WITH_VALID_CATEGORY = '95706'; const DISPUTE_EVIDENCE_CONTENT_DATE_INVALID = '95707'; const DISPUTE_EVIDENCE_CONTENT_TOO_LONG = '95708'; const DISPUTE_EVIDENCE_CONTENT_ARN_TOO_LONG = '95709'; const DISPUTE_EVIDENCE_CONTENT_PHONE_TOO_LONG = '95710'; const DISPUTE_EVIDENCE_CATEGORY_TEXT_ONLY = '95711'; const DISPUTE_EVIDENCE_CATEGORY_DOCUMENT_ONLY = '95712'; const DISPUTE_EVIDENCE_CATEGORY_NOT_FOR_REASON_CODE = '95713'; const DISPUTE_EVIDENCE_CATEGORY_DUPLICATE = '95713'; const DISPUTE_EVIDENCE_CATEGORY_EMAIL_INVALID = '95713'; const DISPUTE_DIGITAL_GOODS_MISSING_EVIDENCE = '95720'; const DISPUTE_DIGITAL_GOODS_MISSING_DOWNLOAD_DATE = '95721'; const DISPUTE_PRIOR_NON_DISPUTED_TRANSACTION_MISSING_ARN = '95722'; const DISPUTE_PRIOR_NON_DISPUTED_TRANSACTION_MISSING_DATE = '95723'; const DISPUTE_RECURRING_TRANSACTION_MISSING_DATE = '95724'; const DISPUTE_RECURRING_TRANSACTION_MISSING_ARN = '95725'; const DISPUTE_VALID_EVIDENCE_REQUIRED_TO_FINALIZE = '95726'; const DOCUMENT_UPLOAD_KIND_IS_INVALID = '84901'; const DOCUMENT_UPLOAD_FILE_IS_TOO_LARGE = '84902'; const DOCUMENT_UPLOAD_FILE_TYPE_IS_INVALID = '84903'; const DOCUMENT_UPLOAD_FILE_IS_MALFORMED_OR_ENCRYPTED = '84904'; const FAILED_AUTH_ADJUSTMENT_ALLOW_RETRY = '95603'; const FAILED_AUTH_ADJUSTMENT_HARD_DECLINE = '95602'; const FINAL_AUTH_SUBMIT_FOR_SETTLEMENT_FOR_DIFFERENT_AMOUNT = '95601'; const INDUSTRY_DATA_INDUSTRY_TYPE_IS_INVALID = '93401'; const INDUSTRY_DATA_LODGING_EMPTY_DATA = '93402'; const INDUSTRY_DATA_LODGING_FOLIO_NUMBER_IS_INVALID = '93403'; const INDUSTRY_DATA_LODGING_CHECK_IN_DATE_IS_INVALID = '93404'; const INDUSTRY_DATA_LODGING_CHECK_OUT_DATE_IS_INVALID = '93405'; const INDUSTRY_DATA_LODGING_CHECK_OUT_DATE_MUST_FOLLOW_CHECK_IN_DATE = '93406'; const INDUSTRY_DATA_LODGING_UNKNOWN_DATA_FIELD = '93407'; const INDUSTRY_DATA_TRAVEL_CRUISE_EMPTY_DATA = '93408'; const INDUSTRY_DATA_TRAVEL_CRUISE_UNKNOWN_DATA_FIELD = '93409'; const INDUSTRY_DATA_TRAVEL_CRUISE_TRAVEL_PACKAGE_IS_INVALID = '93410'; const INDUSTRY_DATA_TRAVEL_CRUISE_DEPARTURE_DATE_IS_INVALID = '93411'; const INDUSTRY_DATA_TRAVEL_CRUISE_LODGING_CHECK_IN_DATE_IS_INVALID = '93412'; const INDUSTRY_DATA_TRAVEL_CRUISE_LODGING_CHECK_OUT_DATE_IS_INVALID = '93413'; const TRANSACTION_LINE_ITEM_COMMODITY_CODE_IS_TOO_LONG = '95801'; const TRANSACTION_LINE_ITEM_DESCRIPTION_IS_TOO_LONG = '95803'; const TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_FORMAT_IS_INVALID = '95804'; const TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_IS_TOO_LARGE = '95805'; const TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_MUST_BE_GREATER_THAN_ZERO = '95806'; // Deprecated as the amount may be zero. Use TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_CANNOT_BE_ZERO. const TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_CANNOT_BE_NEGATIVE = '95806'; const TRANSACTION_LINE_ITEM_KIND_IS_INVALID = '95807'; const TRANSACTION_LINE_ITEM_KIND_IS_REQUIRED = '95808'; const TRANSACTION_LINE_ITEM_NAME_IS_REQUIRED = '95822'; const TRANSACTION_LINE_ITEM_NAME_IS_TOO_LONG = '95823'; const TRANSACTION_LINE_ITEM_PRODUCT_CODE_IS_TOO_LONG = '95809'; const TRANSACTION_LINE_ITEM_QUANTITY_FORMAT_IS_INVALID = '95810'; const TRANSACTION_LINE_ITEM_QUANTITY_IS_REQUIRED = '95811'; const TRANSACTION_LINE_ITEM_QUANTITY_IS_TOO_LARGE = '95812'; const TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_FORMAT_IS_INVALID = '95813'; const TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_IS_REQUIRED = '95814'; const TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_IS_TOO_LARGE = '95815'; const TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_MUST_BE_GREATER_THAN_ZERO = '95816'; const TRANSACTION_LINE_ITEM_UNIT_AMOUNT_FORMAT_IS_INVALID = '95817'; const TRANSACTION_LINE_ITEM_UNIT_AMOUNT_IS_REQUIRED = '95818'; const TRANSACTION_LINE_ITEM_UNIT_AMOUNT_IS_TOO_LARGE = '95819'; const TRANSACTION_LINE_ITEM_UNIT_AMOUNT_MUST_BE_GREATER_THAN_ZERO = '95820'; const TRANSACTION_LINE_ITEM_UNIT_OF_MEASURE_IS_TOO_LONG = '95821'; const TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_FORMAT_IS_INVALID = '95824'; const TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_IS_TOO_LARGE = '95825'; const TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_MUST_BE_GREATER_THAN_ZERO = '95826'; // Deprecated as the amount may be zero. Use TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_CANNOT_BE_ZERO. const TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_CANNOT_BE_NEGATIVE = '95826'; const TRANSACTION_LINE_ITEM_TAX_AMOUNT_FORMAT_IS_INVALID = '95827'; const TRANSACTION_LINE_ITEM_TAX_AMOUNT_IS_TOO_LARGE = '95828'; const TRANSACTION_LINE_ITEM_TAX_AMOUNT_CANNOT_BE_NEGATIVE = '95829'; const MERCHANT_COUNTRY_CANNOT_BE_BLANK = '83603'; const MERCHANT_COUNTRY_CODE_ALPHA2_IS_INVALID = '93607'; const MERCHANT_COUNTRY_CODE_ALPHA2_IS_NOT_ACCEPTED = '93606'; const MERCHANT_COUNTRY_CODE_ALPHA3_IS_INVALID = '93605'; const MERCHANT_COUNTRY_CODE_ALPHA3_IS_NOT_ACCEPTED = '93604'; const MERCHANT_COUNTRY_CODE_NUMERIC_IS_INVALID = '93609'; const MERCHANT_COUNTRY_CODE_NUMERIC_IS_NOT_ACCEPTED = '93608'; const MERCHANT_COUNTRY_NAME_IS_INVALID = '93611'; const MERCHANT_COUNTRY_NAME_IS_NOT_ACCEPTED = '93610'; const MERCHANT_CURRENCIES_ARE_INVALID = '93614'; const MERCHANT_EMAIL_FORMAT_IS_INVALID = '93602'; const MERCHANT_EMAIL_IS_REQUIRED = '83601'; const MERCHANT_INCONSISTENT_COUNTRY = '93612'; const MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID = '93613'; const MERCHANT_PAYMENT_METHODS_ARE_NOT_ALLOWED = '93615'; const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_CURRENCY = '93616'; const MERCHANT_CURRENCY_IS_REQUIRED = '93617'; const MERCHANT_CURRENCY_IS_INVALID = '93618'; const MERCHANT_NO_MERCHANT_ACCOUNTS = '93619'; const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID = '93620'; const MERCHANT_MERCHANT_ACCOUNT_NOT_AUTH_ONBOARDED = '93621'; const MERCHANT_ACCOUNT_ID_FORMAT_IS_INVALID = '82603'; const MERCHANT_ACCOUNT_ID_IS_IN_USE = '82604'; const MERCHANT_ACCOUNT_ID_IS_NOT_ALLOWED = '82605'; const MERCHANT_ACCOUNT_ID_IS_TOO_LONG = '82602'; const MERCHANT_ACCOUNT_MASTER_MERCHANT_ACCOUNT_ID_IS_INVALID = '82607'; const MERCHANT_ACCOUNT_MASTER_MERCHANT_ACCOUNT_ID_IS_REQUIRED = '82606'; const MERCHANT_ACCOUNT_MASTER_MERCHANT_ACCOUNT_MUST_BE_ACTIVE = '82608'; const MERCHANT_ACCOUNT_TOS_ACCEPTED_IS_REQUIRED = '82610'; const MERCHANT_ACCOUNT_CANNOT_BE_UPDATED = '82674'; const MERCHANT_ACCOUNT_DECLINED = '82626'; const MERCHANT_ACCOUNT_DECLINED_MASTER_CARD_MATCH = '82622'; const MERCHANT_ACCOUNT_DECLINED_OFAC = '82621'; const MERCHANT_ACCOUNT_DECLINED_FAILED_KYC = '82623'; const MERCHANT_ACCOUNT_DECLINED_SSN_INVALID = '82624'; const MERCHANT_ACCOUNT_DECLINED_SSN_MATCHES_DECEASED = '82625'; const MERCHANT_ACCOUNT_ID_CANNOT_BE_UPDATED = '82675'; const MERCHANT_ACCOUNT_MASTER_MERCHANT_ACCOUNT_ID_CANNOT_BE_UPDATED = '82676'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ACCOUNT_NUMBER_IS_REQUIRED = '82614'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_COMPANY_NAME_IS_INVALID = '82631'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_COMPANY_NAME_IS_REQUIRED_WITH_TAX_ID = '82633'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DATE_OF_BIRTH_IS_REQUIRED = '82612'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED = '82626'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED_MASTER_CARD_MATCH = '82622'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED_OFAC = '82621'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED_FAILED_KYC = '82623'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED_SSN_INVALID = '82624'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DECLINED_SSN_MATCHES_DECEASED = '82625'; // Keep for backwards compatibility const MERCHANT_ACCOUNT_APPLICANT_DETAILS_EMAIL_ADDRESS_IS_INVALID = '82616'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_FIRST_NAME_IS_INVALID = '82627'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_FIRST_NAME_IS_REQUIRED = '82609'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_LAST_NAME_IS_INVALID = '82628'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_LAST_NAME_IS_REQUIRED = '82611'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_PHONE_IS_INVALID = '82636'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ROUTING_NUMBER_IS_INVALID = '82635'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ROUTING_NUMBER_IS_REQUIRED = '82613'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_SSN_IS_INVALID = '82615'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_TAX_ID_IS_INVALID = '82632'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_TAX_ID_IS_REQUIRED_WITH_COMPANY_NAME = '82634'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_DATE_OF_BIRTH_IS_INVALID = '82663'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_REGION_IS_INVALID = '82664'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_EMAIL_ADDRESS_IS_REQUIRED = '82665'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ACCOUNT_NUMBER_IS_INVALID = '82670'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_TAX_ID_MUST_BE_BLANK = '82673'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_LOCALITY_IS_REQUIRED = '82618'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_POSTAL_CODE_IS_INVALID = '82630'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_POSTAL_CODE_IS_REQUIRED = '82619'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_REGION_IS_REQUIRED = '82620'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_STREET_ADDRESS_IS_INVALID = '82629'; const MERCHANT_ACCOUNT_APPLICANT_DETAILS_ADDRESS_STREET_ADDRESS_IS_REQUIRED = '82617'; const MERCHANT_ACCOUNT_BUSINESS_DBA_NAME_IS_INVALID = '82646'; const MERCHANT_ACCOUNT_BUSINESS_TAX_ID_IS_INVALID = '82647'; const MERCHANT_ACCOUNT_BUSINESS_TAX_ID_IS_REQUIRED_WITH_LEGAL_NAME = '82648'; const MERCHANT_ACCOUNT_BUSINESS_LEGAL_NAME_IS_REQUIRED_WITH_TAX_ID = '82669'; const MERCHANT_ACCOUNT_BUSINESS_TAX_ID_MUST_BE_BLANK = '82672'; const MERCHANT_ACCOUNT_BUSINESS_LEGAL_NAME_IS_INVALID = '82677'; const MERCHANT_ACCOUNT_BUSINESS_ADDRESS_REGION_IS_INVALID = '82684'; const MERCHANT_ACCOUNT_BUSINESS_ADDRESS_STREET_ADDRESS_IS_INVALID = '82685'; const MERCHANT_ACCOUNT_BUSINESS_ADDRESS_POSTAL_CODE_IS_INVALID = '82686'; const MERCHANT_ACCOUNT_INDIVIDUAL_FIRST_NAME_IS_REQUIRED = '82637'; const MERCHANT_ACCOUNT_INDIVIDUAL_LAST_NAME_IS_REQUIRED = '82638'; const MERCHANT_ACCOUNT_INDIVIDUAL_DATE_OF_BIRTH_IS_REQUIRED = '82639'; const MERCHANT_ACCOUNT_INDIVIDUAL_SSN_IS_INVALID = '82642'; const MERCHANT_ACCOUNT_INDIVIDUAL_EMAIL_IS_INVALID = '82643'; const MERCHANT_ACCOUNT_INDIVIDUAL_FIRST_NAME_IS_INVALID = '82644'; const MERCHANT_ACCOUNT_INDIVIDUAL_LAST_NAME_IS_INVALID = '82645'; const MERCHANT_ACCOUNT_INDIVIDUAL_PHONE_IS_INVALID = '82656'; const MERCHANT_ACCOUNT_INDIVIDUAL_DATE_OF_BIRTH_IS_INVALID = '82666'; const MERCHANT_ACCOUNT_INDIVIDUAL_EMAIL_IS_REQUIRED = '82667'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_STREET_ADDRESS_IS_REQUIRED = '82657'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_LOCALITY_IS_REQUIRED = '82658'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_POSTAL_CODE_IS_REQUIRED = '82659'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_REGION_IS_REQUIRED = '82660'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_STREET_ADDRESS_IS_INVALID = '82661'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_POSTAL_CODE_IS_INVALID = '82662'; const MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_REGION_IS_INVALID = '82668'; const MERCHANT_ACCOUNT_FUNDING_ROUTING_NUMBER_IS_REQUIRED = '82640'; const MERCHANT_ACCOUNT_FUNDING_ACCOUNT_NUMBER_IS_REQUIRED = '82641'; const MERCHANT_ACCOUNT_FUNDING_ROUTING_NUMBER_IS_INVALID = '82649'; const MERCHANT_ACCOUNT_FUNDING_ACCOUNT_NUMBER_IS_INVALID = '82671'; const MERCHANT_ACCOUNT_FUNDING_DESTINATION_IS_REQUIRED = '82678'; const MERCHANT_ACCOUNT_FUNDING_DESTINATION_IS_INVALID = '82679'; const MERCHANT_ACCOUNT_FUNDING_EMAIL_IS_REQUIRED = '82680'; const MERCHANT_ACCOUNT_FUNDING_EMAIL_IS_INVALID = '82681'; const MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_REQUIRED = '82682'; const MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_INVALID = '82683'; const OAUTH_INVALID_GRANT = '93801'; const OAUTH_INVALID_CREDENTIALS = '93802'; const OAUTH_INVALID_SCOPE = '93803'; const OAUTH_INVALID_REQUEST = '93804'; const OAUTH_UNSUPPORTED_GRANT_TYPE = '93805'; const PAYMENT_METHOD_CANNOT_FORWARD_PAYMENT_METHOD_TYPE = '93106'; const PAYMENT_METHOD_CUSTOMER_ID_IS_INVALID = '93105'; const PAYMENT_METHOD_CUSTOMER_ID_IS_REQUIRED = '93104'; const PAYMENT_METHOD_NONCE_IS_INVALID = '93102'; const PAYMENT_METHOD_NONCE_IS_REQUIRED = '93103'; const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_CONSUMED = '93107'; const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_UNKNOWN = '93108'; const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_LOCKED = '93109'; const PAYMENT_METHOD_PAYMENT_METHOD_PARAMS_ARE_REQUIRED = '93101'; const PAYMENT_METHOD_NO_LONGER_SUPPORTED = '93117'; const PAYMENT_METHOD_OPTIONS_US_BANK_ACCOUNT_VERIFICATION_METHOD_IS_INVALID = '93121'; const PAYPAL_ACCOUNT_AUTH_EXPIRED = '92911'; const PAYPAL_ACCOUNT_CANNOT_HAVE_BOTH_ACCESS_TOKEN_AND_CONSENT_CODE = '82903'; const PAYPAL_ACCOUNT_CANNOT_HAVE_FUNDING_SOURCE_WITHOUT_ACCESS_TOKEN = '92912'; const PAYPAL_ACCOUNT_CANNOT_UPDATE_PAYPAL_ACCOUNT_USING_PAYMENT_METHOD_NONCE = '92914'; const PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT = '82902'; const PAYPAL_ACCOUNT_CONSENT_CODE_OR_ACCESS_TOKEN_IS_REQUIRED = '82901'; const PAYPAL_ACCOUNT_CUSTOMER_ID_IS_REQUIRED_FOR_VAULTING = '82905'; const PAYPAL_ACCOUNT_INVALID_FUNDING_SOURCE_SELECTION = '92913'; const PAYPAL_ACCOUNT_INVALID_PARAMS_FOR_PAYPAL_ACCOUNT_UPDATE = '92915'; const PAYPAL_ACCOUNT_PAYMENT_METHOD_NONCE_CONSUMED = '92907'; const PAYPAL_ACCOUNT_PAYMENT_METHOD_NONCE_LOCKED = '92909'; const PAYPAL_ACCOUNT_PAYMENT_METHOD_NONCE_UNKNOWN = '92908'; const PAYPAL_ACCOUNT_PAYPAL_ACCOUNTS_ARE_NOT_ACCEPTED = '82904'; const PAYPAL_ACCOUNT_PAYPAL_COMMUNICATION_ERROR = '92910'; const PAYPAL_ACCOUNT_TOKEN_IS_IN_USE = '92906'; const SEPA_BANK_ACCOUNT_ACCOUNT_HOLDER_NAME_IS_REQUIRED = '93003'; const SEPA_BANK_ACCOUNT_BIC_IS_REQUIRED = '93002'; const SEPA_BANK_ACCOUNT_IBAN_IS_REQUIRED = '93001'; const SEPA_MANDATE_ACCOUNT_HOLDER_NAME_IS_REQUIRED = '83301'; const SEPA_MANDATE_BIC_INVALID_CHARACTER = '83306'; const SEPA_MANDATE_BIC_IS_REQUIRED = '83302'; const SEPA_MANDATE_BIC_LENGTH_IS_INVALID = '83307'; const SEPA_MANDATE_BIC_UNSUPPORTED_COUNTRY = '83308'; const SEPA_MANDATE_BILLING_ADDRESS_CONFLICT = '93311'; const SEPA_MANDATE_BILLING_ADDRESS_ID_IS_INVALID = '93312'; const SEPA_MANDATE_IBAN_INVALID_CHARACTER = '83305'; const SEPA_MANDATE_IBAN_INVALID_FORMAT = '83310'; const SEPA_MANDATE_IBAN_IS_REQUIRED = '83303'; const SEPA_MANDATE_IBAN_UNSUPPORTED_COUNTRY = '83309'; const SEPA_MANDATE_TYPE_IS_REQUIRED = '93304'; const SEPA_MANDATE_TYPE_IS_INVALID = '93313'; const SETTLEMENT_BATCH_SUMMARY_SETTLEMENT_DATE_IS_INVALID = '82302'; const SETTLEMENT_BATCH_SUMMARY_SETTLEMENT_DATE_IS_REQUIRED = '82301'; const SETTLEMENT_BATCH_SUMMARY_CUSTOM_FIELD_IS_INVALID = '82303'; const SUBSCRIPTION_BILLING_DAY_OF_MONTH_CANNOT_BE_UPDATED = '91918'; const SUBSCRIPTION_BILLING_DAY_OF_MONTH_IS_INVALID = '91914'; const SUBSCRIPTION_BILLING_DAY_OF_MONTH_MUST_BE_NUMERIC = '91913'; const SUBSCRIPTION_CANNOT_ADD_DUPLICATE_ADDON_OR_DISCOUNT = '91911'; const SUBSCRIPTION_CANNOT_EDIT_CANCELED_SUBSCRIPTION = '81901'; const SUBSCRIPTION_CANNOT_EDIT_EXPIRED_SUBSCRIPTION = '81910'; const SUBSCRIPTION_CANNOT_EDIT_PRICE_CHANGING_FIELDS_ON_PAST_DUE_SUBSCRIPTION = '91920'; const SUBSCRIPTION_FIRST_BILLING_DATE_CANNOT_BE_IN_THE_PAST = '91916'; const SUBSCRIPTION_FIRST_BILLING_DATE_CANNOT_BE_UPDATED = '91919'; const SUBSCRIPTION_FIRST_BILLING_DATE_IS_INVALID = '91915'; const SUBSCRIPTION_ID_IS_IN_USE = '81902'; const SUBSCRIPTION_INCONSISTENT_NUMBER_OF_BILLING_CYCLES = '91908'; const SUBSCRIPTION_INCONSISTENT_START_DATE = '91917'; const SUBSCRIPTION_INVALID_REQUEST_FORMAT = '91921'; const SUBSCRIPTION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91901'; const SUBSCRIPTION_MISMATCH_CURRENCY_ISO_CODE = '91923'; const SUBSCRIPTION_NUMBER_OF_BILLING_CYCLES_CANNOT_BE_BLANK = '91912'; const SUBSCRIPTION_NUMBER_OF_BILLING_CYCLES_IS_TOO_SMALL = '91909'; const SUBSCRIPTION_NUMBER_OF_BILLING_CYCLES_MUST_BE_GREATER_THAN_ZERO = '91907'; const SUBSCRIPTION_NUMBER_OF_BILLING_CYCLES_MUST_BE_NUMERIC = '91906'; const SUBSCRIPTION_PAYMENT_METHOD_NONCE_CARD_TYPE_IS_NOT_ACCEPTED = '91924'; const SUBSCRIPTION_PAYMENT_METHOD_NONCE_IS_INVALID = '91925'; const SUBSCRIPTION_PAYMENT_METHOD_NONCE_NOT_ASSOCIATED_WITH_CUSTOMER = '91926'; const SUBSCRIPTION_PAYMENT_METHOD_NONCE_UNVAULTED_CARD_IS_NOT_ACCEPTED = '91927'; const SUBSCRIPTION_PAYMENT_METHOD_TOKEN_CARD_TYPE_IS_NOT_ACCEPTED = '91902'; const SUBSCRIPTION_PAYMENT_METHOD_TOKEN_IS_INVALID = '91903'; const SUBSCRIPTION_PAYMENT_METHOD_TOKEN_NOT_ASSOCIATED_WITH_CUSTOMER = '91905'; const SUBSCRIPTION_PLAN_BILLING_FREQUENCY_CANNOT_BE_UPDATED = '91922'; const SUBSCRIPTION_PLAN_ID_IS_INVALID = '91904'; const SUBSCRIPTION_PRICE_CANNOT_BE_BLANK = '81903'; const SUBSCRIPTION_PRICE_FORMAT_IS_INVALID = '81904'; const SUBSCRIPTION_PRICE_IS_TOO_LARGE = '81923'; const SUBSCRIPTION_STATUS_IS_CANCELED = '81905'; const SUBSCRIPTION_TOKEN_FORMAT_IS_INVALID = '81906'; const SUBSCRIPTION_TRIAL_DURATION_FORMAT_IS_INVALID = '81907'; const SUBSCRIPTION_TRIAL_DURATION_IS_REQUIRED = '81908'; const SUBSCRIPTION_TRIAL_DURATION_UNIT_IS_INVALID = '81909'; const SUBSCRIPTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_INSTRUMENT_TYPE = '91930'; const SUBSCRIPTION_PAYMENT_METHOD_NONCE_INSTRUMENT_TYPE_DOES_NOT_SUPPORT_SUBSCRIPTIONS = '91929'; const SUBSCRIPTION_PAYMENT_METHOD_TOKEN_INSTRUMENT_TYPE_DOES_NOT_SUPPORT_SUBSCRIPTIONS = '91928'; const SUBSCRIPTION_MODIFICATION_AMOUNT_CANNOT_BE_BLANK = '92003'; const SUBSCRIPTION_MODIFICATION_AMOUNT_IS_INVALID = '92002'; const SUBSCRIPTION_MODIFICATION_AMOUNT_IS_TOO_LARGE = '92023'; const SUBSCRIPTION_MODIFICATION_CANNOT_EDIT_MODIFICATIONS_ON_PAST_DUE_SUBSCRIPTION = '92022'; const SUBSCRIPTION_MODIFICATION_CANNOT_UPDATE_AND_REMOVE = '92015'; const SUBSCRIPTION_MODIFICATION_EXISTING_ID_IS_INCORRECT_KIND = '92020'; const SUBSCRIPTION_MODIFICATION_EXISTING_ID_IS_INVALID = '92011'; const SUBSCRIPTION_MODIFICATION_EXISTING_ID_IS_REQUIRED = '92012'; const SUBSCRIPTION_MODIFICATION_ID_TO_REMOVE_IS_INCORRECT_KIND = '92021'; const SUBSCRIPTION_MODIFICATION_ID_TO_REMOVE_IS_INVALID = '92025'; const SUBSCRIPTION_MODIFICATION_ID_TO_REMOVE_IS_NOT_PRESENT = '92016'; const SUBSCRIPTION_MODIFICATION_INCONSISTENT_NUMBER_OF_BILLING_CYCLES = '92018'; const SUBSCRIPTION_MODIFICATION_INHERITED_FROM_ID_IS_INVALID = '92013'; const SUBSCRIPTION_MODIFICATION_INHERITED_FROM_ID_IS_REQUIRED = '92014'; const SUBSCRIPTION_MODIFICATION_MISSING = '92024'; const SUBSCRIPTION_MODIFICATION_NUMBER_OF_BILLING_CYCLES_CANNOT_BE_BLANK = '92017'; const SUBSCRIPTION_MODIFICATION_NUMBER_OF_BILLING_CYCLES_IS_INVALID = '92005'; const SUBSCRIPTION_MODIFICATION_NUMBER_OF_BILLING_CYCLES_MUST_BE_GREATER_THAN_ZERO = '92019'; const SUBSCRIPTION_MODIFICATION_QUANTITY_CANNOT_BE_BLANK = '92004'; const SUBSCRIPTION_MODIFICATION_QUANTITY_IS_INVALID = '92001'; const SUBSCRIPTION_MODIFICATION_QUANTITY_MUST_BE_GREATER_THAN_ZERO = '92010'; const TRANSACTION_AMOUNT_CANNOT_BE_NEGATIVE = '81501'; const TRANSACTION_AMOUNT_DOES_NOT_MATCH3_D_SECURE_AMOUNT = '91585'; const TRANSACTION_AMOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_AMOUNT = '915144'; const TRANSACTION_AMOUNT_FORMAT_IS_INVALID = '81503'; const TRANSACTION_AMOUNT_IS_INVALID = '81503'; const TRANSACTION_AMOUNT_IS_REQUIRED = '81502'; const TRANSACTION_AMOUNT_IS_TOO_LARGE = '81528'; const TRANSACTION_AMOUNT_MUST_BE_GREATER_THAN_ZERO = '81531'; const TRANSACTION_BILLING_ADDRESS_CONFLICT = '91530'; const TRANSACTION_CANNOT_BE_VOIDED = '91504'; const TRANSACTION_CANNOT_CANCEL_RELEASE = '91562'; const TRANSACTION_CANNOT_CLONE_CREDIT = '91543'; const TRANSACTION_CANNOT_CLONE_MARKETPLACE_TRANSACTION = '915137'; const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_PAYPAL_ACCOUNT = '91573'; const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_VAULT_CREDIT_CARD = '91540'; const TRANSACTION_CANNOT_CLONE_UNSUCCESSFUL_TRANSACTION = '91542'; const TRANSACTION_CANNOT_CLONE_VOICE_AUTHORIZATIONS = '91541'; const TRANSACTION_CANNOT_HOLD_IN_ESCROW = '91560'; const TRANSACTION_CANNOT_PARTIALLY_REFUND_ESCROWED_TRANSACTION = '91563'; const TRANSACTION_CANNOT_REFUND_CREDIT = '91505'; const TRANSACTION_CANNOT_REFUND_SETTLING_TRANSACTION = '91574'; const TRANSACTION_CANNOT_REFUND_UNLESS_SETTLED = '91506'; const TRANSACTION_CANNOT_REFUND_WITH_PENDING_MERCHANT_ACCOUNT = '91559'; const TRANSACTION_CANNOT_REFUND_WITH_SUSPENDED_MERCHANT_ACCOUNT = '91538'; const TRANSACTION_CANNOT_RELEASE_FROM_ESCROW = '91561'; const TRANSACTION_CANNOT_SIMULATE_SETTLEMENT = '91575'; const TRANSACTION_CANNOT_SUBMIT_FOR_PARTIAL_SETTLEMENT = '915103'; const TRANSACTION_CANNOT_SUBMIT_FOR_SETTLEMENT = '91507'; const TRANSACTION_CANNOT_UPDATE_DETAILS_NOT_SUBMITTED_FOR_SETTLEMENT = '915129'; const TRANSACTION_CHANNEL_IS_TOO_LONG = '91550'; const TRANSACTION_CREDIT_CARD_IS_REQUIRED = '91508'; const TRANSACTION_CUSTOMER_DEFAULT_PAYMENT_METHOD_CARD_TYPE_IS_NOT_ACCEPTED = '81509'; const TRANSACTION_CUSTOMER_DOES_NOT_HAVE_CREDIT_CARD = '91511'; const TRANSACTION_CUSTOMER_ID_IS_INVALID = '91510'; const TRANSACTION_CUSTOM_FIELD_IS_INVALID = '91526'; const TRANSACTION_CUSTOM_FIELD_IS_TOO_LONG = '81527'; const TRANSACTION_HAS_ALREADY_BEEN_REFUNDED = '91512'; const TRANSACTION_IDEAL_PAYMENT_NOT_COMPLETE = '815141'; const TRANSACTION_IDEAL_PAYMENTS_CANNOT_BE_VAULTED = '915150'; const TRANSACTION_LINE_ITEMS_EXPECTED = '915158'; const TRANSACTION_TOO_MANY_LINE_ITEMS = '915157'; const TRANSACTION_DISCOUNT_AMOUNT_FORMAT_IS_INVALID = '915159'; const TRANSACTION_DISCOUNT_AMOUNT_CANNOT_BE_NEGATIVE = '915160'; const TRANSACTION_DISCOUNT_AMOUNT_IS_TOO_LARGE = '915161'; const TRANSACTION_SHIPPING_AMOUNT_FORMAT_IS_INVALID = '915162'; const TRANSACTION_SHIPPING_AMOUNT_CANNOT_BE_NEGATIVE = '915163'; const TRANSACTION_SHIPPING_AMOUNT_IS_TOO_LARGE = '915164'; const TRANSACTION_SHIPS_FROM_POSTAL_CODE_IS_TOO_LONG = '915165'; const TRANSACTION_SHIPS_FROM_POSTAL_CODE_IS_INVALID = '915166'; const TRANSACTION_SHIPS_FROM_POSTAL_CODE_INVALID_CHARACTERS = '915167'; const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH3_D_SECURE_MERCHANT_ACCOUNT = '91584'; const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_MERCHANT_ACCOUNT = '915143'; const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_MOTO = '91558'; const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_REFUNDS = '91547'; const TRANSACTION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91513'; const TRANSACTION_MERCHANT_ACCOUNT_IS_SUSPENDED = '91514'; const TRANSACTION_MERCHANT_ACCOUNT_NAME_IS_INVALID = '91513'; //Deprecated const TRANSACTION_OPTIONS_PAY_PAL_CUSTOM_FIELD_TOO_LONG = '91580'; const TRANSACTION_OPTIONS_SUBMIT_FOR_SETTLEMENT_IS_REQUIRED_FOR_CLONING = '91544'; const TRANSACTION_OPTIONS_SUBMIT_FOR_SETTLEMENT_IS_REQUIRED_FOR_PAYPAL_UNILATERAL = '91582'; const TRANSACTION_OPTIONS_USE_BILLING_FOR_SHIPPING_DISABLED = '91572'; const TRANSACTION_OPTIONS_VAULT_IS_DISABLED = '91525'; const TRANSACTION_ORDER_ID_DOES_NOT_MATCH_IDEAL_PAYMENT_ORDER_ID = '91503'; const TRANSACTION_ORDER_ID_IS_REQUIRED_WITH_IDEAL_PAYMENT = '91502'; const TRANSACTION_ORDER_ID_IS_TOO_LONG = '91501'; const TRANSACTION_PAYMENT_INSTRUMENT_NOT_SUPPORTED_BY_MERCHANT_ACCOUNT = '91577'; const TRANSACTION_PAYMENT_INSTRUMENT_TYPE_IS_NOT_ACCEPTED = '915101'; const TRANSACTION_PAYMENT_METHOD_CONFLICT = '91515'; const TRANSACTION_PAYMENT_METHOD_CONFLICT_WITH_VENMO_SDK = '91549'; const TRANSACTION_PAYMENT_METHOD_DOES_NOT_BELONG_TO_CUSTOMER = '91516'; const TRANSACTION_PAYMENT_METHOD_DOES_NOT_BELONG_TO_SUBSCRIPTION = '91527'; const TRANSACTION_PAYMENT_METHOD_NONCE_CARD_TYPE_IS_NOT_ACCEPTED = '91567'; const TRANSACTION_PAYMENT_METHOD_NONCE_CONSUMED = '91564'; const TRANSACTION_PAYMENT_METHOD_NONCE_HAS_NO_VALID_PAYMENT_INSTRUMENT_TYPE = '91569'; const TRANSACTION_PAYMENT_METHOD_NONCE_LOCKED = '91566'; const TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN = '91565'; const TRANSACTION_PAYMENT_METHOD_TOKEN_CARD_TYPE_IS_NOT_ACCEPTED = '91517'; const TRANSACTION_PAYMENT_METHOD_TOKEN_IS_INVALID = '91518'; const TRANSACTION_PAYPAL_NOT_ENABLED = '91576'; const TRANSACTION_PAY_PAL_AUTH_EXPIRED = '91579'; const TRANSACTION_PAY_PAL_VAULT_RECORD_MISSING_DATA = '91583'; const TRANSACTION_PROCESSOR_AUTHORIZATION_CODE_CANNOT_BE_SET = '91519'; const TRANSACTION_PROCESSOR_AUTHORIZATION_CODE_IS_INVALID = '81520'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_AUTHS = '915104'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_CREDITS = '91546'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_PARTIAL_SETTLEMENT = '915102'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_ORDER_ID = '915107'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DESCRIPTOR = '915108'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DETAILS = '915130'; const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_VOICE_AUTHORIZATIONS = '91545'; const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_INVALID = '91548'; const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_TOO_LONG = '91537'; const TRANSACTION_REFUND_AMOUNT_IS_TOO_LARGE = '91521'; const TRANSACTION_SERVICE_FEE_AMOUNT_CANNOT_BE_NEGATIVE = '91554'; const TRANSACTION_SERVICE_FEE_AMOUNT_FORMAT_IS_INVALID = '91555'; const TRANSACTION_SERVICE_FEE_AMOUNT_IS_TOO_LARGE = '91556'; const TRANSACTION_SERVICE_FEE_AMOUNT_NOT_ALLOWED_ON_MASTER_MERCHANT_ACCOUNT = '91557'; const TRANSACTION_SERVICE_FEE_IS_NOT_ALLOWED_ON_CREDITS = '91552'; const TRANSACTION_SERVICE_FEE_NOT_ACCEPTED_FOR_PAYPAL = '91578'; const TRANSACTION_SETTLEMENT_AMOUNT_IS_LESS_THAN_SERVICE_FEE_AMOUNT = '91551'; const TRANSACTION_SETTLEMENT_AMOUNT_IS_TOO_LARGE = '91522'; const TRANSACTION_SHIPPING_ADDRESS_DOESNT_MATCH_CUSTOMER = '91581'; const TRANSACTION_SUBSCRIPTION_DOES_NOT_BELONG_TO_CUSTOMER = '91529'; const TRANSACTION_SUBSCRIPTION_ID_IS_INVALID = '91528'; const TRANSACTION_SUBSCRIPTION_STATUS_MUST_BE_PAST_DUE = '91531'; const TRANSACTION_SUB_MERCHANT_ACCOUNT_REQUIRES_SERVICE_FEE_AMOUNT = '91553'; const TRANSACTION_TAX_AMOUNT_CANNOT_BE_NEGATIVE = '81534'; const TRANSACTION_TAX_AMOUNT_FORMAT_IS_INVALID = '81535'; const TRANSACTION_TAX_AMOUNT_IS_TOO_LARGE = '81536'; const TRANSACTION_THREE_D_SECURE_AUTHENTICATION_FAILED = '81571'; const TRANSACTION_THREE_D_SECURE_TOKEN_IS_INVALID = '91568'; const TRANSACTION_THREE_D_SECURE_TRANSACTION_DATA_DOESNT_MATCH_VERIFY = '91570'; const TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_REQUIRED = '915113'; const TRANSACTION_THREE_D_SECURE_CAVV_IS_REQUIRED = '915116'; const TRANSACTION_THREE_D_SECURE_XID_IS_REQUIRED = '915115'; const TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_INVALID = '915114'; const TRANSACTION_THREE_D_SECURE_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_CARD_TYPE = '915131'; const TRANSACTION_TYPE_IS_INVALID = '91523'; const TRANSACTION_TYPE_IS_REQUIRED = '91524'; const TRANSACTION_UNSUPPORTED_VOICE_AUTHORIZATION = '91539'; const TRANSACTION_US_BANK_ACCOUNT_NONCE_MUST_BE_PLAID_VERIFIED = '915171'; const TRANSACTION_US_BANK_ACCOUNT_NOT_VERIFIED = '915172'; const TRANSACTION_TRANSACTION_SOURCE_IS_INVALID = '915133'; const US_BANK_ACCOUNT_VERIFICATION_NOT_CONFIRMABLE = '96101'; const US_BANK_ACCOUNT_VERIFICATION_MUST_BE_MICRO_TRANSFERS_VERIFICATION = '96102'; const US_BANK_ACCOUNT_VERIFICATION_AMOUNTS_DO_NOT_MATCH = '96103'; const US_BANK_ACCOUNT_VERIFICATION_TOO_MANY_CONFIRMATION_ATTEMPTS = '96104'; const US_BANK_ACCOUNT_VERIFICATION_UNABLE_TO_CONFIRM_DEPOSIT_AMOUNTS = '96105'; const US_BANK_ACCOUNT_VERIFICATION_INVALID_DEPOSIT_AMOUNTS = '96106'; const VERIFICATION_OPTIONS_AMOUNT_CANNOT_BE_NEGATIVE = '94201'; const VERIFICATION_OPTIONS_AMOUNT_FORMAT_IS_INVALID = '94202'; const VERIFICATION_OPTIONS_AMOUNT_IS_TOO_LARGE = '94207'; const VERIFICATION_OPTIONS_AMOUNT_NOT_SUPPORTED_BY_PROCESSOR = '94203'; const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_ID_IS_INVALID = '94204'; const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_IS_SUSPENDED = '94205'; const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_IS_FORBIDDEN = '94206'; const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_CANNOT_BE_SUB_MERCHANT_ACCOUNT = '94208'; } class_alias('Braintree\Error\Codes', 'Braintree_Error_Codes');
priyankamackwan/fit.lara
app/Libraries/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php
PHP
mit
50,875
var xml = require('xmlbuilder'); var fs = require('fs'); /** * Function is used to create plis file which is required for downloading ios app. * @param {string} name app name * @param {string} path path to application * @param {string} title title for alert * @param {Function} callback function which will be called when plist file is created */ function creatPlist(name, path, title, callback){ var d = xml.create('plist', {'version':'1.0'}) .ele('dict') .ele('key','items').up() .ele('array') .ele('dict') .ele('key','assets').up() .ele('array') .ele('dict') .ele('key','kind').up() .ele('string','software-package').up() .ele('key','url').up() .ele('string',path).up() .up() .up() .ele('key','metadata').up() .ele('dict') .ele('key','bundle-identifier').up() .ele('string', name).up() .ele('key', 'kind').up() .ele('string','software').up() .ele('key','title').up() .ele('string', title) .up() .up() .up() .up() .up() .end({ pretty: true}); //generate unique file path:) use this for now. var filePath = './processing/file' + new Date().getMilliseconds() + '.plist'; fs.writeFile(filePath, d, function(err){ callback(err,filePath); }); console.log(xml); } //--------------EXPORTS---------------// exports.creatPlist = creatPlist;
dimko1/ohmystore
server/utils/utils.xml.js
JavaScript
mit
1,412
<h2><span class="pref">options.data.</span>rows</h2> <p>Specifies a custom row definition for this item. This allows you to render multiple rows for a single item.</p> <p>This is useful when you want to have a data item be represented with multiple rows. This is especially useful when you toggle the visibility of the second row via a button (ie. expand/collapse details).</p> <h5>Type and Default</h5> <blockquote> <p><code class="pill green">(object)</code>: Default <code class="pill">undefined</code>.</p> </blockquote> <h5>Example</h5> <pre><code class="language-javascript">rows: { 0: { height: 20, formatter: function () { return "Secondary Row"; } } }</code></pre> <h5>Demo</h5> <div id="demo-grid"></div>
globexdesigns/doby-website
pages/grid-options-data-rows.html
HTML
mit
767
<?php /** * Model_Post actions test * * @group anonymous * @group invalid */ class PostTest extends PHPUnit_Framework_TestCase { private static $_empty_db = FALSE; protected function setUp() { Kohana::$config->load('database')->default = Kohana::$config->load('database')->test; Database::$default = 'test'; if (!self::$_empty_db) $this->prepare_db(); Auth::instance()->login('unittest', '12345'); } /* QUESTION TEST METHODS */ /* * Add 10 anonymous questions with ids 1..10 */ public function testAddQuestionGuest() { for ($i = 1; $i < 11; $i++) $this->addQuestionGuest($i); } /** * @depends testAddQuestionGuest */ /* * Add 10 user questions with ids 10..20 */ public function testAddQuestionUser() { for ($i = 1; $i < 11; $i++) $this->addQuestionUser($i); } /** * @depends testAddQuestionUser */ /* * error on purpose => id:3 and id:5, update id:13, id:14 */ public function testUpdateUserQuestion() { $this->updateUserQuestion(3, FALSE); $this->updateUserQuestion(5, FALSE); $this->updateUserQuestion(13); $this->updateUserQuestion(14); } /** * @depends testUpdateUserQuestion */ /* * error on purpose => id:2, delete id:18, id:19 */ public function testDeleteUserQuestion() { $this->deleteUserQuestion(2, FALSE); $this->deleteUserQuestion(18); $this->deleteUserQuestion(19); } /* ANSWER TEST METHODS */ /** * @depends testDeleteUserQuestion */ /* * Add 4 anonymous Answers with ids 21 (parent:1), 22(P:2), 23(P:3), 24(P:1), 25(P:12) */ public function testAddAnswerGuest() { for ($i = 0; $i < 4; $i++) $this->addAnswerGuest(($i % 3) + 1); $this->addAnswerGuest(12); } /** * @depends testAddAnswerGuest */ /* * Add 4 user Answers with ids 26 (P:1), 27(P:4), 28(P:9), 29(P:16) */ public function testAddAnswerUser() { for ($i = 1; $i < 5; $i++) $this->addAnswerUser($i * $i); } /** * @depends testAddAnswerUser */ /* * error on purpose => id:21(P:2), id:22(P:1) , update id:25(P:1), id:27(P:9) */ public function testUpdateUserAnswer() { $this->updateUserAnswer(21, 2, FALSE); $this->updateUserAnswer(22, 1, FALSE); $this->updateUserAnswer(26, 1); $this->updateUserAnswer(28, 9); } /** * @depends testUpdateUserAnswer */ /* * error on purpose => id:24(P:2), delete id:26(P:4), id:28 (P:16) */ public function testDeleteUserAnswer() { $this->deleteUserAnswer(24, 2, FALSE); $this->deleteUserAnswer(27, 4); $this->deleteUserAnswer(29, 16); } /** * @depends testDeleteUserAnswer */ /* * error on purpose => id:8, id:13, vote id:1, id:8 */ public function testVoteQuestion() { Auth::instance()->logout(TRUE, TRUE); Auth::instance()->login('admin', '12345'); $this->voteQuestion(1, 1); $this->voteQuestion(13, 0); $this->voteQuestion(8, 1); $this->voteQuestion(8, 1, FALSE); // error } /** * @depends testVoteQuestion */ /* * error on purpose => id:23, vote id:22, id:23 */ public function testVoteAnswer() { Auth::instance()->logout(TRUE, TRUE); Auth::instance()->login('admin', '12345'); $this->voteAnswer(22, 0); $this->voteAnswer(23, 1); $this->voteAnswer(23, 1, FALSE); // error } /** * @depends testVoteAnswer */ public function testAcceptAnswer() { Auth::instance()->logout(TRUE, TRUE); Auth::instance()->login('unittest', '12345'); $this->acceptAnswer(25); $this->acceptAnswer(24, FALSE); // error: already accepted another answer } /** * @depends testAcceptAnswer */ /* * Add 3 user comments with ids 30 (P:11), 31(P:21), 32(P:26) */ public function testAddCommentUser() { $this->addCommentUser(11); $this->addCommentUser(21); $this->addCommentUser(26); } /** * @depends testAcceptAnswer */ /* * delete id:29(P:10), id:30 (P:11) => error */ public function testDeleteCommentUser() { $this->deleteCommentUser(30, 11); $this->deleteCommentUser(31, 11, FALSE); } /* PRIVATE METHODS */ private function addQuestionGuest($index) { $_POST = array(); $_POST['title'] = "TEST - Question Add $index - guest"; $_POST['content'] = "TEST - Question Add $index Content - guest"; $_POST['tags'] = 't-' . $index . ',a-' . $index . ',b-' . $index; $question = new Model_Question; $result_add = $question->insert($_POST); $this->assertSame(URL::title($_POST['title']), $question->slug); $this->assertSame(TRUE, $result_add); } private function addQuestionUser($index) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::QUESTION_ADD); $_POST = array(); $_POST['title'] = "TEST - Question Add $index - user"; $_POST['content'] = "TEST - Question Add $index Content - user"; $_POST['user_id'] = $user->id; $_POST['tags'] = 't-' . $index . ',a-' . $index . ',b-' . $index; $old_rep = $user->reputation; $old_question_count = $user->question_count; $question = new Model_Question; $result_add = $question->insert($_POST); $this->assertSame(URL::title($_POST['title']), $question->slug); $this->assertSame(TRUE, $result_add); $this->assertSame($user->reputation, $old_rep + $reputation_value); $this->assertSame($user->question_count, $old_question_count + 1); } private function updateUserQuestion($id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::QUESTION_ADD); $old_rep = $user->reputation; $old_question_count = $user->question_count; try { $post = Model_Question::get_user_question_by_id($id, $user); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('get_user_question_by_id', $ex->getMessage()); // Raise error return; } $_POST = array(); $_POST['title'] = "TEST - Question EDITED $id - user"; $_POST['content'] = "TEST - Question EDITED $id Content - user"; $_POST['user_id'] = $user->id; $_POST['tags'] = 'updated-tag'; try { $result_edit = $post->edit($_POST, ''); } catch (Exception $ex) { $this->assertEquals('edit', $ex->getMessage()); // Raise error } $this->assertSame($user->reputation, $old_rep); $this->assertSame($user->question_count, $old_question_count); } private function deleteUserQuestion($id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::QUESTION_ADD); $old_rep = $user->reputation; $old_question_count = $user->question_count; try { $post = Model_Question::get_user_question_by_id($id, $user)->delete(); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('delete', $ex->getMessage()); // Raise error return; } $this->assertSame($user->reputation, $old_rep - $reputation_value); $this->assertSame($user->question_count, $old_question_count - 1); } private function addAnswerGuest($parent_id) { $_POST = array(); $_POST['content'] = "TEST - Answer For $parent_id th question Content - guest"; if (($question = Model_Question::get($parent_id)) === NULL) throw new Kohana_Exception('Question could not be retrieved, ID:' . $parent_id); $answer = new Model_Answer; $result_add = $answer->insert($_POST, $parent_id); $this->assertSame(TRUE, $result_add); if (($question_updated = Model_Question::get($parent_id)) === NULL) throw new Kohana_Exception('Question could not be retrieved, ID:' . $parent_id); $this->assertSame($question->answer_count + 1, (int) $question_updated->answer_count); } private function addAnswerUser($parent_id) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::ANSWER_ADD); $_POST = array(); $_POST['content'] = "TEST - Answer For $parent_id th question Content - user"; $_POST['user_id'] = $user->id; if (($question = Model_Question::get($parent_id)) === NULL) throw new Kohana_Exception('Question could not be retrieved, ID: ' . $parent_id); $old_rep = $user->reputation; $old_answer_count = $user->answer_count; $answer = new Model_Answer; $result_add = $answer->insert($_POST, $parent_id); $this->assertSame(TRUE, $result_add); $this->assertSame($user->reputation, $old_rep + $reputation_value); $this->assertSame($user->answer_count, $old_answer_count + 1); if (($question_updated = Model_Question::get($parent_id)) === NULL) throw new Kohana_Exception('Post could not be retrieved, ID:' . $parent_id); $this->assertSame($question->answer_count + 1, (int) $question_updated->answer_count); } private function updateUserAnswer($id, $parent_id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $old_rep = $user->reputation; $old_answer_count = $user->answer_count; try { $post = Model_Answer::get_user_answer_by_id($id, $user); if ($parent_id != $post->parent_post_id) throw new Kohana_Exception(sprintf('Given parent id and post parent id are not equal. given: %d, expected: %d' , $parent_id, $post->parent_post_id)); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('get_user_answer_by_id', $ex->getMessage()); // Raise error return; } $_POST = array(); $_POST['content'] = "TEST - Answer EDITED $id, parent_id: $parent_id Content - user"; $_POST['user_id'] = $user->id; try { $question_slug = $post->edit($_POST); } catch (Exception $ex) { $this->assertEquals('edit', $ex->getMessage()); // Raise error } $this->assertNotEquals($question_slug, ''); $this->assertSame($user->reputation, $old_rep); $this->assertSame($user->answer_count, $old_answer_count); } private function deleteUserAnswer($id, $parent_id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::ANSWER_ADD); $old_rep = $user->reputation; $old_answer_count = $user->answer_count; try { $post = Model_Answer::get_user_answer_by_id($id, $user); if ($parent_id != $post->parent_post_id) throw new Kohana_Exception(sprintf('Given parent id and post parent id are not equal. given: %d, expected: %d' , $parent_id, $post->parent_post_id)); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('get_user_answer_by_id', $ex->getMessage()); // Raise error return; } try { $post->delete(); } catch (Exception $ex) { $this->assertEquals('delete', $ex->getMessage()); // Raise error } $this->assertSame($user->reputation, $old_rep - $reputation_value); $this->assertSame($user->answer_count, $old_answer_count - 1); } private function voteQuestion($post_id, $vote_type, $raise_error = TRUE) { $user = Auth::instance()->get_user(); if ($vote_type === 1) { $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::QUESTION_VOTE_UP); $reputation_value_owner = (int) Model_Setting::instance()->get(Model_Reputation::OWN_QUESTION_VOTED_UP); } else { $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::QUESTION_VOTE_DOWN); $reputation_value_owner = (int) Model_Setting::instance()->get(Model_Reputation::OWN_QUESTION_VOTED_DOWN); } $old_rep = $user->reputation; if (($post = Model_Question::get($post_id)) === NULL) { if ($raise_error) $this->assertEquals('voteQuestion', "post not found, ID: $post_id"); // Raise error return; } if ($post->user_id === $user->id) { if ($raise_error) $this->assertEquals('voteQuestion', 'You cannot vote on your own posts.'); // Raise error return; } $post_type = Helper_PostType::QUESTION; if ($post->user_id != 0) { if (($owner_user = Model_User::get($post->user_id)) === NULL) { $this->assertEquals('voteQuestion', 'Owner user couldnt be fetched. ID:' . $post->user_id); // Raise error return; } $old_rep_owner = $owner_user->reputation; } try { $result = $post->vote($vote_type); } catch (Exception $ex) { $this->assertEquals('vote', $ex->getMessage()); // Raise error } if ($result !== 1) { if ($raise_error) $this->assertEquals('voteQuestion', 'You already voted.'); // Raise error return; } $this->assertSame($user->reputation, $old_rep + $reputation_value); if ($post->user_id != 0) { $owner_user = Model_User::get($post->user_id); $this->assertSame((int) $owner_user->reputation, $old_rep_owner + $reputation_value_owner); } } private function voteAnswer($post_id, $vote_type, $raise_error = TRUE) { $user = Auth::instance()->get_user(); if ($vote_type === 1) { $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::ANSWER_VOTE_UP); $reputation_value_owner = (int) Model_Setting::instance()->get(Model_Reputation::OWN_ANSWER_VOTED_UP); } else { $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::ANSWER_VOTE_DOWN); $reputation_value_owner = (int) Model_Setting::instance()->get(Model_Reputation::OWN_ANSWER_VOTED_DOWN); } $old_rep = $user->reputation; if (($post = Model_Answer::get($post_id)) === NULL) { if ($raise_error) $this->assertEquals('voteAnswer', "post not found, ID: $post_id"); // Raise error return; } if ($post->user_id === $user->id) { if ($raise_error) $this->assertEquals('voteAnswer', 'You cannot vote on your own posts.'); // Raise error return; } $post_type = Helper_PostType::ANSWER; if ($post->user_id != 0) { if (($owner_user = Model_User::get($post->user_id)) === NULL) { $this->assertEquals('voteAnswer', 'Owner user couldnt be fetched.'); // Raise error return; } $old_rep_owner = $owner_user->reputation; } try { $result = $post->vote($vote_type); } catch (Exception $ex) { $this->assertEquals('vote', $ex->getMessage()); // Raise error } if ($result !== 1) { if ($raise_error) $this->assertEquals('voteAnswer', 'You already voted.'); // Raise error return; } $this->assertSame($user->reputation, $old_rep + $reputation_value); if ($post->user_id != 0) { $owner_user = Model_User::get($post->user_id); $this->assertSame($owner_user->reputation, $old_rep_owner + $reputation_value_owner); } } private function acceptAnswer($post_id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::ACCEPTED_ANSWER); $reputation_value_owner = (int) Model_Setting::instance()->get(Model_Reputation::OWN_ACCEPTED_ANSWER); $old_rep = $user->reputation; if (($post = Model_Answer::get($post_id)) === NULL) { if ($raise_error) $this->assertEquals('acceptAnswer', "post not found, ID: $post_id"); // Raise error return; } if ($post->user_id === $user->id) { if ($raise_error) $this->assertEquals('voteAnswer', 'You cannot accept your own posts.'); // Raise error return; } if ($post->user_id != 0) { if (($owner_user = Model_User::get($post->user_id)) === NULL) { $this->assertEquals('acceptAnswer', 'Owner user couldnt be fetched.'); // Raise error return; } $old_rep_owner = $owner_user->reputation; } try { $result = $post->accept_post(); } catch (Exception $ex) { $this->assertEquals('accept_post', $ex->getMessage()); // Raise error } if ($result < 1) { if ($result === -2 && $raise_error) $this->assertEquals('voteAnswer', 'Already Accepted An Answer'); // Raise error elseif ($result === -1 && $raise_error) $this->assertEquals('voteAnswer', 'Error occured'); // Raise error return; } $this->assertSame($user->reputation, $old_rep + $reputation_value); if ($post->user_id != 0) { $owner_user = Model_User::get($post->user_id); $this->assertSame($owner_user->reputation, $old_rep_owner + $reputation_value_owner); } } private function addCommentUser($parent_id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::COMMENT_ADD); $old_rep = $user->reputation; $_POST = array(); $_POST['content'] = "TEST - Comment For $parent_id th post Content - user"; if (($question = Model_Post::get($parent_id)) === NULL && $raise_error) throw new Kohana_Exception('Post could not be retrieved, ID:' . $parent_id); try { $comment = new Model_Comment; $add_comment_result = $comment->insert($_POST, $parent_id); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('add_comment', $ex->getMessage()); // Raise error return; } $this->assertSame(TRUE, $add_comment_result > 0); $this->assertSame($user->reputation, $old_rep + $reputation_value); if (($question_updated = Model_Post::get($parent_id)) === NULL && $raise_error) throw new Kohana_Exception('Post could not be retrieved, ID:' . $parent_id); $this->assertSame($question->comment_count + 1, (int) $question_updated->comment_count); } private function deleteCommentUser($comment_id, $parent_id, $raise_error = TRUE) { $user = Auth::instance()->get_user(); $reputation_value = (int) Model_Setting::instance()->get(Model_Reputation::COMMENT_ADD); $old_rep = $user->reputation; try { $comment = Model_Comment::get_user_comment_by_id($comment_id, $user); if ($comment->parent_post_id != $parent_id && $raise_error) { $this->assertEquals('delete', 'Parents not matched!'); // Raise error return; } $comment->delete(); } catch (Exception $ex) { if ($raise_error) $this->assertEquals('delete', $ex->getMessage()); // Raise error return; } $this->assertSame($user->reputation, $old_rep - $reputation_value); } private function prepare_db() { $this->prevent_test_overwrite_current_db(); self::$_empty_db = TRUE; $this->prepare_database_for_test(); } private function prevent_test_overwrite_current_db() { $current_db = DB::select(array(DB::Expr('DATABASE()'), 'database'))->execute()->current(); $test_db = Kohana::$config->load('database')->test; if ($current_db['database'] !== $test_db['connection']['database']) { throw new Kohana_Exception('CURRENT DB IS NOT A TEST DB!!!!!'); } } private function prepare_database_for_test() { $this->drop_and_create_tables('/var/www/qamini/application/db_changes/31032011_1300_qamini_development_empty.sql'); $this->prepare_tables('/var/www/qamini/application/db_changes/03032011_1300_empty_db_script.sql'); } private function drop_and_create_tables($file_name) { $this->execute_sql_from_file($file_name); } private function prepare_tables($file_name) { $this->execute_sql_from_file($file_name); } private function execute_sql_from_file($file_name) { $sql = ''; $sql = file_get_contents($file_name); $query_arr = explode(';', $sql); foreach ($query_arr as $q) { if ($q === '') continue; DB::query(NULL, $q)->execute(); } } }
serdary/qamini
application/tests/post_test.php
PHP
mit
21,091
package math; import util.IReplicable; public class Vector3 implements IReplicable<Vector3> { private static final float MIN_TOLERANCE = (float) 1E-9; public float x; public float y; public float z; public static Vector3 of(float x, float y, float z) { Vector3 vector = new Vector3(); vector.x = x; vector.y = y; vector.z = z; return vector; } public static Vector3 getUnitX() { Vector3 vector = new Vector3(); vector.x = 1; return vector; } public static Vector3 getUnitY() { Vector3 vector = new Vector3(); vector.y = 1; return vector; } public static Vector3 getUnitZ() { Vector3 vector = new Vector3(); vector.z = 1; return vector; } public static Vector3 getUnit() { Vector3 vector = new Vector3(); vector.x = 1; vector.y = 1; vector.z = 1; return vector; } public boolean isUnitX() { return (x == 1) && (y == 0) && (z == 0); } public boolean isUnitY() { return (x == 0) && (y == 1) && (z == 0); } public boolean isUnitZ() { return (x == 0) && (y == 0) && (z == 1); } public boolean isUnit() { return (x == 1) && (y == 1) && (z == 1); } public float lengthSquared() { return (x * x) + (y * y) + (z * z); } public float length() { return (float) Math.sqrt(lengthSquared()); } public float inverseLength() { return 1f / length(); } public static Vector3 add(Vector3 a, Vector3 b) { Vector3 result = new Vector3(); add(result, a, b); return result; } public static void add(Vector3 result, Vector3 a, Vector3 b) { result.x = a.x + b.x; result.y = a.y + b.y; result.z = a.z + b.z; } public static Vector3 subtract(Vector3 a, Vector3 b) { Vector3 result = new Vector3(); subtract(result, a, b); return result; } public static void subtract(Vector3 result, Vector3 a, Vector3 b) { result.x = a.x - b.x; result.y = a.y - b.y; result.z = a.z - b.z; } public static Vector3 multiply(Vector3 a, float scalar) { Vector3 result = new Vector3(); multiply(result, a, scalar); return result; } public static void multiply(Vector3 result, Vector3 a, float scalar) { result.x = a.x * scalar; result.y = a.y * scalar; result.z = a.z * scalar; } public static Vector3 divide(Vector3 a, float scalar) { Vector3 result = new Vector3(); divide(result, a, scalar); return result; } public static void divide(Vector3 result, Vector3 a, float scalar) { float multiplier = (scalar <= MIN_TOLERANCE) ? 0 : 1f / scalar; multiply(result, a, multiplier); } public static float dot(Vector3 a, Vector3 b) { return (a.x * b.x) + (a.y * b.y) + (a.z * b.z); } public static Vector3 cross(Vector3 a, Vector3 b) { Vector3 result = new Vector3(); cross(result, a, b); return result; } public static void cross(Vector3 result, Vector3 a, Vector3 b) { float x = (a.y * b.z) - (a.z * b.y); float y = (a.z * b.x) - (a.x * b.z); float z = (a.x * b.y) - (a.y * b.x); result.x = x; result.y = y; result.z = z; } public static Vector3 negate(Vector3 a) { Vector3 result = new Vector3(); negate(result, a); return result; } public static void negate(Vector3 result, Vector3 a) { result.x = -a.x; result.y = -a.y; result.z = -a.z; } public static Vector3 normalise(Vector3 a) { Vector3 result = new Vector3(); normalise(result, a); return result; } public static void normalise(Vector3 result, Vector3 a) { float sumSq = (a.x * a.x) + (a.y * a.y) + (a.z * a.z); if (sumSq <= MIN_TOLERANCE) { result.x = 0; result.y = 1; result.z = 0; } else { double sum = Math.sqrt(sumSq); multiply(result, a, (float) (1.0 / sum)); } } @Override public Vector3 createBlank() { return new Vector3(); } @Override public void copyFrom(Vector3 master) { this.x = master.x; this.y = master.y; this.z = master.z; } }
NathanJAdams/verJ
src/math/Vector3.java
Java
mit
4,539
using Phaxio.Examples.ReceiveCallback.Models; using System.Collections.Generic; using System.Runtime.Caching; using System.Web.Mvc; namespace Phaxio.Examples.ReceiveCallback.Controllers { public class HomeController : Controller { public ActionResult Index() { ObjectCache cache = MemoryCache.Default; var faxList = cache["Callbacks"] as List<FaxReceipt>; return View(faxList); } } }
phaxio/phaxio-dotnet
Phaxio.Examples.ReceiveCallback/Controllers/HomeController.cs
C#
mit
461
<!doctype html> <html class="theme-next pisces use-motion"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <meta name="google-site-verification" content="hURnC-1VtFyi-v7OYQhy-5eOj-XZW3BAIs6iqzQcQj8" /> <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/> <link href='//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.5.0" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=5.0.0" rel="stylesheet" type="text/css" /> <meta name="keywords" content="jovey,Nodejs,react,redux,coffeescript,前端,js,jquery,javascript,html5,开发者,程序猿,极客,编程,代码,开源,IT网站,Developer,Programmer,Coder,html,css,css3,用户体验,Hexo,next..." /> <link rel="alternate" href="/atom.xml" title="HankCoder's Space" type="application/atom+xml" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.0" /> <meta name="description" content="Android | Linux | RD | OpenSource ..."> <meta property="og:type" content="website"> <meta property="og:title" content="HankCoder's Space"> <meta property="og:url" content="http://HankCoder.github.io/archives/2015/09/index.html"> <meta property="og:site_name" content="HankCoder's Space"> <meta property="og:description" content="Android | Linux | RD | OpenSource ..."> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="HankCoder's Space"> <meta name="twitter:description" content="Android | Linux | RD | OpenSource ..."> <script type="text/javascript" id="hexo.configuration"> var NexT = window.NexT || {}; var CONFIG = { scheme: 'Pisces', sidebar: '[object Object]', fancybox: true, motion: true }; </script> <title> 归档 | HankCoder's Space </title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-67800719-1', 'auto'); ga('send', 'pageview'); </script> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a046e8db6a48f2ab46b7812ba612789"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <div class="container one-collumn sidebar-position-left page-archive "> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">HankCoder's Space</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle">Reading The Fucking Code</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu menu-left"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-home fa-fw"></i> <br /> 首页 </a> </li> <li class="menu-item menu-item-categories"> <a href="/categories" rel="section"> <i class="menu-item-icon fa fa-th fa-fw"></i> <br /> 分类 </a> </li> <li class="menu-item menu-item-about"> <a href="/about" rel="section"> <i class="menu-item-icon fa fa-user fa-fw"></i> <br /> 关于 </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives" rel="section"> <i class="menu-item-icon fa fa-archive fa-fw"></i> <br /> 归档 </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags" rel="section"> <i class="menu-item-icon fa fa-tags fa-fw"></i> <br /> 标签 </a> </li> <li class="menu-item menu-item-search"> <a href="#" class="st-search-show-outputs"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索 </a> </li> </ul> <div class="site-search"> <form class="site-search-form"> <input type="text" id="st-search-input" class="st-search-input st-default-search-input" /> </form> <script type="text/javascript"> (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){ (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t); e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e); })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st'); _st('install', 'Eq6Hisgzq2b_MSGwmySM','2.0.0'); </script> </div> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <section id="posts" class="posts-collapse"> <span class="archive-move-on"></span> <span class="archive-page-counter"> 嗯..! 目前共计 16 篇日志。 继续努力。 </span> <div class="collection-title"> <h2 class="archive-year motion-element" id="archive-year-2015">2015</h2> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2015/09/07/article-1/" itemprop="url"> <span itemprop="name">使用Git管理项目-起步</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2015-09-07T12:06:21+08:00" content="2015-09-07" > 09-07 </time> </div> </header> </article> </section> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview sidebar-panel sidebar-panel-active "> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" src="/images/default_avatar.jpg" alt="HankCoder" /> <p class="site-author-name" itemprop="name">HankCoder</p> <p class="site-description motion-element" itemprop="description">Android | Linux | RD | OpenSource ...</p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives"> <span class="site-state-item-count">16</span> <span class="site-state-item-name">日志</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories"> <span class="site-state-item-count">6</span> <span class="site-state-item-name">分类</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags"> <span class="site-state-item-count">12</span> <span class="site-state-item-name">标签</span> </a> </div> </nav> <div class="feed-link motion-element"> <a href="/atom.xml" rel="alternate"> <i class="fa fa-rss"></i> RSS </a> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/HankCoder" target="_blank"> <i class="fa fa-github"></i> GitHub </a> </span> <span class="links-of-author-item"> <a href="" target="_blank"> <i class="fa fa-twitter"></i> Twitter </a> </span> <span class="links-of-author-item"> <a href="" target="_blank"> <i class="fa fa-weibo"></i> Weibo </a> </span> <span class="links-of-author-item"> <a href="" target="_blank"> <i class="fa fa-facebook-square"></i> Facebook </a> </span> <span class="links-of-author-item"> <a href="" target="_blank"> <i class="fa fa-heartbeat"></i> JianShu </a> </span> </div> <div class="cc-license motion-element" itemprop="license"> <a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank"> <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" /> </a> </div> <div class="links-of-author motion-element"> </div> </section> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; 2015 - <span itemprop="copyrightYear">2017</span> <span class="with-love"> <i class="icon-next-heart fa fa-leaf"></i> </span> <span class="author" itemprop="copyrightHolder">HankCoder</span> </div> <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"> </script> </div> </footer> <div class="back-to-top"></div> </div> <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script> <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script> <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script> <script type="text/javascript" src="/js/src/utils.js?v=5.0.0"></script> <script type="text/javascript" src="/js/src/motion.js?v=5.0.0"></script> <script type="text/javascript" src="/js/src/affix.js?v=5.0.0"></script> <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.0.0"></script> <script type="text/javascript" id="motion.page.archive"> $('.archive-year').velocity('transition.slideLeftIn'); </script> <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.0"></script> <script type="text/javascript"> var duoshuoQuery = {short_name:"hankcoder"}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.id = 'duoshuo-script'; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <script type="text/javascript"> var duoshuo_user_ID = 13537963; var duoshuo_admin_nickname = "博主"; </script> <script src="/vendors/ua-parser-js/dist/ua-parser.min.js"></script> <script src="/js/src/hook-duoshuo.js"></script> <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script> <script>AV.initialize("KIpFhjbOqk9B6NsU6sEACyJt", "HOFTbHJmJyGsoGKssFSPrPAy");</script> <script> function showTime(Counter) { var query = new AV.Query(Counter); var entries = []; var $visitors = $(".leancloud_visitors"); $visitors.each(function () { entries.push( $(this).attr("id").trim() ); }); query.containedIn('url', entries); query.find() .done(function (results) { var COUNT_CONTAINER_REF = '.leancloud-visitors-count'; if (results.length === 0) { $visitors.find(COUNT_CONTAINER_REF).text(0); return; } for (var i = 0; i < results.length; i++) { var item = results[i]; var url = item.get('url'); var time = item.get('time'); var element = document.getElementById(url); $(element).find(COUNT_CONTAINER_REF).text(time); } }) .fail(function (object, error) { console.log("Error: " + error.code + " " + error.message); }); } function addCount(Counter) { var $visitors = $(".leancloud_visitors"); var url = $visitors.attr('id').trim(); var title = $visitors.attr('data-flag-title').trim(); var query = new AV.Query(Counter); query.equalTo("url", url); query.find({ success: function(results) { if (results.length > 0) { var counter = results[0]; counter.fetchWhenSave(true); counter.increment("time"); counter.save(null, { success: function(counter) { var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text(counter.get('time')); }, error: function(counter, error) { console.log('Failed to save Visitor num, with error message: ' + error.message); } }); } else { var newcounter = new Counter(); newcounter.set("title", title); newcounter.set("url", url); newcounter.set("time", 1); newcounter.save(null, { success: function(newcounter) { var $element = $(document.getElementById(url)); $element.find('.leancloud-visitors-count').text(newcounter.get('time')); }, error: function(newcounter, error) { console.log('Failed to create'); } }); } }, error: function(error) { console.log('Error:' + error.code + " " + error.message); } }); } $(function() { var Counter = AV.Object.extend("Counter"); if ($('.leancloud_visitors').length == 1) { addCount(Counter); } else if ($('.post-title-link').length > 1) { showTime(Counter); } }); </script> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery-lazyload/1.9.5/jquery.lazyload.js"></script> <script type="text/javascript"> $(function () { $("#posts").find('img').lazyload({ placeholder: "/images/loading.gif", effect: "fadeIn" }); }); </script> </body> </html>
HankCoder/BlogBackup
public/archives/2015/09/index.html
HTML
mit
16,975
<!DOCTYPE html> <html> <head> <title>MathNotes</title> <link rel="stylesheet" href="css/main.css"/> <link rel="shortcut icon" href="img/pi.png"/> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=AM_CHTML"> </script> </head> <body> <ul id="navbar"><li><a href="index.html"><button>Home</button></a></li><li><a href="notes.html"><button>Notes</button></a></li><li><a href="about.html"><button>About</button></a></li><li><a href="contact.html"><button>Contact</button></a></li> </ul> <p class = "entry">[5/10/17] Book Notes: 5.2 Proving Trig Identities</p> <p>Prove: `(x^2-1) / (x-1) - (x^2-1)/(x+1) = 2`</p><br> <p>`((x-1)(x+1))/(x-1) - ((x+1)(x-1))/((x+1)) =`</p><br> <p>`(x+1) - (x-1) =`</p><br> <p>`x+1 - x + 1 =`</p><br> <p>`2`</p><br> <hr> <p>Prove: `tanTheta + cotTheta = secThetacscTheta`</p><br> <p>`tanTheta + 1 / tanTheta =`</p><br> <p>`sinTheta / cosTheta + cosTheta / sinTheta =`</p><br> <p>`(sin^2Theta + cos^2Theta) /(sinThetacosTheta) =`</p><br> <p>`1 / (sinThetacosTheta) =`</p><br> <p>`secThetacscTheta`</p><br> <hr> <p>Prove: `cosTheta/(1-sinTheta) = (1 + sinTheta)/cosTheta`</p><br> <p>`((1+sinTheta)(cosTheta))/((1+sinTheta)(1-sinTheta)) =`</p><br> <p>`((1+sinTheta)(cosTheta))/(1-sin^2Theta) =`</p><br> <p>`(1+sinTheta)/cosTheta`</p><br> </body> </html>
TheKingSparta/MathNotes
notes.html
HTML
mit
1,494
{-| Module : TestUtils.Validate Description : The Validate type class Copyright : (c) Andrew Burnett 2014-2015 Maintainer : andyburnett88@gmail.com Stability : experimental Portability : Unknown 'Validate' provides a definition for validating a data structure. For example, we may cache information about the size of a list as it is created. Validate would check that this is correct -} module TestUtils.Validate ( Validate(..) ) where {-| The 'Validate' class provides a validate method for types, to make sure that they have been defined correctly. -} class Validate a where -- | validate should return a 'Bool' which defines whether a data structure -- | is valid validate :: a -> Bool
aburnett88/HSat
tests-src/TestUtils/Validate.hs
Haskell
mit
712
<!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 --> <title>org.robolectric.shadows</title> <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="org.robolectric.shadows"; } } 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 class="navBarCell1Rev">Package</li> <li>Class</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"><ul class="navList" style="font-size: 1.5em;"><li>Robolectric 4.2 | <a href="/" target="_top"><img src="http://robolectric.org/images/logo-with-bubbles-down.png" style="max-height: 18pt; vertical-align: sub;"/></a></li></ul></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/shadow/api/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../org/robolectric/shadows/gms/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/shadows/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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&nbsp;org.robolectric.shadows</h1> <div class="docSummary"> <div class="block">Package containing shadow classes for the Android SDK.</div> </div> <p>See:&nbsp;<a href="#package.description">Description</a></p> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</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/robolectric/shadows/_Activity_.html" title="interface in org.robolectric.shadows">_Activity_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/Activity.html?is-external=true" title="class or interface in android.app"><code>Activity</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Provider.html" title="interface in org.robolectric.shadows">Provider</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityNodeInfo.OnPerformActionListener.html" title="interface in org.robolectric.shadows">ShadowAccessibilityNodeInfo.OnPerformActionListener</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityThread._ActivityThread_.html" title="interface in org.robolectric.shadows">ShadowActivityThread._ActivityThread_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/ActivityThread.html?is-external=true" title="class or interface in android.app"><code>ActivityThread</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityThread._AppBindData_.html" title="interface in org.robolectric.shadows">ShadowActivityThread._AppBindData_</a></td> <td class="colLast"> <div class="block">Accessor interface for <code>ActivityThread.AppBindData</code>&rsquo;s internals.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContextImpl._ContextImpl_.html" title="interface in org.robolectric.shadows">ShadowContextImpl._ContextImpl_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/ContextImpl.html?is-external=true" title="class or interface in android.app"><code>ContextImpl</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputMethodManager.SoftInputVisibilityChangeHandler.html" title="interface in org.robolectric.shadows">ShadowInputMethodManager.SoftInputVisibilityChangeHandler</a></td> <td class="colLast"> <div class="block">Handler for receiving soft input visibility changed event.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInstrumentation._Instrumentation_.html" title="interface in org.robolectric.shadows">ShadowInstrumentation._Instrumentation_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/Instrumentation.html?is-external=true" title="class or interface in android.app"><code>Instrumentation</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLoadedApk._LoadedApk_.html" title="interface in org.robolectric.shadows">ShadowLoadedApk._LoadedApk_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/LoadedApk.html?is-external=true" title="class or interface in android.app"><code>LoadedApk</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.CreateListener.html" title="interface in org.robolectric.shadows">ShadowMediaPlayer.CreateListener</a></td> <td class="colLast"> <div class="block">Callback interface for clients that wish to be informed when a new <a href="https://developer.android.com/reference/android/media/MediaPlayer.html?is-external=true" title="class or interface in android.media"><code>MediaPlayer</code></a> instance is constructed.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.MediaEvent.html" title="interface in org.robolectric.shadows">ShadowMediaPlayer.MediaEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageParser._Package_.html" title="interface in org.robolectric.shadows">ShadowPackageParser._Package_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/content/pm/PackageParser.Package.html?is-external=true" title="class or interface in android.content.pm"><code>PackageParser.Package</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemServiceRegistry._ServiceFetcherM_.html" title="interface in org.robolectric.shadows">ShadowSystemServiceRegistry._ServiceFetcherM_</a></td> <td class="colLast"> <div class="block">Accessor interface for <code>android.app.SystemServiceRegistry.StaticOuterContextServiceFetcher</code>&rsquo;s internals (for M).</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemServiceRegistry._ServiceFetcherN_.html" title="interface in org.robolectric.shadows">ShadowSystemServiceRegistry._ServiceFetcherN_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/SystemServiceRegistry.StaticApplicationContextServiceFetcher.html?is-external=true" title="class or interface in android.app"><code>SystemServiceRegistry.StaticApplicationContextServiceFetcher</code></a>&rsquo;s internals (for N+).</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemServiceRegistry._StaticServiceFetcher_.html" title="interface in org.robolectric.shadows">ShadowSystemServiceRegistry._StaticServiceFetcher_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/app/SystemServiceRegistry.StaticServiceFetcher.html?is-external=true" title="class or interface in android.app"><code>SystemServiceRegistry.StaticServiceFetcher</code></a>&rsquo;s internals.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsbManager._UsbManager_.html" title="interface in org.robolectric.shadows">ShadowUsbManager._UsbManager_</a></td> <td class="colLast"> <div class="block">Accessor interface for <a href="https://developer.android.com/reference/android/hardware/usb/UsbManager.html?is-external=true" title="class or interface in android.hardware.usb"><code>UsbManager</code></a>&rsquo;s internals.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</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/robolectric/shadows/CachedPathIteratorFactory.html" title="class in org.robolectric.shadows">CachedPathIteratorFactory</a></td> <td class="colLast"> <div class="block">Class that returns iterators for a given path.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ClassNameResolver.html" title="class in org.robolectric.shadows">ClassNameResolver</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.html" title="class in org.robolectric.shadows">Converter</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.FromArray.html" title="class in org.robolectric.shadows">Converter.FromArray</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.FromAttrData.html" title="class in org.robolectric.shadows">Converter.FromAttrData</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.FromCharSequence.html" title="class in org.robolectric.shadows">Converter.FromCharSequence</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.FromColor.html" title="class in org.robolectric.shadows">Converter.FromColor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter.FromFilePath.html" title="class in org.robolectric.shadows">Converter.FromFilePath</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter2.html" title="class in org.robolectric.shadows">Converter2</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter2.FromCharSequence.html" title="class in org.robolectric.shadows">Converter2.FromCharSequence</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/Converter2.FromColor.html" title="class in org.robolectric.shadows">Converter2.FromColor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ImageUtil.html" title="class in org.robolectric.shadows">ImageUtil</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/LegacyManifestParser.html" title="class in org.robolectric.shadows">LegacyManifestParser</a></td> <td class="colLast"> <div class="block">Creates a <a href="https://developer.android.com/reference/android/content/pm/PackageInfo.html?is-external=true" title="class or interface in android.content.pm"><code>PackageInfo</code></a> from a <a href="../../../org/robolectric/manifest/AndroidManifest.html" title="class in org.robolectric.manifest"><code>AndroidManifest</code></a></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/NativeAndroidInput.html" title="class in org.robolectric.shadows">NativeAndroidInput</a></td> <td class="colLast"> <div class="block">Java representation of framework native system headers Transliterated from oreo-mr1 (SDK 27) frameworks/native/include/android/Input.h</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/NativeBitSet64.html" title="class in org.robolectric.shadows">NativeBitSet64</a></td> <td class="colLast"> <div class="block">Transliteration of native BitSet64.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/NativeInput.html" title="class in org.robolectric.shadows">NativeInput</a></td> <td class="colLast"> <div class="block">Java representation of framework native input Transliterated from oreo-mr1 (SDK 27) frameworks/native/include/input/Input.h and libs/input/Input.cpp</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ResourceHelper.html" title="class in org.robolectric.shadows">ResourceHelper</a></td> <td class="colLast"> <div class="block">Helper class to provide various conversion method used in handling android resources.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ResourceHelper2.html" title="class in org.robolectric.shadows">ResourceHelper2</a></td> <td class="colLast"> <div class="block">Helper class to provide various conversion method used in handling android resources.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ResourceModeShadowPicker.html" title="class in org.robolectric.shadows">ResourceModeShadowPicker</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/RoundRectangle.html" title="class in org.robolectric.shadows">RoundRectangle</a></td> <td class="colLast"> <div class="block">Defines a rectangle with rounded corners, where the sizes of the corners are potentially different.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAbsListView.html" title="class in org.robolectric.shadows">ShadowAbsListView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAbsSeekBar.html" title="class in org.robolectric.shadows">ShadowAbsSeekBar</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAbsSpinner.html" title="class in org.robolectric.shadows">ShadowAbsSpinner</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAbstractCursor.html" title="class in org.robolectric.shadows">ShadowAbstractCursor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityButtonController.html" title="class in org.robolectric.shadows">ShadowAccessibilityButtonController</a></td> <td class="colLast"> <div class="block">Shadow for <a href="https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.html?is-external=true" title="class or interface in android.accessibilityservice"><code>AccessibilityButtonController</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityManager.html" title="class in org.robolectric.shadows">ShadowAccessibilityManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityNodeInfo.html" title="class in org.robolectric.shadows">ShadowAccessibilityNodeInfo</a></td> <td class="colLast"> <div class="block">Properties of <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html?is-external=true" title="class or interface in android.view.accessibility"><code>AccessibilityNodeInfo</code></a> that are normally locked may be changed using test APIs.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityNodeInfo.ShadowAccessibilityAction.html" title="class in org.robolectric.shadows">ShadowAccessibilityNodeInfo.ShadowAccessibilityAction</a></td> <td class="colLast"> <div class="block">Shadow of AccessibilityAction.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityRecord.html" title="class in org.robolectric.shadows">ShadowAccessibilityRecord</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityRecord.html?is-external=true" title="class or interface in android.view.accessibility"><code>AccessibilityRecord</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityService.html" title="class in org.robolectric.shadows">ShadowAccessibilityService</a></td> <td class="colLast"> <div class="block">Shadow of AccessibilityService that saves global actions to a list.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccessibilityWindowInfo.html" title="class in org.robolectric.shadows">ShadowAccessibilityWindowInfo</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html?is-external=true" title="class or interface in android.view.accessibility"><code>AccessibilityWindowInfo</code></a> that allows a test to set properties that are locked in the original class.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAccountManager.html" title="class in org.robolectric.shadows">ShadowAccountManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivity.html" title="class in org.robolectric.shadows">ShadowActivity</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivity.IntentForResult.html" title="class in org.robolectric.shadows">ShadowActivity.IntentForResult</a></td> <td class="colLast"> <div class="block">Container object to hold an Intent, together with the requestCode used in a call to <code>Activity.startActivityForResult(Intent, int)</code></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivity.PermissionsRequest.html" title="class in org.robolectric.shadows">ShadowActivity.PermissionsRequest</a></td> <td class="colLast"> <div class="block">Class to hold a permissions request, including its request code.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityGroup.html" title="class in org.robolectric.shadows">ShadowActivityGroup</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityManager.html" title="class in org.robolectric.shadows">ShadowActivityManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityManagerNative.html" title="class in org.robolectric.shadows">ShadowActivityManagerNative</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowActivityThread.html" title="class in org.robolectric.shadows">ShadowActivityThread</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAdapterView.html" title="class in org.robolectric.shadows">ShadowAdapterView</a>&lt;T extends <a href="https://developer.android.com/reference/android/widget/Adapter.html?is-external=true" title="class or interface in android.widget">Adapter</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAlarmManager.html" title="class in org.robolectric.shadows">ShadowAlarmManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAlarmManager.ScheduledAlarm.html" title="class in org.robolectric.shadows">ShadowAlarmManager.ScheduledAlarm</a></td> <td class="colLast"> <div class="block">Container object to hold a PendingIntent and parameters describing when to send it.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAlertController.html" title="class in org.robolectric.shadows">ShadowAlertController</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAlertDialog.html" title="class in org.robolectric.shadows">ShadowAlertDialog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAlertDialog.ShadowBuilder.html" title="class in org.robolectric.shadows">ShadowAlertDialog.ShadowBuilder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAndroidBidi.html" title="class in org.robolectric.shadows">ShadowAndroidBidi</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAndroidHttpClient.html" title="class in org.robolectric.shadows">ShadowAndroidHttpClient</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAnimationBridge.html" title="class in org.robolectric.shadows">ShadowAnimationBridge</a></td> <td class="colLast"> <div class="block">Bridge between shadows and <a href="https://developer.android.com/reference/android/view/animation/Animation.html?is-external=true" title="class or interface in android.view.animation"><code>Animation</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAnimationUtils.html" title="class in org.robolectric.shadows">ShadowAnimationUtils</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowApkAssets.html" title="class in org.robolectric.shadows">ShadowApkAssets</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowApkAssets.Picker.html" title="class in org.robolectric.shadows">ShadowApkAssets.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowApplication.html" title="class in org.robolectric.shadows">ShadowApplication</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowApplication.Wrapper.html" title="class in org.robolectric.shadows">ShadowApplication.Wrapper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowApplicationPackageManager.html" title="class in org.robolectric.shadows">ShadowApplicationPackageManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppOpsManager.html" title="class in org.robolectric.shadows">ShadowAppOpsManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppOpsManager.ModeAndException.html" title="class in org.robolectric.shadows">ShadowAppOpsManager.ModeAndException</a></td> <td class="colLast"> <div class="block">Class holding usage mode and excpetion packages.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppTask.html" title="class in org.robolectric.shadows">ShadowAppTask</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppWidgetHost.html" title="class in org.robolectric.shadows">ShadowAppWidgetHost</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppWidgetHostView.html" title="class in org.robolectric.shadows">ShadowAppWidgetHostView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAppWidgetManager.html" title="class in org.robolectric.shadows">ShadowAppWidgetManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArrayAdapter.html" title="class in org.robolectric.shadows">ShadowArrayAdapter</a>&lt;T&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArscApkAssets9.html" title="class in org.robolectric.shadows">ShadowArscApkAssets9</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArscAssetInputStream.html" title="class in org.robolectric.shadows">ShadowArscAssetInputStream</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArscAssetManager.html" title="class in org.robolectric.shadows">ShadowArscAssetManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArscAssetManager9.html" title="class in org.robolectric.shadows">ShadowArscAssetManager9</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowArscResourcesImpl.html" title="class in org.robolectric.shadows">ShadowArscResourcesImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAssetInputStream.html" title="class in org.robolectric.shadows">ShadowAssetInputStream</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAssetInputStream.Picker.html" title="class in org.robolectric.shadows">ShadowAssetInputStream.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAssetManager.html" title="class in org.robolectric.shadows">ShadowAssetManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAssetManager.ArscBase.html" title="class in org.robolectric.shadows">ShadowAssetManager.ArscBase</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAssetManager.Picker.html" title="class in org.robolectric.shadows">ShadowAssetManager.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAsyncQueryHandler.html" title="class in org.robolectric.shadows">ShadowAsyncQueryHandler</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/content/AsyncQueryHandler.html?is-external=true" title="class or interface in android.content"><code>AsyncQueryHandler</code></a>, which calls methods synchronously.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAsyncTask.html" title="class in org.robolectric.shadows">ShadowAsyncTask</a>&lt;Params,Progress,Result&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAsyncTaskBridge.html" title="class in org.robolectric.shadows">ShadowAsyncTaskBridge</a>&lt;Params,Progress,Result&gt;</td> <td class="colLast"> <div class="block">Bridge between shadows and <a href="https://developer.android.com/reference/android/os/AsyncTask.html?is-external=true" title="class or interface in android.os"><code>AsyncTask</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAsyncTaskLoader.html" title="class in org.robolectric.shadows">ShadowAsyncTaskLoader</a>&lt;D&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAudioEffect.html" title="class in org.robolectric.shadows">ShadowAudioEffect</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAudioManager.html" title="class in org.robolectric.shadows">ShadowAudioManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAudioManager.AudioFocusRequest.html" title="class in org.robolectric.shadows">ShadowAudioManager.AudioFocusRequest</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowAutofillManager.html" title="class in org.robolectric.shadows">ShadowAutofillManager</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/os/AutofillManager.html?is-external=true" title="class or interface in android.os"><code>AutofillManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBackgroundThread.html" title="class in org.robolectric.shadows">ShadowBackgroundThread</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBackupManager.html" title="class in org.robolectric.shadows">ShadowBackupManager</a></td> <td class="colLast"> <div class="block">A stub implementation of <a href="https://developer.android.com/reference/android/app/backup/BackupManager.html?is-external=true" title="class or interface in android.app.backup"><code>BackupManager</code></a> that instead of connecting to a real backup transport and performing restores, stores which packages are restored from which backup set, and can be verified using methods on the shadow like <a href="../../../org/robolectric/shadows/ShadowBackupManager.html#getPackageRestoreToken-java.lang.String-"><code>ShadowBackupManager.getPackageRestoreToken(String)</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBaseAdapter.html" title="class in org.robolectric.shadows">ShadowBaseAdapter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBatteryManager.html" title="class in org.robolectric.shadows">ShadowBatteryManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBinder.html" title="class in org.robolectric.shadows">ShadowBinder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBinderBridge.html" title="class in org.robolectric.shadows">ShadowBinderBridge</a></td> <td class="colLast"> <div class="block">Bridge between shadow and <a href="https://developer.android.com/reference/android/os/Binder.html?is-external=true" title="class or interface in android.os"><code>Binder</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBitmap.html" title="class in org.robolectric.shadows">ShadowBitmap</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBitmapDrawable.html" title="class in org.robolectric.shadows">ShadowBitmapDrawable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBitmapFactory.html" title="class in org.robolectric.shadows">ShadowBitmapFactory</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBitmapRegionDecoder.html" title="class in org.robolectric.shadows">ShadowBitmapRegionDecoder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBitmapShader.html" title="class in org.robolectric.shadows">ShadowBitmapShader</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBlockGuardOs.html" title="class in org.robolectric.shadows">ShadowBlockGuardOs</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothAdapter.html" title="class in org.robolectric.shadows">ShadowBluetoothAdapter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothDevice.html" title="class in org.robolectric.shadows">ShadowBluetoothDevice</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothGatt.html" title="class in org.robolectric.shadows">ShadowBluetoothGatt</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothHeadset.html" title="class in org.robolectric.shadows">ShadowBluetoothHeadset</a></td> <td class="colLast"> <div class="block">Shadow for <a href="https://developer.android.com/reference/android/bluetooth/BluetoothHeadset.html?is-external=true" title="class or interface in android.bluetooth"><code>BluetoothHeadset</code></a></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothManager.html" title="class in org.robolectric.shadows">ShadowBluetoothManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothServerSocket.html" title="class in org.robolectric.shadows">ShadowBluetoothServerSocket</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBluetoothSocket.html" title="class in org.robolectric.shadows">ShadowBluetoothSocket</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBroadcastPendingResult.html" title="class in org.robolectric.shadows">ShadowBroadcastPendingResult</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBroadcastReceiver.html" title="class in org.robolectric.shadows">ShadowBroadcastReceiver</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowBuild.html" title="class in org.robolectric.shadows">ShadowBuild</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCamera.html" title="class in org.robolectric.shadows">ShadowCamera</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCamera.ShadowParameters.html" title="class in org.robolectric.shadows">ShadowCamera.ShadowParameters</a></td> <td class="colLast"> <div class="block">Shadows the Android <code>Camera.Parameters</code> class.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCamera.ShadowSize.html" title="class in org.robolectric.shadows">ShadowCamera.ShadowSize</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCameraCharacteristics.html" title="class in org.robolectric.shadows">ShadowCameraCharacteristics</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCameraManager.html" title="class in org.robolectric.shadows">ShadowCameraManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.html" title="class in org.robolectric.shadows">ShadowCanvas</a></td> <td class="colLast"> <div class="block">Broken.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.ArcPaintHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.ArcPaintHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.CirclePaintHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.CirclePaintHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.LinePaintHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.LinePaintHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.OvalPaintHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.OvalPaintHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.RectPaintHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.RectPaintHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCanvas.TextHistoryEvent.html" title="class in org.robolectric.shadows">ShadowCanvas.TextHistoryEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCaptioningManager.html" title="class in org.robolectric.shadows">ShadowCaptioningManager</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/view/accessibility/CaptioningManager.html?is-external=true" title="class or interface in android.view.accessibility"><code>CaptioningManager</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCarrierConfigManager.html" title="class in org.robolectric.shadows">ShadowCarrierConfigManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowChoreographer.html" title="class in org.robolectric.shadows">ShadowChoreographer</a></td> <td class="colLast"> <div class="block">Robolectric maintains its own concept of the current time from the Choreographer&rsquo;s point of view, aimed at making animations work correctly.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowClipboardManager.html" title="class in org.robolectric.shadows">ShadowClipboardManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowColor.html" title="class in org.robolectric.shadows">ShadowColor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowColorMatrixColorFilter.html" title="class in org.robolectric.shadows">ShadowColorMatrixColorFilter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCompoundButton.html" title="class in org.robolectric.shadows">ShadowCompoundButton</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowConnectivityManager.html" title="class in org.robolectric.shadows">ShadowConnectivityManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentObserver.html" title="class in org.robolectric.shadows">ShadowContentObserver</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentProvider.html" title="class in org.robolectric.shadows">ShadowContentProvider</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentProviderClient.html" title="class in org.robolectric.shadows">ShadowContentProviderClient</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentProviderOperation.html" title="class in org.robolectric.shadows">ShadowContentProviderOperation</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentProviderResult.html" title="class in org.robolectric.shadows">ShadowContentProviderResult</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.html" title="class in org.robolectric.shadows">ShadowContentResolver</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.DeleteStatement.html" title="class in org.robolectric.shadows">ShadowContentResolver.DeleteStatement</a></td> <td class="colLast"> <div class="block">A statement used to delete content in a <a href="https://developer.android.com/reference/android/content/ContentProvider.html?is-external=true" title="class or interface in android.content"><code>ContentProvider</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.InsertStatement.html" title="class in org.robolectric.shadows">ShadowContentResolver.InsertStatement</a></td> <td class="colLast"> <div class="block">A statement used to insert content into a <a href="https://developer.android.com/reference/android/content/ContentProvider.html?is-external=true" title="class or interface in android.content"><code>ContentProvider</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.NotifiedUri.html" title="class in org.robolectric.shadows">ShadowContentResolver.NotifiedUri</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.Statement.html" title="class in org.robolectric.shadows">ShadowContentResolver.Statement</a></td> <td class="colLast"> <div class="block">A statement used to modify content in a <a href="https://developer.android.com/reference/android/content/ContentProvider.html?is-external=true" title="class or interface in android.content"><code>ContentProvider</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.Status.html" title="class in org.robolectric.shadows">ShadowContentResolver.Status</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentResolver.UpdateStatement.html" title="class in org.robolectric.shadows">ShadowContentResolver.UpdateStatement</a></td> <td class="colLast"> <div class="block">A statement used to update content in a <a href="https://developer.android.com/reference/android/content/ContentProvider.html?is-external=true" title="class or interface in android.content"><code>ContentProvider</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContentUris.html" title="class in org.robolectric.shadows">ShadowContentUris</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContextImpl.html" title="class in org.robolectric.shadows">ShadowContextImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContextThemeWrapper.html" title="class in org.robolectric.shadows">ShadowContextThemeWrapper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowContextWrapper.html" title="class in org.robolectric.shadows">ShadowContextWrapper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCookieManager.html" title="class in org.robolectric.shadows">ShadowCookieManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCookieSyncManager.html" title="class in org.robolectric.shadows">ShadowCookieSyncManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCornerPathEffect.html" title="class in org.robolectric.shadows">ShadowCornerPathEffect</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCountDownTimer.html" title="class in org.robolectric.shadows">ShadowCountDownTimer</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCrossProfileApps.html" title="class in org.robolectric.shadows">ShadowCrossProfileApps</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/content/pm/CrossProfileApps.html?is-external=true" title="class or interface in android.content.pm"><code>CrossProfileApps</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCrossProfileApps.StartedMainActivity.html" title="class in org.robolectric.shadows">ShadowCrossProfileApps.StartedMainActivity</a></td> <td class="colLast"> <div class="block">Container object to hold parameters passed to <a href="../../../org/robolectric/shadows/ShadowCrossProfileApps.html#startMainActivity-android.content.ComponentName-android.os.UserHandle-"><code>ShadowCrossProfileApps.startMainActivity(ComponentName, UserHandle)</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCursorWindow.html" title="class in org.robolectric.shadows">ShadowCursorWindow</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowCursorWrapper.html" title="class in org.robolectric.shadows">ShadowCursorWrapper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDashPathEffect.html" title="class in org.robolectric.shadows">ShadowDashPathEffect</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDateFormat.html" title="class in org.robolectric.shadows">ShadowDateFormat</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDateIntervalFormat.html" title="class in org.robolectric.shadows">ShadowDateIntervalFormat</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDatePickerDialog.html" title="class in org.robolectric.shadows">ShadowDatePickerDialog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDebug.html" title="class in org.robolectric.shadows">ShadowDebug</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDevicePolicyManager.html" title="class in org.robolectric.shadows">ShadowDevicePolicyManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDialog.html" title="class in org.robolectric.shadows">ShadowDialog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDiscoverySession.html" title="class in org.robolectric.shadows">ShadowDiscoverySession</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDisplay.html" title="class in org.robolectric.shadows">ShadowDisplay</a></td> <td class="colLast"> <div class="block">It is possible to override some display properties using setters on <a href="../../../org/robolectric/shadows/ShadowDisplay.html" title="class in org.robolectric.shadows"><code>ShadowDisplay</code></a>; however, this behavior is deprecated as of Robolectric 3.6 and will be removed in 3.7.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDisplayListCanvas.html" title="class in org.robolectric.shadows">ShadowDisplayListCanvas</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDisplayManager.html" title="class in org.robolectric.shadows">ShadowDisplayManager</a></td> <td class="colLast"> <div class="block">For tests, display properties may be changed and devices may be added or removed programmatically.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDisplayManagerGlobal.html" title="class in org.robolectric.shadows">ShadowDisplayManagerGlobal</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDownloadManager.html" title="class in org.robolectric.shadows">ShadowDownloadManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDownloadManager.ShadowQuery.html" title="class in org.robolectric.shadows">ShadowDownloadManager.ShadowQuery</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDownloadManager.ShadowRequest.html" title="class in org.robolectric.shadows">ShadowDownloadManager.ShadowRequest</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDrawable.html" title="class in org.robolectric.shadows">ShadowDrawable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowDropBoxManager.html" title="class in org.robolectric.shadows">ShadowDropBoxManager</a></td> <td class="colLast"> <div class="block">Fake dropbox manager that starts with no entries.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEdgeEffect.html" title="class in org.robolectric.shadows">ShadowEdgeEffect</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEnvironment.html" title="class in org.robolectric.shadows">ShadowEnvironment</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEnvironment.ShadowUserEnvironment.html" title="class in org.robolectric.shadows">ShadowEnvironment.ShadowUserEnvironment</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEuiccManager.html" title="class in org.robolectric.shadows">ShadowEuiccManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEventLog.html" title="class in org.robolectric.shadows">ShadowEventLog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEventLog.EventBuilder.html" title="class in org.robolectric.shadows">ShadowEventLog.EventBuilder</a></td> <td class="colLast"> <div class="block">Class to build <code>EventLog.Event</code></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowEventLog.ShadowEvent.html" title="class in org.robolectric.shadows">ShadowEventLog.ShadowEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowExifInterface.html" title="class in org.robolectric.shadows">ShadowExifInterface</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowExpandableListView.html" title="class in org.robolectric.shadows">ShadowExpandableListView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFileUtils.html" title="class in org.robolectric.shadows">ShadowFileUtils</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFilter.html" title="class in org.robolectric.shadows">ShadowFilter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFingerprintManager.html" title="class in org.robolectric.shadows">ShadowFingerprintManager</a></td> <td class="colLast"> <div class="block">Provides testing APIs for <a href="https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager.html?is-external=true" title="class or interface in android.hardware.fingerprint"><code>FingerprintManager</code></a></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFloatMath.html" title="class in org.robolectric.shadows">ShadowFloatMath</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFontFamily.html" title="class in org.robolectric.shadows">ShadowFontFamily</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowFontsContract.html" title="class in org.robolectric.shadows">ShadowFontsContract</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowGeocoder.html" title="class in org.robolectric.shadows">ShadowGeocoder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowGestureDetector.html" title="class in org.robolectric.shadows">ShadowGestureDetector</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowGLES20.html" title="class in org.robolectric.shadows">ShadowGLES20</a></td> <td class="colLast"> <div class="block">Fake implementation of <a href="https://developer.android.com/reference/android/opengl/GLES20.html?is-external=true" title="class or interface in android.opengl"><code>GLES20</code></a></div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowGLSurfaceView.html" title="class in org.robolectric.shadows">ShadowGLSurfaceView</a></td> <td class="colLast"> <div class="block">Fake implementation of GLSurfaceView</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowGradientDrawable.html" title="class in org.robolectric.shadows">ShadowGradientDrawable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowHandler.html" title="class in org.robolectric.shadows">ShadowHandler</a></td> <td class="colLast">Deprecated</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowHttpResponseCache.html" title="class in org.robolectric.shadows">ShadowHttpResponseCache</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIAppOpsService.html" title="class in org.robolectric.shadows">ShadowIAppOpsService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIAppOpsService.ShadowStub.html" title="class in org.robolectric.shadows">ShadowIAppOpsService.ShadowStub</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIcon.html" title="class in org.robolectric.shadows">ShadowIcon</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowICU.html" title="class in org.robolectric.shadows">ShadowICU</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowImageDecoder.html" title="class in org.robolectric.shadows">ShadowImageDecoder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputDevice.html" title="class in org.robolectric.shadows">ShadowInputDevice</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputEvent.html" title="class in org.robolectric.shadows">ShadowInputEvent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputEventReceiver.html" title="class in org.robolectric.shadows">ShadowInputEventReceiver</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputManager.html" title="class in org.robolectric.shadows">ShadowInputManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInputMethodManager.html" title="class in org.robolectric.shadows">ShadowInputMethodManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowInstrumentation.html" title="class in org.robolectric.shadows">ShadowInstrumentation</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIntent.html" title="class in org.robolectric.shadows">ShadowIntent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIntentService.html" title="class in org.robolectric.shadows">ShadowIntentService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowIoUtils.html" title="class in org.robolectric.shadows">ShadowIoUtils</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowJobScheduler.html" title="class in org.robolectric.shadows">ShadowJobScheduler</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowJobScheduler.ShadowJobSchedulerImpl.html" title="class in org.robolectric.shadows">ShadowJobScheduler.ShadowJobSchedulerImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowJobService.html" title="class in org.robolectric.shadows">ShadowJobService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowJsPromptResult.html" title="class in org.robolectric.shadows">ShadowJsPromptResult</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowJsResult.html" title="class in org.robolectric.shadows">ShadowJsResult</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowKeyCharacterMap.html" title="class in org.robolectric.shadows">ShadowKeyCharacterMap</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowKeyguardManager.html" title="class in org.robolectric.shadows">ShadowKeyguardManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowKeyguardManager.ShadowKeyguardLock.html" title="class in org.robolectric.shadows">ShadowKeyguardManager.ShadowKeyguardLock</a></td> <td class="colLast"> <div class="block">An implementation of <code>KeyguardManager#KeyguardLock</code>, for use in tests.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLayoutAnimationController.html" title="class in org.robolectric.shadows">ShadowLayoutAnimationController</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLegacyApkAssets.html" title="class in org.robolectric.shadows">ShadowLegacyApkAssets</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLegacyAssetInputStream.html" title="class in org.robolectric.shadows">ShadowLegacyAssetInputStream</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLegacyAssetManager.html" title="class in org.robolectric.shadows">ShadowLegacyAssetManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLegacyResourcesImpl.html" title="class in org.robolectric.shadows">ShadowLegacyResourcesImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLegacyResourcesImpl.ShadowLegacyThemeImpl.html" title="class in org.robolectric.shadows">ShadowLegacyResourcesImpl.ShadowLegacyThemeImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLinearGradient.html" title="class in org.robolectric.shadows">ShadowLinearGradient</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLinearLayout.html" title="class in org.robolectric.shadows">ShadowLinearLayout</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLinkMovementMethod.html" title="class in org.robolectric.shadows">ShadowLinkMovementMethod</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLinux.html" title="class in org.robolectric.shadows">ShadowLinux</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowListPopupWindow.html" title="class in org.robolectric.shadows">ShadowListPopupWindow</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowListView.html" title="class in org.robolectric.shadows">ShadowListView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLoadedApk.html" title="class in org.robolectric.shadows">ShadowLoadedApk</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLocalActivityManager.html" title="class in org.robolectric.shadows">ShadowLocalActivityManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLocaleData.html" title="class in org.robolectric.shadows">ShadowLocaleData</a></td> <td class="colLast"> <div class="block">Robolectric only supports en_US regardless of the default locale set in the JVM.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLocationManager.html" title="class in org.robolectric.shadows">ShadowLocationManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLog.html" title="class in org.robolectric.shadows">ShadowLog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLog.LogItem.html" title="class in org.robolectric.shadows">ShadowLog.LogItem</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLooper.html" title="class in org.robolectric.shadows">ShadowLooper</a></td> <td class="colLast"> <div class="block">Robolectric enqueues posted <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a>s to be run (on this thread) later.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMatrix.html" title="class in org.robolectric.shadows">ShadowMatrix</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMeasuredParagraph.html" title="class in org.robolectric.shadows">ShadowMeasuredParagraph</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaCodec.html" title="class in org.robolectric.shadows">ShadowMediaCodec</a></td> <td class="colLast"> <div class="block">Implementation of <a href="https://developer.android.com/reference/android/media/MediaCodec.html?is-external=true" title="class or interface in android.media"><code>MediaCodec</code></a> which only supports a passthrough asynchronous encoding pipeline.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaCodec.ShadowCodecBuffer.html" title="class in org.robolectric.shadows">ShadowMediaCodec.ShadowCodecBuffer</a></td> <td class="colLast"> <div class="block">Shadows CodecBuffer to prevent attempting to free non-direct ByteBuffer objects.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaMetadataRetriever.html" title="class in org.robolectric.shadows">ShadowMediaMetadataRetriever</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaMuxer.html" title="class in org.robolectric.shadows">ShadowMediaMuxer</a></td> <td class="colLast"> <div class="block">Implementation of <a href="https://developer.android.com/reference/android/media/MediaMuxer.html?is-external=true" title="class or interface in android.media"><code>MediaMuxer</code></a> which directly passes input bytes to the specified file, with no modification.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.html" title="class in org.robolectric.shadows">ShadowMediaPlayer</a></td> <td class="colLast"> <div class="block">Automated testing of media playback can be a difficult thing - especially testing that your code properly handles asynchronous errors and events.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.MediaInfo.html" title="class in org.robolectric.shadows">ShadowMediaPlayer.MediaInfo</a></td> <td class="colLast"> <div class="block">Class specifying information for an emulated media object.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaRecorder.html" title="class in org.robolectric.shadows">ShadowMediaRecorder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaRouter.html" title="class in org.robolectric.shadows">ShadowMediaRouter</a></td> <td class="colLast"> <div class="block">Shadow class for <a href="https://developer.android.com/reference/android/media/MediaRouter.html?is-external=true" title="class or interface in android.media"><code>MediaRouter</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaScannerConnection.html" title="class in org.robolectric.shadows">ShadowMediaScannerConnection</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaSession.html" title="class in org.robolectric.shadows">ShadowMediaSession</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaStore.html" title="class in org.robolectric.shadows">ShadowMediaStore</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaStore.ShadowImages.html" title="class in org.robolectric.shadows">ShadowMediaStore.ShadowImages</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaStore.ShadowImages.ShadowMedia.html" title="class in org.robolectric.shadows">ShadowMediaStore.ShadowImages.ShadowMedia</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMemoryMappedFile.html" title="class in org.robolectric.shadows">ShadowMemoryMappedFile</a></td> <td class="colLast"> <div class="block">This is used by Android to load and inferFromValue time zone information.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMessage.html" title="class in org.robolectric.shadows">ShadowMessage</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMessageQueue.html" title="class in org.robolectric.shadows">ShadowMessageQueue</a></td> <td class="colLast"> <div class="block">Robolectric puts <a href="https://developer.android.com/reference/android/os/Message.html?is-external=true" title="class or interface in android.os"><code>Message</code></a>s into the scheduler queue instead of sending them to be handled on a separate thread.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMessenger.html" title="class in org.robolectric.shadows">ShadowMessenger</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMimeTypeMap.html" title="class in org.robolectric.shadows">ShadowMimeTypeMap</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMotionEvent.html" title="class in org.robolectric.shadows">ShadowMotionEvent</a></td> <td class="colLast"> <div class="block">Shadow of MotionEvent.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNativeAllocationRegistry.html" title="class in org.robolectric.shadows">ShadowNativeAllocationRegistry</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNativePluralRules.html" title="class in org.robolectric.shadows">ShadowNativePluralRules</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNetwork.html" title="class in org.robolectric.shadows">ShadowNetwork</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNetworkInfo.html" title="class in org.robolectric.shadows">ShadowNetworkInfo</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNetworkScoreManager.html" title="class in org.robolectric.shadows">ShadowNetworkScoreManager</a></td> <td class="colLast"> <div class="block">Provides testing APIs for <a href="https://developer.android.com/reference/android/net/NetworkScoreManager.html?is-external=true" title="class or interface in android.net"><code>NetworkScoreManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNfcAdapter.html" title="class in org.robolectric.shadows">ShadowNfcAdapter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNinePatch.html" title="class in org.robolectric.shadows">ShadowNinePatch</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNotification.html" title="class in org.robolectric.shadows">ShadowNotification</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNotificationManager.html" title="class in org.robolectric.shadows">ShadowNotificationManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNsdManager.html" title="class in org.robolectric.shadows">ShadowNsdManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowNumberPicker.html" title="class in org.robolectric.shadows">ShadowNumberPicker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowObjectAnimator.html" title="class in org.robolectric.shadows">ShadowObjectAnimator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowOpenGLMatrix.html" title="class in org.robolectric.shadows">ShadowOpenGLMatrix</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowOutline.html" title="class in org.robolectric.shadows">ShadowOutline</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowOverScroller.html" title="class in org.robolectric.shadows">ShadowOverScroller</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageInstaller.html" title="class in org.robolectric.shadows">ShadowPackageInstaller</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageInstaller.ShadowSession.html" title="class in org.robolectric.shadows">ShadowPackageInstaller.ShadowSession</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageManager.html" title="class in org.robolectric.shadows">ShadowPackageManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageManager.ComponentState.html" title="class in org.robolectric.shadows">ShadowPackageManager.ComponentState</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageManager.IntentComparator.html" title="class in org.robolectric.shadows">ShadowPackageManager.IntentComparator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageManager.PackageSetting.html" title="class in org.robolectric.shadows">ShadowPackageManager.PackageSetting</a></td> <td class="colLast"> <div class="block">Settings for a particular package.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPackageParser.html" title="class in org.robolectric.shadows">ShadowPackageParser</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPaint.html" title="class in org.robolectric.shadows">ShadowPaint</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowParcel.html" title="class in org.robolectric.shadows">ShadowParcel</a></td> <td class="colLast"> <div class="block">Robolectric&rsquo;s <a href="https://developer.android.com/reference/android/os/Parcel.html?is-external=true" title="class or interface in android.os"><code>Parcel</code></a> pretends to be backed by a byte buffer, closely matching <a href="https://developer.android.com/reference/android/os/Parcel.html?is-external=true" title="class or interface in android.os"><code>Parcel</code></a>&rsquo;s position, size, and capacity behavior.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowParcelFileDescriptor.html" title="class in org.robolectric.shadows">ShadowParcelFileDescriptor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPath.html" title="class in org.robolectric.shadows">ShadowPath</a></td> <td class="colLast"> <div class="block">The shadow only supports straight-line paths.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPath.Point.html" title="class in org.robolectric.shadows">ShadowPath.Point</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPathMeasure.html" title="class in org.robolectric.shadows">ShadowPathMeasure</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPathParser.html" title="class in org.robolectric.shadows">ShadowPathParser</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPathParser.PathDataNode.html" title="class in org.robolectric.shadows">ShadowPathParser.PathDataNode</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPathParser.ShadowPathData.html" title="class in org.robolectric.shadows">ShadowPathParser.ShadowPathData</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPeerHandle.html" title="class in org.robolectric.shadows">ShadowPeerHandle</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPendingIntent.html" title="class in org.robolectric.shadows">ShadowPendingIntent</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPhoneWindow.html" title="class in org.robolectric.shadows">ShadowPhoneWindow</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPhoneWindowFor22.html" title="class in org.robolectric.shadows">ShadowPhoneWindowFor22</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPicture.html" title="class in org.robolectric.shadows">ShadowPicture</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPlayerBase.html" title="class in org.robolectric.shadows">ShadowPlayerBase</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPolicyManager.html" title="class in org.robolectric.shadows">ShadowPolicyManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPopupMenu.html" title="class in org.robolectric.shadows">ShadowPopupMenu</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPopupWindow.html" title="class in org.robolectric.shadows">ShadowPopupWindow</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPorterDuffColorFilter.html" title="class in org.robolectric.shadows">ShadowPorterDuffColorFilter</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPosix.html" title="class in org.robolectric.shadows">ShadowPosix</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPowerManager.html" title="class in org.robolectric.shadows">ShadowPowerManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPowerManager.ShadowWakeLock.html" title="class in org.robolectric.shadows">ShadowPowerManager.ShadowWakeLock</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPrecomputedText.html" title="class in org.robolectric.shadows">ShadowPrecomputedText</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPreference.html" title="class in org.robolectric.shadows">ShadowPreference</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowProcess.html" title="class in org.robolectric.shadows">ShadowProcess</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowProgressBar.html" title="class in org.robolectric.shadows">ShadowProgressBar</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowProgressDialog.html" title="class in org.robolectric.shadows">ShadowProgressDialog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowQueuedWork.html" title="class in org.robolectric.shadows">ShadowQueuedWork</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRangingResult.html" title="class in org.robolectric.shadows">ShadowRangingResult</a></td> <td class="colLast"> <div class="block">Shadow for <a href="https://developer.android.com/reference/android/net/wifi/rtt/RangingResult.html?is-external=true" title="class or interface in android.net.wifi.rtt"><code>RangingResult</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRangingResult.Builder.html" title="class in org.robolectric.shadows">ShadowRangingResult.Builder</a></td> <td class="colLast"> <div class="block">A builder for creating ShadowRangingResults.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRegion.html" title="class in org.robolectric.shadows">ShadowRegion</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRelativeLayout.html" title="class in org.robolectric.shadows">ShadowRelativeLayout</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRemoteCallbackList.html" title="class in org.robolectric.shadows">ShadowRemoteCallbackList</a>&lt;E extends <a href="https://developer.android.com/reference/android/os/IInterface.html?is-external=true" title="class or interface in android.os">IInterface</a>&gt;</td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRenderNode.html" title="class in org.robolectric.shadows">ShadowRenderNode</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRenderNodeAnimator.html" title="class in org.robolectric.shadows">ShadowRenderNodeAnimator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResolveInfo.html" title="class in org.robolectric.shadows">ShadowResolveInfo</a></td> <td class="colLast"> <div class="block">Utilities for <a href="https://developer.android.com/reference/android/content/pm/ResolveInfo.html?is-external=true" title="class or interface in android.content.pm"><code>ResolveInfo</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResources.html" title="class in org.robolectric.shadows">ShadowResources</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResources.ShadowLegacyTheme.html" title="class in org.robolectric.shadows">ShadowResources.ShadowLegacyTheme</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResources.ShadowNotFoundException.html" title="class in org.robolectric.shadows">ShadowResources.ShadowNotFoundException</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResources.ShadowTheme.html" title="class in org.robolectric.shadows">ShadowResources.ShadowTheme</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResources.ShadowTheme.Picker.html" title="class in org.robolectric.shadows">ShadowResources.ShadowTheme.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResourcesImpl.html" title="class in org.robolectric.shadows">ShadowResourcesImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResourcesImpl.Picker.html" title="class in org.robolectric.shadows">ShadowResourcesImpl.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResourcesImpl.ShadowThemeImpl.html" title="class in org.robolectric.shadows">ShadowResourcesImpl.ShadowThemeImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResourcesImpl.ShadowThemeImpl.Picker.html" title="class in org.robolectric.shadows">ShadowResourcesImpl.ShadowThemeImpl.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResourcesManager.html" title="class in org.robolectric.shadows">ShadowResourcesManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowRestrictionsManager.html" title="class in org.robolectric.shadows">ShadowRestrictionsManager</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/content/RestrictionsManager.html?is-external=true" title="class or interface in android.content"><code>RestrictionsManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowResultReceiver.html" title="class in org.robolectric.shadows">ShadowResultReceiver</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowScaleGestureDetector.html" title="class in org.robolectric.shadows">ShadowScaleGestureDetector</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowScanResult.html" title="class in org.robolectric.shadows">ShadowScanResult</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowScroller.html" title="class in org.robolectric.shadows">ShadowScroller</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowScrollView.html" title="class in org.robolectric.shadows">ShadowScrollView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSearchManager.html" title="class in org.robolectric.shadows">ShadowSearchManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSeekBar.html" title="class in org.robolectric.shadows">ShadowSeekBar</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSensor.html" title="class in org.robolectric.shadows">ShadowSensor</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSensorManager.html" title="class in org.robolectric.shadows">ShadowSensorManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowService.html" title="class in org.robolectric.shadows">ShadowService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowServiceManager.html" title="class in org.robolectric.shadows">ShadowServiceManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSettings.html" title="class in org.robolectric.shadows">ShadowSettings</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSettings.ShadowGlobal.html" title="class in org.robolectric.shadows">ShadowSettings.ShadowGlobal</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSettings.ShadowSecure.html" title="class in org.robolectric.shadows">ShadowSettings.ShadowSecure</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSettings.ShadowSystem.html" title="class in org.robolectric.shadows">ShadowSettings.ShadowSystem</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSharedMemory.html" title="class in org.robolectric.shadows">ShadowSharedMemory</a></td> <td class="colLast"> <div class="block">A <a href="https://developer.android.com/reference/android/os/SharedMemory.html?is-external=true" title="class or interface in android.os"><code>SharedMemory</code></a> fake that uses a private temporary disk file for storage and Java&rsquo;s <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html?is-external=true" title="class or interface in java.nio"><code>MappedByteBuffer</code></a> for the memory mappings.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSharedPreferences.html" title="class in org.robolectric.shadows">ShadowSharedPreferences</a></td> <td class="colLast"> <div class="block">Dummy container class for nested shadow class</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSharedPreferences.ShadowSharedPreferencesEditorImpl.html" title="class in org.robolectric.shadows">ShadowSharedPreferences.ShadowSharedPreferencesEditorImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowShortcutManager.html" title="class in org.robolectric.shadows">ShadowShortcutManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSliceManager.html" title="class in org.robolectric.shadows">ShadowSliceManager</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/app/slice/SliceManager.html?is-external=true" title="class or interface in android.app.slice"><code>SliceManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSmsManager.html" title="class in org.robolectric.shadows">ShadowSmsManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSmsManager.DataMessageParams.html" title="class in org.robolectric.shadows">ShadowSmsManager.DataMessageParams</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSmsManager.TextMultipartParams.html" title="class in org.robolectric.shadows">ShadowSmsManager.TextMultipartParams</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSmsManager.TextSmsParams.html" title="class in org.robolectric.shadows">ShadowSmsManager.TextSmsParams</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSocketTagger.html" title="class in org.robolectric.shadows">ShadowSocketTagger</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSoundPool.html" title="class in org.robolectric.shadows">ShadowSoundPool</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSoundPool.Playback.html" title="class in org.robolectric.shadows">ShadowSoundPool.Playback</a></td> <td class="colLast"> <div class="block">Record of a single call to <a href="https://developer.android.com/reference/android/media/SoundPool.html?is-external=true#play-int-float-float-int-int-float-" title="class or interface in android.media"><code>SoundPool.play(int, float, float, int, int, float)</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSpellChecker.html" title="class in org.robolectric.shadows">ShadowSpellChecker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSQLiteConnection.html" title="class in org.robolectric.shadows">ShadowSQLiteConnection</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSQLiteOpenHelper.html" title="class in org.robolectric.shadows">ShadowSQLiteOpenHelper</a></td> <td class="colLast"> <div class="block">Avoid calls to setIdleConnectionTimeout.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSslErrorHandler.html" title="class in org.robolectric.shadows">ShadowSslErrorHandler</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStateListDrawable.html" title="class in org.robolectric.shadows">ShadowStateListDrawable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStatFs.html" title="class in org.robolectric.shadows">ShadowStatFs</a></td> <td class="colLast"> <div class="block">Robolectic doesn&rsquo;t provide actual filesystem stats; rather, it provides the ability to specify stats values in advance.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStaticLayout.html" title="class in org.robolectric.shadows">ShadowStaticLayout</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStatusBarManager.html" title="class in org.robolectric.shadows">ShadowStatusBarManager</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/app/StatusBarManager.html?is-external=true" title="class or interface in android.app"><code>StatusBarManager</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStorageManager.html" title="class in org.robolectric.shadows">ShadowStorageManager</a></td> <td class="colLast"> <div class="block">Fake implementation of <a href="https://developer.android.com/reference/android/os/storage/StorageManager.html?is-external=true" title="class or interface in android.os.storage"><code>StorageManager</code></a></div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStrictModeVmPolicy.html" title="class in org.robolectric.shadows">ShadowStrictModeVmPolicy</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowStringBlock.html" title="class in org.robolectric.shadows">ShadowStringBlock</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSubscriptionManager.html" title="class in org.robolectric.shadows">ShadowSubscriptionManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSubscriptionManager.SubscriptionInfoBuilder.html" title="class in org.robolectric.shadows">ShadowSubscriptionManager.SubscriptionInfoBuilder</a></td> <td class="colLast"> <div class="block">Builder class to create instance of <a href="https://developer.android.com/reference/android/telephony/SubscriptionInfo.html?is-external=true" title="class or interface in android.telephony"><code>SubscriptionInfo</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSurface.html" title="class in org.robolectric.shadows">ShadowSurface</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSurfaceView.html" title="class in org.robolectric.shadows">ShadowSurfaceView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSurfaceView.FakeSurfaceHolder.html" title="class in org.robolectric.shadows">ShadowSurfaceView.FakeSurfaceHolder</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/view/SurfaceHolder.html?is-external=true" title="class or interface in android.view"><code>SurfaceHolder</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemClock.html" title="class in org.robolectric.shadows">ShadowSystemClock</a></td> <td class="colLast"> <div class="block">Robolectric&rsquo;s concept of current time is base on the current time of the UI Scheduler for consistency with previous implementations.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemProperties.html" title="class in org.robolectric.shadows">ShadowSystemProperties</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemServiceRegistry.html" title="class in org.robolectric.shadows">ShadowSystemServiceRegistry</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowSystemVibrator.html" title="class in org.robolectric.shadows">ShadowSystemVibrator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTabActivity.html" title="class in org.robolectric.shadows">ShadowTabActivity</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTabHost.html" title="class in org.robolectric.shadows">ShadowTabHost</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTabHost.ShadowTabSpec.html" title="class in org.robolectric.shadows">ShadowTabHost.ShadowTabSpec</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTabWidget.html" title="class in org.robolectric.shadows">ShadowTabWidget</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTelecomManager.html" title="class in org.robolectric.shadows">ShadowTelecomManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTelecomManager.CallRecord.html" title="class in org.robolectric.shadows">ShadowTelecomManager.CallRecord</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTelephony.html" title="class in org.robolectric.shadows">ShadowTelephony</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTelephony.ShadowSms.html" title="class in org.robolectric.shadows">ShadowTelephony.ShadowSms</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTelephonyManager.html" title="class in org.robolectric.shadows">ShadowTelephonyManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTextPaint.html" title="class in org.robolectric.shadows">ShadowTextPaint</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTextToSpeech.html" title="class in org.robolectric.shadows">ShadowTextToSpeech</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTextUtils.html" title="class in org.robolectric.shadows">ShadowTextUtils</a></td> <td class="colLast"> <div class="block">Implement by truncating the text.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTextView.html" title="class in org.robolectric.shadows">ShadowTextView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowThreadedRenderer.html" title="class in org.robolectric.shadows">ShadowThreadedRenderer</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTile.html" title="class in org.robolectric.shadows">ShadowTile</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTileService.html" title="class in org.robolectric.shadows">ShadowTileService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTime.html" title="class in org.robolectric.shadows">ShadowTime</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTimePickerDialog.html" title="class in org.robolectric.shadows">ShadowTimePickerDialog</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTimeZoneFinder.html" title="class in org.robolectric.shadows">ShadowTimeZoneFinder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowToast.html" title="class in org.robolectric.shadows">ShadowToast</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTouchDelegate.html" title="class in org.robolectric.shadows">ShadowTouchDelegate</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTrace.html" title="class in org.robolectric.shadows">ShadowTrace</a></td> <td class="colLast"> <div class="block">Shadow implementation for <a href="https://developer.android.com/reference/android/os/Trace.html?is-external=true" title="class or interface in android.os"><code>Trace</code></a>, which stores the traces locally in arrays (unlike the real implementation) and allows reading them.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTrafficStats.html" title="class in org.robolectric.shadows">ShadowTrafficStats</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTypedArray.html" title="class in org.robolectric.shadows">ShadowTypedArray</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTypedArray.Picker.html" title="class in org.robolectric.shadows">ShadowTypedArray.Picker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTypeface.html" title="class in org.robolectric.shadows">ShadowTypeface</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowTypeface.FontDesc.html" title="class in org.robolectric.shadows">ShadowTypeface.FontDesc</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUIModeManager.html" title="class in org.robolectric.shadows">ShadowUIModeManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsageStatsManager.html" title="class in org.robolectric.shadows">ShadowUsageStatsManager</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/app/usage/UsageStatsManager.html?is-external=true" title="class or interface in android.app.usage"><code>UsageStatsManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsageStatsManager.AppUsageObserver.html" title="class in org.robolectric.shadows">ShadowUsageStatsManager.AppUsageObserver</a></td> <td class="colLast"> <div class="block">App usage observer registered via <a href="https://developer.android.com/reference/android/app/usage/UsageStatsManager.html?is-external=true#registerAppUsageObserver-int-java.lang.String:A-long-java.util.concurrent.TimeUnit-android.app.PendingIntent-" title="class or interface in android.app.usage"><code>UsageStatsManager.registerAppUsageObserver(int, String[], long, TimeUnit, PendingIntent)</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsageStatsManager.EventBuilder.html" title="class in org.robolectric.shadows">ShadowUsageStatsManager.EventBuilder</a></td> <td class="colLast"> <div class="block">Builder for constructing <a href="https://developer.android.com/reference/android/app/usage/UsageEvents.Event.html?is-external=true" title="class or interface in android.app.usage"><code>UsageEvents.Event</code></a> objects.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsageStatsManager.UsageStatsBuilder.html" title="class in org.robolectric.shadows">ShadowUsageStatsManager.UsageStatsBuilder</a></td> <td class="colLast"> <div class="block">Builder for constructing <a href="https://developer.android.com/reference/android/app/usage/UsageStats.html?is-external=true" title="class or interface in android.app.usage"><code>UsageStats</code></a> objects.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUsbManager.html" title="class in org.robolectric.shadows">ShadowUsbManager</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/hardware/usb/UsbManager.html?is-external=true" title="class or interface in android.hardware.usb"><code>UsbManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUserManager.html" title="class in org.robolectric.shadows">ShadowUserManager</a></td> <td class="colLast"> <div class="block">Robolectric implementation of <a href="https://developer.android.com/reference/android/os/UserManager.html?is-external=true" title="class or interface in android.os"><code>UserManager</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowValueAnimator.html" title="class in org.robolectric.shadows">ShadowValueAnimator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVectorDrawable.html" title="class in org.robolectric.shadows">ShadowVectorDrawable</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVelocityTracker.html" title="class in org.robolectric.shadows">ShadowVelocityTracker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVibrator.html" title="class in org.robolectric.shadows">ShadowVibrator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVideoView.html" title="class in org.robolectric.shadows">ShadowVideoView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowView.html" title="class in org.robolectric.shadows">ShadowView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowView.WindowIdHelper.html" title="class in org.robolectric.shadows">ShadowView.WindowIdHelper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowViewAnimator.html" title="class in org.robolectric.shadows">ShadowViewAnimator</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowViewConfiguration.html" title="class in org.robolectric.shadows">ShadowViewConfiguration</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowViewGroup.html" title="class in org.robolectric.shadows">ShadowViewGroup</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowViewRootImpl.html" title="class in org.robolectric.shadows">ShadowViewRootImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVirtualRefBasePtr.html" title="class in org.robolectric.shadows">ShadowVirtualRefBasePtr</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVisualVoicemailSms.html" title="class in org.robolectric.shadows">ShadowVisualVoicemailSms</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVMRuntime.html" title="class in org.robolectric.shadows">ShadowVMRuntime</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowVpnService.html" title="class in org.robolectric.shadows">ShadowVpnService</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWallpaperManager.html" title="class in org.robolectric.shadows">ShadowWallpaperManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebStorage.html" title="class in org.robolectric.shadows">ShadowWebStorage</a></td> <td class="colLast"> <div class="block">Shadow of <a href="https://developer.android.com/reference/android/webkit/WebStorage.html?is-external=true" title="class or interface in android.webkit"><code>WebStorage</code></a> which constructs a stub instance rather than attempting to create a full Chromium-backed instance.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebSyncManager.html" title="class in org.robolectric.shadows">ShadowWebSyncManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebView.html" title="class in org.robolectric.shadows">ShadowWebView</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebView.LoadData.html" title="class in org.robolectric.shadows">ShadowWebView.LoadData</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebView.LoadDataWithBaseURL.html" title="class in org.robolectric.shadows">ShadowWebView.LoadDataWithBaseURL</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWebViewDatabase.html" title="class in org.robolectric.shadows">ShadowWebViewDatabase</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiConfiguration.html" title="class in org.robolectric.shadows">ShadowWifiConfiguration</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiInfo.html" title="class in org.robolectric.shadows">ShadowWifiInfo</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiManager.html" title="class in org.robolectric.shadows">ShadowWifiManager</a></td> <td class="colLast"> <div class="block">Shadow for <a href="https://developer.android.com/reference/android/net/wifi/WifiManager.html?is-external=true" title="class or interface in android.net.wifi"><code>WifiManager</code></a>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiManager.ShadowMulticastLock.html" title="class in org.robolectric.shadows">ShadowWifiManager.ShadowMulticastLock</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiManager.ShadowWifiLock.html" title="class in org.robolectric.shadows">ShadowWifiManager.ShadowWifiLock</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiP2pGroup.html" title="class in org.robolectric.shadows">ShadowWifiP2pGroup</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiP2pManager.html" title="class in org.robolectric.shadows">ShadowWifiP2pManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWifiRttManager.html" title="class in org.robolectric.shadows">ShadowWifiRttManager</a></td> <td class="colLast"> <div class="block">Shadow for <a href="https://developer.android.com/reference/android/net/wifi/rtt/WifiRttManager.html?is-external=true" title="class or interface in android.net.wifi.rtt"><code>WifiRttManager</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWindow.html" title="class in org.robolectric.shadows">ShadowWindow</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWindowManager.html" title="class in org.robolectric.shadows">ShadowWindowManager</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWindowManagerGlobal.html" title="class in org.robolectric.shadows">ShadowWindowManagerGlobal</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWindowManagerImpl.html" title="class in org.robolectric.shadows">ShadowWindowManagerImpl</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowWindowManagerImpl.ShadowCompatModeWrapper.html" title="class in org.robolectric.shadows">ShadowWindowManagerImpl.ShadowCompatModeWrapper</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowXmlBlock.html" title="class in org.robolectric.shadows">ShadowXmlBlock</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowZoomButtonsController.html" title="class in org.robolectric.shadows">ShadowZoomButtonsController</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/StorageVolumeBuilder.html" title="class in org.robolectric.shadows">StorageVolumeBuilder</a></td> <td class="colLast"> <div class="block">Class to build <a href="https://developer.android.com/reference/android/os/storage/StorageVolume.html?is-external=true" title="class or interface in android.os.storage"><code>StorageVolume</code></a></div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation"> <caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Enum</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.InvalidStateBehavior.html" title="enum in org.robolectric.shadows">ShadowMediaPlayer.InvalidStateBehavior</a></td> <td class="colLast"> <div class="block">Possible behavior modes for the media player when a method is invoked in an invalid state.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowMediaPlayer.State.html" title="enum in org.robolectric.shadows">ShadowMediaPlayer.State</a></td> <td class="colLast"> <div class="block">Possible states for the media player to be in.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowPath.Point.Type.html" title="enum in org.robolectric.shadows">ShadowPath.Point.Type</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowUserManager.UserState.html" title="enum in org.robolectric.shadows">ShadowUserManager.UserState</a></td> <td class="colLast"> <div class="block">Describes the current state of the user.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation"> <caption><span>Exception Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Exception</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../org/robolectric/shadows/ShadowLog.TerribleFailure.html" title="class in org.robolectric.shadows">ShadowLog.TerribleFailure</a></td> <td class="colLast"> <div class="block">Failure thrown when wtf_is_fatal is true and Log.wtf is called.</div> </td> </tr> </tbody> </table> </li> </ul> <a name="package.description"> <!-- --> </a> <h2 title="Package org.robolectric.shadows Description">Package org.robolectric.shadows Description</h2> <div class="block"><p>Package containing shadow classes for the Android SDK.</p></div> </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 class="navBarCell1Rev">Package</li> <li>Class</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"><ul class="navList" style="font-size: 1.5em;"><li>Robolectric 4.2 | <a href="/" target="_top"><img src="http://robolectric.org/images/logo-with-bubbles-down.png" style="max-height: 18pt; vertical-align: sub;"/></a></li></ul><script type="text/javascript" src="../../../highlight.pack.js"></script> <script type="text/javascript"><!-- hljs.initHighlightingOnLoad(); //--></script></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/robolectric/shadow/api/package-summary.html">Prev&nbsp;Package</a></li> <li><a href="../../../org/robolectric/shadows/gms/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/robolectric/shadows/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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 ======= --> </body> </html>
robolectric/robolectric.github.io
javadoc/4.2/org/robolectric/shadows/package-summary.html
HTML
mit
129,372
'use strict'; define([], function($) { var Util = class { static charToLineCh(string, char) { var stringUpToChar = string.substr(0, char); var lines = stringUpToChar.split("\n"); return { line: lines.length - 1, ch: lines[lines.length - 1].length }; } }; return Util; });
pixelmaid/DynamicBrushes
javascript/app/Util.js
JavaScript
mit
319
package org.usfirst.frc.team5518.robot.subsystems; import org.usfirst.frc.team5518.robot.RobotMap; import org.usfirst.frc.team5518.robot.commands.ArcadeDriveJoystick; import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.RobotDrive; import edu.wpi.first.wpilibj.SpeedController; import edu.wpi.first.wpilibj.Talon; import edu.wpi.first.wpilibj.command.Subsystem; /** * */ public class DrivingSys extends Subsystem { private RobotDrive robotDrive; public DrivingSys() { super(); robotDrive = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR, RobotMap.REAR_LEFT_MOTOR, RobotMap.FRONT_RIGHT_MOTOR, RobotMap.REAR_RIGHT_MOTOR); } public void initDefaultCommand() { // Set the default command for a subsystem here. setDefaultCommand(new ArcadeDriveJoystick()); } public void drive(GenericHID moveStick, final int moveAxis, GenericHID rotateStick, final int rotateAxis) { robotDrive.arcadeDrive(moveStick, moveAxis, rotateStick, rotateAxis); } public void drive(double moveValue, double rotateValue) { robotDrive.arcadeDrive(moveValue, rotateValue); } public void log() { } }
TechnoWolves5518/2015RobotCode
JoystickDemo2/src/org/usfirst/frc/team5518/robot/subsystems/DrivingSys.java
Java
mit
1,232
<?php session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; } $veza = new PDO('mysql:host=' . getenv('MYSQL_SERVICE_HOST') . ';port=3306;dbname=developer_blog', 'admin', 'user'); $veza->exec("set names utf8"); if (isset($_POST['update'])) { $title = $_POST['title']; $paragraph = $_POST['paragraph']; try { $problem_id = $_GET['id']; $upit = $veza->prepare("UPDATE part SET title = '$title', text = '$paragraph' WHERE id=?"); $upit->bindValue(1, $problem_id, PDO::PARAM_INT); $upit->execute(); } catch (Exception $e) { } header("location: problems.php"); exit(); } ?> <!doctype HTML> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Developer Blog</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <!-- Place favicon.ico in the root directory --> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/grid.css"> </head> <body> <nav class="nav"> <ul class="nav-list"> <li class="nav-item"><a id="problems" href="problems.php">Problems</a></li> <li class="nav-item"><a id="tasks" href="tasks.php">Tasks</a></li> <li class="nav-item"><a id="articles" href="articles.php">Articles</a></li> <li class="nav-item"><a id="ideas" href="ideas.php">Ideas</a></li> <?php if (isset($_SESSION['username'])) { echo '<li class="nav-item right"><a id="login" href="logout.php">Log Out</a></li>'; echo '<li class="nav-item right"><a id="profile" href="javascript:loadPartialProfile()">Profile</a></li>'; } else { echo '<li class="nav-item right"><a id="login" href="login.php">Log In</a></li>'; } ?> </ul> </nav> <!--Content--> <div class="content" id="content"> <?php if (isset($_GET['id'])) { $problem_id = $_GET['id']; $title = ""; $paragraph = ""; $upit = $veza->prepare("SELECT * FROM part WHERE id=?"); $upit->bindValue(1, $problem_id, PDO::PARAM_INT); $upit->execute(); foreach($upit as $childrens) { if ($childrens['id'] == $problem_id) { $title = $childrens['title']; $paragraph = $childrens['text']; } } echo '<form action="shareProblem.php?id=' . $_GET['id'] . '" method="POST"> <div class="row creatingForms"> <h1>Share problem</h1> <h2>Title</h2> <input type="text" name="title" id="title" value="' . $title . '"> <h2>Paragraph</h2> <textarea name="paragraph" id="paragraph" >' . $paragraph . '</textarea> <div class="centerAlign"> <button type="Submit" name="update" value="problem">Submit Problem</button> </div> </div> </form>'; } else echo '<form action="index.php" method="POST"> <div class="row creatingForms"> <h1>Share problem</h1> <h2>Title</h2> <input type="text" name="title" id="title"> <h2>Paragraph</h2> <textarea name="paragraph" id="paragraph"></textarea> <div class="centerAlign"> <button type="Submit" name="file" value="problem">Submit Problem</button> </div> </div> </form>'; ?> </div> <script src="js/validations/loginValidation.js"></script> <script src="js/validations/signupValidation.js"></script> <script src="js/dropdownmenu.js"></script> <script src="js/ajax.js"></script> </body> </html>
NerminImamovic/developer-Blog
shareProblem.php
PHP
mit
4,871
#if !NOT_UNITY3D namespace Zenject { public class GameObjectNameGroupNameScopeArgBinder : GameObjectGroupNameScopeArgBinder { public GameObjectNameGroupNameScopeArgBinder( BindInfo bindInfo, GameObjectCreationParameters gameObjectInfo) : base(bindInfo, gameObjectInfo) { } public GameObjectGroupNameScopeArgBinder WithGameObjectName(string gameObjectName) { GameObjectInfo.Name = gameObjectName; return this; } } } #endif
austinmao/reduxity
Assets/Packages/Zenject/Source/Binding/Binders/GameObject/GameObjectNameGroupNameScopeArgBinder.cs
C#
mit
567
<?php namespace Hautelook\ExactTargetBundle\Services; use ET_Subscriber; use Hautelook\ExactTargetBundle\Model\Subscriber as SubscriberProperties; class SubscriberService extends AbstractService { public function __construct($appSignature, $clientId, $clientSecret, $defaultWsdl) { parent::__construct($appSignature, $clientId, $clientSecret, $defaultWsdl); $this->service = new ET_Subscriber(); $this->service->authStub = $this->client; $this->properties = new SubscriberProperties(); } }
BradLook/ExactTargetBundle
Services/SubscriberService.php
PHP
mit
541
function initBtnStartAlgo(){ $('#btn_startDispatch').bind('click', function(event) { event.preventDefault(); initAlgo(); createResultPanel("div_resultPanel"); doRound(); printRound("resultRegion"); printResultPersonal("resultPersonal"); createDownloadableContent(); }); } // 初始化變數、將 html 清空 function initAlgo(){ // 有時會發生役男進來後,才臨時驗退的情形,我們會在其分數欄位填入 "NA" ,在算平均成績時不把他算進去 // 注意這裡只是預設值,當程式執行時,此預設值會被算出的值取代 // Fixed: 2014, Dec, 11 var not_here_student = 0; students = new Array(); avgScore = 0.0; for(x in regionDatas){ regionDatas[x].queue = new Array(); regionDatas[x].resultArray = new Array(); } for(var i=1;i<=TOTAL_STUDENT;i++){ var student = new Student(); student.id = i; student.score = $('#score'+i).val(); student.home = $('#wishList'+i+'_0').val(); student.wish1 = $('#wishList'+i+'_1').val(); student.result = NO_REGION_RESULT; student.homeFirst = $('#homeFirst'+i).is(':checked'); // Add to lists students[i-1] = student; // 處理臨時被驗退的 if($('#score'+i).val()==="NA"){ students[i-1].result = "NA"; // 要給予跟 NO_REGION_RESULT 不一樣的值 not_here_student++; continue; } // parserInt() used to cause lost of digits. Fixed: 2014, Oct 29 avgScore += parseFloat(student.score); } avgScore = avgScore/(TOTAL_STUDENT-not_here_student); var size = Math.pow(10, 2); avgScore = Math.round(avgScore * size) / size; } // 畫出 平均分數、Round1、Round2、Round3、分發結果(依個人)的那個 nav-tabs function createResultPanel(printToDivID){ var str = '<div class="panel panel-info">'; str += '<div class="panel-heading">'; str += '<h3 class="panel-title">第 ' + WHAT_T + ' 梯 預排結果 ( 平均分數:'+avgScore+' )</h3>'; str += '</div>'; str += '<div class="panel-body" id="div_dispatchResult">'; str += '<ul class="nav nav-tabs">'; str += '<li class="active"><a href="#resultRegion" data-toggle="tab">地區</a></li>'; str += '<li><a href="#resultPersonal" data-toggle="tab">個人</a></li>'; // color block 色塊 str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.typeHome + ';"></canvas> 家因</li>'; str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.type1 + ';"></canvas> 高均+戶籍</li>'; str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.type2 + ';"></canvas> 高均+非戶籍</li>'; str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.type3 + ';"></canvas> 低均+戶籍地</li>'; str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.type4 + ';"></canvas> 低均+非戶籍</li>'; str += '<li><canvas width="13" height="13" class="colorBlock" style="background:' + fontColors.typeKicked + ';"></canvas> 被擠掉</li>'; str += '</ul>'; str += '<div id="resultTabContent" class="tab-content">'; str += ' <div class="tab-pane fade active in" id="resultRegion"></div>'; str += ' <div class="tab-pane fade" id="resultPersonal"></div>'; str += '</div>'; str += '</div>'; str += '<div class="panel-fotter">'; str += ' <div class="btn-group btn-group-justified">'; str += ' <a href="" class="btn btn-primary" id="btn_downloadTXT">下載程式可讀取的格式(.txt)</a>'; str += ' <a href="" class="btn btn-info" id="btn_downloadCSVRegion">給輔導組(照地區.csv)</a>'; str += ' <a href="" class="btn btn-success" id="btn_downloadCSVPersonnel">給輔導組(照個人.csv)</a>'; str += ' </div>'; str += '</div>'; str += '</div>'; $("#"+printToDivID).html(str); } // 將 分發規則 用演算法實作 function doRound(){ // 可以清空 queue,因為我們可以直接從 student.result 的內容來找出還沒被分發的學生,送進下一 round for(var i=0;i<regionDatas.length;i++){ regionDatas[i].queue = new Array(); } // Step 1: 將學生加入其第N志願的 queue (N depend on round) var regionDatasLength = regionDatas.length; for(var k=0;k<TOTAL_STUDENT;k++){ // 如果學生已經分發到某的地點,就不須再分發,可跳過直接看下個學生。 if(students[k].result != NO_REGION_RESULT){ continue; } // TODO: 這邊改用 key hash 應該會漂亮、效能也更好 for(var i=0;i<regionDatasLength;i++){ if(students[k].wish1 == regionDatas[i].name){ regionDatas[i].queue.push(students[k]); } } } // Step 2: 將每個單位的 queue 裡面的學生互相比較,取出最適合此單位的學生放入此單位的 resultArray for(var i=0;i<regionDatasLength;i++){ var region = regionDatas[i]; // 此單位名額已經滿,跳過 if(region.resultArray.length == region.available){ continue; } // 要去的人數 小於等於 開放的名額,每個人都錄取 else if(region.queue.length <= region.available){ // 其實可以不用排序,但是排序之後印出來比較好看 region.queue.sort(function(a, b){return a.score-b.score}); popItemFromQueueAndPushToResultArray(region, region.queue.length); } // 要去的人數 大於 開放的名額,依照 分發規則 找出最適合此單位的學生放入此單位的 resultArray else{ // 不管是中央還是地方,都要比較成績,所以先依照成績排序 region.queue.sort(function(a, b){return a.score-b.score}); // 依照成績排序後是"由小到大",亦即 [30分, 40分, 60分, 90分, 100分] // 考慮到之後的 Array.pop() 是 pop 出"最後一個"物件,這樣排列比較方便之後的處理 cruelFunction(i, region); } } } // This function is so cruel that I cannot even look at it. function cruelFunction(regionID, region){ if(regionID<=3){ // 中央只有比成績,不考慮戶籍地,因此可直接依成績排序找出錄取的學生 popItemFromQueueAndPushToResultArray(region, region.available); }else{ // 地方單位在依照成績排序後,再把 "過均標" 且 "符合戶籍地" 的往前排 // 剛剛已經過成績順序了,現在要分別對“過均標”跟“沒過均標”的做戶籍地優先的排序 region.queue.sort(function(a, b){ if((a.score >= avgScore && b.score >= avgScore) || (a.score < avgScore && b.score < avgScore)){ if(a.home == region.homeName && b.home != region.homeName){ return 1; }else if(b.home == region.homeName && a.home != region.homeName){ return -1; } } return 0; }); // 接下來,把家因的抓出來,要優先分發,所以丟到 queue 最後面。(等等 pop()時會變成最前面 ) region.queue.sort(function(a, b){ if(a.homeFirst==true){ return 1; } return 0; }); // 排完後再依照順序找出錄取的學生 popItemFromQueueAndPushToResultArray(region, region.available); } } // 從 region 的排序過後的 queue 裡面,抓出 numberOfItems 個學生,丟進 resultArray 裡面 function popItemFromQueueAndPushToResultArray(region, numberOfItems){ for(var k=0;k<numberOfItems;k++){ region.resultArray.push(region.queue.pop()); } assignStudentToRegion(region.homeName, region.resultArray); } // 將已經被分配到某地區的學生的 result attribute 指定為該地區。(resultArray[] 的 items 為學生,擁有 result ) function assignStudentToRegion(regionName, resultArray){ var length = resultArray.length; for(var i=0;i<length;i++){ resultArray[i].result = regionName; } }
johnyluyte/EPA-SMS-Dispatcher
js/algo.js
JavaScript
mit
7,887
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>olturf Namespace: toolbars</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.simplex.css"> </head> <body> <div class="navbar navbar-default navbar-fixed-top "> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">olturf</a> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse" id="topNavigation"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="external-ol.control.html">external:ol.control</a></li><li><a href="olturf.html">olturf</a></li><li><a href="olturf.toolbars.html">olturf.toolbars</a></li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="external-ol.control.Control.html">external:ol.control.Control</a></li><li><a href="olturf.Toolbar.html">olturf.Toolbar</a></li> </ul> </li> <li class="dropdown"> <a href="externals.list.html" class="dropdown-toggle" data-toggle="dropdown">Externals<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="external-ol.html">ol</a></li> </ul> </li> </ul> <div class="col-sm-3 col-md-3"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> <div class="input-group-btn"> <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> </div> </div> </div> </div> <div class="container" id="toc-content"> <div class="row"> <div class="col-md-8"> <div id="main"> <h1 class="page-title">Namespace: toolbars</h1> <section> <header> <h2> <span class="ancestors"><a href="olturf.html">olturf</a>.</span> toolbars </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <dl> <hr> <dt> <h4 class="name" id=".aggregation"><span class="type-signature">&lt;static> </span>aggregation()</h4> </dt> <dd> <div class="description"> <p>Aggregation toolbar: 'collect'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the aggregation toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".all"><span class="type-signature">&lt;static> </span>all()</h4> </dt> <dd> <div class="description"> <p>Toolbar with all controls: 'distance', 'line-distance', 'area', 'bearing', 'center-of-mass', 'center', 'centroid', 'midpoint', 'point-on-surface', 'envelope', 'square', 'circle', 'along', 'destination', 'bezier', 'buffer', 'concave', 'convex', 'difference', 'intersect', 'simplify', 'union', 'combine', 'explode', 'flip', 'kinks', 'line-slice-along', 'point-on-line', 'inside', 'tag', 'within', 'nearest', 'collect', 'random', 'sample', 'isolines', 'planepoint', 'tin', 'hex-grid', 'point-grid', 'square-grid', 'triangle-grid', 'tesselate'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for all the controls</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".classification"><span class="type-signature">&lt;static> </span>classification()</h4> </dt> <dd> <div class="description"> <p>Classification toolbar: 'nearest'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the classification toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".data"><span class="type-signature">&lt;static> </span>data()</h4> </dt> <dd> <div class="description"> <p>Data toolbar: 'random', 'sample'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the data toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".grids"><span class="type-signature">&lt;static> </span>grids()</h4> </dt> <dd> <div class="description"> <p>Grids toolbar: 'hex-grid', 'point-grid', 'square-grid', 'triangle-grid', 'tesselate'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the grids toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".interpolation"><span class="type-signature">&lt;static> </span>interpolation()</h4> </dt> <dd> <div class="description"> <p>Interpolation toolbar: 'isolines', 'planepoint', 'tin'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the interpolation toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".joins"><span class="type-signature">&lt;static> </span>joins()</h4> </dt> <dd> <div class="description"> <p>Joins toolbar: 'inside', 'tag', 'within'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the joins toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".measurement"><span class="type-signature">&lt;static> </span>measurement()</h4> </dt> <dd> <div class="description"> <p>Measurement toolbar: 'distance', 'line-distance', 'area', 'bearing', 'center-of-mass', 'center', 'centroid', 'midpoint', 'point-on-surface', 'envelope', 'square', 'circle', 'along', 'destination'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the measurement toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".misc"><span class="type-signature">&lt;static> </span>misc()</h4> </dt> <dd> <div class="description"> <p>Miscellaneous toolbar: 'combine', 'explode', 'flip', 'kinks', 'line-slice-along', 'point-on-line'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the miscellaneous toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".transformation"><span class="type-signature">&lt;static> </span>transformation()</h4> </dt> <dd> <div class="description"> <p>Transformation toolbar: 'bezier', 'buffer', 'concave', 'convex', 'difference', 'intersect', 'simplify', 'union'</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Control names for the transformation toolbar</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;string></span> </dd> </dl> </dd> </dl> </article> </section> </div> </div> <div class="clearfix"></div> <div class="col-md-3"> <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div> </div> </div> </div> <div class="modal fade" id="searchResults"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Search results</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <footer> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. </span> </footer> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/toc.js"></script> <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); lang = langClassMatch ? langClassMatch[1] : "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : false, showMenu : true, enableDoclinks : true } ); $.catchAnchorLinks( { navbarOffset: 10 } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", showAndHide : false, smoothScrolling: true } ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); $( "table" ).each( function () { var $this = $( this ); $this.addClass('table'); } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> <script type="text/javascript"> $(document).ready(function() { SearcherDisplay.init(); }); </script> </body> </html>
dpmcmlxxvi/ol3-turf
docs/api/olturf.toolbars.html
HTML
mit
13,825
/* * Velcro Physics: * Copyright (c) 2017 Ian Qvist */ using System.Collections.Generic; using Microsoft.Xna.Framework; using QEngine.Physics.Shared; using QEngine.Physics.Tools.Triangulation.Delaunay.Delaunay; using QEngine.Physics.Tools.Triangulation.Delaunay.Delaunay.Sweep; namespace QEngine.Physics.Tools.Triangulation.Delaunay { /// <summary> /// 2D constrained Delaunay triangulation algorithm. /// Based on the paper "Sweep-line algorithm for constrained Delaunay triangulation" by V. Domiter and and B. Zalik /// /// Properties: /// - Creates triangles with a large interior angle. /// - Supports holes /// - Generate a lot of garbage due to incapsulation of the Poly2Tri library. /// - Running time is O(n^2), n = number of vertices. /// - Does not care about winding order. /// /// Source: http://code.google.com/p/poly2tri/ /// </summary> internal static class CDTDecomposer { /// <summary> /// Decompose the polygon into several smaller non-concave polygon. /// </summary> public static List<Vertices> ConvexPartition(Vertices vertices) { System.Diagnostics.Debug.Assert(vertices.Count > 3); Polygon.Polygon poly = new Polygon.Polygon(); foreach (Vector2 vertex in vertices) poly.Points.Add(new TriangulationPoint(vertex.X, vertex.Y)); if (vertices.Holes != null) { foreach (Vertices holeVertices in vertices.Holes) { Polygon.Polygon hole = new Polygon.Polygon(); foreach (Vector2 vertex in holeVertices) hole.Points.Add(new TriangulationPoint(vertex.X, vertex.Y)); poly.AddHole(hole); } } DTSweepContext tcx = new DTSweepContext(); tcx.PrepareTriangulation(poly); DTSweep.Triangulate(tcx); List<Vertices> results = new List<Vertices>(); foreach (DelaunayTriangle triangle in poly.Triangles) { Vertices v = new Vertices(); foreach (TriangulationPoint p in triangle.Points) { v.Add(new Vector2((float)p.X, (float)p.Y)); } results.Add(v); } return results; } } }
Quincy9000/QEngine.Framework
QEngine/Code/Physics/Tools/Triangulation/Delaunay/CDTDecomposer.cs
C#
mit
2,417
// // ViewController.h // XSInfoView // // Created by 薛纪杰 on 3/16/16. // Copyright © 2016 薛纪杰. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
XueSeason/XSInfoView
XSInfoView/ViewController.h
C
mit
215
<?php namespace Sf\TodoBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class SfTodoBundle extends Bundle { }
a1092/pa8
src/Sf/TodoBundle/SfTodoBundle.php
PHP
mit
120
import * as _ from 'lodash'; import Vuex from 'vuex'; import {Deck} from '../models/Deck' import DeckState from '../models/state/DeckState' const store = { state: new DeckState(), mutations: { addToDeck(state, card) { if (!card) { return; } state.currentDeck.cards.push(card); if (!_.some(state.allDecks, thatDeck => thatDeck == state.currentDeck)) { state.allDecks.push(state.currentDeck); } localStorage["currentDeck"] = JSON.stringify(state.currentDeck); }, removeFromDeck(state, card) { if (card == undefined) { return; } let cardIndex = state.currentDeck.cards.indexOf(card); if (cardIndex < 0) { return; } state.currentDeck.cards.splice(cardIndex, 1); localStorage["currentDeck"] = JSON.stringify(state.currentDeck); }, removeAllFromDeck(state, card) { if (card == undefined) { return; } var filtered = state.currentDeck.cards.filter(c => c.multiverseid != card.multiverseid); state.currentDeck.cards = filtered; localStorage["currentDeck"] = JSON.stringify(state.currentDeck); }, loadDeck(state, deck) { if (deck == undefined) { return; } state.allDecks.push(deck); state.currentDeck = state.allDecks[state.allDecks.length - 1]; }, deleteCurrentDeck(state) { var deckIndex = state.allDecks.indexOf(state.currentDeck); state.allDecks.splice(deckIndex, 1); }, clearDeck(state) { state.currentDeck.cards = []; localStorage["currentDeck"] = JSON.stringify(state.currentDeck); }, setCurrentDeck(state, deck) { if (deck == undefined) { return; } state.currentDeck = deck; localStorage["currentDeck"] = JSON.stringify(state.currentDeck); } } }; export default store
jmazouri/Deckard
Deckard/Frontend/src/deckard/state/DeckModule.ts
TypeScript
mit
2,091
namespace _01.SchoolClasses { // Disciplines have name, number of lectures and number of exercises using System; class Disciplines : BasicInfoPeopleAndObjects { private int lecturesNumber; private int exercisesNumber; public Disciplines(string name, int lecturesNumber, int exercisesNumber) :base(name) { this.LecturesNumber = lecturesNumber; this.ExercisesNumber = exercisesNumber; } public int LecturesNumber { get { return this.lecturesNumber; } private set { if (CheckForValidValue(value)) { this.lecturesNumber = value; } } } public int ExercisesNumber { get { return this.exercisesNumber; } private set { if (CheckForValidValue(value)) { this.exercisesNumber = value; } } } private static bool CheckForValidValue(int value) { if (value < 1 || value > 10) { throw new ArgumentOutOfRangeException("THe number of Lectures Or Exercises should be bewtween 1 and 10"); } return true; } } }
clangelov/TelerikAcademyHomework
03_CSharp-OOP/OOP-Principles-Part1-Homework/01.SchoolClasses/Disciplines.cs
C#
mit
1,440
module Language.Aspell ( -- * Constructors SpellChecker, spellChecker, spellCheckerWithOptions, spellCheckerWithDictionary, -- * Using the spell checker check, suggest ) where import Data.ByteString.Char8 import Foreign #if !MIN_VERSION_base(4,7,0) hiding (unsafePerformIO) #endif import Foreign.C.String import Foreign.C.Types import Language.Aspell.Options import System.IO.Unsafe type AspellConfig = ForeignPtr () type SpellChecker = ForeignPtr () type CAspellConfig = Ptr () type CSpellChecker = Ptr () type CAspellCanHaveError = Ptr () type CWordList = Ptr () type CStringEnumeration = Ptr () newConfig :: IO AspellConfig newConfig = do cf <- new_aspell_config newForeignPtr delete_aspell_config cf setOpts :: [ACOption] -> AspellConfig -> IO AspellConfig setOpts (Dictionary dict:opts) pt = setOpt "master" dict pt >>= setOpts opts setOpts (WordListDir dir:opts) pt = setOpt "dict-dir" dir pt >>= setOpts opts setOpts (Lang lang:opts) pt = setOpt "lang" lang pt >>= setOpts opts setOpts (Size size:opts) pt = setOpt "size" newSize pt >>= setOpts opts where newSize = case size of Tiny -> "+10" ReallySmall -> "+20" Small -> "+30" MediumSmall -> "+40" Medium -> "+50" MediumLarge -> "+60" Large -> "+70" Huge -> "+80" Insane -> "+90" setOpts (PersonalWordList wl:opts) pt = setOpt "personal" wl pt >>= setOpts opts setOpts (ReplacementsList rl:opts) pt = setOpt "repl" rl pt >>= setOpts opts setOpts (Encoding encoding:opts) pt = setOpt "encoding" enc pt >>= setOpts opts where enc = case encoding of UTF8 -> "utf-8" Latin1 -> "iso-8859-1" setOpts (Normalize n:opts) pt = setOptBool "normalize" n pt >>= setOpts opts setOpts (NormalizeStrict n:opts) pt = setOptBool "norm-strict" n pt >>= setOpts opts setOpts (NormalizeForm form:opts) pt = setOpt "norm-form" nform pt >>= setOpts opts where nform = case form of None -> "none" NFD -> "nfd" NFC -> "nfc" Composed -> "comp" setOpts (NormalizeRequired b:opts) pt = setOptBool "norm-required" b pt >>= setOpts opts setOpts (Ignore i:opts) pt = setOptInteger "ignore" i pt >>= setOpts opts setOpts (IgnoreReplace b:opts) pt = setOptBool "ignore-repl" b pt >>= setOpts opts setOpts (SaveReplace b:opts) pt = setOptBool "save-repl" b pt >>= setOpts opts setOpts (KeyboardDef s:opts) pt = setOpt "keyboard" s pt >>= setOpts opts setOpts (SuggestMode sm:opts) pt = setOpt "sug-mode" mode pt >>= setOpts opts where mode = case sm of Ultra -> "ultra" Fast -> "fast" Normal -> "normal" Slow -> "slow" BadSpellers -> "bad-spellers" setOpts (IgnoreCase b:opts) pt = setOptBool "ignore-case" b pt >>= setOpts opts setOpts (IgnoreAccents b:opts) pt = setOptBool "ignore-accents" b pt >>= setOpts opts setOpts (FilterMode s:opts) pt = setOpt "mode" s pt >>= setOpts opts setOpts (EmailMargin n:opts) pt = setOptInteger "email-margin" n pt >>= setOpts opts setOpts (TeXCheckComments b:opts) pt = setOptBool "tex-check-comments" b pt >>= setOpts opts setOpts (ContextVisibleFirst b:opts) pt = setOptBool "context-visible-first" b pt >>= setOpts opts setOpts (RunTogether b:opts) pt = setOptBool "run-together" b pt >>= setOpts opts setOpts (RunTogetherLimit n:opts) pt = setOptInteger "run-together-limit" n pt >>= setOpts opts setOpts (RunTogetherMin n:opts) pt = setOptInteger "run-together-min" n pt >>= setOpts opts setOpts (MainConfig s:opts) pt = setOpt "conf" s pt >>= setOpts opts setOpts (MainConfigDir s:opts) pt = setOpt "conf-dir" s pt >>= setOpts opts setOpts (DataDir s:opts) pt = setOpt "data-dir" s pt >>= setOpts opts setOpts (LocalDataDir s:opts) pt = setOpt "local-data-dir" s pt >>= setOpts opts setOpts (HomeDir s:opts) pt = setOpt "home-dir" s pt >>= setOpts opts setOpts (PersonalConfig s:opts) pt = setOpt "per-conf" s pt >>= setOpts opts setOpts (Layout s:opts) pt = setOpt "keyboard" s pt >>= setOpts opts setOpts (Prefix s:opts) pt = setOpt "prefix" s pt >>= setOpts opts setOpts (SetPrefix b:opts) pt = setOptBool "set-prefix" b pt >>= setOpts opts setOpts [] pt = return pt setOpt :: ByteString -> ByteString -> AspellConfig -> IO AspellConfig setOpt key value pt = do withForeignPtr pt $ \ac -> useAsCString key $ \k -> useAsCString value $ aspell_config_replace ac k return pt setOptBool :: ByteString -> Bool -> AspellConfig -> IO AspellConfig setOptBool k v = setOpt k (if v then "true" else "false") setOptInteger :: ByteString -> Integer -> AspellConfig -> IO AspellConfig setOptInteger k v = setOpt k (pack $ show v) -- | Creates a spell checker with default options. -- -- @ -- 'spellChecker' = 'spellCheckerWithOptions' [] -- @ -- spellChecker :: IO (Either ByteString SpellChecker) spellChecker = spellCheckerWithOptions [] -- | Creates a spell checker with a custom set of options. spellCheckerWithOptions :: [ACOption] -> IO (Either ByteString SpellChecker) spellCheckerWithOptions opts = do cf <- newConfig setOpts opts cf canError <- withForeignPtr cf new_aspell_speller (errNum :: Int) <- fromIntegral `fmap` aspell_error_number canError if errNum > 0 then do errMsg <- aspell_error_message canError >>= packCString return $ Left errMsg else do speller <- to_aspell_speller canError for <- newForeignPtr delete_aspell_speller speller return $ Right for -- | Convenience function for specifying a dictionary. -- -- You can determine which dictionaries are available to you with @aspell dump dicts@. -- -- @ -- 'spellCheckerWithDictionary' dict = 'spellCheckerWithOptions' ['Dictionary' dict] -- @ spellCheckerWithDictionary :: ByteString -> IO (Either ByteString SpellChecker) spellCheckerWithDictionary b = spellCheckerWithOptions [Dictionary b] -- | Checks if a word has been spelled correctly. check :: SpellChecker -> ByteString -> Bool check checker word = unsafePerformIO $ withForeignPtr checker $ \ck -> useAsCString word $ \w -> do res <- aspell_speller_check ck w $ negate 1 return $ res == 1 -- | Lists suggestions for misspelled words. -- -- If the input is not misspelled according to the dictionary, returns @[]@. suggest :: SpellChecker -> ByteString -> IO [ByteString] suggest checker word = withForeignPtr checker $ \ck -> useAsCString word $ \w -> do wlist <- aspell_speller_suggest ck w (negate 1) elems <- aspell_word_list_elements wlist suggestions <- strEnumToList elems delete_aspell_string_enumeration elems return suggestions strEnumToList :: CStringEnumeration -> IO [ByteString] strEnumToList enum = go enum where go e = do nw <- aspell_string_enumeration_next enum if nw == nullPtr then return [] else do curWord <- packCString nw next <- go e return $ curWord:next foreign import ccall unsafe "aspell.h &delete_aspell_config" delete_aspell_config :: FunPtr (CAspellConfig -> IO ()) foreign import ccall unsafe "aspell.h &delete_aspell_speller" delete_aspell_speller :: FunPtr (CSpellChecker -> IO ()) foreign import ccall unsafe "aspell.h delete_aspell_string_enumeration" delete_aspell_string_enumeration :: CStringEnumeration -> IO () foreign import ccall unsafe "aspell.h new_aspell_config" new_aspell_config :: IO CAspellConfig foreign import ccall unsafe "aspell.h aspell_config_replace" aspell_config_replace :: CAspellConfig -> CString -> CString -> IO CAspellConfig foreign import ccall unsafe "aspell.h new_aspell_speller" new_aspell_speller :: CAspellConfig -> IO CAspellCanHaveError foreign import ccall unsafe "aspell.h aspell_error_number" aspell_error_number :: CAspellCanHaveError -> IO CUInt foreign import ccall unsafe "aspell.h aspell_error_message" aspell_error_message :: CAspellCanHaveError -> IO CString foreign import ccall unsafe "aspell.h to_aspell_speller" to_aspell_speller :: CAspellCanHaveError -> IO CSpellChecker foreign import ccall unsafe "aspell.h aspell_speller_check" aspell_speller_check :: CSpellChecker -> CString -> CInt -> IO CInt foreign import ccall unsafe "aspell.h aspell_speller_suggest" aspell_speller_suggest :: CSpellChecker -> CString -> CInt -> IO CWordList foreign import ccall unsafe "aspell.h aspell_word_list_elements" aspell_word_list_elements :: CWordList -> IO CStringEnumeration foreign import ccall unsafe "aspell.h aspell_string_enumeration_next" aspell_string_enumeration_next :: CStringEnumeration -> IO CString
pikajude/haspell
Language/Aspell.hs
Haskell
mit
9,412
# == Schema Information # # Table name: github_stargazers # # id :integer not null, primary key # linked_account_id :integer not null # tracker_id :integer not null # stargazer :boolean # subscriber :boolean # forker :boolean # synced_at :datetime # created_at :datetime # updated_at :datetime # class GithubStargazer < ApplicationRecord belongs_to :linked_account, class_name: 'LinkedAccount::Github::User' belongs_to :tracker, class_name: 'Github::Repository' # options # - oauth_token # - tracker_ids:[123,456] | tracker_id:123 def self.sync_stargazers_for(options) # require trackers return if options[:tracker_ids].blank? # get array of all stargazers, watchers, and forkers start_time = Time.now responses = get_responses_from_github_api(options) logger.error "STARGAZER API TIME: #{Time.now-start_time}" # # delete existing stargazers GithubStargazer.where(tracker_id: options[:tracker_ids]).delete_all # translate array into hash and group by github user and tracker id response_hash = responses.inject({}) do |h,(tr_id, gh_uid, w_type)| h[gh_uid] ||= {} h[gh_uid][tr_id] ||= {} h[gh_uid][tr_id][w_type] = true h end # create all linked accounts time_now_sql = GithubStargazer.connection.quote(Time.now) response_hash.to_a.in_groups_of(1000,false) do |group| # find which github remote ids we're dealing with gh_uids = group.map(&:first) # create any missing linked_accounts rails_autoload = [LinkedAccount::Github, LinkedAccount::Github::Organization, LinkedAccount::Github::User] existing_gh_uids = LinkedAccount::Github.where(uid: gh_uids).pluck(:uid) missing_gh_uids = gh_uids - existing_gh_uids if missing_gh_uids.length > 0 missing_gh_uids_sql = missing_gh_uids.map { |uid| "(#{time_now_sql}, #{time_now_sql}, 'LinkedAccount::Github::User', #{uid.to_i})" } LinkedAccount::Github.connection.insert("INSERT INTO linked_accounts (created_at, updated_at, type, uid) VALUES #{missing_gh_uids_sql.join(',')}") end # create linked account hash linked_account_hash = LinkedAccount::Github.where(uid: gh_uids).pluck(:id, :uid).inject({}) { |h,(id,uid)| h[uid]=id; h } stargazer_inserts = [] group.each do |ghuid, tracker_map| tracker_map.each do |tracker_id, hash| stargazer_inserts << "(#{time_now_sql}, #{time_now_sql}, #{linked_account_hash[ghuid]}, #{tracker_id}, #{!!hash[:stargazer]}, #{!!hash[:subscriber]}, #{!!hash[:forker]})" end end GithubStargazer.connection.insert("INSERT INTO github_stargazers (created_at, updated_at, linked_account_id, tracker_id, stargazer, subscriber, forker) VALUES #{stargazer_inserts.join(',')}") end end protected # this is an event machine that does 20 concurrent connections to get all of the stargazers, watchers, and forkers def self.get_responses_from_github_api(options) # queue up initial page loads, with page=nil requests = [] tracker_map = Tracker.where(id: options[:tracker_ids]).pluck(:id, :remote_id).inject({}) { |h,(id,remote_id)| h[id] = remote_id; h } options[:tracker_ids].each do |tracker_id| [:stargazer, :subscriber, :forker].each do |watch_type| requests.push( tracker_id: tracker_id, github_repository_uid: tracker_map[tracker_id], watch_type: watch_type ) end end # where the responses go responses = [] concurrent_requests = 0 max_concurrent_requests = 20 no_requests_until = Time.now EM.run do repeater = Proc.new do # puts "REPEATER #{concurrent_requests} < #{max_concurrent_requests} && #{requests.length} > 0 && #{no_requests_until} < #{Time.now}" if concurrent_requests < max_concurrent_requests && requests.length > 0 && no_requests_until < Time.now concurrent_requests += 1 request = requests.shift url_path = case request[:watch_type] when :stargazer then 'stargazers' when :subscriber then 'subscribers' when :forker then 'forks' end # generate request params = { per_page: 25 } params[:page] = request[:page] if request[:page] if options[:oauth_token] params[:oauth_token] = options[:oauth_token] else params[:client_id] = Api::Application.config.github_api[:client_id] params[:client_secret] = Api::Application.config.github_api[:client_secret] end url = "https://api.github.com/repositories/#{request[:github_repository_uid]}/#{url_path}?#{params.to_param}" # puts "REQUEST: #{url}" http = EventMachine::HttpRequest.new(url).get callback = proc { |http| # puts "RESPONSE: #{url}" concurrent_requests -= 1 if http.response_header.status == 200 # if the request was for the first page (page=nil), then queue up the rest of the pages if http.response_header['LINK'] && !request[:page] last_page = http.response_header['LINK'].scan(/page=(\d+)>; rel="last"/)[0][0].to_i (2..last_page).each { |page| requests << request.merge(page: page) } end # parse response JSON.parse(http.response).each do |row| responses << [ request[:tracker_id], request[:watch_type] == :forker ? row['owner']['id'] : row['id'], request[:watch_type] ] end # queue the next one repeater.call elsif http.response_header.status == 404 # tracker deleted! queue remote_sync so it gets marked as deleted Tracker.find(request[:tracker_id]).delay.remote_sync elsif http.response.try(:include?, "abuse-rate-limits") && (request[:retries]||0) < 3 puts "DELAY 60 SECONDS" no_requests_until = Time.now + 60.seconds requests << request.merge(retries: (request[:retries]||0) + 1) else puts "ERROR: #{url}" puts http.try(:errors) puts http.response pp http.response_header EM.stop end } http.callback &callback http.errback &callback # if we queued a request, maybe we can queue another repeater.call elsif concurrent_requests == 0 && requests.length == 0 EM.stop end end EventMachine::PeriodicTimer.new(1) { repeater.call } repeater.call end responses end end
bountysource/core
app/models/github_stargazer.rb
Ruby
mit
6,853
'use strict'; angular.module('articles').controller('ChangeHeaderImageController', ['$scope', '$timeout', '$stateParams', '$window', 'Authentication', 'FileUploader', 'Articles', function ($scope, $timeout, $stateParams, $window, Authentication, FileUploader, Articles) { $scope.user = Authentication.user; $scope.article = Articles.get({ articleId: $stateParams.articleId }); $scope.imageURL = $scope.article.headerMedia || null; // Create file uploader instance $scope.uploader = new FileUploader({ url: 'api/articles/' + $stateParams.articleId + '/headerimage', alias: 'newHeaderImage' }); // Set file uploader image filter $scope.uploader.filters.push({ name: 'imageFilter', fn: function (item, options) { var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; } }); // Called after the user selected a new picture file $scope.uploader.onAfterAddingFile = function (fileItem) { if ($window.FileReader) { var fileReader = new FileReader(); fileReader.readAsDataURL(fileItem._file); fileReader.onload = function (fileReaderEvent) { $timeout(function () { $scope.imageURL = fileReaderEvent.target.result; }, 0); }; } }; // Called after the article has been assigned a new header image $scope.uploader.onSuccessItem = function (fileItem, response, status, headers) { // Show success message $scope.success = true; // Populate user object $scope.user = Authentication.user = response; // Clear upload buttons $scope.cancelUpload(); }; // Called after the user has failed to upload a new picture $scope.uploader.onErrorItem = function (fileItem, response, status, headers) { // Clear upload buttons $scope.cancelUpload(); // Show error message $scope.error = response.message; }; // Change article header image $scope.uploadHeaderImage = function () { console.log($scope); // Clear messages $scope.success = $scope.error = null; // Start upload $scope.uploader.uploadAll(); }; // Cancel the upload process $scope.cancelUpload = function () { $scope.uploader.clearQueue(); //$scope.imageURL = $scope.article.profileImageURL; }; } ]);
davidsbelt/bacca-app
modules/articles/client/controllers/change-header-image.client.controller.js
JavaScript
mit
2,451
#chrome-heart { display: inline-block; margin-bottom: -30px; background: url(../images/chrome_logo.png) 50% 50% no-repeat; width: 100px; height: 100px; background-position: 50% 50%; background-size: cover; } .spin { -webkit-animation-name: rotateRight; -webkit-animation-duration: 10s; -webkit-animation-timing-function: linear; -webkit-transform-origin: 50% 50%; -webkit-animation-iteration-count: infinite; } .spin:hover { -webkit-animation-duration: 0.1s; } @-webkit-keyframes rotateRight { from { -webkit-transform: rotate(0); } to { -webkit-transform: rotate(360deg); } }
jaydeepw/jaydeepw.github.com
HTML5/Beginner/css/mystyle.css
CSS
mit
622
# Halitosis TODO: Write a gem description ## Installation Add this line to your application's Gemfile: gem 'halitosis' And then execute: $ bundle Or install it yourself as: $ gem install halitosis ## Usage TODO: Write usage instructions here ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
darrencauthon/halitosis
README.md
Markdown
mit
503
/** @jsx h */ import h from '../../../helpers/h' import { Mark } from '../../../..' export default function(change) { change.addMark( Mark.create({ type: 'bold', data: { thing: 'value' }, }) ) } export const input = ( <value> <document> <paragraph> <anchor />w<focus />ord </paragraph> </document> </value> ) export const output = ( <value> <document> <paragraph> <anchor /> <b thing="value">w</b> <focus />ord </paragraph> </document> </value> )
ashutoshrishi/slate
packages/slate/test/changes/at-current-range/add-mark/with-mark-object.js
JavaScript
mit
556
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * App\Entity$EditeurNatureSupport. * * @ORM\Table(name="editeurnaturesupport") * @ORM\Entity(repositoryClass="App\Repository\EditeurNatureSupportRepository") */ class EditeurNatureSupport { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var Editeur * * @ORM\ManyToOne( * targetEntity="App\Entity\Editeur", * inversedBy="editeurNatureSupports" * ) * @ORM\JoinColumn(nullable=false) */ private $editeur; /** * @var NatureSupport * * @ORM\ManyToOne( * targetEntity="App\Entity\NatureSupport", * inversedBy="editeurNatureSupports" * ) * @ORM\JoinColumn( * name="naturesupport_id", * referencedColumnName="id", * nullable=false * ) */ private $natureSupport; /** * @var Collection * * @ORM\ManyToMany( * targetEntity="App\Entity\CategorieOeuvre", * inversedBy="editeurNatureSupports" * ) * @ORM\JoinTable( * name="editeurnaturesupport_categorieoeuvre", * joinColumns={ * @ORM\JoinColumn( * name="editeurnaturesupport_id", * referencedColumnName="id" * ) * }, * inverseJoinColumns={ * @ORM\JoinColumn( * name="categorieoeuvre_id", * referencedColumnName="id" * ) * } * ) */ private $categoriesOeuvres; /** * @var Collection * * @ORM\OneToMany( * targetEntity="App\Entity\Support", * mappedBy="editeurNatureSupport" * ) */ private $supports; /** * Constructeur. * * @param Editeur|null $editeur * @param NatureSupport|null $natureSupport */ public function __construct( Editeur $editeur = null, NatureSupport $natureSupport = null ) { $this->editeur = $editeur; $this->natureSupport = $natureSupport; $this->categoriesOeuvres = new ArrayCollection(); } /** * Get id. * * @return int */ public function getId(): int { return $this->id; } /** * Set editeur. * * @param Editeur|null $editeur */ public function setEditeur(Editeur $editeur = null): void { $this->editeur = $editeur; } /** * Get editeur. * * @return Editeur */ public function getEditeur(): ?Editeur { return $this->editeur; } /** * Set natureSupport. * * @param NatureSupport|null $natureSupport */ public function setNatureSupport(NatureSupport $natureSupport = null): void { $this->editeur = $natureSupport; } /** * Get natureSupport. * * @return NatureSupport|null */ public function getNatureSupport(): ?NatureSupport { return $this->natureSupport; } /** * Add categorieOeuvre. * * @param CategorieOeuvre $categorieOeuvre */ public function addCategorieOeuvre(CategorieOeuvre $categorieOeuvre): void { if (!$this->categoriesOeuvres->contains($categorieOeuvre)) { $this->categoriesOeuvres[] = $categorieOeuvre; $categorieOeuvre->addEditeurNatureSupport($this); } } /** * Remove categorieOeuvre. * * @param CategorieOeuvre $categorieOeuvre */ public function removeCategorieOeuvre(CategorieOeuvre $categorieOeuvre): void { if ($this->categoriesOeuvres->contains($categorieOeuvre)) { $this->categoriesOeuvres->removeElement($categorieOeuvre); $categorieOeuvre->removeEditeurNatureSupport($this); } } /** * Get categoriesOeuvres. * * @return Collection */ public function getCategoriesOeuvres(): Collection { return $this->categoriesOeuvres; } /** * Add support. * * @param Support $support */ public function addSupport(Support $support): void { if (!$this->supports->contains($support)) { $this->supports[] = $support; } $support->setEditeurNatureSupport($this); } /** * Remove support. * * @param Support $support */ public function removeSupport(Support $support): void { if ($this->supports->contains($support)) { $this->supports->removeElement($support); } $support->setEditeurNatureSupport(null); } /** * Get supports. * * @return Collection */ public function getSupports(): Collection { return $this->supports; } }
dmsr45/github_sf_media
src/Entity/EditeurNatureSupport.php
PHP
mit
4,995
package main import ( "net/http" "sync" "time" "github.com/1lann/airlift/airlift" humanize "github.com/dustin/go-humanize" "github.com/gin-gonic/contrib/renders/multitemplate" "github.com/gin-gonic/contrib/sessions" "github.com/gin-gonic/gin" ) func formatBasicTime(t time.Time) string { return getDay(t) + " " + t.Format("January 2006 at 3:04 PM") } func init() { registers = append(registers, func(r *gin.RouterGroup, t multitemplate.Render) { t.AddFromFiles("notes", viewsPath+"/notes.tmpl", viewsPath+"/components/base.tmpl") r.GET("/notes", viewUserNotes) t.AddFromFiles("view-note", viewsPath+"/view-note.tmpl", viewsPath+"/components/base.tmpl") r.GET("/notes/:id", viewNote) r.POST("/notes/:id/star", func(c *gin.Context) { starred := c.PostForm("starred") == "true" username := c.MustGet("user").(airlift.User).Username err := airlift.SetNoteStar(c.Param("id"), username, starred) if err != nil { panic(err) } c.JSON(http.StatusOK, gin.H{"status": "ok"}) }) }) } func viewNote(c *gin.Context) { id := c.Param("id") user := c.MustGet("user").(airlift.User) note, err := airlift.GetFullNote(id, user.Username) if err != nil { panic(err) } if note.Title == "" { c.HTML(http.StatusNotFound, "not-found", nil) return } files := []fileCard{ { Name: "Notes", Size: humanize.Bytes(note.Size), URL: "/download/notes/" + note.ID, }, } session := sessions.Default(c) uploadFlashes := session.Flashes("upload") uploadSuccess := "" if len(uploadFlashes) > 0 { uploadSuccess = uploadFlashes[0].(string) } session.Save() htmlOK(c, "view-note", gin.H{ "ActiveMenu": "notes", "Note": note, "Files": files, "IsUploader": note.Uploader == user.Username, "UploadTime": formatBasicTime(note.UploadTime), "UpdatedTime": formatBasicTime(note.UpdatedTime), "UploadSuccess": uploadSuccess, }) } func viewUserNotes(c *gin.Context) { user := c.MustGet("user").(airlift.User) wg := new(sync.WaitGroup) wg.Add(2) var starred []airlift.Note go func() { defer func() { wg.Done() }() var err error starred, err = airlift.GetStarredNotes(user.Username) if err != nil { panic(err) } }() var uploaded []airlift.Note go func() { defer func() { wg.Done() }() var err error uploaded, err = airlift.GetUploadedNotes(user.Username) if err != nil { panic(err) } }() deleted := false session := sessions.Default(c) uploadFlashes := session.Flashes("upload") if len(uploadFlashes) > 0 && uploadFlashes[0] == "delete" { deleted = true } session.Save() wg.Wait() htmlOK(c, "notes", gin.H{ "ActiveMenu": "notes", "Starred": starred, "Uploaded": uploaded, "Deleted": deleted, }) }
1lann/airlift
notes.go
GO
mit
2,768
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @since 0.1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ namespace Bake\Shell\Task; use Cake\Console\Shell; use Cake\Core\Configure; use Cake\Database\Exception; use Cake\Database\Schema\Table; use Cake\Datasource\ConnectionManager; use Cake\ORM\TableRegistry; use Cake\Utility\Inflector; use Cake\Utility\Text; use DateTimeInterface; /** * Task class for creating and updating fixtures files. * * @property \Bake\Shell\Task\BakeTemplateTask $BakeTemplate * @property \Bake\Shell\Task\ModelTask $Model */ class FixtureTask extends BakeTask { /** * Tasks to be loaded by this Task * * @var array */ public $tasks = [ 'Bake.Model', 'Bake.BakeTemplate' ]; /** * Get the file path. * * @return string */ public function getPath() { $dir = 'Fixture/'; $path = defined('TESTS') ? TESTS . $dir : ROOT . DS . 'tests' . DS . $dir; if (isset($this->plugin)) { $path = $this->_pluginPath($this->plugin) . 'tests/' . $dir; } return str_replace('/', DS, $path); } /** * Gets the option parser instance and configures it. * * @return \Cake\Console\ConsoleOptionParser */ public function getOptionParser() { $parser = parent::getOptionParser(); $parser = $parser->setDescription( 'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.' )->addArgument('name', [ 'help' => 'Name of the fixture to bake (without the `Fixture` suffix). ' . 'You can use Plugin.name to bake plugin fixtures.' ])->addOption('table', [ 'help' => 'The table name if it does not follow conventions.', ])->addOption('count', [ 'help' => 'When using generated data, the number of records to include in the fixture(s).', 'short' => 'n', 'default' => 1 ])->addOption('schema', [ 'help' => 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.', 'short' => 's', 'boolean' => true ])->addOption('records', [ 'help' => 'Generate a fixture with records from the non-test database.' . ' Used with --count and --conditions to limit which records are added to the fixture.', 'short' => 'r', 'boolean' => true ])->addOption('conditions', [ 'help' => 'The SQL snippet to use when importing records.', 'default' => '1=1', ])->addSubcommand('all', [ 'help' => 'Bake all fixture files for tables in the chosen connection.' ]); return $parser; } /** * Execution method always used for tasks * Handles dispatching to interactive, named, or all processes. * * @param string|null $name The name of the fixture to bake. * @return null|bool */ public function main($name = null) { parent::main(); $name = $this->_getName($name); if (empty($name)) { $this->out('Choose a fixture to bake from the following:'); foreach ($this->Model->listUnskipped() as $table) { $this->out('- ' . $this->_camelize($table)); } return true; } $table = null; if (isset($this->params['table'])) { $table = $this->params['table']; } $model = $this->_camelize($name); $this->bake($model, $table); } /** * Bake All the Fixtures at once. Will only bake fixtures for models that exist. * * @return void */ public function all() { $tables = $this->Model->listUnskipped($this->connection, false); foreach ($tables as $table) { $this->main($table); } } /** * Assembles and writes a Fixture file * * @param string $model Name of model to bake. * @param string|null $useTable Name of table to use. * @return string Baked fixture content * @throws \RuntimeException */ public function bake($model, $useTable = null) { $table = $schema = $records = $import = $modelImport = null; if (!$useTable) { $useTable = Inflector::tableize($model); } elseif ($useTable !== Inflector::tableize($model)) { $table = $useTable; } $importBits = []; if (!empty($this->params['schema'])) { $modelImport = true; $importBits[] = "'table' => '{$useTable}'"; } if (!empty($importBits) && $this->connection !== 'default') { $importBits[] = "'connection' => '{$this->connection}'"; } if (!empty($importBits)) { $import = sprintf("[%s]", implode(', ', $importBits)); } $connection = ConnectionManager::get($this->connection); if (!method_exists($connection, 'schemaCollection')) { throw new \RuntimeException( 'Cannot generate fixtures for connections that do not implement schemaCollection()' ); } $schemaCollection = $connection->schemaCollection(); try { $data = $schemaCollection->describe($useTable); } catch (Exception $e) { $useTable = Inflector::underscore($model); $table = $useTable; $data = $schemaCollection->describe($useTable); } if ($modelImport === null) { $schema = $this->_generateSchema($data); } if (empty($this->params['records'])) { $recordCount = 1; if (isset($this->params['count'])) { $recordCount = $this->params['count']; } $records = $this->_makeRecordString($this->_generateRecords($data, $recordCount)); } if (!empty($this->params['records'])) { $records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable)); } return $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import')); } /** * Generate the fixture file, and write to disk * * @param string $model name of the model being generated * @param array $otherVars Contents of the fixture file. * @return string Content saved into fixture file. */ public function generateFixtureFile($model, array $otherVars) { $defaults = [ 'name' => $model, 'table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null, 'namespace' => Configure::read('App.namespace') ]; if ($this->plugin) { $defaults['namespace'] = $this->_pluginNamespace($this->plugin); } $vars = $otherVars + $defaults; $path = $this->getPath(); $filename = $vars['name'] . 'Fixture.php'; $this->BakeTemplate->set('model', $model); $this->BakeTemplate->set($vars); $content = $this->BakeTemplate->generate('tests/fixture'); $this->out("\n" . sprintf('Baking test fixture for %s...', $model), 1, Shell::QUIET); $this->createFile($path . $filename, $content); $emptyFile = $path . 'empty'; $this->_deleteEmptyFile($emptyFile); return $content; } /** * Generates a string representation of a schema. * * @param \Cake\Database\Schema\Table $table Table schema * @return string fields definitions */ protected function _generateSchema(Table $table) { $cols = $indexes = $constraints = []; foreach ($table->columns() as $field) { $fieldData = $table->column($field); $properties = implode(', ', $this->_values($fieldData)); $cols[] = " '$field' => [$properties],"; } foreach ($table->indexes() as $index) { $fieldData = $table->index($index); $properties = implode(', ', $this->_values($fieldData)); $indexes[] = " '$index' => [$properties],"; } foreach ($table->constraints() as $index) { $fieldData = $table->constraint($index); $properties = implode(', ', $this->_values($fieldData)); $constraints[] = " '$index' => [$properties],"; } $options = $this->_values($table->options()); $content = implode("\n", $cols) . "\n"; if (!empty($indexes)) { $content .= " '_indexes' => [\n" . implode("\n", $indexes) . "\n ],\n"; } if (!empty($constraints)) { $content .= " '_constraints' => [\n" . implode("\n", $constraints) . "\n ],\n"; } if (!empty($options)) { foreach ($options as &$option) { $option = ' ' . $option; } $content .= " '_options' => [\n" . implode(",\n", $options) . "\n ],\n"; } return "[\n$content ]"; } /** * Formats Schema columns from Model Object * * @param array $values options keys(type, null, default, key, length, extra) * @return array Formatted values */ protected function _values($values) { $vals = []; if (!is_array($values)) { return $vals; } foreach ($values as $key => $val) { if (is_array($val)) { $vals[] = "'{$key}' => [" . implode(", ", $this->_values($val)) . "]"; } else { $val = var_export($val, true); if ($val === 'NULL') { $val = 'null'; } if (!is_numeric($key)) { $vals[] = "'{$key}' => {$val}"; } else { $vals[] = "{$val}"; } } } return $vals; } /** * Generate String representation of Records * * @param \Cake\Database\Schema\Table $table Table schema array * @param int $recordCount The number of records to generate. * @return array Array of records to use in the fixture. */ protected function _generateRecords(Table $table, $recordCount = 1) { $records = []; for ($i = 0; $i < $recordCount; $i++) { $record = []; foreach ($table->columns() as $field) { $fieldInfo = $table->column($field); $insert = ''; switch ($fieldInfo['type']) { case 'decimal': $insert = $i + 1.5; break; case 'biginteger': case 'integer': case 'float': case 'smallinteger': case 'tinyinteger': $insert = $i + 1; break; case 'string': case 'binary': $isPrimary = in_array($field, $table->primaryKey()); if ($isPrimary) { $insert = Text::uuid(); } else { $insert = "Lorem ipsum dolor sit amet"; if (!empty($fieldInfo['length'])) { $insert = substr($insert, 0, (int)$fieldInfo['length'] - 2); } } break; case 'timestamp': $insert = time(); break; case 'datetime': $insert = date('Y-m-d H:i:s'); break; case 'date': $insert = date('Y-m-d'); break; case 'time': $insert = date('H:i:s'); break; case 'boolean': $insert = 1; break; case 'text': $insert = "Lorem ipsum dolor sit amet, aliquet feugiat."; $insert .= " Convallis morbi fringilla gravida,"; $insert .= " phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin"; $insert .= " venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla"; $insert .= " vestibulum massa neque ut et, id hendrerit sit,"; $insert .= " feugiat in taciti enim proin nibh, tempor dignissim, rhoncus"; $insert .= " duis vestibulum nunc mattis convallis."; break; case 'uuid': $insert = Text::uuid(); break; } $record[$field] = $insert; } $records[] = $record; } return $records; } /** * Convert a $records array into a string. * * @param array $records Array of records to be converted to string * @return string A string value of the $records array. */ protected function _makeRecordString($records) { $out = "[\n"; foreach ($records as $record) { $values = []; foreach ($record as $field => $value) { if ($value instanceof DateTimeInterface) { $value = $value->format('Y-m-d H:i:s'); } $val = var_export($value, true); if ($val === 'NULL') { $val = 'null'; } $values[] = " '$field' => $val"; } $out .= " [\n"; $out .= implode(",\n", $values); $out .= "\n ],\n"; } $out .= " ]"; return $out; } /** * Interact with the user to get a custom SQL condition and use that to extract data * to build a fixture. * * @param string $modelName name of the model to take records from. * @param string|null $useTable Name of table to use. * @return array Array of records. */ protected function _getRecordsFromTable($modelName, $useTable = null) { $recordCount = (isset($this->params['count']) ? $this->params['count'] : 10); $conditions = (isset($this->params['conditions']) ? $this->params['conditions'] : '1=1'); if (TableRegistry::exists($modelName)) { $model = TableRegistry::get($modelName); } else { $model = TableRegistry::get($modelName, [ 'table' => $useTable, 'connection' => ConnectionManager::get($this->connection) ]); } $records = $model->find('all') ->where($conditions) ->limit($recordCount) ->enableHydration(false); return $records; } }
JayWalker512/CrueltyGame
cruelty/vendor/cakephp/bake/src/Shell/Task/FixtureTask.php
PHP
mit
15,668
using System; namespace _14.MagicLetter { class Program { static void Main(string[] args) { char letter1 = char.Parse(Console.ReadLine()); char letter2 = char.Parse(Console.ReadLine()); string letter3 = Console.ReadLine(); for (char i = letter1; i <= letter2; i++) { for (char p = letter1; p <= letter2; p++) { for (char k = letter1; k <= letter2; k++) { string result = $"{i}{p}{k}"; if (!result.Contains(letter3)) { Console.Write(result + " "); } } } } } } }
spacex13/SoftUni-Homework
ConditionalStatementsAndLoops/14.MagicLetter/Program.cs
C#
mit
806
<?php namespace Metro; use Monolog\Handler\HandlerInterface; use Monolog\Handler\PsrHandler; use Monolog\Logger; use Psr\Log\LoggerInterface; class Worker { /** @var ConsumableQueue */ private $metro; /** @var JobExecutor */ private $jobExecutor; /** @var string[] */ private $queues; /** @var Logger */ private $logger; /** @var int */ private $interval = 5000; /** @var bool */ private $drainMode = false; public function __construct(ConsumableQueue $metro, JobExecutor $jobExecutor, LoggerInterface $logger, ...$queueIds) { $this->metro = $metro; $this->jobExecutor = $jobExecutor; $this->setLogger($logger); $this->queues = $queueIds; } public function setLogger(LoggerInterface $logger) { if ($logger instanceof \Monolog\Logger) { $this->logger = $logger; } else { $this->logger = new Logger('metro', [new PsrHandler($logger)]); } } public function identify() { return sprintf("%s@%s", getmypid(), gethostname()); } /** * @param int $timeInMilliseconds * @return void */ public function setInterval($timeInMilliseconds) { $this->interval = $timeInMilliseconds; } public function quitAsap() { $this->drainMode = true; } public function work() { $identity = $this->identify(); $this->logger->notice(sprintf( '%s waiting for work on queue(s) [%s]', $identity, join(', ', $this->queues) )); for (;;) { $job = $this->metro->pop($this->queues, $this); if (null !== $job) { $jobHandler = $this->metro->createTaskLogHander($job->getId()); $this->logger->pushHandler($jobHandler); $this->logger->pushProcessor(function ($record) use ($job) { $record['extra']['job_id'] = $job->getId(); return $record; }); $this->workOn($job, $jobHandler); $this->logger->popHandler(); $this->logger->popProcessor(); } if ($this->interval <= 0) { return; } if (null === $job) { if ($this->drainMode) { $this->logger->notice(sprintf('%s exiting because all queues are empty', $identity)); return; } usleep($this->interval * 1e3); } } } private function workOn(CommittedJob $job, HandlerInterface $jobHandler) { try { $this->logger->notice("Starting work on {$job->getId()}"); $logProvider = new LogProvider($this->logger, $jobHandler); $this->jobExecutor->execute($job, $logProvider); $this->metro->succeed($job->getId()); $this->logger->notice("Finished work on {$job->getId()}"); } catch (\Exception $e) { $this->logException($e, $job->getId()); $this->metro->fail($job->getId()); } } private function logException(\Exception $e, $jobId) { $trace = isset($e->traceString) ? $e->traceString : $e->getTraceAsString(); $this->logger->error("Job $jobId failed: " . $e->getMessage(), ['exception' => $e]); foreach (explode(PHP_EOL, $trace) as $line) { $this->logger->error($line); } } }
metro-q/metro
src/Worker.php
PHP
mit
3,524
<?php namespace EasiestWay\MainBundle\Entity; use Doctrine\ORM\Mapping as ORM; use FOS\UserBundle\Model\User as BaseUser; /** * User */ class User extends BaseUser { /** * @var integer */ protected $id; /** * Get id * * @return integer */ public function getId() { return $this->id; } }
easiestway/project
src/EasiestWay/MainBundle/Entity/User.php
PHP
mit
358
package algorithms.sorting; import java.util.Scanner; /* * Sample Challenge * This is a simple challenge to get things started. Given a sorted array (ar) * and a number (V), can you print the index location of V in the array? * * Input Format: * There will be three lines of input: * * V - the value that has to be searched. * n - the size of the array. * ar - n numbers that make up the array. * * Output Format: * Output the index of V in the array. * * Constraints: * 1 <= n <= 1000 * -1000 <= V <= 1000, V is an element of ar * It is guaranteed that V will occur in ar exactly once. * * Sample Input: * 4 * 6 * 1 4 5 7 9 12 * * Sample Output: * 1 */ public class FindIndexIntro { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int target = sc.nextInt(); int arraySize = sc.nextInt(); int targetIndex = -1; int arrayIndex = 0; while (arrayIndex < arraySize) { if (target == sc.nextInt()) { targetIndex = arrayIndex; break; } arrayIndex++; } sc.close(); System.out.println(targetIndex); } }
RCoon/HackerRank
algorithms/sorting/FindIndexIntro.java
Java
mit
1,297
require 'resque' require 'resque/plugins/heroku_scaler/version' require 'resque/plugins/heroku_scaler/config' require 'resque/plugins/heroku_scaler/manager' require 'resque/plugins/heroku_scaler/worker' require 'resque/plugins/heroku_scaler/resque' module Resque module Plugins module HerokuScaler class << self def run startup loop do begin scale rescue Exception => e log "Scale failed with #{e.class.name} #{e.message}" end wait_for_scale end end def scale required = scale_for(pending) active = workers return if required == active if required > active log "Scale workers from #{active} to #{required}" scale_workers(required) return end return if pending? scale_down(active) end def wait_for_scale sleep Resque::Plugins::HerokuScaler::Config.scale_interval end def scale_for(pending) Resque::Plugins::HerokuScaler::Config.scale_for(pending) end def scale_workers(qty) Resque::Plugins::HerokuScaler::Manager.workers = qty end def scale_down(active) log "Scale #{active} workers down" lock timeout = Time.now + Resque::Plugins::HerokuScaler::Config.scale_timeout until locked == active or Time.now >= timeout sleep Resque::Plugins::HerokuScaler::Config.poll_interval end scale_workers(0) timeout = Time.now + Resque::Plugins::HerokuScaler::Config.scale_timeout until Time.now >= timeout if offline? log "#{active} workers scaled down successfully" prune break end sleep Resque::Plugins::HerokuScaler::Config.poll_interval end ensure unlock end def workers Resque::Plugins::HerokuScaler::Manager.workers end def offline? workers.zero? end def pending? pending > 0 end def pending Resque.info[:pending] end def lock Resque.lock end def unlock Resque.unlock end def locked Resque.info[:locked] end def prune Resque.prune end def configure yield Resque::Plugins::HerokuScaler::Config end def startup STDOUT.sync = true trap('TERM') do log "Shutting down scaler" exit end log "Starting scaler" unlock end def log(message) puts "*** #{message}" end end end end end
aarondunnington/resque-heroku-scaler
lib/resque/plugins/heroku_scaler.rb
Ruby
mit
2,946
# Pool server This software includes: * A pool master for miner handling * A pool controller ## Warning The software is not well tested and it's a work in progress, use at your own risk. ## Requirements * golang * python2 * python2 flask * python2 requests * python2 pysqlite3 ## Configuration For first, configure the pool master: 1. Open poolmaster/pool.go 2. Choose a secure key, and replace the one proposed in line 46 3. Set the poolPort at line 46; this will be used by pool miners 4. Set the port of your ethereum daemon at line 47 5. Enter the ethpool.py directory and run ``` ./make_poolmaster.sh ``` Now edit ethpool.py: 1. At line 15, set the previously secure key 2. At line 21, set the pool fee 3. At line 22, set your coinbase address ## Startup 1. Start geth or similar with rpc ``` geth --rpc ``` 2. First run ``` ./poolmaster/pool ``` 3. Start the pool server with ``` python ethpool.py ``` ## Donations Donations are always welcome: BTC: 13TRVwiqLMveg9aPAmZgcAix5ogKVgpe4T ETH: 0x18f081247ad32af38404d071eb8c246cc4f33534
dakk/ethpool.py
README.md
Markdown
mit
1,053
using Newtonsoft.Json.Linq; using System.Collections.Generic; namespace BlizzardAPI.Wow.DataResources { public class CharacterRaces { private List<CharacterRace> races = new List<CharacterRace>(); public List<CharacterRace> Races { get => races; set => races = value; } public CharacterRaces(string region, string locale) { var racesData = ApiHelper.GetJsonFromUrl( $"https://{region}.api.battle.net/wow/data/character/races?locale={locale}&apikey={ApiHandler.ApiKey}" ); if (racesData == null) return; for (var i = 0; i < (racesData["races"] as JArray).Count; i++) { Races.Add(new CharacterRace { Id = racesData["races"][i]["id"], Mask = racesData["races"][i]["mask"], Side = racesData["races"][i]["side"], Name = racesData["races"][i]["name"] }); } } } }
EcadryM/BlizzardAPI
BlizzardAPI/BlizzardAPI.Wow/DataResources/CharacterRaces.cs
C#
mit
1,046
from datetime import datetime from flask import Blueprint, render_template from flask_cas import login_required from timecard.api import current_period_start from timecard.models import config, admin_required admin_views = Blueprint('admin', __name__, url_prefix='/admin', template_folder='templates') @admin_views.route('/') @admin_views.route('/users', methods=['GET']) @login_required @admin_required def admin_users_page(): return render_template( 'admin_users.html', initial_date=datetime.now().isoformat(), # now, in server's time zone initial_period_start=current_period_start().isoformat(), period_duration=config['period_duration'], lock_date=config['lock_date'], ) @admin_views.route('/settings') @login_required @admin_required def admin_settings_page(): return render_template( 'admin_settings.html' )
justinbot/timecard
timecard/admin/views.py
Python
mit
885
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>마봉아빠의 개발자를 위한 CSS 초급강의</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <link rel="stylesheet" href="../../template/style.css"> </head> <body> <p>##CSS의 기초 - 폰트명(font-family)</p> <p>웹에 사용될 폰트명을 지정합니다. 지정되지 않으면, 브라우저의 기본 폰트로 설정이 되고, 지정하게 되면 해당 폰트명을 검색하여 반영합니다. 만약 지정폰트명이 없으면, 브라우저의 폰트명을 상속받게 됩니다.</p> <p>폰트에는 두가지 종류가 있는데, 형태를 기준하는 제너릭명(generic-family) 방식과 실제 폰트명(font-name) 방식이 있습니다.</p> <h3 id="font-family">font-family</h3> <ul> <li>기본값 : 브라우저의 기본폰트</li> <li>상속성 : 있음</li> <li>작성방법 : <code>font-family: (제너릭명 | 폰트명)+|initial|inherit;</code></li> </ul> <h4 id="-">제너릭명?</h4> <p>폰트는 글자의 형태에 따라 크게 3가지 로 지칭합니다.</p> <ul> <li>Serif(쉐리프) : 곡선을 주로 사용하여 작성된 폰트 스타일들 (예 : Times New Roman , Georgia)</li> <li>Sans-serif(산쉐리프) : 직선을 주로 사용하여 작성된 폰트 스타일들 (예 : Arial , Verdana)</li> <li>Monospace(모노스페이스) : 곡선과 직선을 혼합하여 작성된 폰트 스타일들 (예 : Courier New , Lucida Console)</li> </ul> <h4 id="-">다양한 폰트설정</h4> <pre><code class="lang-css">body{font-family:&quot;Nanum Gothic&quot;,&quot;나눔고딕&quot;,&quot;Malgun Gothic&quot;,&quot;맑은고딕&quot;,Dotum,&quot;돋움&quot;,Gulim,&quot;굴림&quot;,&quot;Helvetica Neue&quot;,Helvetica,Tahoma,Verdana,&quot;Trebuchet MS&quot;,Arial,Apple-Gothic,Sans-serif;} </code></pre> <h4 id="qa">QA</h4> <p>Q. 제너릭명으로 지칭했는데, 포함되는 폰트가 많다면, 어떤것이 적용되나요?<br>A. 그건 브라우저에 설정된 폰트를 따라갑니다. 한글 윈도우7에 있는 크롬은 기본적으로 쉐리프 라면 &quot;batang&quot;(바탕체) 폰트를 사용합니다.<br>A. 산쉐리프라면? &quot;Malgun Gothic&quot; (맑은고딕) </p> <h2 id="a-gulimche-">A. 모노스페이스 라면? &quot;GulimChe&quot; (굴림체) </h2> <p>Q. 따움표로 감싸진것과 아닌것의 차이<br>A. 폰트명이 &quot;CJK&quot; 이거나 &quot;띄어쓰기&quot;가 있는경우엔 따옴표를 넣게 됩니다.</p> </body> </html>
dstyle0210/minipaper
css-page/step3/02_family.html
HTML
mit
3,124
/* * The Life Simulation Challenge * https://github.com/dankrusi/life-simulation-challenge * * Contributor(s): * Dan Krusi <dan.krusi@nerves.ch> (original author) * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ using System; using System.Collections; using System.Drawing; using System.Windows.Forms; namespace LifeSimulation.Core.GUI { public class StartScreen : Form { #region Private Variables private TableLayoutPanel _layout; private CheckedListBox _checkedListRaces; private Button _buttonSimulate; private Label _labelInitialLifelets; private TrackBar _trackbarInitialLifelets; #endregion #region Public Method public StartScreen () : base() { // Init // Window //this.ClientSize = new Size(300, 500); this.Text = "Life Simulation"; this.FormBorderStyle = FormBorderStyle.FixedDialog; this.StartPosition = FormStartPosition.CenterScreen; // Layout _layout = new TableLayoutPanel(); _layout.Dock = DockStyle.Fill; this.Controls.Add(_layout); // Suspend layouting _layout.SuspendLayout(); this.SuspendLayout(); // Races list _checkedListRaces = new CheckedListBox(); _checkedListRaces.Dock = DockStyle.Fill; _layout.Controls.Add(createLabel("Races to Simulate:")); _layout.Controls.Add(_checkedListRaces); // Initial lifelets _labelInitialLifelets = createLabel("Initial Lifelets:"); _layout.Controls.Add(_labelInitialLifelets); _trackbarInitialLifelets = new TrackBar(); _trackbarInitialLifelets.Dock = DockStyle.Fill; _trackbarInitialLifelets.Minimum = 1; _trackbarInitialLifelets.Maximum = 1000; _trackbarInitialLifelets.TickStyle = TickStyle.None; _trackbarInitialLifelets.Scroll += new System.EventHandler(trackbarInitialLifelets_Scroll); _layout.Controls.Add(_trackbarInitialLifelets); // Simulate button _buttonSimulate = new Button(); _buttonSimulate.Dock = DockStyle.Fill; _buttonSimulate.Text = "Simulate"; _buttonSimulate.Click += new System.EventHandler(buttonSimulate_Click); _layout.Controls.Add(_buttonSimulate); // Load races ArrayList races = World.GetAvailableRaces(); foreach(Type type in races) _checkedListRaces.Items.Add(type,true); _trackbarInitialLifelets.Value = (races.Count == 0 ? 1 : races.Count * Config.WorldInitialLifeletsPerRace); // Special cases if(races.Count == 0) { _buttonSimulate.Enabled = false; } // Resume layouting _layout.ResumeLayout(false); _layout.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); // Send of some events trackbarInitialLifelets_Scroll(null,null); } #endregion #region UI Events private void buttonSimulate_Click(object sender, EventArgs e) { // Compile list of races ArrayList races = new ArrayList(); foreach(Type type in _checkedListRaces.CheckedItems) races.Add(type); // Create world World world = new World(races,_trackbarInitialLifelets.Value,Config.WorldInitialSpawnMethod); // Create and show viewport Viewport viewport = new Viewport(world); viewport.Show(); } private void trackbarInitialLifelets_Scroll(object sender, EventArgs e) { _labelInitialLifelets.Text = "Initial Lifelets: " + _trackbarInitialLifelets.Value; } #endregion #region Private Methods private Label createLabel(string text) { Label lbl = new Label(); lbl.Text = text; lbl.Dock = DockStyle.Fill; return lbl; } #endregion } }
dankrusi/life-simulation-challenge
Core/GUI/StartScreen.cs
C#
mit
4,607
2D Game ============ A slowly updating 2D game written in Java.
AlexLamson/2D-Game
README.md
Markdown
mit
65
""" Django settings for keyman project. Generated by 'django-admin startproject' using Django 1.11.7. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '$-2ijwgs8-3i*r#j@1ian5xrp+17)fz)%cdjjhwa#4x&%lk7v@' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'keys', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'keyman.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'keyman.wsgi.application' # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/'
htlcnn/pyrevitscripts
HTL.tab/Test.panel/Test.pushbutton/keyman/keyman/keyman/settings.py
Python
mit
3,109
<script src="flowplayer-6.0.5/flowplayer.min.js'"></script> <script src="flowplayer-6.0.5/flowplayer.dashjs.min.js'"></script> <script src="flowplayer-6.0.5/flowplayer.hlsjs.min.js'"></script> <script src="flowplayer-6.0.5/flowplayer.quality-selector.min.js'"></script> <link rel="flowplayer-6.0.5/skin/functional.css"/> <link rel="flowplayer-6.0.5/flowplayer.quality-selector.css"/> <div id="flowvid"> </div> <script type="text/javascript"> window.onload = function () { flowplayer("#flowvid", { embed: false, // setup would need iframe embedding // manual HLS level selection for Drive videos hlsQualities: true, // manual VOD quality selection when hlsjs is not supported qualities: false, // if this is enabled and same as in hls it would select still mp4 splash:true, // splash vs logo // logo will download the first part of an mp4 video and display a nice image // problem with dash,hls: it downloads the complete video // splash: will do nothing until play is pressed => provide our own image here clip: { loop: true, sources: [ // first hls because it allows manual quality selection {type:"application/x-mpegurl",src: "<?=$url?>master.m3u8" }, // then comes dash without manual quality selection but still good protocol {type:"application/dash+xml", src: "<?=$url?>stream.mpd" }, // then mp4 because h264 is the standard and might be played nearly everywhere {type:"video/mp4", src: "<?=$url?>video_02000.mp4"}, // then webm which has bigger videos and is afaik only required for older opera browsers {type:"video/webm", src: "<?=$url?>video.webm"} ] } }); }; </script>
balrok/web_video
video.php
PHP
mit
1,711
.cb_customselect_span{ background: none repeat scroll 0 0 #fff; float: left; left: 0; margin-right: 10px; margin-top: 4px; overflow: hidden; width: 117px; } .cb_customselect_span>span{ background: url("./images/selectlabg.jpg") no-repeat scroll 100px 16px rgba(0, 0, 0, 0); border: 1px solid #e6e6e6; color: #666; cursor: pointer; display: block; font-size: 14px; height: 30px; line-height: 30px; margin-bottom: 0px; padding: 3px 20px 3px 10px; text-align: left; } .cb_customselect_span>ul{ background: none repeat scroll 0 0 #fff; border: 1px solid #e6e6e6; overflow-x:hidden; overflow-y:auto; max-height: 200px; padding: 0; margin: 0; } .cb_customselect_span>ul>li{ cursor: pointer; line-height: 24px; padding: 9px 0 9px 20px; list-style: none; margin: 0; font-size: 12px; } .cb_customselect_span>ul>li:hover{ background: none repeat scroll 0 0 #22c063; color: #fff; }
chanble/customselect
themes/default/customselect.css
CSS
mit
947
package sx1272 const ( SX1272_REG_LR_FIFO byte = 0x00 // Common settings SX1272_REG_LR_OPMODE = 0x01 SX1272_REG_LR_FRFMSB = 0x06 SX1272_REG_LR_FRFMID = 0x07 SX1272_REG_LR_FRFLSB = 0x08 // Tx settings SX1272_REG_LR_PACONFIG = 0x09 SX1272_REG_LR_PARAMP = 0x0A SX1272_REG_LR_OCP = 0x0B // Rx settings SX1272_REG_LR_LNA = 0x0C // LoRa registers SX1272_REG_LR_FIFOADDRPTR = 0x0D SX1272_REG_LR_FIFOTXBASEADDR = 0x0E SX1272_REG_LR_FIFORXBASEADDR = 0x0F SX1272_REG_LR_FIFORXCURRENTADDR = 0x10 SX1272_REG_LR_IRQFLAGSMASK = 0x11 SX1272_REG_LR_IRQFLAGS = 0x12 SX1272_REG_LR_RXNBBYTES = 0x13 SX1272_REG_LR_RXHEADERCNTVALUEMSB = 0x14 SX1272_REG_LR_RXHEADERCNTVALUELSB = 0x15 SX1272_REG_LR_RXPACKETCNTVALUEMSB = 0x16 SX1272_REG_LR_RXPACKETCNTVALUELSB = 0x17 SX1272_REG_LR_MODEMSTAT = 0x18 SX1272_REG_LR_PKTSNRVALUE = 0x19 SX1272_REG_LR_PKTRSSIVALUE = 0x1A SX1272_REG_LR_RSSIVALUE = 0x1B SX1272_REG_LR_HOPCHANNEL = 0x1C SX1272_REG_LR_MODEMCONFIG1 = 0x1D SX1272_REG_LR_MODEMCONFIG2 = 0x1E SX1272_REG_LR_SYMBTIMEOUTLSB = 0x1F SX1272_REG_LR_PREAMBLEMSB = 0x20 SX1272_REG_LR_PREAMBLELSB = 0x21 SX1272_REG_LR_PAYLOADLENGTH = 0x22 SX1272_REG_LR_PAYLOADMAXLENGTH = 0x23 SX1272_REG_LR_HOPPERIOD = 0x24 SX1272_REG_LR_FIFORXBYTEADDR = 0x25 SX1272_REG_LR_FEIMSB = 0x28 SX1272_REG_LR_FEIMID = 0x29 SX1272_REG_LR_FEILSB = 0x2A SX1272_REG_LR_RSSIWIDEBAND = 0x2C SX1272_REG_LR_DETECTOPTIMIZE = 0x31 SX1272_REG_LR_INVERTIQ = 0x33 SX1272_REG_LR_DETECTIONTHRESHOLD = 0x37 SX1272_REG_LR_SYNCWORD = 0x39 SX1272_REG_LR_INVERTIQ2 = 0x3B // end of documented register in datasheet // I/O settings SX1272_REG_LR_DIOMAPPING1 = 0x40 SX1272_REG_LR_DIOMAPPING2 = 0x41 // Version SX1272_REG_LR_VERSION = 0x42 // Additional settings SX1272_REG_LR_AGCREF = 0x43 SX1272_REG_LR_AGCTHRESH1 = 0x44 SX1272_REG_LR_AGCTHRESH2 = 0x45 SX1272_REG_LR_AGCTHRESH3 = 0x46 SX1272_REG_LR_PLLHOP = 0x4B SX1272_REG_LR_TCXO = 0x58 SX1272_REG_LR_PADAC = 0x5A SX1272_REG_LR_PLL = 0x5C SX1272_REG_LR_PLLLOWPN = 0x5E SX1272_REG_LR_FORMERTEMP = 0x6C )
NeuralSpaz/semtech1301
sx1272/sx1272LoraRegisters.go
GO
mit
2,318
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace HTLib2.Bioinfo { public partial class ForceField { public class PwVdw : INonbonded, IHessBuilder4PwIntrAct { public virtual string[] FrcFldType { get { return new string[] { "Nonbonded", "LennardJones" }; } } public virtual double? GetDefaultMinimizeStep() { return 0.0001; } public virtual void EnvClear() { } public virtual bool EnvAdd(string key, object value) { return false; } // ! Wildcards used to minimize memory requirements // NONBONDED NBXMOD 5 ATOM CDIEL FSHIFT VATOM VDISTANCE VFSWITCH - // CUTNB 14.0 CTOFNB 12.0 CTONNB 10.0 EPS 1.0 E14FAC 1.0 WMIN 1.5 // ! // !V(Lennard-Jones) = Eps,i,j[(Rmin,i,j/ri,j)**12 - 2(Rmin,i,j/ri,j)**6] // ! // !epsilon: kcal/mole, Eps,i,j = sqrt(eps,i * eps,j) // !Rmin/2: A, Rmin,i,j = Rmin/2,i + Rmin/2,j // ! // !atom ignored epsilon Rmin/2 ignored eps,1-4 Rmin/2,1-4 // ! // HT 0.0 -0.0460 0.2245 ! TIP3P // HN1 0.0 -0.0460 0.2245 // CN7 0.0 -0.02 2.275 0.0 -0.01 1.90 !equivalent to protein CT1 // CN7B 0.0 -0.02 2.275 0.0 -0.01 1.90 !equivalent to protein CT1 // ... ///////////////////////////////////////////////////////////// public virtual void Compute(Universe.Nonbonded14 nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc=null, double[,] pwspr=null) { Universe.Atom atom1 = nonbonded.atoms[0]; Universe.Atom atom2 = nonbonded.atoms[1]; double radi = atom1.Rmin2_14; radi = (double.IsNaN(radi)==false) ? radi : atom1.Rmin2; double radj = atom2.Rmin2_14; radj = (double.IsNaN(radj)==false) ? radj : atom2.Rmin2; double epsi = atom1.eps_14; epsi = (double.IsNaN(epsi)==false) ? epsi : atom1.epsilon; double epsj = atom2.eps_14; epsj = (double.IsNaN(epsj)==false) ? epsj : atom2.epsilon; Compute(nonbonded, coords, ref energy, ref forces, ref hessian, radi, radj, epsi, epsj, pwfrc, pwspr); } public virtual void Compute(Universe.Nonbonded nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian, double[,] pwfrc=null, double[,] pwspr=null) { Universe.Atom atom1 = nonbonded.atoms[0]; Universe.Atom atom2 = nonbonded.atoms[1]; double radi = atom1.Rmin2; double radj = atom2.Rmin2; double epsi = atom1.epsilon; double epsj = atom2.epsilon; Compute(nonbonded, coords, ref energy, ref forces, ref hessian, radi, radj, epsi, epsj, pwfrc, pwspr); } public virtual void Compute(Universe.AtomPack nonbonded, Vector[] coords, ref double energy, ref Vector[] forces, ref MatrixByArr[,] hessian ,double radi ,double radj ,double epsi ,double epsj, double[,] pwfrc=null, double[,] pwspr=null) { Universe.Atom atom1 = nonbonded.atoms[0]; Universe.Atom atom2 = nonbonded.atoms[1]; Vector pos0 = coords[0]; Vector pos1 = coords[1]; double rmin = (radi + radj); double epsij = Math.Sqrt(epsi * epsj); double lenergy, forceij, springij; Compute(coords, out lenergy, out forceij, out springij, epsij, rmin); double abs_forceij = Math.Abs(forceij); if(pwfrc != null) pwfrc[0, 1] = pwfrc[1, 0] = forceij; if(pwspr != null) pwspr[0, 1] = pwspr[1, 0] = springij; /////////////////////////////////////////////////////////////////////////////// // energy energy += lenergy; /////////////////////////////////////////////////////////////////////////////// // force if(forces != null) { Vector frc0, frc1; GetForceVector(pos0, pos1, forceij, out frc0, out frc1); forces[0] += frc0; forces[1] += frc1; } /////////////////////////////////////////////////////////////////////////////// // hessian if(hessian != null) { hessian[0, 1] += GetHessianBlock(coords[0], coords[1], springij, forceij); hessian[1, 0] += GetHessianBlock(coords[1], coords[0], springij, forceij); } } public static void Compute(Vector[] coords, out double energy, out double forceij, out double springij, double epsij, double rmin) { /// !V(Lennard-Jones) = Eps,i,j[(Rmin,i,j/ri,j)**12 - 2(Rmin,i,j/ri,j)**6] /// !epsilon: kcal/mole, Eps,i,j = sqrt(eps,i * eps,j) /// !Rmin/2: A, Rmin,i,j = Rmin/2,i + Rmin/2,j /// /// V(r) = epsij * r0^12 * rij^-12 - 2 * epsij * r0^6 * rij^-6 /// = epsij * (r0 / rij)^12 - 2 * epsij * (r0 / rij)^6 /// F(r) = -12 * epsij * r0^12 * rij^-13 - -6*2 * epsij * r0^6 * rij^-7 /// = -12 * epsij * (r0 / rij)^12 / rij - -6*2 * epsij * (r0 / rij)^6 / rij /// K(r) = -13*-12 * epsij * r0^12 * rij^-14 - -7*-6*2 * epsij * r0^6 * rij^-8 /// = -13*-12 * epsij * (r0 / rij)^12 / rij^2 - -7*-6*2 * epsij * (r0 / rij)^6 / rij^2 double rij = (coords[1] - coords[0]).Dist; double rij2 = rij*rij; double rmin_rij = rmin / rij; double rmin_rij_2 = rmin_rij * rmin_rij; double rmin_rij_6 = rmin_rij_2 * rmin_rij_2 * rmin_rij_2; double rmin_rij_12 = rmin_rij_6 * rmin_rij_6; energy = epsij * rmin_rij_12 - 2 * epsij * rmin_rij_6; forceij = (-12) * epsij * rmin_rij_12 / rij - (-6*2) * epsij * rmin_rij_6 / rij; springij = (-13*-12) * epsij * rmin_rij_12 / rij2 - (-7*-6*2) * epsij * rmin_rij_6 / rij2; HDebug.AssertIf(forceij>0, rmin<rij); // positive force => attractive HDebug.AssertIf(forceij<0, rij<rmin); // negative force => repulsive } public void BuildHess4PwIntrAct(Universe.AtomPack info, Vector[] coords, out ValueTuple<int, int>[] pwidxs, out PwIntrActInfo[] pwhessinfos) { int idx1 = 0; // nonbonded.atoms[0].ID; int idx2 = 1; // nonbonded.atoms[1].ID; Universe.Atom atom1 = info.atoms[0]; Universe.Atom atom2 = info.atoms[1]; Vector diff = (coords[idx2] - coords[idx1]); double dx = diff[0]; double dy = diff[1]; double dz = diff[2]; double radi = double.NaN; double radj = double.NaN; double epsi = double.NaN; double epsj = double.NaN; if(typeof(Universe.Nonbonded14).IsInstanceOfType(info)) { radi = atom1.Rmin2_14; radi = (double.IsNaN(radi)==false) ? radi : atom1.Rmin2; radj = atom2.Rmin2_14; radj = (double.IsNaN(radj)==false) ? radj : atom2.Rmin2; epsi = atom1.eps_14; epsi = (double.IsNaN(epsi)==false) ? epsi : atom1.epsilon; epsj = atom2.eps_14; epsj = (double.IsNaN(epsj)==false) ? epsj : atom2.epsilon; } if(typeof(Universe.Nonbonded).IsInstanceOfType(info)) { radi = atom1.Rmin2; radj = atom2.Rmin2; epsi = atom1.epsilon; epsj = atom2.epsilon; } HDebug.Assert(double.IsNaN(radi) == false, double.IsNaN(radj) == false, double.IsNaN(epsi) == false, double.IsNaN(epsj) == false); // !V(Lennard-Jones) = Eps,i,j[(Rmin,i,j/ri,j)**12 - 2(Rmin,i,j/ri,j)**6] // !epsilon: kcal/mole, Eps,i,j = sqrt(eps,i * eps,j) // !Rmin/2: A, Rmin,i,j = Rmin/2,i + Rmin/2,j // // V(r) = epsij * r0^12 * rij^-12 - 2 * epsij * r0^6 * rij^-6 // F(r) = -12 * epsij * r0^12 * rij^-13 - -6*2 * epsij * r0^6 * rij^-7 // K(r) = -13*-12 * epsij * r0^12 * rij^-14 - -7*-6*2 * epsij * r0^6 * rij^-8 double r = (radi + radj); double r6 = Math.Pow(r, 6); double r12 = Math.Pow(r, 12); double rij2 = (dx*dx + dy*dy + dz*dz); double rij = Math.Sqrt(rij2); double rij7 = Math.Pow(rij2, 3)*rij; double rij8 = Math.Pow(rij2, 4); double rij13 = Math.Pow(rij2, 6)*rij; double rij14 = Math.Pow(rij2, 7); double epsij = epsi*epsj; double fij = ( -12) * epsij * r12 / rij13 - ( -6*2) * epsij * r6 / rij7; double kij = (-13*-12) * epsij * r12 / rij14 - (-7*-6*2) * epsij * r6 / rij8; pwidxs = new ValueTuple<int, int>[1]; pwidxs[0] = new ValueTuple<int, int>(0, 1); pwhessinfos = new PwIntrActInfo[1]; pwhessinfos[0] = new PwIntrActInfo(kij, fij); } } } }
htna/HCsbLib
HCsbLib/HCsbLib/HTLib2.Bioinfo/ForceField/ForceField.Pw/ForceField.PwVdw.cs
C#
mit
10,124
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } var Parameter = require("../src/Parameter"); var OT = require("./FRP"); var glow = require("./glow"); __export(require("./types")); var DEBUG = false; /** * Each frame an animation is provided a CanvasTick. The tick exposes access to the local animation time, the * time delta between the previous frame (dt) and the drawing context. Animators typically use the drawing context * directly, and pass the clock onto any time varying parameters. */ var CanvasTick = (function (_super) { __extends(CanvasTick, _super); function CanvasTick(clock, dt, ctx, events, previous) { _super.call(this, clock, dt, previous); this.clock = clock; this.dt = dt; this.ctx = ctx; this.events = events; this.previous = previous; } CanvasTick.prototype.copy = function () { return new CanvasTick(this.clock, this.dt, this.ctx, this.events, this.previous); }; CanvasTick.prototype.save = function () { var cp = _super.prototype.save.call(this); cp.ctx.save(); return cp; }; CanvasTick.prototype.restore = function () { var cp = _super.prototype.restore.call(this); cp.ctx.restore(); return cp; }; return CanvasTick; })(OT.BaseTick); exports.CanvasTick = CanvasTick; var Animation = (function (_super) { __extends(Animation, _super); function Animation(attach) { _super.call(this, attach); this.attach = attach; } /** * subclasses should override this to create another animation of the same type * @param attach */ Animation.prototype.create = function (attach) { if (attach === void 0) { attach = function (nop) { return nop; }; } return new Animation(attach); }; /** * Affect this with an effect to create combined animation. * Debug messages are inserted around the effect (e.g. a mutation to the canvas). * You can expose time varying or constant parameters to the inner effect using the optional params. */ Animation.prototype.loggedAffect = function (label, effectBuilder, param1, param2, param3, param4, param5, param6, param7, param8) { if (DEBUG) console.log(label + ": build"); return this.affect(function () { if (DEBUG) console.log(label + ": attach"); var effect = effectBuilder(); return function (tick, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { if (DEBUG) { var elements = []; if (arg1) elements.push(arg1 + ""); if (arg2) elements.push(arg2 + ""); if (arg3) elements.push(arg3 + ""); if (arg4) elements.push(arg4 + ""); if (arg5) elements.push(arg5 + ""); if (arg6) elements.push(arg6 + ""); if (arg7) elements.push(arg7 + ""); if (arg8) elements.push(arg8 + ""); console.log(label + ": tick (" + elements.join(",") + ")"); } effect(tick, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); }; }, (param1 ? Parameter.from(param1) : undefined), (param2 ? Parameter.from(param2) : undefined), (param3 ? Parameter.from(param3) : undefined), (param4 ? Parameter.from(param4) : undefined), (param5 ? Parameter.from(param5) : undefined), (param6 ? Parameter.from(param6) : undefined), (param7 ? Parameter.from(param7) : undefined), (param8 ? Parameter.from(param8) : undefined)); }; Animation.prototype.velocity = function (velocity) { if (DEBUG) console.log("velocity: build"); return this.affect(function () { if (DEBUG) console.log("velocity: attach"); var pos = [0.0, 0.0]; return function (tick, velocity) { if (DEBUG) console.log("velocity: tick", velocity, pos); tick.ctx.transform(1, 0, 0, 1, pos[0], pos[1]); pos[0] += velocity[0] * tick.dt; pos[1] += velocity[1] * tick.dt; }; }, Parameter.from(velocity)); }; Animation.prototype.tween_linear = function (from, to, time) { return this.affect(function () { var t = 0; if (DEBUG) console.log("tween: init"); return function (tick, from, to, time) { t = t + tick.dt; if (t > time) t = time; var x = from[0] + (to[0] - from[0]) * t / time; var y = from[1] + (to[1] - from[1]) * t / time; if (DEBUG) console.log("tween: tick", x, y, t); tick.ctx.transform(1, 0, 0, 1, x, y); }; }, Parameter.from(from), Parameter.from(to), Parameter.from(time)); }; Animation.prototype.glow = function (decay) { if (decay === void 0) { decay = 0.1; } return glow.glow(this, decay); }; // Canvas API /** * Dynamic chainable wrapper for strokeStyle in the canvas API. */ Animation.prototype.strokeStyle = function (color) { return this.loggedAffect("strokeStyle", function () { return function (tick, color) { return tick.ctx.strokeStyle = color; }; }, color); }; /** * Dynamic chainable wrapper for fillStyle in the canvas API. */ Animation.prototype.fillStyle = function (color) { return this.loggedAffect("fillStyle", function () { return function (tick, color) { return tick.ctx.fillStyle = color; }; }, color); }; /** * Dynamic chainable wrapper for shadowColor in the canvas API. */ Animation.prototype.shadowColor = function (color) { return this.loggedAffect("shadowColor", function () { return function (tick, color) { return tick.ctx.shadowColor = color; }; }, color); }; /** * Dynamic chainable wrapper for shadowBlur in the canvas API. */ Animation.prototype.shadowBlur = function (level) { return this.loggedAffect("shadowBlur", function () { return function (tick, level) { return tick.ctx.shadowBlur = level; }; }, level); }; /** * Dynamic chainable wrapper for shadowOffsetX and shadowOffsetY in the canvas API. */ Animation.prototype.shadowOffset = function (xy) { return this.loggedAffect("shadowOffset", function () { return function (tick, xy) { tick.ctx.shadowOffsetX = xy[0]; tick.ctx.shadowOffsetY = xy[1]; }; }, xy); }; /** * Dynamic chainable wrapper for lineCap in the canvas API. */ Animation.prototype.lineCap = function (style) { return this.loggedAffect("lineCap", function () { return function (tick, arg) { return tick.ctx.lineCap = arg; }; }, style); }; /** * Dynamic chainable wrapper for lineJoin in the canvas API. */ Animation.prototype.lineJoin = function (style) { return this.loggedAffect("lineJoin", function () { return function (tick, arg) { return tick.ctx.lineJoin = arg; }; }, style); }; /** * Dynamic chainable wrapper for lineWidth in the canvas API. */ Animation.prototype.lineWidth = function (width) { return this.loggedAffect("lineWidth", function () { return function (tick, arg) { return tick.ctx.lineWidth = arg; }; }, width); }; /** * Dynamic chainable wrapper for miterLimit in the canvas API. */ Animation.prototype.miterLimit = function (limit) { return this.loggedAffect("miterLimit", function () { return function (tick, arg) { return tick.ctx.miterLimit = arg; }; }, limit); }; /** * Dynamic chainable wrapper for rect in the canvas API. */ Animation.prototype.rect = function (xy, width_height) { return this.loggedAffect("rect", function () { return function (tick, xy, width_height) { return tick.ctx.rect(xy[0], xy[1], width_height[0], width_height[1]); }; }, xy, width_height); }; /** * Dynamic chainable wrapper for fillRect in the canvas API. */ Animation.prototype.fillRect = function (xy, width_height) { return this.loggedAffect("fillRect", function () { return function (tick, xy, width_height) { return tick.ctx.fillRect(xy[0], xy[1], width_height[0], width_height[1]); }; }, xy, width_height); }; /** * Dynamic chainable wrapper for strokeRect in the canvas API. */ Animation.prototype.strokeRect = function (xy, width_height) { return this.loggedAffect("strokeRect", function () { return function (tick, xy, width_height) { return tick.ctx.strokeRect(xy[0], xy[1], width_height[0], width_height[1]); }; }, xy, width_height); }; /** * Dynamic chainable wrapper for clearRect in the canvas API. */ Animation.prototype.clearRect = function (xy, width_height) { return this.loggedAffect("clearRect", function () { return function (tick, xy, width_height) { return tick.ctx.clearRect(xy[0], xy[1], width_height[0], width_height[1]); }; }, xy, width_height); }; /** * Encloses the inner animation with a beginpath() and endpath() from the canvas API. * * This returns a path object which events can be subscribed to */ Animation.prototype.withinPath = function (inner) { return this.pipe(new PathAnimation(function (upstream) { if (DEBUG) console.log("withinPath: attach"); var beginPathBeforeInner = upstream.tapOnNext(function (tick) { return tick.ctx.beginPath(); }); return inner.attach(beginPathBeforeInner).tapOnNext(function (tick) { return tick.ctx.closePath(); }); })); }; /** * Dynamic chainable wrapper for fill in the canvas API. */ Animation.prototype.closePath = function () { return this.loggedAffect("closePath", function () { return function (tick) { return tick.ctx.closePath(); }; }); }; /** * Dynamic chainable wrapper for fill in the canvas API. */ Animation.prototype.beginPath = function () { return this.loggedAffect("beginPath", function () { return function (tick) { return tick.ctx.beginPath(); }; }); }; /** * Dynamic chainable wrapper for fill in the canvas API. */ Animation.prototype.fill = function () { return this.loggedAffect("fill", function () { return function (tick) { return tick.ctx.fill(); }; }); }; /** * Dynamic chainable wrapper for stroke in the canvas API. */ Animation.prototype.stroke = function () { return this.loggedAffect("stroke", function () { return function (tick) { return tick.ctx.stroke(); }; }); }; /** * Dynamic chainable wrapper for moveTo in the canvas API. */ Animation.prototype.moveTo = function (xy) { return this.loggedAffect("moveTo", function () { return function (tick, xy) { return tick.ctx.moveTo(xy[0], xy[1]); }; }, xy); }; /** * Dynamic chainable wrapper for lineTo in the canvas API. */ Animation.prototype.lineTo = function (xy) { return this.loggedAffect("lineTo", function () { return function (tick, xy) { return tick.ctx.lineTo(xy[0], xy[1]); }; }, xy); }; /** * Dynamic chainable wrapper for clip in the canvas API. */ Animation.prototype.clip = function () { return this.loggedAffect("clip", function () { return function (tick) { return tick.ctx.clip(); }; }); }; /** * Dynamic chainable wrapper for quadraticCurveTo in the canvas API. Use with withinPath. */ Animation.prototype.quadraticCurveTo = function (control, end) { return this.loggedAffect("quadraticCurveTo", function () { return function (tick, arg1, arg2) { return tick.ctx.quadraticCurveTo(arg1[0], arg1[1], arg2[0], arg2[1]); }; }, control, end); }; /** * Dynamic chainable wrapper for bezierCurveTo in the canvas API. Use with withinPath. */ Animation.prototype.bezierCurveTo = function (control1, control2, end) { return this.loggedAffect("bezierCurveTo", function () { return function (tick, arg1, arg2, arg3) { return tick.ctx.bezierCurveTo(arg1[0], arg1[1], arg2[0], arg2[1], arg3[0], arg3[1]); }; }, control1, control2, end); }; /** * Dynamic chainable wrapper for arc in the canvas API. Use with withinPath. */ Animation.prototype.arcTo = function (tangent1, tangent2, radius) { return this.loggedAffect("arcTo", function () { return function (tick, arg1, arg2, arg3) { return tick.ctx.arcTo(arg1[0], arg1[1], arg2[0], arg2[1], arg3); }; }, tangent1, tangent2, radius); }; /** * Dynamic chainable wrapper for scale in the canvas API. */ Animation.prototype.scale = function (xy) { return this.loggedAffect("scale", function () { return function (tick, xy) { return tick.ctx.scale(xy[0], xy[1]); }; }, xy); }; /** * Dynamic chainable wrapper for rotate in the canvas API. */ Animation.prototype.rotate = function (clockwiseRadians) { return this.loggedAffect("rotate", function () { return function (tick, arg) { return tick.ctx.rotate(arg); }; }, clockwiseRadians); }; /** * Dynamic chainable wrapper for translate in the canvas API. */ Animation.prototype.translate = function (xy) { return this.loggedAffect("translate", function () { return function (tick, xy) { tick.ctx.translate(xy[0], xy[1]); }; }, xy); }; /** * Dynamic chainable wrapper for translate in the canvas API. * [ a c e * b d f * 0 0 1 ] */ Animation.prototype.transform = function (a, b, c, d, e, f) { return this.loggedAffect("transform", function () { return function (tick, arg1, arg2, arg3, arg4, arg5, arg6) { return tick.ctx.transform(arg1, arg2, arg3, arg4, arg5, arg6); }; }, a, b, c, d, e, f); }; /** * Dynamic chainable wrapper for setTransform in the canvas API. */ Animation.prototype.setTransform = function (a, b, c, d, e, f) { return this.loggedAffect("setTransform", function () { return function (tick, arg1, arg2, arg3, arg4, arg5, arg6) { return tick.ctx.setTransform(arg1, arg2, arg3, arg4, arg5, arg6); }; }, a, b, c, d, e, f); }; /** * Dynamic chainable wrapper for font in the canvas API. */ Animation.prototype.font = function (style) { return this.loggedAffect("font", function () { return function (tick, arg) { return tick.ctx.font = arg; }; }, style); }; /** * Dynamic chainable wrapper for textAlign in the canvas API. */ Animation.prototype.textAlign = function (style) { return this.loggedAffect("textAlign", function () { return function (tick, arg) { return tick.ctx.textAlign = arg; }; }, style); }; /** * Dynamic chainable wrapper for textBaseline in the canvas API. */ Animation.prototype.textBaseline = function (style) { return this.loggedAffect("textBaseline", function () { return function (tick, arg) { return tick.ctx.textBaseline = arg; }; }, style); }; /** * Dynamic chainable wrapper for textBaseline in the canvas API. */ Animation.prototype.fillText = function (text, xy, maxWidth) { if (maxWidth) { return this.loggedAffect("fillText", function () { return function (tick, text, xy, maxWidth) { return tick.ctx.fillText(text, xy[0], xy[1], maxWidth); }; }, text, xy, maxWidth); } else { return this.loggedAffect("fillText", function () { return function (tick, text, xy, maxWidth) { return tick.ctx.fillText(text, xy[0], xy[1]); }; }, text, xy); } }; /** * Dynamic chainable wrapper for drawImage in the canvas API. */ Animation.prototype.drawImage = function (img, xy) { return this.loggedAffect("drawImage", function () { return function (tick, img, xy) { return tick.ctx.drawImage(img, xy[0], xy[1]); }; }, img, xy); }; /** * * Dynamic chainable wrapper for globalCompositeOperation in the canvas API. */ Animation.prototype.globalCompositeOperation = function (operation) { return this.loggedAffect("globalCompositeOperation", function () { return function (tick, arg) { return tick.ctx.globalCompositeOperation = arg; }; }, operation); }; Animation.prototype.arc = function (center, radius, radStartAngle, radEndAngle, counterclockwise) { if (counterclockwise === void 0) { counterclockwise = false; } return this.loggedAffect("arc", function () { return function (tick, arg1, arg2, arg3, arg4, counterclockwise) { return tick.ctx.arc(arg1[0], arg1[1], arg2, arg3, arg4, counterclockwise); }; }, center, radius, radStartAngle, radEndAngle, counterclockwise); }; return Animation; })(OT.SignalPipe); exports.Animation = Animation; function create(attach) { if (attach === void 0) { attach = function (x) { return x; }; } return new Animation(attach); } exports.create = create; var PathAnimation = (function (_super) { __extends(PathAnimation, _super); function PathAnimation() { _super.apply(this, arguments); } return PathAnimation; })(Animation); exports.PathAnimation = PathAnimation; function save(width, height, path) { var GIFEncoder = require('gifencoder'); var fs = require('fs'); var encoder = new GIFEncoder(width, height); encoder.createReadStream() .pipe(encoder.createWriteStream({ repeat: 10000, delay: 100, quality: 1 })) .pipe(fs.createWriteStream(path)); encoder.start(); return new Animation(function (upstream) { return upstream.tap(function (tick) { if (DEBUG) console.log("save: wrote frame"); encoder.addFrame(tick.ctx); }, function () { console.error("save: not saved", path); }, function () { console.log("save: saved", path); encoder.finish(); }); }); } exports.save = save;
tomlarkworthy/animaxe
dist/src/CanvasAnimation.js
JavaScript
mit
19,265
import { h } from 'preact'; import JustNotSorry from '../src/components/JustNotSorry.js'; import { configure, mount } from 'enzyme'; import Adapter from 'enzyme-adapter-preact-pure'; configure({ adapter: new Adapter() }); describe('JustNotSorry', () => { const justNotSorry = mount(<JustNotSorry />); let editableDiv1; let editableDiv2; let editableDiv3; let wrapper; let instance; const mutationObserverMock = jest.fn(function MutationObserver(callback) { this.observe = jest.fn(); this.disconnect = jest.fn(); this.trigger = (mockedMutationList) => { callback(mockedMutationList, this); }; }); document.createRange = jest.fn(() => ({ setStart: jest.fn(), setEnd: jest.fn(), commonAncestorContainer: { nodeName: 'BODY', ownerDocument: document, }, startContainer: 'test', getClientRects: jest.fn(() => [{}]), })); global.MutationObserver = mutationObserverMock; function generateEditableDiv(id, innerHtml) { return mount( <div id={id} contentEditable={'true'}> {innerHtml ? innerHtml : ''} </div> ); } beforeAll(() => { editableDiv1 = generateEditableDiv('div-1'); editableDiv2 = generateEditableDiv('div-2', 'test just test'); editableDiv3 = generateEditableDiv('div-3', 'test justify test'); }); describe('#addObserver', () => { it('adds an observer that listens for structural changes to the content editable div', () => { // remount JNS to trigger constructor functions justNotSorry.unmount(); justNotSorry.mount(); const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'addObserver'); const node = mount( <div id={'div-focus'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} ></div> ); node.simulate('focus'); // There should be the document observer and the observer specifically for the target div const observerInstances = mutationObserverMock.mock.instances; const observerInstance = observerInstances[observerInstances.length - 1]; expect(observerInstances.length).toBe(2); expect(spy).toHaveBeenCalledTimes(1); expect(observerInstance.observe).toHaveBeenCalledWith(node.getDOMNode(), { attributes: false, characterData: false, childList: true, subtree: true, }); node.unmount(); }); it('starts checking for warnings', () => { const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'checkForWarnings'); const node = mount( <div id={'div-focus'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} ></div> ); node.simulate('focus'); expect(spy).toHaveBeenCalled(); node.unmount(); }); it('adds warnings to the content editable div', () => { const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'addWarnings'); const node = mount( <div id={'div-focus'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} ></div> ); node.simulate('focus'); expect(spy).toHaveBeenCalledWith(node.getDOMNode().parentNode); node.unmount(); }); }); describe('#removeObserver', () => { it('removes any existing warnings', () => { const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'removeObserver'); const node = mount( <div id={'div-focus'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} onBlur={instance.removeObserver.bind(instance)} > just not sorry </div> ); node.simulate('focus'); expect(justNotSorry.state('warnings').length).toEqual(2); // remount the node node.mount(); node.simulate('blur'); expect(spy).toHaveBeenCalledTimes(1); expect(justNotSorry.state('warnings').length).toEqual(0); node.unmount(); }); it('no longer checks for warnings on input events', () => { justNotSorry.unmount(); justNotSorry.mount(); const instance = justNotSorry.instance(); const node = mount( <div id={'div-remove'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} onBlur={instance.removeObserver.bind(instance)} ></div> ); node.simulate('focus'); node.simulate('blur'); const spy = jest.spyOn(instance, 'checkForWarnings'); node.simulate('input'); expect(spy).not.toHaveBeenCalled(); node.unmount(); }); it('disconnects the observer', () => { const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'removeObserver'); const node = mount( <div id={'div-disconnect'} contentEditable={'true'} onFocus={instance.addObserver.bind(instance)} onBlur={instance.removeObserver.bind(instance)} ></div> ); node.simulate('focus'); node.simulate('blur'); // There should be the document observer and the observer specifically for the target div const observerInstances = mutationObserverMock.mock.instances; const observerInstance = observerInstances[observerInstances.length - 1]; expect(spy).toHaveBeenCalled(); expect(observerInstance.disconnect).toHaveBeenCalled(); node.unmount(); }); }); describe('#addWarning', () => { beforeEach(() => { wrapper = mount(<JustNotSorry />); instance = wrapper.instance(); }); it('adds a warning for a single keyword', () => { const node = editableDiv2.getDOMNode(); instance.addWarning(node, 'just', 'warning message'); expect(wrapper.state('warnings').length).toEqual(1); expect(wrapper.state('warnings')[0]).toEqual( expect.objectContaining({ keyword: 'just', message: 'warning message', parentNode: node, }) ); }); it('does not add warnings for partial matches', () => { const node = editableDiv3.getDOMNode(); instance.addWarning(node, 'just', 'warning message'); expect(wrapper.state('warnings').length).toEqual(0); expect(wrapper.state('warnings')).toEqual([]); }); it('matches case insensitive', () => { const node = generateEditableDiv('div-case', 'jUsT kidding').getDOMNode(); instance.addWarning(node, 'just', 'warning message'); expect(wrapper.state('warnings').length).toEqual(1); expect(wrapper.state('warnings')[0]).toEqual( expect.objectContaining({ keyword: 'just', message: 'warning message', parentNode: node, }) ); }); it('catches keywords with punctuation', () => { const node = generateEditableDiv( 'div-punctuation', 'just. test' ).getDOMNode(); instance.addWarning(node, 'just', 'warning message'); expect(wrapper.state('warnings').length).toEqual(1); expect(wrapper.state('warnings')[0]).toEqual( expect.objectContaining({ keyword: 'just', message: 'warning message', parentNode: node, }) ); }); it('matches phrases', () => { const node = generateEditableDiv( 'div-phrase', 'my cat is so sorry because of you' ).getDOMNode(); instance.addWarning(node, 'so sorry', 'warning message'); expect(wrapper.state('warnings').length).toEqual(1); expect(wrapper.state('warnings')[0]).toEqual( expect.objectContaining({ keyword: 'so sorry', message: 'warning message', parentNode: node, }) ); }); it('does not add warnings for tooltip matches', () => { document.createRange = jest.fn(() => ({ setStart: jest.fn(), setEnd: jest.fn(), commonAncestorContainer: { nodeName: 'BODY', ownerDocument: document, }, startContainer: "The word 'very' does not communicate enough information. Find a stronger, more meaningful adverb, or omit it completely. --Andrea Ayres", getClientRects: jest.fn(() => [{}]), })); const node = editableDiv3.getDOMNode(); instance.addWarning(node, 'very', 'warning message'); expect(wrapper.state('warnings').length).toEqual(0); expect(wrapper.state('warnings')).toEqual([]); }); }); describe('#addWarnings', () => { beforeEach(() => { wrapper = mount(<JustNotSorry />); instance = wrapper.instance(); }); it('does nothing when given an empty string', () => { const node = editableDiv1.getDOMNode(); instance.addWarnings(node); expect(wrapper.state('warnings').length).toEqual(0); expect(wrapper.state('warnings')).toEqual([]); }); it('adds warnings to all keywords', () => { const node = generateEditableDiv( 'div-keywords', 'I am just so sorry. Yes, just.' ).getDOMNode(); instance.addWarnings(node); expect(wrapper.state('warnings').length).toEqual(3); }); }); describe('#checkForWarnings', () => { const instance = justNotSorry.instance(); const spy = jest.spyOn(instance, 'checkForWarnings'); const node = mount( <div onInput={instance.checkForWarnings}>just not sorry</div> ); it('updates warnings each time input is triggered', () => { node.simulate('input'); node.simulate('input'); node.simulate('input'); expect(spy).toHaveBeenCalledTimes(3); node.unmount(); }); }); });
cyrusinnovation/just-not-sorry
spec/JustNotSorrySpec.test.js
JavaScript
mit
9,846
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Mypy</title> <meta property="og:title" content="Mypy" /> <meta property="og:image" content="https://rcalsaverini.github.io/images/me.png" /> <meta name="description" content="Random ramblings from an entropy maximizer."> <meta property="og:description" content="Random ramblings from an entropy maximizer." /> <meta name="author" content="Rafael S. Calsaverini"> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Saira+Extra+Condensed:100,200,300,400,500,600,700,800,900" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet"> <link href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" rel="stylesheet"> <link href='https://cdnjs.cloudflare.com/ajax/libs/devicons/1.8.0/css/devicons.min.css' rel='stylesheet'> <link href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css" integrity="sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc" crossorigin="anonymous" /> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.js" integrity="sha384-YNHdsYkH6gMx9y3mRkmcJ2mFUjTd0qNQQvY9VYZgQd7DcN7env35GzlmFaZ23JGp" crossorigin="anonymous" ></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous" ></script> <script> document.addEventListener("DOMContentLoaded", function () { renderMathInElement(document.body, { delimiters: [ { left: "$$", right: "$$", display: true }, { left: "$", right: "$", display: false }, { left: "\\(", right: "\\)", display: false }, { left: "\\[", right: "\\]", display: true }, ], throwOnError: false, }); }); </script> <link href="https://rcalsaverini.github.io/css/resume.css" rel="stylesheet"> <link href="https://rcalsaverini.github.io/css/tweaks.css" rel="stylesheet"> <meta name="generator" content="Hugo 0.83.1" /> </head> <body id="page-top"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top" id="sideNav"> <a class="navbar-brand js-scroll-trigger" href="#page-top"> <span class="d-block d-lg-none">Rafael S. Calsaverini</span> <span class="d-none d-lg-block"> <img class="img-fluid img-profile rounded-circle mx-auto mb-2" src="/images/me.png" alt=""> </span> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#about">About</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#experience">Experience</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#education">Education</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#blog">Blog</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#skills">Skills</a> </li> <li class="nav-item"> <a class="nav-link js-scroll-trigger" href="/#publications">Publications</a> </li> </ul> </div> </nav> <div class="container-fluid p-0"> <section class="resume-section p-3 p-lg-5 d-flex d-column"> <div class="my-auto"> Content tagged with <span class="tag">Mypy</span> <ul> <li> <a href="https://rcalsaverini.github.io/blog/2019-01-20-frustrations-with-mypy/">A few frustrations with Python&#39;s type annotation system</a> </li> </ul> </div> </section> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script> <script src="/js/resume.js"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-53013610-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'UA-53013610-1'); </script> </body> </html>
rcalsaverini/rcalsaverini.github.io
tags/mypy/index.html
HTML
mit
5,278
<html><body> <h4>Windows 10 x64 (18362.113)</h4><br> <h2>_HEAP_GLOBAL_APPCOMPAT_FLAGS</h2> <font face="arial"> +0x000 SafeInputValidation : Pos 0, 1 Bit<br> +0x000 Padding : Pos 1, 1 Bit<br> +0x000 CommitLFHSubsegments : Pos 2, 1 Bit<br> +0x000 AllocateHeapFromEnv : Pos 3, 1 Bit<br> </font></body></html>
epikcraw/ggool
public/Windows 10 x64 (18362.113)/_HEAP_GLOBAL_APPCOMPAT_FLAGS.html
HTML
mit
325
<!doctype html> <html lang="en"> <head> <title>Code coverage report for test/features/support/page-objects/style.js</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../../../../prettify.css" /> <link rel="stylesheet" href="../../../../base.css" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type='text/css'> .coverage-summary .sorter { background-image: url(../../../../sort-arrow-sprite.png); } </style> </head> <body> <div class='wrapper'> <div class='pad1'> <h1> <a href="../../../../index.html">All files</a> / <a href="index.html">test/features/support/page-objects</a> style.js </h1> <div class='clearfix'> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Statements</span> <span class='fraction'>2/2</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Branches</span> <span class='fraction'>0/0</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Functions</span> <span class='fraction'>0/0</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Lines</span> <span class='fraction'>2/2</span> </div> </div> <p class="quiet"> Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block. </p> </div> <div class='status-line high'></div> <pre><table class="coverage"> <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a> <a name='L2'></a><a href='#L2'>2</a> <a name='L3'></a><a href='#L3'>3</a> <a name='L4'></a><a href='#L4'>4</a> <a name='L5'></a><a href='#L5'>5</a> <a name='L6'></a><a href='#L6'>6</a> <a name='L7'></a><a href='#L7'>7</a> <a name='L8'></a><a href='#L8'>8</a> <a name='L9'></a><a href='#L9'>9</a> <a name='L10'></a><a href='#L10'>10</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash' &nbsp; const searchColor = 'rgba(252,237,217,1)' const errorColor = 'rgba(245, 186, 186, 0.3)' &nbsp; export { searchColor, errorColor } &nbsp;</pre></td></tr> </table></pre> <div class='push'></div><!-- for sticky footer --> </div><!-- /wrapper --> <div class='footer quiet pad2 space-top1 center small'> Code coverage generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu Jul 05 2018 17:19:06 GMT+1000 (AEST) </div> </div> <script src="../../../../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../../../../sorter.js"></script> <script src="../../../../block-navigation.js"></script> </body> </html>
ODIQueensland/data-curator
coverage/lcov-report/test/features/support/page-objects/style.js.html
HTML
mit
3,510
from cryptography.hazmat import backends from cryptography.hazmat.primitives.asymmetric import ec, dsa, rsa # Crypto and Cryptodome have same API if random(): from Crypto.PublicKey import DSA from Crypto.PublicKey import RSA else: from Cryptodome.PublicKey import DSA from Cryptodome.PublicKey import RSA RSA_WEAK = 1024 RSA_OK = 2048 RSA_STRONG = 3076 DSA_WEAK = 1024 DSA_OK = 2048 DSA_STRONG = 3076 BIG = 10000 EC_WEAK = ec.SECT163K1() # has key size of 163 EC_OK = ec.SECP224R1() EC_STRONG = ec.SECP384R1() EC_BIG = ec.SECT571R1() dsa_gen_key = dsa.generate_private_key ec_gen_key = ec.generate_private_key rsa_gen_key = rsa.generate_private_key # Strong and OK keys. dsa_gen_key(key_size=DSA_OK) dsa_gen_key(key_size=DSA_STRONG) dsa_gen_key(key_size=BIG) ec_gen_key(curve=EC_OK) ec_gen_key(curve=EC_STRONG) ec_gen_key(curve=EC_BIG) rsa_gen_key(public_exponent=65537, key_size=RSA_OK) rsa_gen_key(public_exponent=65537, key_size=RSA_STRONG) rsa_gen_key(public_exponent=65537, key_size=BIG) DSA.generate(bits=RSA_OK) DSA.generate(bits=RSA_STRONG) RSA.generate(bits=RSA_OK) RSA.generate(bits=RSA_STRONG) dsa_gen_key(DSA_OK) dsa_gen_key(DSA_STRONG) dsa_gen_key(BIG) ec_gen_key(EC_OK) ec_gen_key(EC_STRONG) ec_gen_key(EC_BIG) rsa_gen_key(65537, RSA_OK) rsa_gen_key(65537, RSA_STRONG) rsa_gen_key(65537, BIG) DSA.generate(DSA_OK) DSA.generate(DSA_STRONG) RSA.generate(RSA_OK) RSA.generate(RSA_STRONG) # Weak keys dsa_gen_key(DSA_WEAK) ec_gen_key(EC_WEAK) rsa_gen_key(65537, RSA_WEAK) dsa_gen_key(key_size=DSA_WEAK) ec_gen_key(curve=EC_WEAK) rsa_gen_key(65537, key_size=RSA_WEAK) DSA.generate(DSA_WEAK) RSA.generate(RSA_WEAK) # ------------------------------------------------------------------------------ # Through function calls def make_new_rsa_key_weak(bits): return RSA.generate(bits) # NOT OK make_new_rsa_key_weak(RSA_WEAK) def make_new_rsa_key_strong(bits): return RSA.generate(bits) # OK make_new_rsa_key_strong(RSA_STRONG) def only_used_by_test(bits): # Although this call will technically not be ok, since it's only used in a test, we don't want to alert on it. return RSA.generate(bits)
github/codeql
python/ql/test/query-tests/Security/CWE-326-WeakCryptoKey/weak_crypto.py
Python
mit
2,155
module Travis::API::V3 class Models::Message < Model self.inheritance_column = :none belongs_to :subject, polymorphic: true scope :ordered, -> do order(%Q{ CASE WHEN level = 'alert' THEN '0' WHEN level = 'error' THEN '1' WHEN level = 'warn' THEN '2' WHEN level = 'info' THEN '3' WHEN level IS NULL THEN '4' END }.strip) end end end
travis-ci/travis-api
lib/travis/api/v3/models/message.rb
Ruby
mit
422
import re import urllib import hashlib from django import template from django.conf import settings URL_RE = re.compile(r'^https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?', re.IGNORECASE) EMAIL_RE = re.compile(r'^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$', re.IGNORECASE) GRAVATAR_URL_PREFIX = 'http://www.gravatar.com/avatar/' DEFAULT_PARAMS = \ { # api_key: (gravatar_key, value), 'size': ('s', 80), # value is in [1,512] 'rating': ('r', 'g'), # 'pg', 'r', or 'x' 'default': ('d', ''), # 'identicon', 'monsterid', 'wavatar', '404', or escaped URI } register = template.Library() def _build_gravatar_url(email, params): """Generate a Gravatar URL. """ # step 1: get a hex hash of the email address email = email.strip().lower().encode('utf-8') if not EMAIL_RE.match(email): return '' email_hash = hashlib.md5(email).hexdigest() # step 2a: build a canonized parameters dictionary if not type(params).__name__ == 'dict': params = params.__dict__ actual_params = {} default_keys = DEFAULT_PARAMS.keys() for key, value in params.items(): if key in default_keys: k, default_value = DEFAULT_PARAMS[key] # skip parameters whose values are defaults, # assume these values are mirroring Gravatar's defaults if value != default_value: actual_params[k] = value # step 2b: validate the canonized parameters dictionary # silently drop parameter when the value is not valid for key, value in actual_params.items(): if key == 's': if value < 1 or value > 512: del actual_params[key] elif key == 'r': if value.lower() not in ('g', 'pg', 'r', 'x'): del actual_params[key] # except when the parameter key is 'd': replace with 'identicon' elif key == 'd': if value.lower() not in ('identicon', 'monsterid', 'wavatar', '404'): if not URL_RE.match(value): # if not a valid URI del actual_params[key] else: # valid URI, encode it actual_params[key] = value # urlencode will encode it later # step 3: encode params params_encode = urllib.urlencode(actual_params) # step 4: form the gravatar url gravatar_url = GRAVATAR_URL_PREFIX + email_hash if params_encode: gravatar_url += '?' + params_encode return gravatar_url class GravatarURLNode(template.Node): def __init__(self, email, params): self.email = email self.params = params def render(self, context): try: if self.params: params = template.Variable(self.params).resolve(context) else: params = {} # try matching an address string literal email_literal = self.email.strip().lower() if EMAIL_RE.match(email_literal): email = email_literal # treat as a variable else: email = template.Variable(self.email).resolve(context) except template.VariableDoesNotExist: return '' # now, we generate the gravatar url return _build_gravatar_url(email, params) @register.tag(name="gravatar_url") def get_gravatar_url(parser, token): """For template tag: {% gravatar_url <email> <params> %} Where <params> is an object or a dictionary (variable), and <email> is a string object (variable) or a string (literal). """ try: tag_name, email, params = token.split_contents() except ValueError: try: tag_name, email = token.split_contents() params = None except ValueError: raise template.TemplateSyntaxError('%r tag requires one or two arguments.' % token.contents.split()[0]) # if email is quoted, parse as a literal string if email[0] in ('"', "'") or email[-1] in ('"', "'"): if email[0] == email[-1]: email = email[1:-1] else: raise template.TemplateSyntaxError( "%r tag's first argument is in unbalanced quotes." % tag_name) return GravatarURLNode(email, params)
santa4nt/django-gravatar
django_gravatar/templatetags/gravatar_tags.py
Python
mit
4,346
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace RemoteSurf { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new RemoteSurf()); } } }
XanderLuciano/remotesurf
src/winforms/RemoteSurf/Program.cs
C#
mit
516
package viewModel import java.net.URI import com.thetestpeople.trt.model._ import com.thetestpeople.trt.model.jenkins._ import com.thetestpeople.trt.utils.http.Credentials object EditableJenkinsConfiguration { def apply(fullConfig: FullJenkinsConfiguration): EditableJenkinsConfiguration = EditableJenkinsConfiguration( credentialsOpt = fullConfig.config.credentialsOpt, rerunJobUrlOpt = fullConfig.config.rerunJobUrlOpt, authenticationTokenOpt = fullConfig.config.authenticationTokenOpt, params = fullConfig.params) } case class EditableJenkinsConfiguration( credentialsOpt: Option[Credentials], rerunJobUrlOpt: Option[URI], authenticationTokenOpt: Option[String], params: Seq[JenkinsJobParam]) { def usernameOpt: Option[String] = credentialsOpt.map(_.username) def apiTokenOpt: Option[String] = credentialsOpt.map(_.password) def asJenkinsConfiguration = FullJenkinsConfiguration( config = JenkinsConfiguration( usernameOpt = usernameOpt, apiTokenOpt = apiTokenOpt, rerunJobUrlOpt = rerunJobUrlOpt, authenticationTokenOpt = authenticationTokenOpt), params = params) def duplicateParamNames: Seq[String] = params.groupBy(_.param).filter(_._2.size > 1).map(_._1).toSeq.sorted }
thetestpeople/trt
app/viewModel/EditableJenkinsConfiguration.scala
Scala
mit
1,289
import { Category } from '../../../stories/storiesHierarchy'; export const storySettings = { category: Category.COMPONENTS, storyName: 'ColorPicker', dataHook: 'storybook-colorpicker', };
wix/wix-style-react
packages/wix-style-react/src/ColorPicker/test/storySettings.js
JavaScript
mit
195
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.storage.v2019_04_01; import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; import java.util.Map; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; /** * The parameters that can be provided when updating the storage account * properties. */ @JsonFlatten public class StorageAccountUpdateParameters { /** * Gets or sets the SKU name. Note that the SKU name cannot be updated to * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU * names be updated to any other value. */ @JsonProperty(value = "sku") private SkuInner sku; /** * Gets or sets a list of key value pairs that describe the resource. These * tags can be used in viewing and grouping this resource (across resource * groups). A maximum of 15 tags can be provided for a resource. Each tag * must have a key no greater in length than 128 characters and a value no * greater in length than 256 characters. */ @JsonProperty(value = "tags") private Map<String, String> tags; /** * The identity of the resource. */ @JsonProperty(value = "identity") private Identity identity; /** * Custom domain assigned to the storage account by the user. Name is the * CNAME source. Only one custom domain is supported per storage account at * this time. To clear the existing custom domain, use an empty string for * the custom domain name property. */ @JsonProperty(value = "properties.customDomain") private CustomDomain customDomain; /** * Provides the encryption settings on the account. The default setting is * unencrypted. */ @JsonProperty(value = "properties.encryption") private Encryption encryption; /** * Required for storage accounts where kind = BlobStorage. The access tier * used for billing. Possible values include: 'Hot', 'Cool'. */ @JsonProperty(value = "properties.accessTier") private AccessTier accessTier; /** * Provides the identity based authentication settings for Azure Files. */ @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; /** * Allows https traffic only to storage service if sets to true. */ @JsonProperty(value = "properties.supportsHttpsTrafficOnly") private Boolean enableHttpsTrafficOnly; /** * Network rule set. */ @JsonProperty(value = "properties.networkAcls") private NetworkRuleSet networkRuleSet; /** * Allow large file shares if sets to Enabled. It cannot be disabled once * it is enabled. Possible values include: 'Disabled', 'Enabled'. */ @JsonProperty(value = "properties.largeFileSharesState") private LargeFileSharesState largeFileSharesState; /** * Allow or disallow public access to all blobs or containers in the * storage account. The default interpretation is true for this property. */ @JsonProperty(value = "properties.allowBlobPublicAccess") private Boolean allowBlobPublicAccess; /** * Set the minimum TLS version to be permitted on requests to storage. The * default interpretation is TLS 1.0 for this property. Possible values * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. */ @JsonProperty(value = "properties.minimumTlsVersion") private MinimumTlsVersion minimumTlsVersion; /** * Optional. Indicates the type of storage account. Currently only * StorageV2 value supported by server. Possible values include: 'Storage', * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. */ @JsonProperty(value = "kind") private Kind kind; /** * Get gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. * * @return the sku value */ public SkuInner sku() { return this.sku; } /** * Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. * * @param sku the sku value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withSku(SkuInner sku) { this.sku = sku; return this; } /** * Get gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @return the tags value */ public Map<String, String> tags() { return this.tags; } /** * Set gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. * * @param tags the tags value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withTags(Map<String, String> tags) { this.tags = tags; return this; } /** * Get the identity of the resource. * * @return the identity value */ public Identity identity() { return this.identity; } /** * Set the identity of the resource. * * @param identity the identity value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withIdentity(Identity identity) { this.identity = identity; return this; } /** * Get custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @return the customDomain value */ public CustomDomain customDomain() { return this.customDomain; } /** * Set custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. * * @param customDomain the customDomain value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { this.customDomain = customDomain; return this; } /** * Get provides the encryption settings on the account. The default setting is unencrypted. * * @return the encryption value */ public Encryption encryption() { return this.encryption; } /** * Set provides the encryption settings on the account. The default setting is unencrypted. * * @param encryption the encryption value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withEncryption(Encryption encryption) { this.encryption = encryption; return this; } /** * Get required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @return the accessTier value */ public AccessTier accessTier() { return this.accessTier; } /** * Set required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'. * * @param accessTier the accessTier value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { this.accessTier = accessTier; return this; } /** * Get provides the identity based authentication settings for Azure Files. * * @return the azureFilesIdentityBasedAuthentication value */ public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { return this.azureFilesIdentityBasedAuthentication; } /** * Set provides the identity based authentication settings for Azure Files. * * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; return this; } /** * Get allows https traffic only to storage service if sets to true. * * @return the enableHttpsTrafficOnly value */ public Boolean enableHttpsTrafficOnly() { return this.enableHttpsTrafficOnly; } /** * Set allows https traffic only to storage service if sets to true. * * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; return this; } /** * Get network rule set. * * @return the networkRuleSet value */ public NetworkRuleSet networkRuleSet() { return this.networkRuleSet; } /** * Set network rule set. * * @param networkRuleSet the networkRuleSet value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { this.networkRuleSet = networkRuleSet; return this; } /** * Get allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. * * @return the largeFileSharesState value */ public LargeFileSharesState largeFileSharesState() { return this.largeFileSharesState; } /** * Set allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. Possible values include: 'Disabled', 'Enabled'. * * @param largeFileSharesState the largeFileSharesState value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { this.largeFileSharesState = largeFileSharesState; return this; } /** * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. * * @return the allowBlobPublicAccess value */ public Boolean allowBlobPublicAccess() { return this.allowBlobPublicAccess; } /** * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. * * @param allowBlobPublicAccess the allowBlobPublicAccess value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { this.allowBlobPublicAccess = allowBlobPublicAccess; return this; } /** * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. * * @return the minimumTlsVersion value */ public MinimumTlsVersion minimumTlsVersion() { return this.minimumTlsVersion; } /** * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. * * @param minimumTlsVersion the minimumTlsVersion value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { this.minimumTlsVersion = minimumTlsVersion; return this; } /** * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. * * @return the kind value */ public Kind kind() { return this.kind; } /** * Set optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. * * @param kind the kind value to set * @return the StorageAccountUpdateParameters object itself. */ public StorageAccountUpdateParameters withKind(Kind kind) { this.kind = kind; return this; } }
selvasingh/azure-sdk-for-java
sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java
Java
mit
14,066
FROM ubuntu:wily MAINTAINER Adam Szalkowski <adam.szalkowski@bbv.ch> RUN apt-get -qq update && apt-get -qq install -y --fix-missing --no-install-recommends \ build-essential \ autoconf \ automake \ libtool \ make \ m4 \ gawk \ autoconf-archive \ flex \ bison \ gdb \ gettext \ binutils-gold \ g++-5 \ libstdc++-5-dev \ libcairomm-1.0-dev \ libcairomm-1.0-doc \ libcairo2-doc \ libgtkmm-3.0-dev \ libgtkmm-3.0-doc \ libgtk-3-doc \ eclipse-cdt \ clang \ && apt-get -qq clean RUN useradd -m -U user USER user WORKDIR /home/user CMD /usr/bin/eclipse
butzist/academy-cc11
Dockerfile
Dockerfile
mit
573
<?php namespace App\Events\Stats; use App\Events\Event; class TorrentDuplicateDeleted extends Event { }
ivacuum/hosting
app/Events/Stats/TorrentDuplicateDeleted.php
PHP
mit
106