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
seamless-immutable ================== Immutable JS data structures which are backwards-compatible with normal Arrays and Objects. Use them in `for` loops, pass them to functions expecting vanilla JavaScript data structures, etc. ```javascript var array = Immutable(["totally", "immutable", {hammer: "Can’t Touch This"}]); array[1] = "I'm going to mutate you!" array[1] // "immutable" array[2].hammer = "hm, surely I can mutate this nested object..." array[2].hammer // "Can’t Touch This" for (var index in array) { console.log(array[index]); } // "totally" // "immutable" // { hammer: 'Can’t Touch This' } JSON.stringify(array) // '["totally","immutable",{"hammer":"Can’t Touch This"}]' ``` This level of backwards compatibility requires [ECMAScript 5](http://kangax.github.io/compat-table/es5/) features like [Object.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) and [Object.freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) to exist and work correctly, which limits the browsers that can use this library to the ones shown in the test results below. (tl;dr [IE9+](https://saucelabs.com/u/seamless-immutable)) [![build status][1]][2] [![NPM version][3]][4] [![coverage status][5]][6] [![Sauce Test Status](https://saucelabs.com/browser-matrix/seamless-immutable.svg)](https://saucelabs.com/u/seamless-immutable) ## Performance Whenever you deeply clone large nested objects, it should typically go much faster with `Immutable` data structures. This is because the library reuses the existing nested objects rather than instantiating new ones. In the development build, objects are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze). (Note that [Safari is relatively slow to iterate over frozen objects](http://jsperf.com/performance-frozen-object/20).) The development build also overrides unsupported methods (methods that ordinarily mutate the underlying data structure) to throw helpful exceptions. The production (minified) build does neither of these, which significantly improves performance. We generally recommend to use the "development" build that enforces immutability (and this is the default in Node.js). Only switch to the production build when you encounter performance problems. (See #50 for how to do that in Node or using a build tool - essentially do explicitely refer to the production build.) ## Intentional Abstraction Leaks By popular demand, functions, dates, and [React](https://facebook.github.io/react/) components are treated as immutable even though technically they can be mutated. (It turns out that trying to make these immutable leads to more bad things than good.) If you call `Immutable()` on any of these, be forewarned: they will not actually be immutable! ## Add-ons seamless-immutable is tightly focused on the mechanics of turning existing JavaScript data structurs into immutable variants. Additional packages are available to build on this capability and enable additional programming models: |Library|Description| |--------|------------| |[Cursor](https://github.com/MartinSnyder/seamless-immutable-cursor)|Compact Cursor Library built on top of the excellent seamless-immutable. Cursors can be used to manage transitions and manipulations of immutable structures in an application.| ## API Overview `Immutable()` returns a backwards-compatible immutable representation of whatever you pass it, so feel free to pass it absolutely anything that can be serialized as JSON. (As is the case with JSON, objects containing circular references are not allowed. Functions are allowed, unlike in JSON, but they will not be touched.) Since numbers, strings, `undefined`, and `null` are all immutable to begin with, the only unusual things it returns are Immutable Arrays and Immutable Objects. These have the same [ES5 methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) you’re used to seeing on them, but with these important differences: 1. All the methods that would normally mutate the data structures instead throw `ImmutableError`. 2. All the methods that return a relevant value now return an immutable equivalent of that value. 3. Attempting to reassign values to their elements (e.g. `foo[5] = bar`) will not work. Browsers other than Internet Explorer will throw a `TypeError` if [use strict](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) is enabled, and in all other cases it will fail silently. 4. A few additional methods have been added for convenience. For example: ```javascript Immutable([3, 1, 4]).sort() // This will throw an ImmutableError, because sort() is a mutating method. Immutable([1, 2, 3]).concat([10, 9, 8]).sort() // This will also throw ImmutableError, because an Immutable Array's methods // (including concat()) are guaranteed to return other immutable values. [1, 2, 3].concat(Immutable([6, 5, 4])).sort() // This will succeed, and will yield a sorted mutable array containing // [1, 2, 3, 4, 5, 6], because a vanilla array's concat() method has // no knowledge of Immutable. var obj = Immutable({all: "your base", are: {belong: "to them"}}); Immutable.merge(obj, {are: {belong: "to us"}}) // This will return the following: // Immutable({all: "your base", are: {belong: "to us"}}) ``` ## Static or instance syntax Seamless-immutable supports both static and instance syntaxes: ``` var Immutable = require("seamless-immutable").static; Immutable.setIn(obj, 'key', data) ``` ``` var Immutable = require("seamless-immutable"); obj.setIn('key', data) ``` Although the later is shorter and is the current default, it can lead to collisions and some users may dislike polluting object properties when it comes to debugging. As such the first syntax is recommended, but both are supported. ## Immutable.from If your linter cringes with the use of `Immutable` without a preceding `new` (e.g. ESLint's [new-cap](http://eslint.org/docs/rules/new-cap) rule), use `Immutable.from`: ```javascript Immutable.from([1, 2, 3]); // is functionally the same as calling: Immutable([1, 2, 3]) ``` ## Immutable Array Like a regular Array, but immutable! You can construct these by passing an array to `Immutable()`: ```javascript Immutable([1, 2, 3]) // An immutable array containing 1, 2, and 3. ``` Beyond [the usual Array fare](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Accessor_methods), the following methods have been added. ### flatMap ```javascript var array = Immutable(["here", "we", "go"]); Immutable.flatMap(array, function(str) { return [str, str, str]; }); // returns Immutable(["here", "here", "here", "we", "we", "we", "go", "go", "go"]) var array = Immutable(["drop the numbers!", 3, 2, 1, 0, null, undefined]); Immutable.flatMap(array, function(value) { if (typeof value === "number") { return []; } else { return value; } }); // returns Immutable(["drop the numbers!", null, undefined]) ``` Effectively performs a [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) over the elements in the array, except that whenever the provided iterator function returns an Array, that Array's elements are each added to the final result. ### asObject ```javascript var array = Immutable(["hey", "you"]); Immutable.asObject(array, function(str) { return [str, str.toUpperCase()]; }); // returns Immutable({hey: "HEY", you: "YOU"}) ``` Effectively performs a [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) over the elements in the array, expecting that the iterator function will return an array of two elements - the first representing a key, the other a value. Then returns an Immutable Object constructed of those keys and values. You can also call `.asObject` without passing an iterator, in which case it will proceed assuming the Array is already organized as desired. ### asMutable ```javascript var array = Immutable(["hello", "world"]); var mutableArray = Immutable.asMutable(array); mutableArray.push("!!!"); mutableArray // ["hello", "world", "!!!"] ``` Returns a mutable copy of the array. For a deeply mutable copy, in which any instances of `Immutable` contained in nested data structures within the array have been converted back to mutable data structures, call `Immutable.asMutable(obj, {deep: true})` instead. ## Immutable Object Like a regular Object, but immutable! You can construct these by passing an object to `Immutable()`. ```javascript Immutable({foo: "bar"}) // An immutable object containing the key "foo" and the value "bar". ``` To construct an Immutable Object with a custom prototype, simply specify the prototype in `options` (while useful for preserving prototypes, please note that custom mutator methods will not work as the object will be immutable): ```javascript function Square(length) { this.length = length }; Square.prototype.area = function() { return Math.pow(this.length, 2) }; Immutable(new Square(2), {prototype: Square.prototype}).area(); // An immutable object, with prototype Square, // containing the key "length" and method `area()` returning 4 ``` Beyond [the usual Object fare](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#Methods_of_Object_instances), the following methods have been added. ### Stack overflow protection Currently you can't construct Immutable from an object with circular references. To protect from ugly stack overflows, we provide a simple protection during development. We stop at a suspiciously deep stack level and [show an error message][deep]. If your objects are deep, but not circular, you can increase this level from default `64`. For example: ```javascript Immutable(deepObject, null, 256); ``` This check is not performed in the production build. [deep]: https://github.com/rtfeldman/seamless-immutable/wiki/Deeply-nested-object-was-detected ### merge ```javascript var obj = Immutable({status: "good", hypothesis: "plausible", errors: 0}); Immutable.merge(obj, {status: "funky", hypothesis: "confirmed"}); // returns Immutable({status: "funky", hypothesis: "confirmed", errors: 0}) var obj = Immutable({status: "bad", errors: 37}); Immutable.merge(obj, [ {status: "funky", errors: 1}, {status: "groovy", errors: 2}, {status: "sweet"}]); // returns Immutable({status: "sweet", errors: 2}) // because passing an Array (or just multiple arguments) is shorthand for // invoking a separate merge for each object in turn. ``` Returns an Immutable Object containing the properties and values of both this object and the provided object, prioritizing the provided object's values whenever the same key is present in both objects. Multiple objects can be provided in an Array in which case more `merge` invocations will be performed using each provided object in turn. A second argument can be provided to perform a deep merge: `{deep: true}`. ### replace ```javascript var obj1 = Immutable({a: {b: 'test'}, c: 'test'}); var obj2 = Immutable.replace(obj1, {a: {b: 'test'}}, {deep: true}); // returns Immutable({a: {b: 'test'}}); obj1 === obj2 // returns false obj1.a === obj2.a // returns true because child .a objects were identical ``` Returns an Immutable Object containing the properties and values of the second object only. With deep merge, all child objects are checked for equality and the original immutable object is returned when possible. A second argument can be provided to perform a deep merge: `{deep: true}`. ### set ```javascript var obj = Immutable({type: "parrot", subtype: "Norwegian Blue", status: "alive"}); Immutable.set(obj, "status", "dead"); // returns Immutable({type: "parrot", subtype: "Norwegian Blue", status: "dead"}) ``` Returns an Immutable Object with a single property set to the provided value. Basically a more straightforward way of saying ```javascript var obj = Immutable({type: "parrot", subtype: "Norwegian Blue", status: "alive"}); Immutable.merge(obj, {status: "dead"}); ``` (and more convenient with non-literal keys unless you have ES6 ```[computed_property_names]```). A second argument can be provided to perform a deep compare: `{deep: true}`. ### setIn Like [set](#set), but accepts a nested path to the property. ```javascript var obj = Immutable({type: {main: "parrot", sub: "Norwegian Blue"}, status: "alive"}); Immutable.setIn(obj, ["type", "sub"], "Norwegian Ridgeback"); // returns Immutable({type: {main: "parrot", sub: "Norwegian Ridgeback"}, status: "alive"}) ``` A second argument can be provided to perform a deep compare: `{deep: true}`. ### update Returns an Immutable Object with a single property updated using the provided updater function. ```javascript function inc (x) { return x + 1 } var obj = Immutable({foo: 1}); Immutable.update(obj, "foo", inc); // returns Immutable({foo: 2}) ``` All additional arguments will be passed to the updater function. ```javascript function add (x, y) { return x + y } var obj = Immutable({foo: 1}); Immutable.update(obj, "foo", add, 10); // returns Immutable({foo: 11}) ``` ### updateIn Like [update](#update), but accepts a nested path to the property. ```javascript function add (x, y) { return x + y } var obj = Immutable({foo: {bar: 1}}); Immutable.updateIn(obj, ["foo", "bar"], add, 10); // returns Immutable({foo: {bar: 11}}) ``` ### without ```javascript var obj = Immutable({the: "forests", will: "echo", with: "laughter"}); Immutable.without(obj, "with"); // returns Immutable({the: "forests", will: "echo"}) var obj = Immutable({the: "forests", will: "echo", with: "laughter"}); Immutable.without(obj, ["will", "with"]); // returns Immutable({the: "forests"}) var obj = Immutable({the: "forests", will: "echo", with: "laughter"}); Immutable.without(obj, "will", "with"); // returns Immutable({the: "forests"}) var obj = Immutable({the: "forests", will: "echo", with: "laughter"}); Immutable.without(obj, (value, key) => key === "the" || value === "echo"); // returns Immutable({with: "laughter"}) ``` Returns an Immutable Object excluding the given keys or keys/values satisfying the given predicate from the existing object. Multiple keys can be provided, either in an Array or as extra arguments. ### asMutable ```javascript var obj = Immutable({when: "the", levee: "breaks"}); var mutable = Immutable.asMutable(obj); mutableObject.have = "no place to go"; mutableObject // {when: "the", levee: "breaks", have: "no place to go"} ``` Returns a mutable copy of the object. For a deeply mutable copy, in which any instances of `Immutable` contained in nested data structures within the object have been converted back to mutable data structures, call `Immutable.asMutable(obj, {deep: true})` instead. ### Releases #### 7.0.1 Fix `.npmignore` and `react-native` in `package.json` #### 7.0.0 Add `Immutable.static` as the preferred API. Default to development build in webpack. #### 6.3.0 Adds optional deep compare for `.set`, `.setIn` and `.replace` #### 6.2.0 Adds static alternatives to methods, e.g. `Immutable.setIn` #### 6.1.4 Fixes [bug with deep merge() on an array argument](https://github.com/rtfeldman/seamless-immutable/pull/140). #### 6.1.3 Fixes bug with setting a new object on an existing leaf array. #### 6.1.2 Fixes bug where on some systems arrays are treated as plain objects. #### 6.1.1 `without` now handles numeric keys the same way as string keys. #### 6.1.0 Alias `Immutable.from()` to `Immutable()` for linters. #### 6.0.1 React components are now considered immutable. #### 6.0.0 Add cycle detection. #### 5.2.0 Add `update` and `updateIn`. #### 5.1.1 `Immutable(Object.create(null))` now works as expected. #### 5.1.0 Add predicate support to `without()` #### 5.0.1 Fix missing dev/prod builds for 5.0.0 #### 5.0.0 In development build, freeze Dates and ban mutating methods. (Note: dev and prod builds were mistakenly not generated for this, so to get this functionality in those builds, use 5.0.1) #### 4.1.1 Make `setIn` more null safe. #### 4.1.0 Adds `set` and `setIn` #### 4.0.1 Now when you `require("seamless-immutable")`, you get the development build by default. #### 4.0.0 `main` now points to `src/seamless-immutable.js` so you can more easily build with `envify` yourself. #### 3.0.0 Add support for optional prototyping. #### 2.4.2 Calling .asMutable({deep: true}) on an Immutable data structure with a nested Date no longer throws an exception. #### 2.4.1 Arrays with nonstandard prototypes no longer throw exceptions when passed to `Immutable`. #### 2.4.0 Custom mergers now check for reference equality and abort early if there is no more work needed, allowing improved performance. #### 2.3.2 Fixes a bug where indices passed into iterators for flatMap and asObject were strings instead of numbers. #### 2.3.1 Fixes an IE and Firefox bug related to cloning Dates while preserving their prototypes. #### 2.3.0 Dates now retain their prototypes, the same way Arrays do. #### 2.2.0 Adds a minified production build with no freezing or defensive unsupported methods, for a ~2x performance boost. #### 2.1.0 Adds optional `merger` function to `#merge`. #### 2.0.2 Bugfix: `#merge` with `{deep: true}` no longer attempts (unsuccessfully) to deeply merge arrays as though they were regular objects. #### 2.0.1 Minor documentation typo fix. #### 2.0.0 Breaking API change: `#merge` now takes exactly one or exactly two arguments. The second is optional and allows specifying `deep: true`. #### 1.3.0 Don't bother returning a new value from `#merge` if no changes would result. #### 1.2.0 Make error message for invalid `#asObject` less fancy, resulting in a performance improvement. #### 1.1.0 Adds `#asMutable` #### 1.0.0 Initial stable release ## Development Run `npm install -g grunt-cli`, `npm install` and then `grunt` to build and test it. [1]: https://travis-ci.org/rtfeldman/seamless-immutable.svg?branch=master [2]: https://travis-ci.org/rtfeldman/seamless-immutable [3]: https://badge.fury.io/js/seamless-immutable.svg [4]: https://badge.fury.io/js/seamless-immutable [5]: http://img.shields.io/coveralls/rtfeldman/seamless-immutable.svg [6]: https://coveralls.io/r/rtfeldman/seamless-immutable
maty21/statistisc
node_modules/seamless-immutable/README.md
Markdown
mit
18,447
/******************************************************************************* * * MIT License * * Copyright (c) 2019 Advanced Micro Devices, Inc. * * 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. * *******************************************************************************/ #include <miopen/conv/invokers/gcn_asm_1x1u.hpp> #include <miopen/conv/data_invoke_params.hpp> #include <miopen/handle.hpp> #include <miopen/kernel.hpp> #include <miopen/tensor.hpp> namespace miopen { namespace conv { InvokerFactory MakeGcnAsm1x1UInvokerFactory(int N, int C, int H, int W, int K, int n_groups) { return [=](const std::vector<Kernel>& kernels) { if(kernels.size() != 1) MIOPEN_THROW("Solver expects one kernel"); const auto kernel = kernels[0]; return [=](const Handle& handle, const AnyInvokeParams& primitive_parameters) { const auto& params = primitive_parameters.CastTo<DataInvokeParams>(); const auto& tensors = params.tensors; int unused = 0; int* return_addr = nullptr; handle.Run(kernel)(N, C, H, W, K, n_groups, unused, unused, tensors.in, tensors.w, tensors.out, return_addr); }; }; } } // namespace conv } // namespace miopen
ROCmSoftwarePlatform/MIOpen
src/conv/invokers/gcn_asm_1x1u.cpp
C++
mit
2,639
// Copyright (c) 2014, Kelp Heavy Weaponry // MasterLog project -- see MasterLog licencing for details. // File access namespace MasterLog { namespace Storage { int configure(Configuration const& config); }} // File : MasterLog
davidstewartzink/MasterLog
include/mstrlg/Storage.h
C
mit
232
namespace BugTracker.WebServices.Areas.HelpPage { using System; using System.Text; using System.Web; using System.Web.Http.Description; public static class ApiDescriptionExtensions { /// <summary> /// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}" /// </summary> /// <param name="description">The <see cref="ApiDescription"/>.</param> /// <returns>The ID as a string.</returns> public static string GetFriendlyId(this ApiDescription description) { var path = description.RelativePath; var urlParts = path.Split('?'); var localPath = urlParts[0]; string queryKeyString = null; if (urlParts.Length > 1) { var query = urlParts[1]; var queryKeys = HttpUtility.ParseQueryString(query).AllKeys; queryKeyString = string.Join("_", queryKeys); } var friendlyPath = new StringBuilder(); friendlyPath.AppendFormat( "{0}-{1}", description.HttpMethod.Method, localPath.Replace("/", "-").Replace("{", string.Empty).Replace("}", string.Empty)); if (queryKeyString != null) { friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-')); } return friendlyPath.ToString(); } } }
2She2/WebSevices
07.Web-Services-Testing/BugTracker.WebServices/Areas/HelpPage/ApiDescriptionExtensions.cs
C#
mit
1,519
function goMain(){ window.location.href = 'main.html'; };
Keimaru/liasonMaster
www/index.js
JavaScript
mit
63
<?php namespace PHQ\Database; use PHQ\Database\PDO\Statement; /** * Interface IConnection * @package PHQ\Database */ interface IConnection { /** * Execute une requête avec la connexion interne * * @param string $statement * @param array $params * @return Statement L'objet représentant les résultats */ public function request(string $statement, array $params = []): Statement; /** * Démarre un système de transaction qui permet de faire des modifs et * de revenir en arrière si jamais une erreur survient. * @return void */ public function startTransaction(); /** * Permet de persister les changements fait avec les précédantes * requête après avoir lancer un startTransaction * @return void */ public function commit(); /** * Permet de revenir en arrière sur les changements fait avec les * précédantes requête après avoir lancer un startTransaction * @return void */ public function rollback(); /** * Récupère le dernière id sur une * table avec un auto increment * * @return int */ public function lastId(): int; }
quenti77/phq
src/Database/IConnection.php
PHP
mit
1,203
version https://git-lfs.github.com/spec/v1 oid sha256:8d51e43626611f90ffa2bf855ceaf2c501b01a5a083681b6a9426092bd85651f size 3788
yogeshsaroya/new-cdnjs
ajax/libs/angular.js/1.4.0-beta.6/i18n/angular-locale_ru-by.js
JavaScript
mit
129
/*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { font-family: sans-serif; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background-color: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { margin: .67em 0; font-size: 2em; } mark { color: #000; background: #ff0; } small { font-size: 80%; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -.5em; } sub { bottom: -.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { height: 0; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { margin: 0; font: inherit; color: inherit; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { padding: .35em .625em .75em; margin: 0 2px; border: 1px solid #c0c0c0; } legend { padding: 0; border: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-spacing: 0; border-collapse: collapse; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { color: #000 !important; text-shadow: none !important; background: transparent !important; -webkit-box-shadow: none !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('../fonts/glyphicons-halflings-regular.eot'); src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro:before, .glyphicon-eur:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-cd:before { content: "\e201"; } .glyphicon-save-file:before { content: "\e202"; } .glyphicon-open-file:before { content: "\e203"; } .glyphicon-level-up:before { content: "\e204"; } .glyphicon-copy:before { content: "\e205"; } .glyphicon-paste:before { content: "\e206"; } .glyphicon-alert:before { content: "\e209"; } .glyphicon-equalizer:before { content: "\e210"; } .glyphicon-king:before { content: "\e211"; } .glyphicon-queen:before { content: "\e212"; } .glyphicon-pawn:before { content: "\e213"; } .glyphicon-bishop:before { content: "\e214"; } .glyphicon-knight:before { content: "\e215"; } .glyphicon-baby-formula:before { content: "\e216"; } .glyphicon-tent:before { content: "\26fa"; } .glyphicon-blackboard:before { content: "\e218"; } .glyphicon-bed:before { content: "\e219"; } .glyphicon-apple:before { content: "\f8ff"; } .glyphicon-erase:before { content: "\e221"; } .glyphicon-hourglass:before { content: "\231b"; } .glyphicon-lamp:before { content: "\e223"; } .glyphicon-duplicate:before { content: "\e224"; } .glyphicon-piggy-bank:before { content: "\e225"; } .glyphicon-scissors:before { content: "\e226"; } .glyphicon-bitcoin:before { content: "\e227"; } .glyphicon-btc:before { content: "\e227"; } .glyphicon-xbt:before { content: "\e227"; } .glyphicon-yen:before { content: "\00a5"; } .glyphicon-jpy:before { content: "\00a5"; } .glyphicon-ruble:before { content: "\20bd"; } .glyphicon-rub:before { content: "\20bd"; } .glyphicon-scale:before { content: "\e230"; } .glyphicon-ice-lolly:before { content: "\e231"; } .glyphicon-ice-lolly-tasted:before { content: "\e232"; } .glyphicon-education:before { content: "\e233"; } .glyphicon-option-horizontal:before { content: "\e234"; } .glyphicon-option-vertical:before { content: "\e235"; } .glyphicon-menu-hamburger:before { content: "\e236"; } .glyphicon-modal-window:before { content: "\e237"; } .glyphicon-oil:before { content: "\e238"; } .glyphicon-grain:before { content: "\e239"; } .glyphicon-sunglasses:before { content: "\e240"; } .glyphicon-text-size:before { content: "\e241"; } .glyphicon-text-color:before { content: "\e242"; } .glyphicon-text-background:before { content: "\e243"; } .glyphicon-object-align-top:before { content: "\e244"; } .glyphicon-object-align-bottom:before { content: "\e245"; } .glyphicon-object-align-horizontal:before { content: "\e246"; } .glyphicon-object-align-left:before { content: "\e247"; } .glyphicon-object-align-vertical:before { content: "\e248"; } .glyphicon-object-align-right:before { content: "\e249"; } .glyphicon-triangle-right:before { content: "\e250"; } .glyphicon-triangle-left:before { content: "\e251"; } .glyphicon-triangle-bottom:before { content: "\e252"; } .glyphicon-triangle-top:before { content: "\e253"; } .glyphicon-console:before { content: "\e254"; } .glyphicon-superscript:before { content: "\e255"; } .glyphicon-subscript:before { content: "\e256"; } .glyphicon-menu-left:before { content: "\e257"; } .glyphicon-menu-right:before { content: "\e258"; } .glyphicon-menu-down:before { content: "\e259"; } .glyphicon-menu-up:before { content: "\e260"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333; background-color: #fff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #337ab7; text-decoration: none; } a:hover, a:focus { color: #23527c; text-decoration: underline; } a:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { display: inline-block; max-width: 100%; height: auto; padding: 4px; line-height: 1.42857143; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eee; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } [role="button"] { cursor: pointer; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } mark, .mark { padding: .2em; background-color: #fcf8e3; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777; } .text-primary { color: #337ab7; } a.text-primary:hover, a.text-primary:focus { color: #286090; } .text-success { color: #3c763d; } a.text-success:hover, a.text-success:focus { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover, a.text-info:focus { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover, a.text-warning:focus { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover, a.text-danger:focus { color: #843534; } .bg-primary { color: #fff; background-color: #337ab7; } a.bg-primary:hover, a.bg-primary:focus { background-color: #286090; } .bg-success { background-color: #dff0d8; } a.bg-success:hover, a.bg-success:focus { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover, a.bg-info:focus { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover, a.bg-warning:focus { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover, a.bg-danger:focus { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; margin-left: -5px; list-style: none; } .list-inline > li { display: inline-block; padding-right: 5px; padding-left: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.42857143; } dt { font-weight: bold; } dd { margin-left: 0; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; overflow: hidden; clear: left; text-align: right; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #777; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; color: #777; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; text-align: right; border-right: 5px solid #eee; border-left: 0; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857143; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #fff; background-color: #333; border-radius: 3px; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; -webkit-box-shadow: none; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; color: #333; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } .row { margin-right: -15px; margin-left: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0; } } table { background-color: transparent; } caption { padding-top: 8px; padding-bottom: 8px; color: #777; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #ddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #ddd; } .table .table { background-color: #fff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } .table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { position: static; display: table-column; float: none; } table td[class*="col-"], table th[class*="col-"] { position: static; display: table-cell; float: none; } .table > thead > tr > td.active, .table > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } .table-responsive { min-height: .01%; overflow-x: auto; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #ddd; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { min-width: 0; padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857143; color: #555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); } .form-control::-moz-placeholder { color: #999; opacity: 1; } .form-control:-ms-input-placeholder { color: #999; } .form-control::-webkit-input-placeholder { color: #999; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #eee; opacity: 1; } .form-control[disabled], fieldset[disabled] .form-control { cursor: not-allowed; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control { line-height: 34px; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm, .input-group-sm input[type="date"], .input-group-sm input[type="time"], .input-group-sm input[type="datetime-local"], .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg, .input-group-lg input[type="date"], .input-group-lg input[type="time"], .input-group-lg input[type="datetime-local"], .input-group-lg input[type="month"] { line-height: 46px; } } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { min-height: 20px; padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-top: 4px \9; margin-left: -20px; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; font-weight: normal; vertical-align: middle; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { min-height: 34px; padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; } .form-control-static.input-lg, .form-control-static.input-sm { padding-right: 0; padding-left: 0; } .input-sm { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .form-group-sm select.form-control { height: 30px; line-height: 30px; } .form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control { height: auto; } .form-group-sm .form-control-static { height: 30px; min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 1.5; } .input-lg { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-lg { height: 46px; line-height: 46px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .form-group-lg select.form-control { height: 46px; line-height: 46px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 46px; min-height: 38px; padding: 11px 16px; font-size: 18px; line-height: 1.3333333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .form-control-feedback, .input-group-sm + .form-control-feedback, .form-group-sm .form-control + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-success .form-control:focus { border-color: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; background-color: #dff0d8; border-color: #3c763d; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-warning .form-control:focus { border-color: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; background-color: #fcf8e3; border-color: #8a6d3b; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #a94442; } .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); } .has-error .form-control:focus { border-color: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; background-color: #f2dede; border-color: #a94442; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label ~ .form-control-feedback { top: 25px; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-static { display: inline-block; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { padding-top: 7px; margin-top: 0; margin-bottom: 0; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { padding-top: 7px; margin-bottom: 0; text-align: right; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 14.333333px; font-size: 18px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; padding: 6px 12px; margin-bottom: 0; font-size: 14px; font-weight: normal; line-height: 1.42857143; text-align: center; white-space: nowrap; vertical-align: middle; -ms-touch-action: manipulation; touch-action: manipulation; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-image: none; border: 1px solid transparent; border-radius: 4px; } .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn.active.focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus, .btn.focus { color: #333; text-decoration: none; } .btn:active, .btn.active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; opacity: .65; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #333; background-color: #fff; border-color: #ccc; } .btn-default:focus, .btn-default.focus { color: #333; background-color: #e6e6e6; border-color: #8c8c8c; } .btn-default:hover { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active:hover, .btn-default.active:hover, .open > .dropdown-toggle.btn-default:hover, .btn-default:active:focus, .btn-default.active:focus, .open > .dropdown-toggle.btn-default:focus, .btn-default:active.focus, .btn-default.active.focus, .open > .dropdown-toggle.btn-default.focus { color: #333; background-color: #d4d4d4; border-color: #8c8c8c; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled.focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #fff; border-color: #ccc; } .btn-default .badge { color: #fff; background-color: #333; } .btn-primary { color: #fff; background-color: #337ab7; border-color: #2e6da4; } .btn-primary:focus, .btn-primary.focus { color: #fff; background-color: #286090; border-color: #122b40; } .btn-primary:hover { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active:hover, .btn-primary.active:hover, .open > .dropdown-toggle.btn-primary:hover, .btn-primary:active:focus, .btn-primary.active:focus, .open > .dropdown-toggle.btn-primary:focus, .btn-primary:active.focus, .btn-primary.active.focus, .open > .dropdown-toggle.btn-primary.focus { color: #fff; background-color: #204d74; border-color: #122b40; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled.focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #337ab7; border-color: #2e6da4; } .btn-primary .badge { color: #337ab7; background-color: #fff; } .btn-success { color: #fff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:focus, .btn-success.focus { color: #fff; background-color: #449d44; border-color: #255625; } .btn-success:hover { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active:hover, .btn-success.active:hover, .open > .dropdown-toggle.btn-success:hover, .btn-success:active:focus, .btn-success.active:focus, .open > .dropdown-toggle.btn-success:focus, .btn-success:active.focus, .btn-success.active.focus, .open > .dropdown-toggle.btn-success.focus { color: #fff; background-color: #398439; border-color: #255625; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled.focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #fff; } .btn-info { color: #fff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:focus, .btn-info.focus { color: #fff; background-color: #31b0d5; border-color: #1b6d85; } .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active:hover, .btn-info.active:hover, .open > .dropdown-toggle.btn-info:hover, .btn-info:active:focus, .btn-info.active:focus, .open > .dropdown-toggle.btn-info:focus, .btn-info:active.focus, .btn-info.active.focus, .open > .dropdown-toggle.btn-info.focus { color: #fff; background-color: #269abc; border-color: #1b6d85; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled.focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #fff; } .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:focus, .btn-warning.focus { color: #fff; background-color: #ec971f; border-color: #985f0d; } .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active:hover, .btn-warning.active:hover, .open > .dropdown-toggle.btn-warning:hover, .btn-warning:active:focus, .btn-warning.active:focus, .open > .dropdown-toggle.btn-warning:focus, .btn-warning:active.focus, .btn-warning.active.focus, .open > .dropdown-toggle.btn-warning.focus { color: #fff; background-color: #d58512; border-color: #985f0d; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled.focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #fff; } .btn-danger { color: #fff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:focus, .btn-danger.focus { color: #fff; background-color: #c9302c; border-color: #761c19; } .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active:hover, .btn-danger.active:hover, .open > .dropdown-toggle.btn-danger:hover, .btn-danger:active:focus, .btn-danger.active:focus, .open > .dropdown-toggle.btn-danger:focus, .btn-danger:active.focus, .btn-danger.active.focus, .open > .dropdown-toggle.btn-danger.focus { color: #fff; background-color: #ac2925; border-color: #761c19; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled.focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #fff; } .btn-link { font-weight: normal; color: #337ab7; border-radius: 0; } .btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #23527c; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity .15s linear; -o-transition: opacity .15s linear; transition: opacity .15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-timing-function: ease; -o-transition-timing-function: ease; transition-timing-function: ease; -webkit-transition-duration: .35s; -o-transition-duration: .35s; transition-duration: .35s; -webkit-transition-property: height, visibility; -o-transition-property: height, visibility; transition-property: height, visibility; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-top: 4px solid \9; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropup, .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; font-size: 14px; text-align: left; list-style: none; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, .15); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); box-shadow: 0 6px 12px rgba(0, 0, 0, .175); } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857143; color: #333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { color: #262626; text-decoration: none; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #fff; text-decoration: none; background-color: #337ab7; outline: 0; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; cursor: not-allowed; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { right: 0; left: auto; } .dropdown-menu-left { right: auto; left: 0; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.42857143; color: #777; white-space: nowrap; } .dropdown-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { content: ""; border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { right: 0; left: auto; } .navbar-right .dropdown-menu-left { right: auto; left: 0; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn, .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-right: 8px; padding-left: 8px; } .btn-group > .btn-lg + .dropdown-toggle { padding-right: 12px; padding-left: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 4px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-left-radius: 0; border-top-right-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { display: table-cell; float: none; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-right: 0; padding-left: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 46px; line-height: 46px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555; text-align: center; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -1px; } .nav { padding-left: 0; margin-bottom: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eee; } .nav > li.disabled > a { color: #777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777; text-decoration: none; cursor: not-allowed; background-color: transparent; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eee; border-color: #337ab7; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eee #eee #ddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555; cursor: default; background-color: #fff; border: 1px solid #ddd; border-bottom-color: transparent; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { margin-bottom: 5px; text-align: center; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #fff; } } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 4px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; background-color: #337ab7; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { margin-bottom: 5px; text-align: center; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #fff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { padding-right: 15px; padding-left: 15px; overflow-x: visible; -webkit-overflow-scrolling: touch; border-top: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-right: 0; padding-left: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-device-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; height: 50px; padding: 15px 15px; font-size: 18px; line-height: 20px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; padding: 9px 10px; margin-top: 8px; margin-right: 15px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; -webkit-box-shadow: none; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } .navbar-form { padding: 10px 15px; margin-top: 8px; margin-right: -15px; margin-bottom: 8px; margin-left: -15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .form-control-static { display: inline-block; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } .navbar-form .form-group:last-child { margin-bottom: 0; } } @media (min-width: 768px) { .navbar-form { width: auto; padding-top: 0; padding-bottom: 0; margin-right: 0; margin-left: 0; border: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-right: 15px; margin-left: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777; } .navbar-default .navbar-nav > li > a { color: #777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #ccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #ddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #ddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { color: #555; background-color: #e7e7e7; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #ccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777; } .navbar-default .navbar-link:hover { color: #333; } .navbar-default .btn-link { color: #777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #ccc; } .navbar-inverse { background-color: #222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #9d9d9d; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-text { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #fff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #fff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { color: #fff; background-color: #080808; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #9d9d9d; } .navbar-inverse .navbar-link:hover { color: #fff; } .navbar-inverse .btn-link { color: #9d9d9d; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #fff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { padding: 0 5px; color: #ccc; content: "/\00a0"; } .breadcrumb > .active { color: #777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; margin-left: -1px; line-height: 1.42857143; /* removed */ /* color: #337ab7; */ text-decoration: none; background-color: #fff; border: 1px solid #ddd; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-top-right-radius: 4px; border-bottom-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { z-index: 3; color: #23527c; background-color: #eee; /* removed */ /* border-color: #ddd; */ } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #fff; cursor: default; /* removed */ /* background-color: #337ab7; border-color: #337ab7; */ } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #777; cursor: not-allowed; background-color: #fff; border-color: #ddd; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; line-height: 1.3333333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-top-right-radius: 6px; border-bottom-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; text-align: center; list-style: none; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #777; cursor: not-allowed; background-color: #fff; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #fff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #337ab7; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #286090; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: middle; background-color: #777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #fff; text-decoration: none; cursor: pointer; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #337ab7; background-color: #fff; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #eee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 6px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-right: 60px; padding-left: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.42857143; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: border .2s ease-in-out; -o-transition: border .2s ease-in-out; transition: border .2s ease-in-out; } .thumbnail > img, .thumbnail a > img { margin-right: auto; margin-left: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #337ab7; } .thumbnail .caption { padding: 9px; color: #333; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { height: 20px; margin-bottom: 20px; overflow: hidden; background-color: #f5f5f5; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); } .progress-bar { float: left; width: 0; height: 100%; font-size: 12px; line-height: 20px; color: #fff; text-align: center; background-color: #337ab7; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); -webkit-transition: width .6s ease; -o-transition: width .6s ease; transition: width .6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { overflow: hidden; zoom: 1; } .media-body { width: 10000px; } .media-object { display: block; } .media-object.img-thumbnail { max-width: none; } .media-right, .media > .pull-right { padding-left: 10px; } .media-left, .media > .pull-left { padding-right: 10px; } .media-left, .media-right, .media-body { display: table-cell; vertical-align: top; } .media-middle { vertical-align: middle; } .media-bottom { vertical-align: bottom; } .media-heading { margin-top: 0; margin-bottom: 5px; } .media-list { padding-left: 0; list-style: none; } .list-group { padding-left: 0; margin-bottom: 20px; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #fff; border: 1px solid #ddd; } .list-group-item:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } a.list-group-item, button.list-group-item { color: #555; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #333; } a.list-group-item:hover, button.list-group-item:hover, a.list-group-item:focus, button.list-group-item:focus { color: #555; text-decoration: none; background-color: #f5f5f5; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { color: #777; cursor: not-allowed; background-color: #eee; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #fff; background-color: #337ab7; border-color: #337ab7; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #c7ddef; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success, button.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, button.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, button.list-group-item-success.active, a.list-group-item-success.active:hover, button.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info, button.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, button.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, button.list-group-item-info.active, a.list-group-item-info.active:hover, button.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning, button.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, button.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, button.list-group-item-warning.active, a.list-group-item-warning.active:hover, button.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger, button.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, button.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, button.list-group-item-danger.active, a.list-group-item-danger.active:hover, button.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #fff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); box-shadow: 0 1px 1px rgba(0, 0, 0, .05); } .panel-body { padding: 15px; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group, .panel > .panel-collapse > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { border-top-left-radius: 0; border-top-right-radius: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption { padding-right: 15px; padding-left: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #ddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { margin-bottom: 0; border: 0; } .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #ddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #ddd; } .panel-default { border-color: #ddd; } .panel-default > .panel-heading { color: #333; background-color: #f5f5f5; border-color: #ddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ddd; } .panel-primary { border-color: #337ab7; } .panel-primary > .panel-heading { color: #fff; background-color: #337ab7; border-color: #337ab7; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #337ab7; } .panel-primary > .panel-heading .badge { color: #337ab7; background-color: #fff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #337ab7; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; } .embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, .15); } .well-lg { padding: 24px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; filter: alpha(opacity=20); opacity: .2; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; filter: alpha(opacity=50); opacity: .5; } button.close { -webkit-appearance: none; padding: 0; cursor: pointer; background: transparent; border: 0; } .modal-open { overflow: hidden; } .modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transition: -webkit-transform .3s ease-out; -o-transition: -o-transform .3s ease-out; transition: transform .3s ease-out; -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, .2); border-radius: 6px; outline: 0; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); box-shadow: 0 3px 9px rgba(0, 0, 0, .5); } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { filter: alpha(opacity=0); opacity: 0; } .modal-backdrop.in { filter: alpha(opacity=50); opacity: .5; } .modal-header { min-height: 16.42857143px; padding: 15px; border-bottom: 1px solid #e5e5e5; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857143; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn { margin-bottom: 0; margin-left: 5px; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); box-shadow: 0 5px 15px rgba(0, 0, 0, .5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; word-wrap: normal; white-space: normal; filter: alpha(opacity=0); opacity: 0; line-break: auto; } .tooltip.in { filter: alpha(opacity=90); opacity: .9; } .tooltip.top { padding: 5px 0; margin-top: -3px; } .tooltip.right { padding: 0 5px; margin-left: 3px; } .tooltip.bottom { padding: 5px 0; margin-top: 3px; } .tooltip.left { padding: 0 5px; margin-left: -3px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; background-color: #000; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-left .tooltip-arrow { right: 5px; bottom: 0; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-right .tooltip-arrow { bottom: 0; left: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-left .tooltip-arrow { top: 0; right: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-right .tooltip-arrow { top: 0; left: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 1.42857143; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; word-wrap: normal; white-space: normal; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, .2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); box-shadow: 0 5px 10px rgba(0, 0, 0, .2); line-break: auto; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { padding: 8px 14px; margin: 0; font-size: 14px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { content: ""; border-width: 10px; } .popover.top > .arrow { bottom: -11px; left: 50%; margin-left: -11px; border-top-color: #999; border-top-color: rgba(0, 0, 0, .25); border-bottom-width: 0; } .popover.top > .arrow:after { bottom: 1px; margin-left: -10px; content: " "; border-top-color: #fff; border-bottom-width: 0; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-right-color: #999; border-right-color: rgba(0, 0, 0, .25); border-left-width: 0; } .popover.right > .arrow:after { bottom: -10px; left: 1px; content: " "; border-right-color: #fff; border-left-width: 0; } .popover.bottom > .arrow { top: -11px; left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999; border-bottom-color: rgba(0, 0, 0, .25); } .popover.bottom > .arrow:after { top: 1px; margin-left: -10px; content: " "; border-top-width: 0; border-bottom-color: #fff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999; border-left-color: rgba(0, 0, 0, .25); } .popover.left > .arrow:after { right: 1px; bottom: -10px; content: " "; border-right-width: 0; border-left-color: #fff; } .carousel { position: relative; } .carousel-inner { position: relative; width: 100%; overflow: hidden; } .carousel-inner > .item { position: relative; display: none; -webkit-transition: .6s ease-in-out left; -o-transition: .6s ease-in-out left; transition: .6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform .6s ease-in-out; -o-transition: -o-transform .6s ease-in-out; transition: transform .6s ease-in-out; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { left: 0; -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { left: 0; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { left: 0; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; bottom: 0; left: 0; width: 15%; font-size: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); filter: alpha(opacity=50); opacity: .5; } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); background-repeat: repeat-x; } .carousel-control.right { right: 0; left: auto; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); background-repeat: repeat-x; } .carousel-control:hover, .carousel-control:focus { color: #fff; text-decoration: none; filter: alpha(opacity=90); outline: 0; opacity: .9; } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; z-index: 5; display: inline-block; margin-top: -10px; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; font-family: serif; line-height: 1; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; padding-left: 0; margin-left: -30%; text-align: center; list-style: none; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); border: 1px solid #fff; border-radius: 10px; } .carousel-indicators .active { width: 12px; height: 12px; margin: 0; background-color: #fff; } .carousel-caption { position: absolute; right: 15%; bottom: 20px; left: 15%; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -15px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -15px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -15px; } .carousel-caption { right: 20%; left: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-footer:before, .modal-footer:after { display: table; content: " "; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-footer:after { clear: both; } .center-block { display: block; margin-right: auto; margin-left: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; } .affix { position: fixed; } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } /*# sourceMappingURL=bootstrap.css.map */
iranianpep/code-jetter
public/styles/bootstrap.css
CSS
mit
147,501
<?php use \Glucose\Model as Model; require_once 'Models/Country.class.php'; require_once 'Models/City.class.php'; require_once 'Models/Person.class.php'; require_once 'Models/User.class.php'; class TransparentConcurrencyTest extends TableComparisonTestCase { private static $mysqli; protected function setUp() { $this->comparisonSchema = $GLOBALS['comparisonSchema']; $this->actualSchema = $GLOBALS['schema']; self::$mysqli = $GLOBALS['mysqli']; self::$mysqli->query('START TRANSACTION;'); } protected function getConnection() { return self::$mysqli; } public function test_P_InstanceJoin() { $andsens1 = new User(1); $andsens2 = new User(1); $andsens1->nickname = 'somethingelse'; $this->assertEquals('somethingelse', $andsens2->nickname); } public function test_P_InitByInstanceJoin() { $aarhus = City::initByCountryAndPostalCode(2, 8000); $aarhus->name = 'Dublin'; $dublin = new City(1); $this->assertEquals('Dublin', $dublin->name); } public function test_N_NoChangeOnCollision() { $aarhus = new City(1); $hamburg = new City(2); try { $aarhus->id = 2; } catch(\Glucose\Exceptions\User\EntityCollisionException $e) { } $this->assertEquals(1, $aarhus->id); } public function test_N_DBConsolidationForCollisionDetection() { $aarhus = new City(1); $this->setExpectedException('\Glucose\Exceptions\User\EntityCollisionException', 'Your changes collide with the unique values of an existing entity.'); $aarhus->id = 4; } protected function tearDown() { self::$mysqli->query('ROLLBACK;'); } }
andsens/Glucose
UnitTests/Behaviour/Semi-Singleton/TransparentConcurrencyTest.php
PHP
mit
1,571
--- layout: compress --- <!DOCTYPE html> <!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8"><![endif]--> <!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"><!--<![endif]--> <head> {% include head.html %} </head> <body> {% include nav.html %} <!-- Header --> <header class="header" role="banner"> <div class="wrapper animated fadeIn"> <div class="content"> <div class="post-title"> <h1>{{ page.title }}</h1> <a class="btn zoombtn" href="{{site.url}}"> <i class="fa fa-home"></i> </a> </div> <div class="post-list"> {% for post in site.posts %} {% if post.project == null and post.experience == null%} <ul> <li class="wow fadeInLeft" data-wow-duration="1.5s"> <a class="zoombtn" href="{{ site.url }}{{ post.url }}">{{ post.title }}</a> <p>{{ post.excerpt }}</p> <a href="{{ site.url }}{{ post.url }}" class="btn zoombtn">Read More</a> </li> </ul> {% endif %} {% endfor %} </div> </div> </div> </header> {% include scripts.html %} <script src="{{ site.url }}/assets/js/wow.min.js"></script> <script type="text/javascript">(new WOW).init();</script> </body> </html>
quido3/quido3.github.io
_layouts/post-list.html
HTML
mit
1,686
module Rosetta module Generators class MigrationGenerator < Rails::Generator::Base include Rails::Generators::migration desc 'Creates migrations for Rosetta tables' source_root File.expand_path('../templates', __FILE__) def self.next_migration_number if @prev_migration_nr @prev_migration_number += 1 else @prev_migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i end @prev_migration_nr.to_s end def copy_migrations migration_template('create_rosetta_tables', 'db/migrate/create_rosetta_tables.rb') end end end end
jaronson/rosetta
lib/rails/generators/rosetta/migration/migration_generator.rb
Ruby
mit
643
# Schema Repositories allow you to query and update documents in the database. To create a repository you first must define a schema to describe which columns and database tables to use. ## Defining Schemas The `db.table` method allows creating repositories with a schema description. ```js /** * Create a repository * @param {String} tableName * @param {} schemaDescription describe keys * @return {Repository} model constructor */ Connection.prototype.table = function (tableName, schemaDescription) { var schema = new Schema(schemaDescription); return new SequelizeRepository(sequelize, tableName, schema); }; ``` Example Usage: ```js var db = require('loke-mysql-orm').create('mysql://root@localhost/demo'); var userRepo = db.table('Users', { firstName: {type: db.String}, birthdate: {type: db.Date} }); ``` ## Relations Relations are defined by using another repository instance as a `type` value. Example Usage: ```js var db = require('loke-mysql-orm').create('mysql://root@localhost/demo'); var address = db.table('Addresses', { suburb : String }); var petsRepo = db.table('Pets', { name : String }); var userRepo = db.table('Users', { address : { type: address }, // Defines a `HasOne` relation pets : { type: [petsRepo] } // Defines a `HasMany` relation }); ``` ## Types: List of all supported types and their MYSQL translation: - `db.Id` - `INT(11) UNSIGNED` - `db.String` - `VARCHAR(255)` - `db.Number` - `DOUBLE` - `db.Boolean` - `TINYINT(1)` - `db.Date` - `DATETIME` - `db.Text` - `TEXT` - `db.Decimal` - `DECIMAL(10, 2)` - `db.Enum` - `ENUM`
LOKE/mysql-orm
doc/Section 3 -- Schema.md
Markdown
mit
1,607
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for node.js v0.10.2 - v0.10.3: v8::Isolate::Scope Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v0.10.2 - v0.10.3 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_isolate.html">Isolate</a></li><li class="navelem"><a class="el" href="classv8_1_1_isolate_1_1_scope.html">Scope</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classv8_1_1_isolate_1_1_scope-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">v8::Isolate::Scope Class Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="v8_8h_source.html">v8.h</a>&gt;</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a43889336478a5625e095c4444b9dd684"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a43889336478a5625e095c4444b9dd684"></a> &#160;</td><td class="memItemRight" valign="bottom"><b>Scope</b> (<a class="el" href="classv8_1_1_isolate.html">Isolate</a> *isolate)</td></tr> <tr class="separator:a43889336478a5625e095c4444b9dd684"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Stack-allocated class which sets the isolate for all operations executed within a local scope. </p> </div><hr/>The documentation for this class was generated from the following file:<ul> <li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:45:04 for V8 API Reference Guide for node.js v0.10.2 - v0.10.3 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
v8-dox/v8-dox.github.io
14417fd/html/classv8_1_1_isolate_1_1_scope.html
HTML
mit
5,626
package goenocean type EepD20109 struct { TelegramVld } func NewEepD20109() *EepD20109 { // {{{ return &EepD20109{NewTelegramVld()} } // }}} func (p *EepD20109) SetTelegram(t TelegramVld) { // {{{ p.TelegramVld = t } // }}} func (p *EepD20109) CommandId() uint8 { return p.TelegramData()[0] & 0x0f } func (p *EepD20109) SetCommandId(id uint8) { sizeMap := make(map[byte]int) sizeMap[0x01] = 3 sizeMap[0x02] = 4 sizeMap[0x03] = 2 sizeMap[0x04] = 3 sizeMap[0x05] = 6 sizeMap[0x06] = 2 sizeMap[0x07] = 7 tmp := make([]byte, sizeMap[id]) tmp[0] &^= 0x0f //zero first 4 bits tmp[0] |= id & 0x0f //set the 4 bits from count p.SetTelegramData(tmp) } func (p *EepD20109) OutputValue() uint8 { return p.TelegramData()[2] & 0x7f } func (p *EepD20109) SetOutputValue(count uint8) { //TODO validate only 0-100 DECIMAL here tmp := p.TelegramData() tmp[2] &^= 0x7f //zero first 4 bits tmp[2] |= count & 0x7f //set the 7 bits from count p.SetTelegramData(tmp) } //DimValue only valid for command id 1 func (p *EepD20109) DimValue() uint8 { return (p.TelegramData()[1] & 0xe0) >> 5 } //Can be between 0 and 4. func (p *EepD20109) SetDimValue(count uint8) { tmp := p.TelegramData() tmp[1] &^= 0xe0 //zero the bits tmp[1] |= (count << 5) & 0xe0 //set the bits from count p.SetTelegramData(tmp) } func (p *EepD20109) LocalControl() uint8 { return (p.TelegramData()[2] & 0x80) >> 7 } func (p *EepD20109) IOChannel() uint8 { return p.TelegramData()[1] & 0x1f } func (p *EepD20109) SetIOChannel(count uint8) { tmp := p.TelegramData() tmp[1] &^= 0x1f //zero first 5 bits tmp[1] |= count & 0x1f //set the 5 bits from count p.SetTelegramData(tmp) }
jonaz/goenocean
eepd20109.go
GO
mit
1,697
(function (angular) { // Create all modules and define dependencies to make sure they exist // and are loaded in the correct order to satisfy dependency injection // before all nested files are concatenated by Gulp // Config angular.module('df.validator.config', []) .value('df.validator.config', { debug: true }); // Modules angular.module('df.validator.services', []); angular.module('df.validator', [ 'df.validator.config', 'df.validator.services' ]); })(angular); /** * Created by nikita on 12/29/14. */ 'use strict'; angular.module('df.validator') .service('defaultValidationRules', function ($interpolate, $q, $filter, $parse) { function invalid(value, object, options) { var msg = options.message ? options.message : this.message; msg = $interpolate(msg)(angular.extend({value: value, object: object}, options)); throw msg; //return $q.reject(msg); } return { required: { message: 'This field is required', validate: function (value, object, options) { options = options || {}; if (!value || value.length === 0) { return invalid.apply(this, [value, object, options]); } return true; } }, minlength: { message: 'Must be at least {{rule}} characters', validate: function (value, object, options) { options = angular.isObject(options) ? options : {rule: options}; if (!value || value.length < options.rule) { return invalid.apply(this, [value, object, options]); } return true; } }, maxlength: { message: 'Must be fewer than {{rule}} characters', validate: function (value, object, options) { options = angular.isObject(options) ? options : {rule: options}; if (value && value.length > options.rule) { return invalid.apply(this, [value, object, options]); } return true; } }, equal: { message: 'Must be equal', validate: function (value, context, options) { options = angular.isObject(options) ? options : {rule: options}; var secondVal = angular.isObject(options.rule) && options.rule.field ? $parse(options.rule.field)(context) : options.rule; var compareByVal = options.rule.byValue || false; if (compareByVal && value !== secondVal){ return invalid.apply(this, [value, context, options]); } if (!compareByVal && value != secondVal){ return invalid.apply(this, [value, context, options]); } return true; } }, notEqual: { message: 'Must be equal', validate: function (value, context, options) { options = angular.isObject(options) ? options : {rule: options}; var secondVal = angular.isObject(options.rule) && options.rule.field ? $parse(options.rule.field)(context) : options.rule; var compareByVal = options.rule.byValue || false; if (compareByVal && value === secondVal){ return invalid.apply(this, [value, context, options]); } if (!compareByVal && value == secondVal){ return invalid.apply(this, [value, context, options]); } return true; } }, type: { message: 'Must be an {{rule}}', validate: function (value, object, options) { options = angular.isObject(options) ? options : {rule: options}; if (value) { var stringValue = value.toString(); } else { return true; } if (options.rule === 'integer' && stringValue && !stringValue.match(/^\-*[0-9]+$/)) { return invalid.apply(this, [value, object, options]); } if (options.rule === 'number' && stringValue && !stringValue.match(/^\-*[0-9\.]+$/)) { return invalid.apply(this, [value, object, options]); } if (options.rule === 'negative' && stringValue && !stringValue.match(/^\-[0-9\.]+$/)) { return invalid.apply(this, [value, object, options]); } if (options.rule === 'positive' && stringValue && !stringValue.match(/^[0-9\.]+$/)) { return invalid.apply(this, [value, object, options]); } if (options.rule === 'email' && stringValue && !stringValue.match(/^.+@.+$/)) { return invalid.apply(this, [value, object, options]); } if (options.rule === 'phone' && stringValue && !stringValue.match(/^\+?[0-9\-]+\*?$/)) { return invalid.apply(this, [value, object, options]); } return true; } }, pattern: { message: 'Invalid format', validate: function (value, object, options) { options = angular.isObject(options) ? options : {rule: options}; var pattern = options.rule instanceof RegExp ? options.rule : new RegExp(options.rule); if (value && !pattern.exec(value)) { return invalid.apply(this, [value, object, options]); } return true; } }, custom: { message: 'Invalid value', validate: function (value, object, options) { return options.rule(value, object, options); } }, email:{ message: 'Invalid email address', validate: function(value, context, options){ options = angular.isObject(options) ? options : {rule: options}; var emailRe = /^([\w\-_+]+(?:\.[\w\-_+]+)*)@((?:[\w\-]+\.)*\w[\w\-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; value += ''; if ( ! emailRe.test(value) ) return invalid.apply(this, [value, context, options]); if ( /\@.*\@/.test(value) ) return invalid.apply(this, [value, context, options]); if ( /\@.*_/.test(value) ) return invalid.apply(this, [value, context, options]); return true; } }, lessThan: { message: 'This field should be less than {{errorField}}', validate: function (value, context, options) { options = angular.isObject(options) ? options : {rule: options}; options.rule = angular.isString(options.rule) ? options.rule.split(/[ ,;]+/).filter(Boolean) : [options.rule]; var parsedValue = parseFloat(value); var isNumber = true; if (isNaN(parsedValue)){ isNumber = false; } else { value = parsedValue; } for (var i = 0; i < options.rule.length; i++){ var errorName = null; var shouldBeLess = context[options.rule[i]] || options.rule[i]; if (!shouldBeLess){ continue; } if (isNumber) { if (isNaN(parseFloat(shouldBeLess))){ continue; } errorName = shouldBeLess = parseFloat(shouldBeLess); } if (value > shouldBeLess) { //var tmp = $filter('humanize')($filter('tableize')(options.rule[i])); errorName = errorName === null ? $filter('humanize')($filter('tableize')(options.rule[i])) : errorName; return invalid.apply(this, [value, context, angular.extend(options, {errorField: errorName})]); } } return true; } } }; }); /** * Created by nikita */ (function () { 'use strict'; /** * Some of the code below was filched from https://github.com/bvaughn/angular-form-for */ angular.module('df.validator') .service('dfValidationUtils', function () { function dfValidationUtils() { } dfValidationUtils.prototype = { /** * Crawls an object and returns a flattened set of all attributes using dot notation. * This converts an Object like: {foo: {bar: true}, baz: true} * Into an Array like ['foo', 'foo.bar', 'baz'] * @param {Object} object Object to be flattened * @returns {Array} Array of flattened keys (perhaps containing dot notation) */ flattenObjectKeys: function (object) { var keys = []; var queue = [ { object: object, prefix: null } ]; while (true) { if (queue.length === 0) { break; } var data = queue.pop(); var prefix = data.prefix ? data.prefix + '.' : ''; if (typeof data.object === 'object') { for (var prop in data.object) { var path = prefix + prop; keys.push(path); queue.push({ object: data.object[prop], prefix: path }); } } } return keys; } }; return new dfValidationUtils(); }); })(); /** * Created by nikita on 12/29/14. */ angular.module('df.validator') .service('formValidator', function ($q, dfValidationUtils, $parse, validatorRulesCollection) { /** * @class * @constructor */ function FormValidator() { } /** * * @type {FormValidator} */ FormValidator.prototype = { /** * @method * @description * Strip array brackets from field names so that object values can be mapped to rules. * For instance: * 'foo[0].bar' should be validated against 'foo.collection.fields.bar'. */ $getRulesForFieldName: function (validationRules, fieldName) { fieldName = fieldName.replace(/\[[^\]]+\]/g, '.collection.fields'); return $parse(fieldName)(validationRules); }, /** * @method * @description * Validates the object against all rules in the validationRules. * This method returns a promise to be resolved on successful validation, * Or rejected with a map of field-name to error-message. * @param {Object} object Form-data object object is contained within * @param {Object} validationRules Set of named validation rules * @returns {Promise} To be resolved or rejected based on validation success or failure. */ validateAll: function (object, validationRules) { throw 'Not Implemented'; //var fields = dfValidationUtils.flattenObjectKeys(validationRules); //return this.validateFields(object, fields, validationRules); }, /** * @method * @param {*} viewValue * @param {*} modelValue * @param {*} object * @param {string} fieldName * @param {*} validationRules * @return {promise} */ validateField: function (viewValue, modelValue, object, fieldName, validationRules) { validationRules = angular.copy(validationRules); var rules = this.$getRulesForFieldName(validationRules, fieldName); var value = modelValue || viewValue; var validationPromises = []; if (angular.isString(value)) { value = value.replace(/\s+$/, ''); } if (!rules){ return $q.resolve(); } var defer = $q.defer(); (function shiftRule(rules) { var rule = rules.shift(); function processRule(rule) { var returnValue; if (validatorRulesCollection.has(rule.name)) { var validationRule = validatorRulesCollection.get(rule.name); try { returnValue = validationRule.validate(value, object, rule); } catch (error) { return $q.reject(error.message || error || validationRule.message); } if (angular.isObject(returnValue) && angular.isFunction(returnValue.then)) { return returnValue.then( function (reason) { return $q.when(reason); }, function (reason) { return $q.reject(reason || validationRule.message); }); } else if (returnValue) { return $q.when(returnValue); } else { return $q.reject(validationRule.message); } } return $q.reject('Unknown validation rule with name ' + rule.name); } return processRule(rule) .then(function () { if (rules.length === 0) { return defer.resolve(); } return shiftRule(rules); }) .catch(defer.reject); }(rules)); return defer.promise; } }; return new FormValidator(); }) ; /** * Created by nikita on 12/29/14. */ angular.module('df.validator') .service('objectValidator', /** * * @param $q * @param dfValidationUtils * @param $parse * @param {ValidatorRulesCollection} validatorRulesCollection */ function ($q, dfValidationUtils, $parse, validatorRulesCollection) { /** * @class * @constructor */ function ObjectValidator() { } /** * * @type ObjectValidator */ ObjectValidator.prototype = { /** * @method * @description * Strip array brackets from field names so that object values can be mapped to rules. * For instance: * 'foo[0].bar' should be validated against 'foo.collection.fields.bar'. */ $getRulesForFieldName: function (validationRules, fieldName) { fieldName = fieldName.replace(/\[[^\]]+\]/g, '.collection.fields'); return $parse(fieldName)(validationRules); }, /** * @method * @description * Validates the object against all rules in the validationRules. * This method returns a promise to be resolved on successful validation, * Or rejected with a map of field-name to error-message. * @param {Object} object Form-data object object is contained within * @param {Object} validationRules Set of named validation rules * @returns {Promise} To be resolved or rejected based on validation success or failure. */ validateAll: function (object, validationRules) { var fields = dfValidationUtils.flattenObjectKeys(validationRules); return this.validateFields(object, fields, validationRules); }, /** * @method * @description * Validates the values in object with the rules defined in the current validationRules. * This method returns a promise to be resolved on successful validation, * Or rejected with a map of field-name to error-message. * @param {Object} object Form-data object object is contained within * @param {Array} fieldNames Whitelist set of fields to validate for the given object; values outside of this list will be ignored * @param {Object} validationRules Set of named validation rules * @returns {Promise} To be resolved or rejected based on validation success or failure. */ validateFields: function (object, fieldNames, validationRules) { validationRules = angular.copy(validationRules); var deferred = $q.defer(); var promises = []; var errorMap = {}; angular.forEach(fieldNames, function (fieldName) { var rules = this.$getRulesForFieldName(validationRules, fieldName); if (rules) { var promise; promise = this.validateField(object, fieldName, validationRules); promise.then( angular.noop, function (error) { $parse(fieldName).assign(errorMap, error); }); promises.push(promise); } }, this); $q.all(promises).then( deferred.resolve, function () { deferred.reject(errorMap); }); return deferred.promise; }, /** * @method * @param object * @param fieldName * @param validationRules * @return {*} */ validateField: function (object, fieldName, validationRules) { var rules = this.$getRulesForFieldName(validationRules, fieldName); var value = $parse(fieldName)(object); var validationPromises = []; if (angular.isString(value)) { value = value.replace(/\s+$/, ''); } var defer = $q.defer(); (function shiftRule(rules) { var rule = rules.shift(); function processRule(rule) { var returnValue; if (validatorRulesCollection.has(rule.name)) { var validationRule = validatorRulesCollection.get(rule.name); var ruleOptions = rule; try { returnValue = validationRule.validate(value, object, ruleOptions); } catch (error) { return $q.reject(error || validationRule.message); } if (angular.isObject(returnValue) && angular.isFunction(returnValue.then)) { return returnValue.then( function (reason) { return $q.when(reason); }, function (reason) { return $q.reject(reason || validationRule.message); }); } else if (returnValue) { return $q.when(returnValue); } else { return $q.reject(validationRule.message); } } return $q.reject('Unknown validation rule with name ' + ruleName); } return processRule(rules) .then(function () { if (rules.length === 0) { return defer.resolve(); } return shiftRule(rules); }) .catch(defer.reject); }(rules)); return defer.promise; }, /** * Convenience method for determining if the specified collection is flagged as required (aka min length). */ isCollectionRequired: function (fieldName, validationRules) { var rules = this.$getRulesForFieldName(validationRules, fieldName); return rules && rules.collection && rules.collection.min && (angular.isObject(rules.collection.min) ? rules.collection.min.rule : rules.collection.min); }, /** * Convenience method for determining if the specified field is flagged as required. */ isFieldRequired: function (fieldName, validationRules) { var rules = this.$getRulesForFieldName(validationRules, fieldName); return rules && rules.required && (angular.isObject(rules.required) ? rules.required.rule : rules.required); } }; return new ObjectValidator(); }) ; /** * Created by nikita on 12/29/14. */ angular.module('df.validator') .provider('validator', function ($provide) { var schemas = {}; this.add = function (name, schema) { schemas[name] = schema; return this; }; this.addCollection = function (col) { var self = this; angular.forEach(col, function (schema, type) { self.add(type, schema.validators || schema); }); }; this.remove = function (name) { delete schemas[name]; return this; }; this.has = function (name) { return schemas[name] !== undefined; }; this.get = function (name) { return schemas[name] || {}; }; var provider = this; this.$get = /** * * @param $q * @param {ObjectValidator} objectValidator * @param {FormValidator} formValidator * @param {ValidatorRulesCollection} validatorRulesCollection */ function ($q, objectValidator, formValidator, validatorRulesCollection) { /** * @class * @constructor */ function Validator() { } /** * * @type Validator */ Validator.prototype = { add: function add(name, schema) { provider.add(name, schema); return this; }, remove: function remove(name) { provider.remove(name); return this; }, has: function has(name) { return provider.has(name); }, get: function get(name) { return provider.get(name); }, addRule: function addRule(name, rule) { validatorRulesCollection.add(name, rule); return this; }, removeRule: function removeRule(name) { validatorRulesCollection.remove(name); return this; }, hasRule: function hasRule(name) { return validatorRulesCollection.has(name); }, getRule: function getRule(name) { return validatorRulesCollection.get(name); }, getValidationRules: function getValidationRules(schema) { schema = angular.isFunction(schema) ? this.get(schema.constructor.name) : schema; schema = angular.isString(schema) ? this.get(schema) : schema; return schema; }, validate: function validate(object, schema) { schema = angular.isObject(schema) ? schema : this.getValidationRules(schema || object); return objectValidator.validateAll(object, schema); }, validateField: function validateField(object, fields, schema) { var fieldNames = angular.isString(fields) ? [fields] : fields; return objectValidator.validateFields(object, fieldNames, this.getValidationRules(schema || object)); }, validateFormField: function (viewValue, modelValue, model, field, schema) { return formValidator.validateField(viewValue, modelValue, model, field, schema); } }; return new Validator(); }; }); /** * @ngdoc Services * @name ValidatorRulesCollection * @description * ValidatorRulesCollection service used by EntityBundle to manage validation rules by name. */ 'use strict'; angular.module('df.validator') .service('validatorRulesCollection', function ValidatorRulesCollection($q, defaultValidationRules) { var validators = {}; /** * Use this method to add new rule to the validation collection. * @memberof ValidatorRulesCollection */ this.add = function (name, rule) { if (angular.isFunction(rule)) { rule = { message: 'Invalid value', validate: rule }; } if (!angular.isFunction(rule.validate)) { throw 'Invalid validator object type'; } validators[name] = rule; return this; }; /** * Use this method to remove existed rule from the validation collection. * @memberof ValidatorRulesCollection */ this.remove = function (name) { delete validators[name]; return this; }; /** * Use this method to check is rule existe inside the validation collection. * @memberof ValidatorRulesCollection */ this.has = function (name) { return validators[name]; }; /** * Use this method to get the rule from the validation collection. * @memberof ValidatorRulesCollection */ this.get = function (name) { return validators[name]; }; //---- add pre defined validator rules to the validation collection var self = this; angular.forEach(defaultValidationRules, function (rule, name) { self.add(name, rule); }); });
nikita-yaroshevich/df-validator
dist/df-validator.js
JavaScript
mit
24,167
package fr.hmil.roshttp /** Low-level configuration for the HTTP client backend * * @param maxChunkSize Maximum size of each data chunk in streamed requests/responses. * @param internalBufferLength Maximum number of chunks of response data to buffer when the network is faster than what * the stream consumer can handle. * @param allowChunkedRequestBody If set to false, HTTP chunked encoding will be disabled (i.e. the request payload * cannot be streamed). */ class BackendConfig private( val maxChunkSize: Int, val internalBufferLength: Int, val allowChunkedRequestBody: Boolean ) object BackendConfig { def apply( maxChunkSize: Int = 8192, internalBufferLength: Int = 128, allowChunkedRequestBody: Boolean = true ): BackendConfig = new BackendConfig( maxChunkSize = maxChunkSize, internalBufferLength = internalBufferLength, allowChunkedRequestBody = allowChunkedRequestBody ) }
hmil/RosHTTP
shared/src/main/scala/fr/hmil/roshttp/BackendConfig.scala
Scala
mit
1,004
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="layoutclass_pic"><div class="layoutclass_first_pic"><table class="ztable"><tr><th class="ztd1"><b>成語&nbsp;</b></th><td class="ztd2">罪不容宥</td></tr> <tr><th class="ztd1"><b>注音&nbsp;</b></th><td class="ztd2">ㄗㄨㄟ<sup class="subfont">ˋ</sup> ㄅㄨ<sup class="subfont">ˋ</sup> ㄖㄨㄥ<sup class="subfont">ˊ</sup> |ㄡ<sup class="subfont">ˋ</sup></td></tr> <tr><th class="ztd1"><b>漢語拼音&nbsp;</b></th><td class="ztd2"><font class="english_word">zuì bù róng yòu</font></td></tr> <tr><th class="ztd1"><b>釋義&nbsp;</b></th><td class="ztd2"> 義參「<a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000772%22.%26v%3D-1" class="clink" target=_blank>罪不容誅</a>」。見「<a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000772%22.%26v%3D-1" class="clink" target=_blank>罪不容誅</a>」條。</font></td></tr> <tr><th class="ztd1"><b><style>.tableoutfmt2 .std1{width:3%;}</style></b></th><td class="ztd2"><table class="fmt16_table"><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>參考詞語︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" ><a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000772%22.%26v%3D-1" class="clink" target=_blank>罪不容誅</a></td></tr><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>注音︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" >ㄗㄨㄟ<sup class="subfont">ˋ</sup> ㄅㄨ<sup class="subfont">ˋ</sup> ㄖㄨㄥ<sup class="subfont">ˊ</sup> ㄓㄨ</td></tr><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>漢語拼音︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" ><font class="english_word">zuì bù róng zhū</font></td></tr></table><br><br></td></tr> </td></tr></table></div> <!-- layoutclass_first_pic --><div class="layoutclass_second_pic"></div> <!-- layoutclass_second_pic --></div> <!-- layoutclass_pic --></td></tr></table>
BuzzAcademy/idioms-moe-unformatted-data
all-data/3000-3999/3698-34.html
HTML
mit
2,325
//----------------------------------------------------------------------- // <copyright file="JsonExtensionObject.cs" company="NJsonSchema"> // Copyright (c) Rico Suter. All rights reserved. // </copyright> // <license>https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md</license> // <author>Rico Suter, mail@rsuter.com</author> //----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace NJsonSchema { /// <summary>The base JSON class with extension data.</summary> [JsonConverter(typeof(ExtensionDataDeserializationConverter))] public class JsonExtensionObject : IJsonExtensionObject { /// <summary>Gets or sets the extension data (i.e. additional properties which are not directly defined by the JSON object).</summary> [JsonExtensionData] public IDictionary<string, object> ExtensionData { get; set; } } /// <summary>Deserializes all JSON Schemas in the extension data property.</summary> internal class ExtensionDataDeserializationConverter : JsonConverter { public override bool CanRead => true; public override bool CanWrite => false; public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType != JsonToken.Null) { var obj = (IJsonExtensionObject)Activator.CreateInstance(objectType); serializer.Populate(reader, obj); DeserializeExtensionDataSchemas(obj, serializer); return obj; } else { reader.Skip(); return null; } } public override bool CanConvert(Type objectType) { return true; } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { throw new NotImplementedException(); } /// <summary>Transforms the extension data so that contained schemas are correctly deserialized.</summary> /// <param name="extensionObject">The extension object.</param> /// <param name="serializer">The serializer.</param> internal void DeserializeExtensionDataSchemas(IJsonExtensionObject extensionObject, JsonSerializer serializer) { if (extensionObject.ExtensionData != null) { foreach (var pair in extensionObject.ExtensionData.ToArray()) { extensionObject.ExtensionData[pair.Key] = TryDeserializeValueSchemas(pair.Value, serializer); } } } private object TryDeserializeValueSchemas(object value, JsonSerializer serializer) { if (value is JObject obj) { var isSchema = obj.Property("type") != null || obj.Property("properties") != null; if (isSchema) { try { return obj.ToObject<JsonSchema>(serializer); } catch { // object was probably not a JSON Schema } } var dictionary = new Dictionary<string, object>(); foreach (var property in obj.Properties()) { dictionary[property.Name] = TryDeserializeValueSchemas(property.Value, serializer); } return dictionary; } if (value is JArray array) { return array.Select(i => TryDeserializeValueSchemas(i, serializer)).ToArray(); } if (value is JValue token) { return token.Value; } return value; } } }
RSuter/NJsonSchema
src/NJsonSchema/JsonExtensionObject.cs
C#
mit
4,027
package net.sf.esfinge.metadata.examples.validate.field.visibility; import net.sf.esfinge.metadata.examples.validate.field.test.OneAnnotationWithFieldVisibilityRequired; public class VisibilityRequeridValid { @OneAnnotationWithFieldVisibilityRequired private String nome; }
EsfingeFramework/MetadataExamples
Examples/src/test/java/net/sf/esfinge/metadata/examples/validate/field/visibility/VisibilityRequeridValid.java
Java
mit
280
// https://leetcode.com/problems/reverse-vowels-of-a-string/ class Solution { public: bool isVowel(char c) { char check = tolower(c); return (check == 'a') || (check == 'e') || (check == 'i') || (check == 'o') || (check == 'u'); } string reverseVowels(string s) { int front = 0; int back = s.size() - 1; while (front < back) { while (!isVowel(s[front]) && (front < back)) { front++; } while (!isVowel(s[back]) && (front < back)) { back--; } if (front < back) { char temp = s[front]; s[front] = s[back]; s[back] = temp; front++; back--; } } return s; } };
nave7693/leetcode
345-reverse-vowels-of-a-string.cpp
C++
mit
841
<?php return unserialize('a:1:{i:0;O:27:"Doctrine\\ORM\\Mapping\\Column":9:{s:4:"name";s:6:"gender";s:4:"type";s:6:"string";s:6:"length";i:20;s:9:"precision";i:0;s:5:"scale";i:0;s:6:"unique";b:0;s:8:"nullable";b:0;s:7:"options";a:0:{}s:16:"columnDefinition";N;}}');
rajdamaciej/mycms
app/cache/prod/annotations/a9bc4272a8d44f4d80c627b7881525739d669e07$gender.cache.php
PHP
mit
265
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_26) on Sat Nov 05 23:16:32 EST 2011 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck (checkstyle 5.5 API) </TITLE> <META NAME="date" CONTENT="2011-11-05"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck (checkstyle 5.5 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.html" title="class in com.puppycrawl.tools.checkstyle.checks.coding"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?com/puppycrawl/tools/checkstyle/checks/coding/\class-useMissingCtorCheck.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MissingCtorCheck.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck</B></H2> </CENTER> No usage of com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.html" title="class in com.puppycrawl.tools.checkstyle.checks.coding"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?com/puppycrawl/tools/checkstyle/checks/coding/\class-useMissingCtorCheck.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MissingCtorCheck.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2001-2011. All Rights Reserved. </BODY> </HTML>
kentwang/algs4
checkstyle-5.5/site/apidocs/com/puppycrawl/tools/checkstyle/checks/coding/class-use/MissingCtorCheck.html
HTML
mit
6,404
module Gitlab module Devops VERSION = '0.1.2' end end
sanjusoftware/gitlab-devops
lib/gitlab/devops/version.rb
Ruby
mit
62
#!/usr/bin/env python from setuptools import setup, find_packages setup( description='RESTful Nagios/Icinga Livestatus API', author='Christoph Oelmueller', url='https://github.com/zwopiR/lsapi', download_url='https://github.com/zwopiR/lsapi', author_email='christoph@oelmueller.info', version='0.1', install_requires=['flask', 'ConfigParser'], tests_require=['mock', 'nose'], packages=find_packages(exclude=['contrib', 'docs', 'tests*']), scripts=[], name='lsapi' )
zwopiR/lsapi
setup.py
Python
mit
511
from __future__ import unicode_literals from __future__ import absolute_import import json import logging import logging.config import os class AlpineObject(object): """ Base Class of Alpine API objects """ # # alpine alpine version string # _alpine_api_version = "v1" _min_alpine_version = "6.2" def __init__(self, base_url=None, session=None, token=None): self.base_url = base_url self.session = session self.token = token self._setup_logging() # Get loggers from the configuration files(logging.json) if exists # For detail, reference logging.json self.logger = logging.getLogger("debug") # debug def _add_token_to_url(self, url): """ Used internally to properly form URLs. :param str url: An Alpine API URL :return: Formatted URL :rtype str: """ return str("{0}?session_id={1}".format(url, self.token)) @staticmethod def _setup_logging(default_configuration_setting_file='logging.json', default_level=logging.INFO, env_key='LOG_CFG'): """ Sets internal values for logging through a file or an environmental variable :param str default_configuration_setting_file: Path to logging config file. Will be overwritten by environment variable if it exists. :param default_level: See possible levels here: https://docs.python.org/2/library/logging.html#logging-levels :param str env_key: Name of environment variable with logging setting. :return: None """ path = default_configuration_setting_file value = os.getenv(env_key, None) if value: path = value else: pass if os.path.exists(path): with open(path, 'rt') as f: config = json.load(f) logging.config.dictConfig(config) else: logging.basicConfig(level=default_level, format="%(asctime)s %(name)s %(module)s[%(lineno)d] %(levelname)s: %(message)s")
AlpineNow/python-alpine-api
alpine/alpineobject.py
Python
mit
2,190
using System.Collections.Generic; using SchoolSystem.Data.Models; using SchoolSystem.Data.Models.CustomModels; namespace SchoolSystem.Web.Services.Contracts { public interface IMarksManagementService { IEnumerable<SchoolReportCardModel> GetMarks(int subjectId, int classOfStudentsId); void AddMark(string studentId, int subjectId, int markId); IEnumerable<Mark> GetAllMarks(); IEnumerable<StudentMarksModel> GetMarksForStudent(string studentName); } }
HlebForms/SchoolSystemProject
SchoolSystem/SchoolSystem.Web.Services/Contracts/IMarksManagementService.cs
C#
mit
504
import * as $ from 'jquery'; import { Timestamp } from 'index'; export const endlessWaiting = new Promise<void>(() => {}); export function waitDOMContentLoaded(): Promise<void> { return new Promise(resolve => { switch (document.readyState) { case 'interactive': case 'complete': { resolve(); break; } default: { window.addEventListener('DOMContentLoaded', () => resolve()); } break; } }); }; export function waitForSelector(selector: string): Promise<void> { return new Promise(resolve => { const i = setInterval(() => { if ($(selector).length > 0) { clearInterval(i); resolve(); } }, 100); }); } export function wait(ms: number): Promise<void> { return new Promise(resolve => setTimeout(resolve, ms)); } export function clearStyles(element: HTMLElement | Node) { if ('jquery' in element) { throw new Error('`clearStyles` 함수는 인자로 DOM element만 받습니다.'); } const ele = element as HTMLElement; try { for (const child of Array.from(ele.querySelectorAll('*[style]'))) { child.removeAttribute('style'); } for (const image of Array.from(ele.querySelectorAll('img'))) { image.removeAttribute('width'); image.removeAttribute('height'); image.removeAttribute('border'); } for (const table of Array.from(ele.getElementsByTagName('table'))) { table.removeAttribute('width'); table.removeAttribute('height'); } } catch (e) { console.error('스타일 청소에 실패하였습니다.'); console.error('`article.content`를 처리하는 부분이 의심됩니다.'); console.error('청소하려던 element:', ele); console.error('에러:', e); } return ele; } export function getQueryParam(param: string, search: string = location.search): string { const searchParams = new URLSearchParams(search); return searchParams.get(param) || ''; } /** * 작성일, 수정일이 들어있는 문자열을 파싱해서 Timestamp 객체를 반환합니다. * 이 함수는 입력 문자열에 작성일이 수정일보다 앞에 써있을거라고 가정합니다. */ export function parseTimestamp(text: string): Timestamp { const timestamp: Timestamp = {}; const dateRegex = /(\d{4})[\.\s/\-]*(\d{1,2})[\.\s/\-]*(\d{1,2})\s*(?:(\d{1,2})[:\s]+(\d{1,2})(?:[:\s]+(\d{1,2}))?)/g; const [createdText, lastModifiedText] = matchAll(text, dateRegex); if (createdText) timestamp.created = parseTimestamp.getDate(createdText); if (lastModifiedText) timestamp.lastModified = parseTimestamp.getDate(lastModifiedText); return timestamp; } parseTimestamp.getDate = (fragments: string[]): Date => { const [, year, month, date, hour, minute, second] = fragments; const dateText = [year.padStart(4, '0'), month.padStart(2, '0'), date.padStart(2, '0')].join('-'); if (!hour) return new Date(dateText); if (!second) return new Date(`${dateText}T${[hour, minute].map(t => t.padStart(2, '0')).join(':')}`); return new Date(`${dateText}T${[hour, minute, second].map(t => t.padStart(2, '0')).join(':')}`); }; export function matchAll(text: string, regex: RegExp) { const result = []; let match; do { match = regex.exec(text); if (match) result.push(match); } while (match); return result; }
disjukr/jews
src/util.ts
TypeScript
mit
3,495
namespace android.graphics.drawable { [global::MonoJavaBridge.JavaClass()] public partial class AnimationDrawable : android.graphics.drawable.DrawableContainer, java.lang.Runnable, Animatable { internal new static global::MonoJavaBridge.JniGlobalHandle staticClass; static AnimationDrawable() { InitJNI(); } protected AnimationDrawable(global::MonoJavaBridge.JNIEnv @__env) : base(@__env) { } internal static global::MonoJavaBridge.MethodId _run3833; public virtual void run() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._run3833); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._run3833); } internal static global::MonoJavaBridge.MethodId _start3834; public virtual void start() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._start3834); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._start3834); } internal static global::MonoJavaBridge.MethodId _stop3835; public virtual void stop() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._stop3835); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._stop3835); } internal static global::MonoJavaBridge.MethodId _inflate3836; public override void inflate(android.content.res.Resources arg0, org.xmlpull.v1.XmlPullParser arg1, android.util.AttributeSet arg2) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._inflate3836, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2)); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._inflate3836, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2)); } internal static global::MonoJavaBridge.MethodId _unscheduleSelf3837; public override void unscheduleSelf(java.lang.Runnable arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._unscheduleSelf3837, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._unscheduleSelf3837, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } internal static global::MonoJavaBridge.MethodId _setVisible3838; public override bool setVisible(bool arg0, bool arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return @__env.CallBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._setVisible3838, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); else return @__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._setVisible3838, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } internal static global::MonoJavaBridge.MethodId _mutate3839; public override global::android.graphics.drawable.Drawable mutate() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallObjectMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._mutate3839)) as android.graphics.drawable.Drawable; else return global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._mutate3839)) as android.graphics.drawable.Drawable; } internal static global::MonoJavaBridge.MethodId _getDuration3840; public virtual int getDuration(int arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return @__env.CallIntMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._getDuration3840, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); else return @__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._getDuration3840, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } internal static global::MonoJavaBridge.MethodId _isRunning3841; public virtual bool isRunning() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return @__env.CallBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._isRunning3841); else return @__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._isRunning3841); } internal static global::MonoJavaBridge.MethodId _getNumberOfFrames3842; public virtual int getNumberOfFrames() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return @__env.CallIntMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._getNumberOfFrames3842); else return @__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._getNumberOfFrames3842); } internal static global::MonoJavaBridge.MethodId _getFrame3843; public virtual global::android.graphics.drawable.Drawable getFrame(int arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallObjectMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._getFrame3843, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.graphics.drawable.Drawable; else return global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._getFrame3843, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.graphics.drawable.Drawable; } internal static global::MonoJavaBridge.MethodId _isOneShot3844; public virtual bool isOneShot() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) return @__env.CallBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._isOneShot3844); else return @__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._isOneShot3844); } internal static global::MonoJavaBridge.MethodId _setOneShot3845; public virtual void setOneShot(bool arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._setOneShot3845, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._setOneShot3845, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } internal static global::MonoJavaBridge.MethodId _addFrame3846; public virtual void addFrame(android.graphics.drawable.Drawable arg0, int arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) @__env.CallVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable._addFrame3846, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); else @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._addFrame3846, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } internal static global::MonoJavaBridge.MethodId _AnimationDrawable3847; public AnimationDrawable() : base(global::MonoJavaBridge.JNIEnv.ThreadEnv) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.graphics.drawable.AnimationDrawable.staticClass, global::android.graphics.drawable.AnimationDrawable._AnimationDrawable3847); Init(@__env, handle); } private static void InitJNI() { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; global::android.graphics.drawable.AnimationDrawable.staticClass = @__env.NewGlobalRef(@__env.FindClass("android/graphics/drawable/AnimationDrawable")); global::android.graphics.drawable.AnimationDrawable._run3833 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "run", "()V"); global::android.graphics.drawable.AnimationDrawable._start3834 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "start", "()V"); global::android.graphics.drawable.AnimationDrawable._stop3835 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "stop", "()V"); global::android.graphics.drawable.AnimationDrawable._inflate3836 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "inflate", "(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;)V"); global::android.graphics.drawable.AnimationDrawable._unscheduleSelf3837 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "unscheduleSelf", "(Ljava/lang/Runnable;)V"); global::android.graphics.drawable.AnimationDrawable._setVisible3838 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "setVisible", "(ZZ)Z"); global::android.graphics.drawable.AnimationDrawable._mutate3839 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "mutate", "()Landroid/graphics/drawable/Drawable;"); global::android.graphics.drawable.AnimationDrawable._getDuration3840 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "getDuration", "(I)I"); global::android.graphics.drawable.AnimationDrawable._isRunning3841 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "isRunning", "()Z"); global::android.graphics.drawable.AnimationDrawable._getNumberOfFrames3842 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "getNumberOfFrames", "()I"); global::android.graphics.drawable.AnimationDrawable._getFrame3843 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "getFrame", "(I)Landroid/graphics/drawable/Drawable;"); global::android.graphics.drawable.AnimationDrawable._isOneShot3844 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "isOneShot", "()Z"); global::android.graphics.drawable.AnimationDrawable._setOneShot3845 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "setOneShot", "(Z)V"); global::android.graphics.drawable.AnimationDrawable._addFrame3846 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "addFrame", "(Landroid/graphics/drawable/Drawable;I)V"); global::android.graphics.drawable.AnimationDrawable._AnimationDrawable3847 = @__env.GetMethodIDNoThrow(global::android.graphics.drawable.AnimationDrawable.staticClass, "<init>", "()V"); } } }
koush/androidmono
jni/MonoJavaBridge/android/generated/android/graphics/drawable/AnimationDrawable.cs
C#
mit
13,373
module Gitlab # Custom parser for GitLab-flavored Markdown # # It replaces references in the text with links to the appropriate items in # GitLab. # # Supported reference formats are: # * @foo for team members # * #123 for issues # * #JIRA-123 for Jira issues # * !123 for merge requests # * $123 for snippets # * 123456 for commits # # It also parses Emoji codes to insert images. See # http://www.emoji-cheat-sheet.com/ for a list of the supported icons. # # Examples # # >> gfm("Hey @david, can you fix this?") # => "Hey <a href="/u/david">@david</a>, can you fix this?" # # >> gfm("Commit 35d5f7c closes #1234") # => "Commit <a href="/gitlab/commits/35d5f7c">35d5f7c</a> closes <a href="/gitlab/issues/1234">#1234</a>" # # >> gfm(":trollface:") # => "<img alt=\":trollface:\" class=\"emoji\" src=\"/images/trollface.png" title=\":trollface:\" /> module Markdown include IssuesHelper attr_reader :html_options # Public: Parse the provided text with GitLab-Flavored Markdown # # text - the source text # project - extra options for the reference links as given to link_to # html_options - extra options for the reference links as given to link_to def gfm(text, project = @project, html_options = {}) return text if text.nil? # Duplicate the string so we don't alter the original, then call to_str # to cast it back to a String instead of a SafeBuffer. This is required # for gsub calls to work as we need them to. text = text.dup.to_str @html_options = html_options # Extract pre blocks so they are not altered # from http://github.github.com/github-flavored-markdown/ text.gsub!(%r{<pre>.*?</pre>|<code>.*?</code>}m) { |match| extract_piece(match) } # Extract links with probably parsable hrefs text.gsub!(%r{<a.*?>.*?</a>}m) { |match| extract_piece(match) } # Extract images with probably parsable src text.gsub!(%r{<img.*?>}m) { |match| extract_piece(match) } # TODO: add popups with additional information text = parse(text, project) # Insert pre block extractions text.gsub!(/\{gfm-extraction-(\h{32})\}/) do insert_piece($1) end allowed_attributes = ActionView::Base.sanitized_allowed_attributes allowed_tags = ActionView::Base.sanitized_allowed_tags sanitize text.html_safe, attributes: allowed_attributes + %w(id class), tags: allowed_tags + %w(table tr td th) end private def extract_piece(text) @extractions ||= {} md5 = Digest::MD5.hexdigest(text) @extractions[md5] = text "{gfm-extraction-#{md5}}" end def insert_piece(id) @extractions[id] end # Private: Parses text for references and emoji # # text - Text to parse # # Returns parsed text def parse(text, project = @project) parse_references(text, project) if project parse_emoji(text) text end REFERENCE_PATTERN = %r{ (?<prefix>\W)? # Prefix ( # Reference @(?<user>[a-zA-Z][a-zA-Z0-9_\-\.]*) # User name |(?<issue>([A-Z\-]+-)\d+) # JIRA Issue ID |\#(?<issue>([a-zA-Z\-]+-)?\d+) # Issue ID |!(?<merge_request>\d+) # MR ID |\$(?<snippet>\d+) # Snippet ID |(?<commit>[\h]{6,40}) # Commit ID |(?<skip>gfm-extraction-[\h]{6,40}) # Skip gfm extractions. Otherwise will be parsed as commit ) (?<suffix>\W)? # Suffix }x.freeze TYPES = [:user, :issue, :merge_request, :snippet, :commit].freeze def parse_references(text, project = @project) # parse reference links text.gsub!(REFERENCE_PATTERN) do |match| prefix = $~[:prefix] suffix = $~[:suffix] type = TYPES.select{|t| !$~[t].nil?}.first if type identifier = $~[type] # Avoid HTML entities if prefix && suffix && prefix[0] == '&' && suffix[-1] == ';' match elsif ref_link = reference_link(type, identifier, project) "#{prefix}#{ref_link}#{suffix}" else match end else match end end end EMOJI_PATTERN = %r{(:(\S+):)}.freeze def parse_emoji(text) # parse emoji text.gsub!(EMOJI_PATTERN) do |match| if valid_emoji?($2) image_tag(url_to_image("emoji/#{$2}.png"), class: 'emoji', title: $1, alt: $1, size: "20x20") else match end end end # Private: Checks if an emoji icon exists in the image asset directory # # emoji - Identifier of the emoji as a string (e.g., "+1", "heart") # # Returns boolean def valid_emoji?(emoji) Emoji.find_by_name(emoji) end # Private: Dispatches to a dedicated processing method based on reference # # reference - Object reference ("@1234", "!567", etc.) # identifier - Object identifier (Issue ID, SHA hash, etc.) # # Returns string rendered by the processing method def reference_link(type, identifier, project = @project) send("reference_#{type}", identifier, project) end def reference_user(identifier, project = @project) if user = User.find_by(username: identifier) options = html_options.merge( class: "gfm gfm-team_member #{html_options[:class]}" ) link_to("@#{identifier}", user_url(identifier), options) end end def reference_issue(identifier, project = @project) if project.used_default_issues_tracker? || !external_issues_tracker_enabled? if project.issue_exists? identifier url = url_for_issue(identifier, project) title = title_for_issue(identifier) options = html_options.merge( title: "Issue: #{title}", class: "gfm gfm-issue #{html_options[:class]}" ) link_to("##{identifier}", url, options) end elsif project.issues_tracker == 'jira' reference_jira_issue(identifier, project) end end def reference_merge_request(identifier, project = @project) if merge_request = project.merge_requests.find_by(iid: identifier) options = html_options.merge( title: "Merge Request: #{merge_request.title}", class: "gfm gfm-merge_request #{html_options[:class]}" ) url = project_merge_request_url(project, merge_request) link_to("!#{identifier}", url, options) end end def reference_snippet(identifier, project = @project) if snippet = project.snippets.find_by(id: identifier) options = html_options.merge( title: "Snippet: #{snippet.title}", class: "gfm gfm-snippet #{html_options[:class]}" ) link_to("$#{identifier}", project_snippet_url(project, snippet), options) end end def reference_commit(identifier, project = @project) if project.valid_repo? && commit = project.repository.commit(identifier) options = html_options.merge( title: commit.link_title, class: "gfm gfm-commit #{html_options[:class]}" ) link_to(identifier, project_commit_url(project, commit), options) end end def reference_jira_issue(identifier, project = @project) url = url_for_issue(identifier) title = Gitlab.config.issues_tracker[project.issues_tracker]["title"] options = html_options.merge( title: "Issue in #{title}", class: "gfm gfm-issue #{html_options[:class]}" ) link_to("#{identifier}", url, options) end end end
akumetsuv/gitlab
lib/gitlab/markdown.rb
Ruby
mit
7,884
PHP Rest CURL ========= PHP Rest CURL is a wrapper class for PHP, simplifying the typical CRUD requests to the extreme. All the data passed to the server is encoded to JSON and decoded from JSON. ## Getting Started Using it is as simple as can be. ```php <?php require_once('rest.inc.php'); // CALL $result = RestCurl::get("https://api.mongolab.com/api/1/databases/my-db/collections/bookings?apiKey=0123456789abcde"); ``` ## CRUD Methods RestCurl supports the typical CRUD methods (GET, POST, PUT, DELETE) as follows: ```php // GET $result = RestCurl::get($URL, array('id' => 12345678)); // POST $result = RestCurl::post($URL, array('name' => 'RestCurl')); // PUT $result = RestCurl::put($URL, array('$set' => array('version' => 1))); // DELETE $result = RestCurl::delete($URL, array()); ``` The second parameter is an **optional** key/value array. * In GET requests its contents will be translated into query string parameters * `array('id' => '12345678')` will turn the URL into `<url-prefix>/?id=12345678` * If GET parameters are already present in the URL, nothing will be appended * For the rest of methods, the contents of the second parameter will be stringified as **JSON** and passed as the request **body**. ## Return value The previous example: ```php $res = RestCurl::get("https://api.mongolab.com/api/1/databases/my-db/collections/bookings?apiKey=0123456789abcde"); ``` Will assign to $res something like: ```php print_r($res); Array ( [status] => 200 [data] => Array ( [0] => stdClass Object ( [_id] => stdClass Object ( [$oid] => 52476ad1e4b08781144211f3 ) [city] => Barcelona [date] => 2014-03-10 [guest] => Jordi Moraleda [company] => Uniclau ) ) [header] => HTTP/1.1 200 OK Date: Wed, 12 Mar 2014 01:17:53 GMT Server: Apache/2.2.22 (Ubuntu) Expires: Tue, 01 Feb 2000 08:00:00 GMT Last-Modified: Wed, 12 Mar 2014 01:17:53 GMT Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0 Pragma: no-cache X-Frame-Options: DENY Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: * Transfer-Encoding: chunked Content-Type: application/json;charset=utf-8 ) ``` In the array: * `$res['status']` is the HTTP status code. * `$res['data']` is the JSON response parsed into an array * `$res['header']` is a string with the response headers ## Other HTTP methods If you want to use methods besides GET, POST, PUT, DELETE, you can achieve that by just calling: ```php $result = RestCurl::exec('OPTIONS', $URL, array('foo' => 'bar')); ``` ## Dependencies To get PHP Rest Curl working, you will need to install the corresponding package for your platform. #### Debian/Ubuntu sudo apt-get install curl libcurl3 libcurl3-dev php5-curl #### Red Hat/CentOS yum install php-common php-curl #### Mac OS X (development) * Just use [MAMP](http://www.mamp.info/en/). Everything is bundled inside.
ledfusion/php-rest-curl
README.md
Markdown
mit
3,247
var assert = require('assert'); var wdQuery = require('../index.js'); describe('wd-query', function () { describe('injected browser executing a Google Search', function () { var browser, $; before(function(){ browser = this.browser; $ = wdQuery(browser); }); it('performs as expected', function (done) { browser.get('http://google.com') .then(function () { return $('input[name=q]').val('webdriver'); }) .then(function () { return $('input[name=q]').val(); }) .then(function (val) { return assert.equal(val, 'webdriver'); }) .then(function(){ return $('body').isDisplayed(); }) .then(function(isDisplayed){ assert.ok(isDisplayed); done(); }); }); }); });
wookiehangover/wd-query
test/index.js
JavaScript
mit
841
class RenameCommuniqueMessagesToCommuniqueOutgoingMessages < ActiveRecord::Migration def up rename_table :communique_messages, :communique_outgoing_messages end def down rename_table :communique_outgoing_messages, :communique_messages end end
clekstro/communique
db/migrate/20121223140443_rename_communique_messages_to_communique_outgoing_messages.rb
Ruby
mit
260
/* * Copyright 1999-2101 Alibaba Group. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.fastjson.serializer; import java.io.IOException; import java.lang.reflect.Type; import java.util.concurrent.atomic.AtomicLongArray; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.parser.DefaultJSONParser; import com.alibaba.fastjson.parser.JSONToken; import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer; /** * @author wenshao<szujobs@hotmail.com> */ public class AtomicLongArrayCodec implements ObjectSerializer, ObjectDeserializer { public final static AtomicLongArrayCodec instance = new AtomicLongArrayCodec(); public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { SerializeWriter out = serializer.getWriter(); if (object == null) { if (out.isEnabled(SerializerFeature.WriteNullListAsEmpty)) { out.write("[]"); } else { out.writeNull(); } return; } AtomicLongArray array = (AtomicLongArray) object; int len = array.length(); out.append('['); for (int i = 0; i < len; ++i) { long val = array.get(i); if (i != 0) { out.write(','); } out.writeLong(val); } out.append(']'); } @SuppressWarnings("unchecked") public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) { if (parser.getLexer().token() == JSONToken.NULL) { parser.getLexer().nextToken(JSONToken.COMMA); return null; } JSONArray array = new JSONArray(); parser.parseArray(array); AtomicLongArray atomicArray = new AtomicLongArray(array.size()); for (int i = 0; i < array.size(); ++i) { atomicArray.set(i, array.getLong(i)); } return (T) atomicArray; } public int getFastMatchToken() { return JSONToken.LBRACKET; } }
liufeiit/itmarry
source/geek.android/geek/src/com/alibaba/fastjson/serializer/AtomicLongArrayCodec.java
Java
mit
2,667
# 简介 本风格指南的目的是展示AngularJS应用的最佳实践和风格指南。 这些最佳实践来自于: 0. AngularJS项目源码 0. 本人阅读过的源码和文章 0. 本人的实践经历 **说明1**: 这只是风格指南的草案,主要目的是通过交流以消除分歧,进而被社区广泛采纳。 **说明2**: 本版本是翻译自英文原版,在遵循下面的指南之前请确认你看到的是比较新的版本。 在本指南中不会包含基本的JavaScript开发指南。这些基本的指南可以在下面的列表中找到: 0. [Google's JavaScript style guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) 0. [Mozilla's JavaScript style guide](https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style) 0. [GitHub's JavaScript style guide](https://github.com/styleguide/javascript) 0. [Douglas Crockford's JavaScript style guide](http://javascript.crockford.com/code.html) 0. [Airbnb JavaScript style guide](https://github.com/airbnb/javascript) 对于AngularJS开发,推荐 [Google's JavaScript style guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml). 在AngularJS的Github wiki中有一个相似的章节 [ProLoser](https://github.com/ProLoser), 你可以点击[这里](https://github.com/angular/angular.js/wiki)查看。 # 其它翻译版本 - [英语](https://github.com/mgechev/angularjs-style-guide/blob/master/README.md) - [德语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-de-de.md) - [西班牙语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-es-es.md) - [法语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-fr-fr.md) - [印度尼西亚语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-id-id.md) - [意大利语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-it-it.md) - [日语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-ja-jp.md) - [韩语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-ko-kr.md) - [波兰语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-pl-pl.md) - [葡萄牙语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-pt-br.md) - [俄语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-ru-ru.md) - [塞尔维亚语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-sr.md) - [塞尔维亚拉丁语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-sr-lat.md) - [土耳其语](https://github.com/mgechev/angularjs-style-guide/blob/master/README-tr-tr.md) # 内容目录 * [概览](#概览) * [目录结构](#目录结构) * [标记](#标记) * [命名约定](#命名约定) * [其他](#其他) * [模块](#模块) * [控制器](#控制器) * [指令](#指令) * [过滤器](#过滤器) * [服务](#服务) * [模板](#模板) * [路由](#路由) * [国际化](#国际化) * [性能](#性能) * [加入我们](#加入我们) * [贡献者](#贡献者) # 概览 ## 目录结构 由于一个大型的AngularJS应用有较多组成部分,所以最好通过分层的目录结构来组织。 有两个主流的组织方式: * 按照类型优先,业务功能其次的组织方式 这种方式的目录结构看起来如下: ``` . ├── app │   ├── app.js │   ├── controllers │   │   ├── home │   │   │   ├── FirstCtrl.js │   │   │   └── SecondCtrl.js │   │   └── about │   │   └── ThirdCtrl.js │   ├── directives │   │   ├── home │   │   │   └── directive1.js │   │   └── about │   │   ├── directive2.js │   │   └── directive3.js │   ├── filters │   │   ├── home │   │   └── about │   └── services │   ├── CommonService.js │   ├── cache │   │   ├── Cache1.js │   │   └── Cache2.js │   └── models │   ├── Model1.js │   └── Model2.js ├── partials ├── lib └── test ``` * 按照业务功能优先,类型其次的组织方式 如下: ``` . ├── app │   ├── app.js │   ├── common │   │   ├── controllers │   │   ├── directives │   │   ├── filters │   │   └── services │   ├── home │   │   ├── controllers │   │   │   ├── FirstCtrl.js │   │   │   └── SecondCtrl.js │   │   ├── directives │   │   │   └── directive1.js │   │   ├── filters │   │   │   ├── filter1.js │   │   │   └── filter2.js │   │   └── services │   │   ├── service1.js │   │   └── service2.js │   └── about │   ├── controllers │   │   └── ThirdCtrl.js │   ├── directives │   │   ├── directive2.js │   │   └── directive3.js │   ├── filters │   │   └── filter3.js │   └── services │   └── service3.js ├── partials ├── lib └── test ``` * 当目录里有多个单词时, 使用 lisp-case 语法: ``` app ├── app.js └── my-complex-module    ├── controllers    ├── directives    ├── filters    └── services ``` * 在创建指令时,合适的做法是将相关的文件放到同一目录下 (如:模板文件, CSS/SASS 文件, JavaScript文件)。如果你在整个项目周期都选择这种组织方式, ``` app └── directives ├── directive1 │   ├── directive1.html │   ├── directive1.js │   └── directive1.sass └── directive2 ├── directive2.html ├── directive2.js └── directive2.sass ``` 那么,上述的两种目录结构均能适用。 * 组件的单元测试应与组件放置在同一目录下下。在这种方式下,当改变组件时,更加容易找到对应的测试。同时,单元测试也充当了文档和示例。 ``` services ├── cache │   ├── cache1.js │   └── cache1.spec.js └── models ├── model1.js └── model1.spec.js ``` * `app.js`文件包含路由定义、配置和启动说明(如果需要的话)。 * 每一个 JavaScript 文件应该仅包含 **一个组件** 。文件名应该以组件名命名。 * 使用 Angular 项目模板,如 [Yeoman](http://yeoman.io), [ng-boilerplate](http://joshdmiller.github.io/ng-boilerplate/#/home). 组件命名的约定可以在每个组件中看到。 ## 标记 [太长慎读](http://developer.yahoo.com/blogs/ydn/high-performance-sites-rule-6-move-scripts-bottom-7200.html) 把script标签放在文档底部。 ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>MyApp</title> </head> <body> <div ng-app="myApp"> <div ng-view></div> </div> <script src="angular.js"></script> <script src="app.js"></script> </body> </html> ``` 保持标签的简洁并把AngularJS的标签放在标准HTML属性后面。这样提高了代码可读性。标准HTML属性和AngularJS的属性没有混到一起,提高了代码的可维护性。 ```html <form class="frm" ng-submit="login.authenticate()"> <div> <input class="ipt" type="text" placeholder="name" require ng-model="user.name"> </div> </form> ``` 其它的HTML标签应该遵循下面的指南的 [建议](http://mdo.github.io/code-guide/#html-attribute-order) ## 标记 下表展示了各个Angular元素的命名约定 元素 | 命名风格 | 实例 | 用途 ----|------|----|-------- Modules | lowerCamelCase | angularApp | Controllers | Functionality + 'Ctrl' | AdminCtrl | Directives | lowerCamelCase | userInfo | Filters | lowerCamelCase | userFilter | Services | UpperCamelCase | User | constructor Services | lowerCamelCase | dataFactory | others ## 其他 * 使用: * `$timeout` 替代 `setTimeout` * `$interval` instead of `setInterval` * `$window` 替代 `window` * `$document` 替代 `document` * `$http` 替代 `$.ajax` 这将使你更易于在测试时处理代码异常 (例如:你在 `setTimeout` 中忘记 `$scope.$apply`) 使用如下工具自动化你的工作流 * [Yeoman](http://yeoman.io) * [Gulp](http://gulpjs.com) * [Grunt](http://gruntjs.com) * [Bower](http://bower.io) * 使用 promise (`$q`) 而非回调。这将使你的代码更加优雅、直观,并且免于回调地狱。 * 尽可能使用 `$resource` 而非 `$http`。更高的抽象可以避免冗余。 * 使用AngularJS的预压缩版 (像 [ngmin](https://github.com/btford/ngmin) 或 [ng-annotate](https://github.com/olov/ng-annotate)) 避免在压缩之后出现问题。 * 不要使用全局变量或函数。通过依赖注入解决所有依赖,这可以减少 bug ,规避很多测试时的麻烦。 * 为避免使用全局变量或函数,可以借助 Grunt 或 Gulp 把你的代码放到一个立即执行的函数表达式(IIFE)中。可用的插件有 [grunt-wrap](https://www.npmjs.com/package/grunt-wrap) 或 [gulp-wrap](https://www.npmjs.com/package/gulp-wrap/)。下面是 Gulp 的示例: ```Javascript gulp.src("./src/*.js") .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();')) .pipe(gulp.dest("./dist")); ``` * 不要污染 `$scope`。仅添加与视图相关的函数和变量。 * [使用 controllers 而非 `ngInit`](https://github.com/angular/angular.js/pull/4366/files)。`ngInit` 只有在一种情况下的使用是合适的:用来给 `ngRepeat`的特殊属性赋予一个别名。除此之外, 你应该使用 controllers 而不是 `ngInit` 来初始化scope变量。`ngInit` 中的表达式会传递给 Angular 的 `$parse` 服务,通过词法分析,语法分析,求值等过程。这会导致: - 对性能的巨大影响,因为解释器由 Javascript 写成 - 多数情况下,`$parse` 服务中对表达式的缓存基本不起作用,因为 `ngInit` 表达式经常只有一次求值 - 很容易出错,因为是模板中写字符串,没有针对表达式的语法高亮和进一步的编辑器支持 - 不会抛出运行时错误 * 不要使用 `$` 前缀来命名变量, 属性和方法. 这种前缀是预留给 AngularJS 来使用的. * 当使用 DI 机制来解决依赖关系, 要根据他们的类型进行排序 - AngularJS 内建的依赖要优先, 之后才是你自定义的: ```javascript module.factory('Service', function ($rootScope, $timeout, MyCustomDependency1, MyCustomDependency2) { return { //Something }; }); ``` # 模块 * 模块应该用驼峰式命名。为表明模块 `b` 是模块 `a` 的子模块, 可以用点号连接: `a.b` 。 有两种常见的组织模块的方式: 0. 按照功能组织 0. 按照组件类型组织 当前并无太大差别,但前者更加清晰。同时,如果 lazy-loading modules 被实现的话 (当前并未列入 AngularJS 的路线图),这种方式将改善应用的性能。 # 控制器 * 不要在控制器里操作 DOM,这会让你的控制器难以测试,而且违背了[关注点分离原则](https://en.wikipedia.org/wiki/Separation_of_concerns)。应该通过指令操作 DOM。 * 通过控制器完成的功能命名控制器 (如:购物卡,主页,控制板),并以字符串`Ctrl`结尾。 * 控制器是纯 Javascript [构造函数](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor),所以应该用首字母大写的驼峰命名法(`HomePageCtrl`, `ShoppingCartCtrl`, `AdminPanelCtrl`, 等等)。 * 控制器不应该在全局中定义 (尽管 AngularJS 允许,但污染全局命名空间是个糟糕的实践)。 * 使用以下语法定义控制器: ```JavaScript function MyCtrl(dependency1, dependency2, ..., dependencyn) { // ... } module.controller('MyCtrl', MyCtrl); ``` 为了避免在压缩代码时产生问题,你可以使用工具自动生成标准的数组定义式语法,如:[ng-annotate](https://github.com/olov/ng-annotate) (还有 grunt 任务 [grunt-ng-annotate](https://github.com/mzgol/grunt-ng-annotate)) * 使用 `controller as` 语法: ``` <div ng-controller="MainCtrl as main"> {{ main.title }} </div> ``` ```JavaScript app.controller('MainCtrl', MainCtrl); function MainCtrl () { this.title = 'Some title'; } ``` 使用 `controller as` 主要的优点是: * 创建了一个“独立”的组件——绑定的属性不属于 `$scope` 原型链。这是一个很好的实践,因为 `$scope` 原型继承有一些重要的缺点(这可能是为什么它在 Angular 2 中被移除了): * Scope值的改变会在你不注意的地方有影响。 * 难以重构。 * [dot rule](http://jimhoskins.com/2012/12/14/nested-scopes-in-angularjs.html)'. * 当你不需要做必须由 `$scope` 完成的操作(比如`$scope.$broadcast`)时,移除掉了 `$scope`,就是为 Angular2 做好准备。 * 语法上更接近于普通的 JavaScript 构造函数。 想深入了解 `controller as` ,请看: [digging-into-angulars-controller-as-syntax](http://toddmotto.com/digging-into-angulars-controller-as-syntax/) * 如果使用数组定义语法声明控制器,使用控制器依赖的原名。这将提高代码的可读性: ```JavaScript function MyCtrl(s) { // ... } module.controller('MyCtrl', ['$scope', MyCtrl]); ``` 下面的代码更易理解 ```JavaScript function MyCtrl($scope) { // ... } module.controller('MyCtrl', ['$scope', MyCtrl]); ``` 对于包含大量代码的需要上下滚动的文件尤其适用。这可能使你忘记某一变量是对应哪一个依赖。 * 尽可能的精简控制器。将通用函数抽象为独立的服务。 * 不要再控制器中写业务逻辑。把业务逻辑交给模型层的服务。 举个例子: ```Javascript // 这是把业务逻辑放在控制器的常见做法 angular.module('Store', []) .controller('OrderCtrl', function ($scope) { $scope.items = []; $scope.addToOrder = function (item) { $scope.items.push(item);//-->控制器中的业务逻辑 }; $scope.removeFromOrder = function (item) { $scope.items.splice($scope.items.indexOf(item), 1);//-->控制器中的业务逻辑 }; $scope.totalPrice = function () { return $scope.items.reduce(function (memo, item) { return memo + (item.qty * item.price);//-->控制器中的业务逻辑 }, 0); }; }); ``` 当你把业务逻辑交给模型层的服务,控制器看起来就会想这样:(关于 service-model 的实现,参看 'use services as your Model'): ```Javascript // Order 在此作为一个 'model' angular.module('Store', []) .controller('OrderCtrl', function (Order) { $scope.items = Order.items; $scope.addToOrder = function (item) { Order.addToOrder(item); }; $scope.removeFromOrder = function (item) { Order.removeFromOrder(item); }; $scope.totalPrice = function () { return Order.total(); }; }); ``` 为什么控制器不应该包含业务逻辑和应用状态? * 控制器会在每个视图中被实例化,在视图被销毁时也要同时销毁 * 控制器是不可重用的——它与视图有耦合 * Controllers are not meant to be injected * 需要进行跨控制器通讯时,通过方法引用(通常是子控制器到父控制器的通讯)或者 `$emit`, `$broadcast` 及 `$on` 方法。发送或广播的消息应该限定在最小的作用域。 * 制定一个通过 `$emit`, `$broadcast` 发送的消息列表并且仔细的管理以防命名冲突和bug。 Example: ```JavaScript // app.js /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Custom events: - 'authorization-message' - description of the message - { user, role, action } - data format - user - a string, which contains the username - role - an ID of the role the user has - action - specific ation the user tries to perform * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ``` * 在需要格式化数据时将格式化逻辑封装成 [过滤器](#过滤器) 并将其声明为依赖: ```JavaScript function myFormat() { return function () { // ... }; } module.filter('myFormat', myFormat); function MyCtrl($scope, myFormatFilter) { // ... } module.controller('MyCtrl', MyCtrl); ``` * 有内嵌的控制器时使用 "内嵌作用域" ( `controllerAs` 语法): **app.js** ```javascript module.config(function ($routeProvider) { $routeProvider .when('/route', { templateUrl: 'partials/template.html', controller: 'HomeCtrl', controllerAs: 'home' }); }); ``` **HomeCtrl** ```javascript function HomeCtrl() { this.bindingValue = 42; } ``` **template.html** ``` <div ng-bind="home.bindingValue"></div> ``` # 指令 * 使用小写字母开头的驼峰法命名指令。 * 在 link function 中使用 `scope` 而非 `$scope`。在 compile 中, 你已经定义参数的 post/pre link functions 将在函数被执行时传递, 你无法通过依赖注入改变他们。这种方式同样应用在 AngularJS 项目中。 * 为你的指令添加自定义前缀以免与第三方指令冲突。 * 不要使用 `ng` 或 `ui` 前缀,因为这些备用于 AngularJS 和 AngularJS UI。 * DOM 操作只通过指令完成。 * 为你开发的可复用组件创建独立作用域。 * 以属性和元素形式使用指令,而不是注释和 class。这会使你的代码可读性更高。 * 使用 `scope.$on('$destroy', fn)` 来清除。这点在使用第三方指令的时候特别有用。 * 处理不可信的数据时,不要忘记使用 `$sce` 。 # 过滤器 * 使用小写字母开头的驼峰法命名过滤器。 * 尽可能使过滤器精简。过滤器在 `$digest` loop 中被频繁调用,过于复杂的过滤器将使得整个应用缓慢。 * 在过滤器中只做一件事。更加复杂的操作可以用 pipe 串联多个过滤器来实现。 # 服务 这个部分包含了 AngularJS 服务组件的相关信息。下面提到的东西与定义服务的具体方式(`.provider`, `.factory`, `.service` 等)无关,除非有特别提到。 * 用驼峰法命名服务。 * 用首字母大写的驼峰法命名你自己的服务, 把服务写成构造函数的形式,例如: ```JavaScript function MainCtrl($scope, User) { $scope.user = new User('foo', 42); } module.controller('MainCtrl', MainCtrl); function User(name, age) { this.name = name; this.age = age; } module.factory('User', function () { return User; }); ``` * 用首字母小写的驼峰法命名其它所有的服务。 * 把业务逻辑封装到服务中,把业务逻辑抽象为服务作为你的 `model`。例如: ```Javascript //Order is the 'model' angular.module('Store') .factory('Order', function () { var add = function (item) { this.items.push (item); }; var remove = function (item) { if (this.items.indexOf(item) > -1) { this.items.splice(this.items.indexOf(item), 1); } }; var total = function () { return this.items.reduce(function (memo, item) { return memo + (item.qty * item.price); }, 0); }; return { items: [], addToOrder: add, removeFromOrder: remove, totalPrice: total }; }); ``` 如果需要例子展现如何在控制器中使用服务,请参考 'Avoid writing business logic inside controllers'。 * 将业务逻辑封装成 `service` 而非 `factory`,这样我们可以更容易在服务间实现“经典式”继承: ```JavaScript function Human() { //body } Human.prototype.talk = function () { return "I'm talking"; }; function Developer() { //body } Developer.prototype = Object.create(Human.prototype); Developer.prototype.code = function () { return "I'm coding"; }; myModule.service('human', Human); myModule.service('developer', Developer); ``` * 使用 `$cacheFactory` 进行会话级别的缓存,缓存网络请求或复杂运算的结果。 * 如果给定的服务需要配置,把配置相关代码放在 `config` 回调里,就像这样: ```JavaScript angular.module('demo', []) .config(function ($provide) { $provide.provider('sample', function () { var foo = 42; return { setFoo: function (f) { foo = f; }, $get: function () { return { foo: foo }; } }; }); }); var demo = angular.module('demo'); demo.config(function (sampleProvider) { sampleProvider.setFoo(41); }); ``` # 模板 * 使用 `ng-bind` 或者 `ng-cloak` 而非简单的 `{{ }}` 以防止页面渲染时的闪烁。 * 避免在模板中使用复杂的表达式。 * 当需要动态设置 <img> 的 `src` 时使用 `ng-src` 而非 `src` 中嵌套 `{{}}` 的模板。 * 当需要动态设置<a>的 `href` 时使用 `ng-href` 而非 `href` 中嵌套 `{{ }}` 的模板。 * 通过 `ng-style` 指令配合对象式参数和 scope 变量来动态设置元素样式,而不是将 scope 变量作为字符串通过 `{{ }}` 用于 `style` 属性。 ```HTML <script> ... $scope.divStyle = { width: 200, position: 'relative' }; ... </script> <div ng-style="divStyle">my beautifully styled div which will work in IE</div>; ``` # 路由 * 在视图展示之前通过 `resolve` 解决依赖。 * 不要在 `resolve` 回调函数中显式使用RESTful调用。将所有请求放在合适的服务中。这样你就可以使用缓存和遵循关注点分离原则。 # 国际化 * 在较新版本的 Angular(>=1.4.0)下,使用内置的 i18n 工具,在较老版本下(<1.4.0),使用 [`angular-translate`](https://github.com/angular-translate/angular-translate)。 # 性能 * 优化 digest cycle * 只监听必要的变量。仅在必要时显式调用 `$digest` 循环(例如:在进行实时通讯时,不要在每次接收到消息时触发 `$digest` 循环)。 * 对于那些只初始化一次并不再改变的内容, 使用一次性 watcher [`bindonce`](https://github.com/Pasvaz/bindonce) (对于早期的 AngularJS)。如果是 AngularJS >=1.3.0 的版本,应使用Angular内置的一次性数据绑定(One-time bindings). * 尽可能使 `$watch` 中的运算简单。在单个 `$watch` 中进行繁杂的运算将使得整个应用变慢(由于JavaScript的单线程特性,`$digest` loop 只能在单一线程进行) * 当监听集合时, 如果不是必要的话不要深度监听. 最好使用 `$watchCollection`, 对监听的表达式和之前表达式的值进行浅层的检测. * 当没有变量被 `$timeout` 回调函数所影响时,在 `$timeout` 设置第三个参数为 false 来跳过 `$digest` 循环. * 当面对超大不太改变的集合, [使用 immutable data structures](http://blog.mgechev.com/2015/03/02/immutability-in-angularjs-immutablejs/). * 用打包、缓存html模板文件到你的主js文件中,减少网络请求, 可以用 [grunt-html2js](https://github.com/karlgoldstein/grunt-html2js) / [gulp-html2js](https://github.com/fraserxu/gulp-html2js). 详见 [这里](http://ng-learn.org/2014/08/Populating_template_cache_with_html2js/) 和 [这里](http://slides.com/yanivefraim-1/real-world-angularjs#/34) 。 在项目有很多小html模板并可以放进主js文件中时(通过minify和gzip压缩),这个办法是很有用的。 # 加入我们 本指南是社区驱动产生的,欢迎贡献你的一份力量。 比如,通过扩展测试部分或翻译为你使用的语言都是很好的方式。 # 贡献者 [<img alt="mgechev" src="https://avatars.githubusercontent.com/u/455023?v=3&s=117" width="117">](https://github.com/mgechev) |[<img alt="morizotter" src="https://avatars.githubusercontent.com/u/536954?v=3&s=117" width="117">](https://github.com/morizotter) |[<img alt="pascalockert" src="https://avatars.githubusercontent.com/u/4253438?v=3&s=117" width="117">](https://github.com/pascalockert) |[<img alt="yanivefraim" src="https://avatars.githubusercontent.com/u/1336186?v=3&s=117" width="117">](https://github.com/yanivefraim) |[<img alt="ericguirbal" src="https://avatars.githubusercontent.com/u/322135?v=3&s=117" width="117">](https://github.com/ericguirbal) |[<img alt="agnislav" src="https://avatars.githubusercontent.com/u/364255?v=3&s=117" width="117">](https://github.com/agnislav) | :---: |:---: |:---: |:---: |:---: |:---: | [mgechev](https://github.com/mgechev) |[morizotter](https://github.com/morizotter) |[pascalockert](https://github.com/pascalockert) |[yanivefraim](https://github.com/yanivefraim) |[ericguirbal](https://github.com/ericguirbal) |[agnislav](https://github.com/agnislav) | [<img alt="ray7551" src="https://avatars.githubusercontent.com/u/1812388?v=3&s=117" width="117">](https://github.com/ray7551) |[<img alt="mainyaa" src="https://avatars.githubusercontent.com/u/800781?v=3&s=117" width="117">](https://github.com/mainyaa) |[<img alt="elfinxx" src="https://avatars.githubusercontent.com/u/4384908?v=3&s=117" width="117">](https://github.com/elfinxx) |[<img alt="Xuefeng-Zhu" src="https://avatars.githubusercontent.com/u/5875315?v=3&s=117" width="117">](https://github.com/Xuefeng-Zhu) |[<img alt="rubystream" src="https://avatars.githubusercontent.com/u/3200?v=3&s=117" width="117">](https://github.com/rubystream) |[<img alt="SullyP" src="https://avatars.githubusercontent.com/u/12484363?v=3&s=117" width="117">](https://github.com/SullyP) | :---: |:---: |:---: |:---: |:---: |:---: | [ray7551](https://github.com/ray7551) |[mainyaa](https://github.com/mainyaa) |[elfinxx](https://github.com/elfinxx) |[Xuefeng-Zhu](https://github.com/Xuefeng-Zhu) |[rubystream](https://github.com/rubystream) |[SullyP](https://github.com/SullyP) | [<img alt="giacomocusinato" src="https://avatars.githubusercontent.com/u/7659518?v=3&s=117" width="117">](https://github.com/giacomocusinato) |[<img alt="susieyy" src="https://avatars.githubusercontent.com/u/62295?v=3&s=117" width="117">](https://github.com/susieyy) |[<img alt="lukaszklis" src="https://avatars.githubusercontent.com/u/11782?v=3&s=117" width="117">](https://github.com/lukaszklis) |[<img alt="cironunes" src="https://avatars.githubusercontent.com/u/469908?v=3&s=117" width="117">](https://github.com/cironunes) |[<img alt="cavarzan" src="https://avatars.githubusercontent.com/u/3915288?v=3&s=117" width="117">](https://github.com/cavarzan) |[<img alt="guiltry" src="https://avatars.githubusercontent.com/u/1484308?v=3&s=117" width="117">](https://github.com/guiltry) | :---: |:---: |:---: |:---: |:---: |:---: | [giacomocusinato](https://github.com/giacomocusinato) |[susieyy](https://github.com/susieyy) |[lukaszklis](https://github.com/lukaszklis) |[cironunes](https://github.com/cironunes) |[cavarzan](https://github.com/cavarzan) |[guiltry](https://github.com/guiltry) | [<img alt="MertSKaan" src="https://avatars.githubusercontent.com/u/5517637?v=3&s=117" width="117">](https://github.com/MertSKaan) |[<img alt="mingchen" src="https://avatars.githubusercontent.com/u/1002838?v=3&s=117" width="117">](https://github.com/mingchen) |[<img alt="tornad" src="https://avatars.githubusercontent.com/u/2128499?v=3&s=117" width="117">](https://github.com/tornad) |[<img alt="jmblog" src="https://avatars.githubusercontent.com/u/86085?v=3&s=117" width="117">](https://github.com/jmblog) |[<img alt="kuzzmi" src="https://avatars.githubusercontent.com/u/1727140?v=3&s=117" width="117">](https://github.com/kuzzmi) |[<img alt="nikshulipa" src="https://avatars.githubusercontent.com/u/1872256?v=3&s=117" width="117">](https://github.com/nikshulipa) | :---: |:---: |:---: |:---: |:---: |:---: | [MertSKaan](https://github.com/MertSKaan) |[mingchen](https://github.com/mingchen) |[tornad](https://github.com/tornad) |[jmblog](https://github.com/jmblog) |[kuzzmi](https://github.com/kuzzmi) |[nikshulipa](https://github.com/nikshulipa) | [<img alt="astalker" src="https://avatars.githubusercontent.com/u/1486567?v=3&s=117" width="117">](https://github.com/astalker) |[<img alt="clbn" src="https://avatars.githubusercontent.com/u/1071933?v=3&s=117" width="117">](https://github.com/clbn) |[<img alt="atodorov" src="https://avatars.githubusercontent.com/u/1002300?v=3&s=117" width="117">](https://github.com/atodorov) |[<img alt="apetro" src="https://avatars.githubusercontent.com/u/952283?v=3&s=117" width="117">](https://github.com/apetro) |[<img alt="valgreens" src="https://avatars.githubusercontent.com/u/903263?v=3&s=117" width="117">](https://github.com/valgreens) |[<img alt="kirstein" src="https://avatars.githubusercontent.com/u/426442?v=3&s=117" width="117">](https://github.com/kirstein) | :---: |:---: |:---: |:---: |:---: |:---: | [astalker](https://github.com/astalker) |[clbn](https://github.com/clbn) |[atodorov](https://github.com/atodorov) |[apetro](https://github.com/apetro) |[valgreens](https://github.com/valgreens) |[kirstein](https://github.com/kirstein) | [<img alt="meetbryce" src="https://avatars.githubusercontent.com/u/1845143?v=3&s=117" width="117">](https://github.com/meetbryce) |[<img alt="dchest" src="https://avatars.githubusercontent.com/u/52677?v=3&s=117" width="117">](https://github.com/dchest) |[<img alt="gsamokovarov" src="https://avatars.githubusercontent.com/u/604618?v=3&s=117" width="117">](https://github.com/gsamokovarov) |[<img alt="grvcoelho" src="https://avatars.githubusercontent.com/u/7416751?v=3&s=117" width="117">](https://github.com/grvcoelho) |[<img alt="bargaorobalo" src="https://avatars.githubusercontent.com/u/993001?v=3&s=117" width="117">](https://github.com/bargaorobalo) |[<img alt="hermankan" src="https://avatars.githubusercontent.com/u/2899106?v=3&s=117" width="117">](https://github.com/hermankan) | :---: |:---: |:---: |:---: |:---: |:---: | [meetbryce](https://github.com/meetbryce) |[dchest](https://github.com/dchest) |[gsamokovarov](https://github.com/gsamokovarov) |[grvcoelho](https://github.com/grvcoelho) |[bargaorobalo](https://github.com/bargaorobalo) |[hermankan](https://github.com/hermankan) | [<img alt="jabhishek" src="https://avatars.githubusercontent.com/u/1830537?v=3&s=117" width="117">](https://github.com/jabhishek) |[<img alt="jesselpalmer" src="https://avatars.githubusercontent.com/u/682097?v=3&s=117" width="117">](https://github.com/jesselpalmer) |[<img alt="capaj" src="https://avatars.githubusercontent.com/u/1305378?v=3&s=117" width="117">](https://github.com/capaj) |[<img alt="johnnyghost" src="https://avatars.githubusercontent.com/u/1117330?v=3&s=117" width="117">](https://github.com/johnnyghost) |[<img alt="jordanyee" src="https://avatars.githubusercontent.com/u/3303098?v=3&s=117" width="117">](https://github.com/jordanyee) |[<img alt="nacyot" src="https://avatars.githubusercontent.com/u/148919?v=3&s=117" width="117">](https://github.com/nacyot) | :---: |:---: |:---: |:---: |:---: |:---: | [jabhishek](https://github.com/jabhishek) |[jesselpalmer](https://github.com/jesselpalmer) |[capaj](https://github.com/capaj) |[johnnyghost](https://github.com/johnnyghost) |[jordanyee](https://github.com/jordanyee) |[nacyot](https://github.com/nacyot) | [<img alt="mariolamacchia" src="https://avatars.githubusercontent.com/u/6282722?v=3&s=117" width="117">](https://github.com/mariolamacchia) |[<img alt="mischkl" src="https://avatars.githubusercontent.com/u/8177979?v=3&s=117" width="117">](https://github.com/mischkl) |[<img alt="dwmkerr" src="https://avatars.githubusercontent.com/u/1926984?v=3&s=117" width="117">](https://github.com/dwmkerr) |[<img alt="mo-gr" src="https://avatars.githubusercontent.com/u/95577?v=3&s=117" width="117">](https://github.com/mo-gr) |[<img alt="cryptojuice" src="https://avatars.githubusercontent.com/u/458883?v=3&s=117" width="117">](https://github.com/cryptojuice) |[<img alt="dreame4" src="https://avatars.githubusercontent.com/u/277870?v=3&s=117" width="117">](https://github.com/dreame4) | :---: |:---: |:---: |:---: |:---: |:---: | [mariolamacchia](https://github.com/mariolamacchia) |[mischkl](https://github.com/mischkl) |[dwmkerr](https://github.com/dwmkerr) |[mo-gr](https://github.com/mo-gr) |[cryptojuice](https://github.com/cryptojuice) |[dreame4](https://github.com/dreame4) | [<img alt="olov" src="https://avatars.githubusercontent.com/u/19247?v=3&s=117" width="117">](https://github.com/olov) |[<img alt="vorktanamobay" src="https://avatars.githubusercontent.com/u/2623355?v=3&s=117" width="117">](https://github.com/vorktanamobay) |[<img alt="sahat" src="https://avatars.githubusercontent.com/u/544954?v=3&s=117" width="117">](https://github.com/sahat) |[<img alt="ganchiku" src="https://avatars.githubusercontent.com/u/149973?v=3&s=117" width="117">](https://github.com/ganchiku) |[<img alt="kaneshin" src="https://avatars.githubusercontent.com/u/936972?v=3&s=117" width="117">](https://github.com/kaneshin) |[<img alt="imaimiami" src="https://avatars.githubusercontent.com/u/2256037?v=3&s=117" width="117">](https://github.com/imaimiami) | :---: |:---: |:---: |:---: |:---: |:---: | [olov](https://github.com/olov) |[vorktanamobay](https://github.com/vorktanamobay) |[sahat](https://github.com/sahat) |[ganchiku](https://github.com/ganchiku) |[kaneshin](https://github.com/kaneshin) |[imaimiami](https://github.com/imaimiami) | [<img alt="dooart" src="https://avatars.githubusercontent.com/u/371426?v=3&s=117" width="117">](https://github.com/dooart) |[<img alt="thomastuts" src="https://avatars.githubusercontent.com/u/1914255?v=3&s=117" width="117">](https://github.com/thomastuts) |[<img alt="VladimirKazan" src="https://avatars.githubusercontent.com/u/3514422?v=3&s=117" width="117">](https://github.com/VladimirKazan) |[<img alt="andela-abankole" src="https://avatars.githubusercontent.com/u/11836769?v=3&s=117" width="117">](https://github.com/andela-abankole) |[<img alt="grapswiz" src="https://avatars.githubusercontent.com/u/309459?v=3&s=117" width="117">](https://github.com/grapswiz) |[<img alt="coderhaoxin" src="https://avatars.githubusercontent.com/u/2569835?v=3&s=117" width="117">](https://github.com/coderhaoxin) | :---: |:---: |:---: |:---: |:---: |:---: | [dooart](https://github.com/dooart) |[thomastuts](https://github.com/thomastuts) |[VladimirKazan](https://github.com/VladimirKazan) |[andela-abankole](https://github.com/andela-abankole) |[grapswiz](https://github.com/grapswiz) |[coderhaoxin](https://github.com/coderhaoxin) | [<img alt="ntaoo" src="https://avatars.githubusercontent.com/u/511213?v=3&s=117" width="117">](https://github.com/ntaoo) |[<img alt="kuzmeig1" src="https://avatars.githubusercontent.com/u/8707951?v=3&s=117" width="117">](https://github.com/kuzmeig1) | :---: |:---: | [ntaoo](https://github.com/ntaoo) |[kuzmeig1](https://github.com/kuzmeig1) |
chatii2412/angularjs-style-guide
README-zh-cn.md
Markdown
mit
35,522
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>最短路径 | chenfy27的博客</title> <meta name="author" content="chenfy27"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta property="og:site_name" content="chenfy27的博客"/> <meta property="og:image" content=""/> <link href="/favicon.png" rel="icon"> <!-- CSS --> <link rel="stylesheet" href="/css/themes/yeti.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/font-awesome.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/style.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/responsive.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/highlight.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/highlight-default.min.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/google-fonts.css" media="screen" type="text/css"> <link rel="stylesheet" href="/css/comment.css" media="screen" type="text/css"> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script> <![endif]--> <script src="/js/jquery-2.0.3.min.js"></script> <script src="/js/marked.js"></script> <script src="/js/comment.js"></script> <script src="/js/timeago.min.js"></script> <script src="/js/highlight.min.js"></script> <script src="/js/spin.min.js"></script> <!-- analytics --> </head> <body> <nav id="main-nav" class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <button type="button" class="navbar-header 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="/">chenfy27的博客</a> <div class="collapse navbar-collapse nav-menu"> <ul class="nav navbar-nav"> <li> <a href="/archives" title="All the articles."> <i class="fa fa-archive"></i>归档 </a> </li> <li> <a href="/categories" title="All the categories."> <i class="fa fa-folder"></i>分类 </a> </li> <li> <a href="/tags" title="All the tags."> <i class="fa fa-tags"></i>标签 </a> </li> <li> <a href="/about" title="About me."> <i class="fa fa-user"></i>关于 </a> </li> </ul> </div> </div> <!-- container --> </nav> <div class="clearfix"></div> <div class="container"> <div class="content"> <!-- title --> <div class="page-header "> <h1 class="archive-title-tag title ">最短路径</h1> </div> <div class="row page"> <!-- cols --> <div class="col-md-9"> <div id="top_search"></div> <!-- display as entry --> <div class="mypage"> <!-- display as entry --> <h3 class="title"> <div class="date"> 2016-08-29 </div> <div class="article-title"><a href="/2016/08/29/shortest-path/" >常用的最短路径算法</a></div> </h3> <div class="entry"> <div class="row"> <h3 id="floyd算法"><a href="#floyd算法" class="headerlink" title="floyd算法"></a>floyd算法</h3><p>floyd算法用于求加权图中任意两点之间的最短路径,即多源最短路,是动态规划思想的一个典型应用。</p> <h4 id="算法流程"><a href="#算法流程" class="headerlink" title="算法流程"></a>算法流程</h4><ul> <li>初始化任意两点之间的距离为正无穷;</li> <li>加入一个点,遍历任意两点的距离,检查两点之间如果经过新加点的话路径是否会缩短,如果会则更新;</li> <li>重复上一步直到所有点都加完;</li> </ul> </div> <a type="button" href="/2016/08/29/shortest-path/#more" class="btn btn-default more">阅读此文</a> </div> </div> <div> <center> <div class="pagination"> <ul class="pagination"> </ul> </div> </center> </div> </div> <!-- col-md-9/col-md-12 --> <div class="col-md-3"> <div id="sidebar"> <div id="site_search"> <div class="form-group"> <input type="text" id="local-search-input" name="q" results="0" placeholder="搜索" class="st-search-input st-default-search-input form-control"/> </div> <div id="local-search-result"></div> </div> <div class="widget"> <h4>分类</h4> <ul class="tag_box inline list-unstyled"> <li><a href="/categories/平台/">平台<span>17</span></a></li> <li><a href="/categories/算法/">算法<span>13</span></a></li> <li><a href="/categories/运维/">运维<span>1</span></a></li> </ul> </div> <div class="widget"> <h4>标签云</h4> <ul class="tag_box inline list-unstyled"> <li><a href="/tags/algorithm/">algorithm<span>13</span></a></li> <li><a href="/tags/二分图/">二分图<span>1</span></a></li> <li><a href="/tags/多线程/">多线程<span>8</span></a></li> <li><a href="/tags/多进程/">多进程<span>6</span></a></li> <li><a href="/tags/select/">select<span>2</span></a></li> <li><a href="/tags/gcd/">gcd<span>1</span></a></li> <li><a href="/tags/xml/">xml<span>1</span></a></li> <li><a href="/tags/c/">c<span>1</span></a></li> <li><a href="/tags/log/">log<span>1</span></a></li> <li><a href="/tags/hexdump/">hexdump<span>1</span></a></li> <li><a href="/tags/openssl/">openssl<span>1</span></a></li> <li><a href="/tags/cpp/">cpp<span>2</span></a></li> <li><a href="/tags/python/">python<span>2</span></a></li> <li><a href="/tags/快速幂/">快速幂<span>1</span></a></li> <li><a href="/tags/shell/">shell<span>1</span></a></li> <li><a href="/tags/最短路径/">最短路径<span>1</span></a></li> <li><a href="/tags/字符串/">字符串<span>1</span></a></li> <li><a href="/tags/kmp/">kmp<span>1</span></a></li> <li><a href="/tags/哈希/">哈希<span>1</span></a></li> <li><a href="/tags/平台/">平台<span>1</span></a></li> <li><a href="/tags/网络/">网络<span>2</span></a></li> <li><a href="/tags/epoll/">epoll<span>1</span></a></li> <li><a href="/tags/tcp/">tcp<span>1</span></a></li> <li><a href="/tags/udp/">udp<span>1</span></a></li> <li><a href="/tags/stl/">stl<span>1</span></a></li> </ul> </div> <div class="widget"> <h4>链接</h4> <ul class="blogroll list-unstyled"> <li><i class=""></i><a href="http://www.github.com/chenfy27" title="" target="_blank"]);">Github</a></li> <li><i class=""></i><a href="https://theboostcpplibraries.com" title="" target="_blank"]);">Boost库</a></li> <li><i class=""></i><a href="https://deerchao.net/tutorials/regex/regex.htm" title="" target="_blank"]);">正则表达式</a></li> <li><i class=""></i><a href="https://docs.python.org/3/library/index.html" title="" target="_blank"]);">python标准库</a></li> <li><i class=""></i><a href="http://www.cplusplus.com/reference" title="" target="_blank"]);">C++标准库</a></li> <li><i class=""></i><a href="https://www.jb51.net/shouce/autoit" title="" target="_blank"]);">AutoIt参考</a></li> <li><i class=""></i><a href="https://chenfy27.gitee.io/blog" title="" target="_blank"]);">旧版博客</a></li> </ul> </div> <div class="widget"> <h4 class="dsq-widget-title">最新留言</h4> <div id="recent-comments"></div> <script type="text/javascript"> getRecentCommentsList({ type: "github" ? "github" : "github", user: "chenfy27", repo: "chenfy27.github.io", client_id: "9debc16a49221a5c03d3", client_secret: "6fa5f9d947d5b1cbcd91f2cb16636553b13a5a33", count: "10" ? "10" : 5, recent_comments_target: "#recent-comments" }); </script> </div> </div> <!-- sidebar --> </div> <!-- col-md-3 --> </div> </div> <div class="container-narrow"> <footer> <p> &copy; 2019 chenfy27 with help from <a href="http://hexo.io/" target="_blank">Hexo</a> and <a href="http://getbootstrap.com/" target="_blank">Twitter Bootstrap</a>. Theme by <a href="http://github.com/wzpan/hexo-theme-freemind/">Freemind</a>. </p> </footer> </div> <!-- container-narrow --> <a id="gotop" href="#"> <span>▲</span> </a> <script src="/js/jquery.imagesloaded.min.js"></script> <script src="/js/gallery.js"></script> <script src="/js/bootstrap.min.js"></script> <script src="/js/main.js"></script> <script src="/js/search.js"></script> <script type="text/javascript"> var search_path = "search.xml"; if (search_path.length == 0) { search_path = "search.xml"; } var path = "/" + search_path; searchFunc(path, 'local-search-input', 'local-search-result'); </script> <!-- syntax highlighting --> <script> marked.setOptions({ highlight: function (code, lang) { return hljs.highlightAuto(code).value; } }); function Highlighting(){ var markdowns = document.getElementsByClassName('markdown'); for(var i=0;i<markdowns.length;i++){ if(markdowns[i].innerHTML) markdowns[i].innerHTML =marked(markdowns[i].innerHTML); } } window.addEventListener('DOMContentLoaded', Highlighting, false); window.addEventListener('load', Highlighting, false); </script> </body> </html>
boyfaceone/boyfaceone.github.io
tags/最短路径/index.html
HTML
mit
9,776
/*! \file \author Igor Mironchik (igor.mironchik at gmail dot com). Copyright (c) 2017 Igor Mironchik 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. */ // generator include. #include "generator.hpp" // C++ include. #include <algorithm> namespace cfgfile { namespace generator { // // generator_t // generator_t::generator_t() { } generator_t::~generator_t() { } typedef const cfg::namespace_t* const_namespace_ptr_t; // // cpp_generator_t // cpp_generator_t::cpp_generator_t( const cfg::model_t & model ) : m_model( model ) { } cpp_generator_t::~cpp_generator_t() { } // // namespace_stack_t // typedef std::vector< const_namespace_ptr_t > namespace_stack_t; // // startNamespaces // static inline void start_namespaces( std::ostream & stream, namespace_stack_t & stack ) { for( const const_namespace_ptr_t & n : stack ) stream << "namespace " << n->name() << " {\n\n"; } // closeNamespaces // // close_namespace // static inline void close_namespace( std::ostream & stream, namespace_stack_t & stack ) { stream << "} /* namespace " << stack.back()->name() << " */\n\n"; stack.pop_back(); } // closeNamespace // // generate_includes // static inline void generate_includes( std::ostream & stream, const std::vector< std::string > & global_includes, const std::vector< std::string > & relative_includes ) { stream << "// cfgfile include.\n" "#include <cfgfile/all.hpp>\n\n"; stream << "// C++ include.\n" << "#include <vector>\n\n"; for( const std::string & incl : global_includes ) stream << "#include <" << incl << ">\n"; if( !global_includes.empty() ) stream << "\n"; for( const std::string & incl : relative_includes ) stream << "#include \"" << incl << "\"\n"; if( !relative_includes.empty() ) stream << "\n"; } // generate_includes // // generate_setter_method_name // static inline std::string generate_setter_method_name( const std::string & name ) { return ( std::string( "set_" ) + name ); } // generate_setter_method_name // // generate_class_name // static inline std::string generate_class_name( const std::string & name ) { const auto pos = name.rfind( cfg::c_namespace_separator ); std::string res = ( pos == std::string::npos ? std::string() : name.substr( 0, pos + cfg::c_namespace_separator.length() ) ); res.append( "tag_" ); res.append( ( pos == std::string::npos ? name : name.substr( pos + cfg::c_namespace_separator.length() ) ) ); return res; } // // generate_base_class_name // static inline std::string generate_base_class_name( const std::string & base, const std::string & value_type ) { if( base == cfg::c_scalar_tag_name ) return std::string( "cfgfile::tag_scalar_t< " ) + value_type + std::string( ", Trait >" ); else if( base == cfg::c_no_value_tag_name ) return std::string( "cfgfile::tag_no_value_t< Trait >" ); else if( base == cfg::c_scalar_vector_tag_name ) return std::string( "cfgfile::tag_scalar_vector_t< " ) + value_type + std::string( ", Trait >" ); else if( base == cfg::c_vector_of_tags_tag_name ) return std::string( "cfgfile::tag_vector_of_tags_t< " ) + value_type + std::string( ", Trait >" ); else return generate_class_name( base ); } // generate_base_class_name // // generate_tag_name_from_class_name // static inline std::string generate_tag_name_from_class_name( const std::string & name, const std::string & tag_name ) { if( !tag_name.empty() ) return tag_name; else return name; } // generate_tag_name_from_class_name // // bool_to_string // static inline std::string bool_to_string( bool value ) { if( value ) return std::string( "true" ); else return std::string( "false" ); } // bool_to_string // // generate_fields_in_ctor // static inline void generate_fields_in_ctor( std::ostream & stream, cfg::const_class_ptr_t c ) { for( const cfg::field_t & f : c->fields() ) { if( !f.is_base() ) { stream << std::string( "\t\t,\tm_" ) << f.name() << std::string( "( *this, Trait::from_ascii( \"" ) << f.name() << std::string( "\" ), " ) << bool_to_string( f.is_required() ) << std::string( " )\n" ); if( !f.is_constraint_null() ) { cfg::constraint_base_t * constr = f.constraint().get(); switch( constr->type() ) { case cfg::constraint_base_t::min_max_constraint_type : { cfg::min_max_constraint_t * min_max = static_cast< cfg::min_max_constraint_t* > ( constr ); stream << std::string( "\t\t,\tm_" ) << f.name() << std::string( "_constraint( " ) << min_max->min() << std::string( ", " ) << min_max->max() << std::string( " )\n" ); } break; case cfg::constraint_base_t::one_of_constraint_type : { stream << std::string( "\t\t,\tm_" ) << f.name() << std::string( "_constraint()\n" ); } break; default : break; } } } } } // generate_fields_in_ctor // // generate_constraints_in_ctor // static inline void generate_constraints_in_ctor( std::ostream & stream, cfg::const_class_ptr_t c ) { for( const cfg::field_t & f : c->fields() ) { if( !f.is_constraint_null() ) { cfg::constraint_base_t * constr = f.constraint().get(); switch( constr->type() ) { case cfg::constraint_base_t::min_max_constraint_type : { if( !f.is_base() ) stream << std::string( "\t\tm_" ) << f.name() << std::string( ".set_constraint( &m_" ) << f.name() << std::string( "_constraint );\n\n" ); else stream << std::string( "\t\tthis->set_constraint( &m_" ) << f.name() << std::string( "_constraint );\n\n" ); } break; case cfg::constraint_base_t::one_of_constraint_type : { cfg::one_of_constraint_t * one_of = static_cast< cfg::one_of_constraint_t* > ( constr ); for( const std::string & s : one_of->values() ) { stream << std::string( "\t\tm_" ) << f.name() << std::string( "_constraint.add_value( " ) << s << std::string( " );\n" ); } if( !f.is_base() ) stream << std::string( "\t\tm_" ) << f.name() << std::string( ".set_constraint( &m_" ) << f.name() << std::string( "_constraint );\n\n" ); else stream << std::string( "\t\tthis->set_constraint( &m_" ) << f.name() << std::string( "_constraint );\n\n" ); } break; default : break; } } } } // generate_constraints_in_ctor // // generate_type_of_data // static inline std::string generate_type_of_data( const cfg::field_t & f ) { switch( f.type() ) { case cfg::field_t::no_value_field_type : return std::string( "bool" ); case cfg::field_t::custom_tag_field_type : case cfg::field_t::scalar_field_type : return f.value_type(); case cfg::field_t::vector_of_tags_field_type : case cfg::field_t::scalar_vector_field_type : return std::string( "std::vector< " ) + f.value_type() + std::string( " >" ); default : return std::string( "void" ); } } // generate_type_of_data // // generate_data_class // static inline void generate_data_class( std::ostream & stream, cfg::const_class_ptr_t c ) { stream << std::string( "//\n// " ) << c->name() << std::string( "\n//\n\n" ); stream << std::string( "class " ) << c->name() << std::string( " {\n" ); stream << std::string( "public:\n" ); // c_tor and d_tor. stream << std::string( "\t" ) << c->name() << std::string( "()\n" ); int i = 0; for( const cfg::field_t & f : c->fields() ) { if( !f.default_value().empty() ) { if( i == 0 ) stream << std::string( "\t\t:" ); else stream << std::string( "\t\t," ); stream << std::string( "\tm_" ) << f.name() << std::string( "( " ) << f.default_value() << std::string( " )\n" ); ++i; } } stream << std::string( "\t{\n" "\t}\n" "\t~" ) << c->name() << std::string( "()\n" "\t{\n" "\t}\n\n" ); // Getters and setters. for( const cfg::field_t & f : c->fields() ) { if( f.type() != cfg::field_t::no_value_field_type ) { stream << std::string( "\tconst " ) << generate_type_of_data( f ) << std::string( " & " ) << f.name() << std::string( "() const\n" "\t{\n" "\t\treturn m_" ) << f.name() << std::string( ";\n" "\t}\n" ); stream << std::string( "\t" ) << generate_type_of_data( f ) << std::string( " & " ) << f.name() << std::string( "()\n" "\t{\n" "\t\treturn m_" ) << f.name() << std::string( ";\n" "\t}\n" ); stream << std::string( "\tvoid " ) << generate_setter_method_name( f.name() ) << std::string( "( const " ) << generate_type_of_data( f ) << std::string( " & v )\n" "\t{\n" "\t\tm_" ) << f.name() << std::string( " = v;\n" "\t}\n\n" ); } else { stream << std::string( "\tbool " ) << f.name() << std::string( "() const\n" "\t{\n" "\t\treturn m_" ) << f.name() << std::string( ";\n" "\t}\n" ); stream << std::string( "\tvoid " ) << generate_setter_method_name( f.name() ) << std::string( "( bool v = true )\n" "\t{\n" "\t\tm_" ) << f.name() << std::string( " = v;\n" "\t}\n\n" ); } } // Private members. stream << std::string( "private:\n" ); for( const cfg::field_t & f : c->fields() ) { stream << std::string( "\t" ) << generate_type_of_data( f ) << std::string( " m_" ) << f.name() << std::string( ";\n" ); } stream << std::string( "}; // class " ) << c->name() << std::string( "\n\n\n" ); } // generate_data_class // // generate_cfg_init // static inline void generate_cfg_init( std::ostream & stream, cfg::const_class_ptr_t c ) { for( const cfg::field_t & f : c->fields() ) { if( !f.is_base() ) { switch( f.type() ) { case cfg::field_t::no_value_field_type : { stream << std::string( "\n\t\tif( m_" ) << f.name() << std::string( ".is_defined() )\n" "\t\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( true );\n\n" ); } break; case cfg::field_t::scalar_field_type : { stream << std::string( "\n\t\tif( m_" ) << f.name() << std::string( ".is_defined() )\n" "\t\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( m_" ) << f.name() << std::string( ".value() );\n" ); } break; case cfg::field_t::scalar_vector_field_type : { stream << std::string( "\n\t\tif( m_" ) << f.name() << std::string( ".is_defined() )\n" "\t\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( m_" ) << f.name() << std::string( ".values() );\n" ); } break; case cfg::field_t::vector_of_tags_field_type : { stream << std::string( "\n\t\tif( m_" ) << f.name() << std::string( ".is_defined() )\n" "\t\t{\n" ) << std::string( "\t\t\tstd::vector< " ) << f.value_type() << std::string( " > " ) << f.name() << std::string( "_" ) << std::string( "_;\n\n" ) << std::string( "\t\t\tfor( std::size_t i = 0; i < m_" ) << f.name() << std::string( ".size(); ++i )\n" ) << std::string( "\t\t\t\t" ) << f.name() << std::string( "_" ) << std::string( "_.push_back( m_" ) << f.name() << std::string( ".at( i ).get_cfg() );\n\n" ) << std::string( "\t\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( " ) << f.name() << std::string( "_" ) << std::string( "_ );\n" ) << std::string( "\t\t}\n" ); } break; case cfg::field_t::custom_tag_field_type : { stream << std::string( "\n\t\tif( m_" ) << f.name() << std::string( ".is_defined() )\n" "\t\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( m_" ) << f.name() << std::string( ".get_cfg() );\n" ); } break; default : break; } } else { switch( f.type() ) { case cfg::field_t::scalar_field_type : { stream << std::string( "\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( this->value() );\n" ); } break; case cfg::field_t::scalar_vector_field_type : { stream << std::string( "\t\tc." ) << generate_setter_method_name( f.name() ) << std::string( "( this->values() );\n" ); } break; default : break; } } } } // generate_cfg_init // // generate_cfg_set // static inline void generate_cfg_set( std::ostream & stream, cfg::const_class_ptr_t c ) { for( const cfg::field_t & f : c->fields() ) { if( !f.is_base() ) { switch( f.type() ) { case cfg::field_t::no_value_field_type : { stream << std::string( "\n\t\tif( cfg." ) << f.name() << std::string( "() )\n" "\t\t\tm_" ) << f.name() << std::string( ".set_defined();\n\n" ); } break; case cfg::field_t::scalar_field_type : { stream << std::string( "\t\tm_" ) << f.name() << std::string( ".set_value( cfg." ) << f.name() << std::string( "() );\n" ); } break; case cfg::field_t::scalar_vector_field_type : { stream << std::string( "\t\tm_" ) << f.name() << std::string( ".set_values( cfg." ) << f.name() << std::string( "() );\n" ); } break; case cfg::field_t::vector_of_tags_field_type : { stream << std::string( "\n\t\tfor( const " ) << f.value_type() << std::string( " & v : cfg." ) << f.name() << std::string( "() )\n" ) << std::string( "\t\t{\n" ) << std::string( "\t\t\ttypename cfgfile::tag_vector_of_tags_t< " ) << generate_class_name( f.value_type() ) << std::string( "< Trait >, Trait >::ptr_to_tag_t p(\n" ) << std::string( "\t\t\t\tnew " ) << generate_class_name( f.value_type() ) << std::string( "< Trait >( \"" ) << f.name() << std::string( "\", " ) << bool_to_string( f.is_required() ) << std::string( " ) );\n\n" ) << std::string( "\t\t\tp->set_cfg( v );\n\n" ) << std::string( "\t\t\tm_" ) << f.name() << std::string( ".set_value( p );\n" ) << std::string( "\t\t}\n" ); } break; case cfg::field_t::custom_tag_field_type : { stream << std::string( "\t\tm_" ) << f.name() << std::string( ".set_cfg( cfg." ) << f.name() << std::string( "() );\n" ); } break; default : break; } } else { switch( f.type() ) { case cfg::field_t::scalar_field_type : { stream << std::string( "\t\tthis->set_value( cfg." ) << f.name() << std::string( "() );\n" ); } break; case cfg::field_t::scalar_vector_field_type : { stream << std::string( "\t\tthis->set_values( cfg." ) << f.name() << std::string( "() );\n" ); } break; default : break; } } } if( c->fields().empty() ) stream << std::string( "\t\t(void) cfg;" ); stream << std::string( "\n\t\tthis->set_defined();\n" ); } // generate_cfg_set // // generate_private_tag_members // static inline void generate_private_tag_members( std::ostream & stream, cfg::const_class_ptr_t c ) { for( const cfg::field_t & f : c->fields() ) { if( !f.is_base() ) { switch( f.type() ) { case cfg::field_t::no_value_field_type : { stream << std::string( "\tcfgfile::tag_no_value_t< Trait > m_" ) << f.name() << std::string( ";\n" ); } break; case cfg::field_t::scalar_field_type : { stream << std::string( "\tcfgfile::tag_scalar_t< " ) << f.value_type() << std::string( ", Trait > m_" ) << f.name() << std::string( ";\n" ); } break; case cfg::field_t::scalar_vector_field_type : { stream << std::string( "\tcfgfile::tag_scalar_vector_t< " ) << f.value_type() << std::string( ", Trait > m_" ) << f.name() << std::string( ";\n" ); } break; case cfg::field_t::vector_of_tags_field_type : { stream << std::string( "\tcfgfile::tag_vector_of_tags_t< " ) << generate_class_name( f.value_type() ) << "< Trait >" << std::string( ", Trait > m_" ) << f.name() << std::string( ";\n" ); } break; case cfg::field_t::custom_tag_field_type : { stream << std::string( "\t" ) << generate_class_name( f.value_type() ) << std::string( "< Trait > m_" ) << f.name() << std::string( ";\n" ); } break; default : break; } } if( !f.is_constraint_null() ) { cfg::constraint_base_t * constr = f.constraint().get(); switch( constr->type() ) { case cfg::constraint_base_t::min_max_constraint_type : { stream << std::string( "\tcfgfile::constraint_min_max_t< " ) << f.value_type() << std::string( " > m_" ) << f.name() << std::string( "_constraint;\n" ); } break; case cfg::constraint_base_t::one_of_constraint_type : { stream << std::string( "\tcfgfile::constraint_one_of_t< " ) << f.value_type() << std::string( " > m_" ) << f.name() << std::string( "_constraint;\n" ); } break; default : break; } } } } // generate_private_tag_members // // generatetag_class_t // static inline void generate_tag_class( std::ostream & stream, cfg::const_class_ptr_t c ) { const std::string tag_class_name = std::string( "tag_" ) + c->name(); stream << std::string( "//\n" "// " ) << tag_class_name << std::string( "\n" "//\n\n" ); stream << std::string( "template< typename Trait >\n" ); stream << std::string( "class " ) << tag_class_name << std::string( "\n" "\t:\tpublic " ); const std::string base_tag = generate_base_class_name( c->base_name(), c->base_value_type() ); stream << base_tag << std::string( "\n" ); stream << std::string( "{\n" ); stream << std::string( "public:\n" ); // c_tors. // 1 const std::string tag_name = generate_tag_name_from_class_name( c->name(), c->tag_name() ); stream << std::string( "\t" ) << tag_class_name << std::string( "()\n" "\t\t:\t" ) << base_tag << std::string( "( Trait::from_ascii( \"" ) << tag_name << std::string( "\" ), true )\n" ); generate_fields_in_ctor( stream, c ); stream << std::string( "\t{\n" ); generate_constraints_in_ctor( stream, c ); stream << std::string( "\t}\n\n" ); // 2 stream << std::string( "\texplicit " ) << tag_class_name << std::string( "( const " ) << c->name() << std::string( " & cfg )\n" "\t\t:\t" ) << base_tag << std::string( "( Trait::from_ascii( \"" ) << tag_name << std::string( "\" ), true )\n" ); generate_fields_in_ctor( stream, c ); stream << std::string( "\t{\n" ); generate_constraints_in_ctor( stream, c ); stream << std::string( "\t\tset_cfg( cfg );\n" ); stream << std::string( "\t}\n\n" ); // 3 stream << std::string( "\t" ) << tag_class_name << std::string( "( const typename Trait::string_t & name, bool is_mandatory )\n" ) << std::string( "\t\t:\t" ) << base_tag << std::string( "( name, is_mandatory )\n" ); generate_fields_in_ctor( stream, c ); stream << std::string( "\t{\n" ); generate_constraints_in_ctor( stream, c ); stream << std::string( "\t}\n\n" ); // 4 stream << std::string( "\t" ) << tag_class_name << std::string( "( cfgfile::tag_t< Trait > & owner, const typename Trait::string_t & name, " "bool is_mandatory )\n" ) << std::string( "\t\t:\t" ) << base_tag << std::string( "( owner, name, is_mandatory )\n" ); generate_fields_in_ctor( stream, c ); stream << std::string( "\t{\n" ); generate_constraints_in_ctor( stream, c ); stream << std::string( "\t}\n\n" ); // d_tor. stream << std::string( "\t~" ) << tag_class_name << std::string( "()\n" ) << std::string( "\t{\n" "\t}\n\n" ); // getter. stream << std::string( "\t" ) << c->name() << std::string( " get_cfg() const\n" "\t{\n" "\t\t" ) << c->name() << std::string( " c;\n" ); generate_cfg_init( stream, c ); stream << std::string( "\n\t\treturn c;\n" "\t}\n\n" ); // setter. stream << std::string( "\tvoid set_cfg( const " ) << c->name() << std::string( " & cfg )\n" "\t{\n" ); generate_cfg_set( stream, c ); stream << std::string( "\t}\n\n" ); // private members. stream << std::string( "private:\n" ); generate_private_tag_members( stream, c ); stream << std::string( "}; // class " ) << tag_class_name << std::string( "\n\n" ); } // generatetag_class_t // // generate_cpp_classes // static inline void generate_cpp_classes( std::ostream & stream, cfg::const_class_ptr_t c ) { generate_data_class( stream, c ); generate_tag_class( stream, c ); } // generate_cpp_classes void cpp_generator_t::generate( std::ostream & stream ) const { unsigned long long index = 0; namespace_stack_t nms; cfg::const_class_ptr_t c = 0; const std::string guard = m_model.include_guard() + std::string( "__INCLUDED" ); stream << std::string( "\n#ifndef " ) << guard << std::string( "\n#define " ) << guard << std::string( "\n\n" ); generate_includes( stream, m_model.global_includes(), m_model.relative_includes() ); while( ( c = m_model.next_class( index ) ) ) { ++index; namespace_stack_t tmp; const_namespace_ptr_t n = c->parent_namespace(); while( n ) { if( !n->name().empty() ) tmp.push_back( n ); n = n->parent_namespace(); } if( !tmp.empty() ) { std::reverse( tmp.begin(), tmp.end() ); while( !nms.empty() && nms.back() != tmp.back() ) close_namespace( stream, nms ); if( nms.empty() ) { nms.swap( tmp ); start_namespaces( stream, nms ); } } else { while( !nms.empty() ) close_namespace( stream, nms ); } generate_cpp_classes( stream, c ); } while( !nms.empty() ) close_namespace( stream, nms ); stream << std::string( "#endif // " ) << guard << std::string( "\n" ); } } /* namespace generator */ } /* namespace cfgfile */
igormironchik/cfgfile
generator/generator.cpp
C++
mit
23,082
<!DOCTYPE html> <html> <head> <title> demo </title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css"> <link rel="stylesheet" type"text/css" href="../styles/demo.css"> <link rel="shortcut icon" href="favicon.ico" type="favicon.ico"> <link rel="icon" href="favicon.ico" type="favicon.ico"> </head> <body> <header class="blogHeader"> <!-- ..............MENU ...............--> <nav class="container row"> <ul> <li> <a href="../index.html" class="active">home</a> <a href="a-work.html">school work</a> <a href="a-index.html">blog</a> <a href="a-contact-me.html">contact</a> </li> </ul> <ul class="mobileIndex"> <li> <a href="../index.html" class="active">home</a> <a href="a-index.html">blog</a> <a href="a-contact-me.html">contact</a> </li> </ul> </nav> <!-- ..............MENU ...............--> </header> <div class="table-container"> <div class="table-block footer-push"> <!-- Primary Page Layout –––––––––––––––––––––––––––––––––––––––––––––––––– --> <div class="container"> <div class="row"> <div class="twelve column Hulk"> <h4>mybcito app</h4> <h6>quick demo from development environment for internal purposes</h6> <p> This gif shows captures from myBcito app registration process, adding student work projects, marking those projects as completed, adding qualifications to the profile page. It also shows how all those actions are reflected on achieving badges by the user. </p> <p> Please note that the video may be lagging a bit and is made for internal purposes. </p> <img class= "demoImg" src="../images/myBcitoDemoGif_normalSpeed.gif"></img> <p class="tag reflection"> #demo #davanti <p> </div> </div> </div> <!-- end primary div.container --> </div> <!-- end primary div.table-block --> <div class="table-block"> <!-- Page Footer Layout –––––––––––––––––––––––––––––––––––––––––––––––––– --> <div class="container"> <footer class="blogFooter" class="twelve columns"> <ul> <li><a id="footerParrotLink" href="../index.html"><img src="../images/Parrot_Icon.png"></a></li> <!-- <li> <a href="https://www.facebook.com">facebook</a> <a href="https://www.instagram.com/ania_podh/">instagram</a> <a href="tel:333 444 333"> call me</a> </li> --> </footer> </div> <!-- end footer div.container --> </div> <!-- end footer div.table-block --> </div> <!-- End Document –––––––––––––––––––––––––––––––––––––––––––––––––– --> <!-- <iframe width="0" height="0" src="https://www.youtube.com/embed/1frLJSKKCx8?rel=0&autoplay=1&controls=0&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> --> <iframe width="100%" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/345676171&color=%23ff5500&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true"></iframe> </body> </html>
anna-podhajska/anna-podhajska.github.io
blog/demo.html
HTML
mit
4,027
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_80) on Thu Oct 27 12:13:59 EEST 2016 --> <title>Uses of Class com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType (SKMaps Framework)</title> <meta name="date" content="2016-10-27"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType (SKMaps Framework)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/skobbler/ngx/map/class-use/SKAnimationSettings.SKAnimationType.html" target="_top">Frames</a></li> <li><a href="SKAnimationSettings.SKAnimationType.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType" class="title">Uses of Class<br>com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.skobbler.ngx.map">com.skobbler.ngx.map</a></td> <td class="colLast"> <div class="block">Constains classses needed to show the map and information on the map.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.skobbler.ngx.map"> <!-- --> </a> <h3>Uses of <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a> in <a href="../../../../../com/skobbler/ngx/map/package-summary.html">com.skobbler.ngx.map</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../com/skobbler/ngx/map/package-summary.html">com.skobbler.ngx.map</a> that return <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></code></td> <td class="colLast"><span class="strong">SKAnimationSettings.</span><code><strong><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.html#getAnimationType()">getAnimationType</a></strong>()</code> <div class="block">Gets the annotation animation type</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></code></td> <td class="colLast"><span class="strong">SKAnimationSettings.SKAnimationType.</span><code><strong><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a>[]</code></td> <td class="colLast"><span class="strong">SKAnimationSettings.SKAnimationType.</span><code><strong><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../com/skobbler/ngx/map/package-summary.html">com.skobbler.ngx.map</a> with parameters of type <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">SKAnimationSettings.</span><code><strong><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.html#setAnimationType(com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType)">setAnimationType</a></strong>(<a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a>&nbsp;animationType)</code> <div class="block">Sets the annotation animation type</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructors in <a href="../../../../../com/skobbler/ngx/map/package-summary.html">com.skobbler.ngx.map</a> with parameters of type <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><strong><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.html#SKAnimationSettings(com.skobbler.ngx.map.SKAnimationSettings.SKAnimationType,%20com.skobbler.ngx.map.SKAnimationSettings.SKEasingType,%20int)">SKAnimationSettings</a></strong>(<a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKAnimationType</a>&nbsp;animationType, <a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKEasingType.html" title="enum in com.skobbler.ngx.map">SKAnimationSettings.SKEasingType</a>&nbsp;animationEasingType, int&nbsp;duration)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../com/skobbler/ngx/map/SKAnimationSettings.SKAnimationType.html" title="enum in com.skobbler.ngx.map">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/skobbler/ngx/map/class-use/SKAnimationSettings.SKAnimationType.html" target="_top">Frames</a></li> <li><a href="SKAnimationSettings.SKAnimationType.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &#169 2014 skobbler GmbH, Luisenstr. 41, 10117 Berlin, Germany. All rights reserved.</i></small></p> </body> </html>
TrekDev/Xamarin.Android.Skobbler
src/Skobbler.Binding/Jars/docs/com/skobbler/ngx/map/class-use/SKAnimationSettings.SKAnimationType.html
HTML
mit
10,481
<?php /** * PageSize * * PHP version 5 * * @category Class * @package DocuSign\eSign * @author Swaagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ /** * DocuSign REST API * * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. * * OpenAPI spec version: v2.1 * Contact: devcenter@docusign.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * */ /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ namespace DocuSign\eSign\Model; use \ArrayAccess; /** * PageSize Class Doc Comment * * @category Class * @package DocuSign\eSign * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class PageSize implements ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. * @var string */ protected static $swaggerModelName = 'pageSize'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ protected static $swaggerTypes = [ 'page_height' => 'string', 'page_width' => 'string' ]; public static function swaggerTypes() { return self::$swaggerTypes; } /** * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ protected static $attributeMap = [ 'page_height' => 'pageHeight', 'page_width' => 'pageWidth' ]; /** * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ protected static $setters = [ 'page_height' => 'setPageHeight', 'page_width' => 'setPageWidth' ]; /** * Array of attributes to getter functions (for serialization of requests) * @var string[] */ protected static $getters = [ 'page_height' => 'getPageHeight', 'page_width' => 'getPageWidth' ]; public static function attributeMap() { return self::$attributeMap; } public static function setters() { return self::$setters; } public static function getters() { return self::$getters; } /** * Associative array for storing property values * @var mixed[] */ protected $container = []; /** * Constructor * @param mixed[] $data Associated array of property values initializing the model */ public function __construct(array $data = null) { $this->container['page_height'] = isset($data['page_height']) ? $data['page_height'] : null; $this->container['page_width'] = isset($data['page_width']) ? $data['page_width'] : null; } /** * show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalid_properties = []; return $invalid_properties; } /** * validate all the properties in the model * return true if all passed * * @return bool True if all properteis are valid */ public function valid() { return true; } /** * Gets page_height * @return string */ public function getPageHeight() { return $this->container['page_height']; } /** * Sets page_height * @param string $page_height * @return $this */ public function setPageHeight($page_height) { $this->container['page_height'] = $page_height; return $this; } /** * Gets page_width * @return string */ public function getPageWidth() { return $this->container['page_width']; } /** * Sets page_width * @param string $page_width * @return $this */ public function setPageWidth($page_width) { $this->container['page_width'] = $page_width; return $this; } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset * @return boolean */ public function offsetExists($offset) { return isset($this->container[$offset]); } /** * Gets offset. * @param integer $offset Offset * @return mixed */ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * @param integer $offset Offset * @param mixed $value Value to be set * @return void */ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * @param integer $offset Offset * @return void */ public function offsetUnset($offset) { unset($this->container[$offset]); } /** * Gets the string presentation of the object * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\DocuSign\eSign\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); } return json_encode(\DocuSign\eSign\ObjectSerializer::sanitizeForSerialization($this)); } }
docusign/docusign-php-client
src/Model/PageSize.php
PHP
mit
5,645
<?php return array ( 'id' => 'apple_iphone_emulator_ver3', 'fallback' => 'apple_iphone_ver3', 'capabilities' => array ( 'model_extra_info' => '3.0 Simulator', ), );
cuckata23/wurfl-data
data/apple_iphone_emulator_ver3.php
PHP
mit
180
#include <iostream> #include <string> #include "vehicle.h" #include "tourist.h" int main() { std::string cname; // name of the city double x, y; // position of the city double bsp, tsp, asp; // speed of bicycle, train and airplane. std::cin >> cname >> x >> y; City src = {x, y, cname}; std::cin >> cname >> x >> y; City dest = {x, y, cname}; std::cin >> bsp >> tsp >> asp; BicycleStrategy bicycle(bsp); TrainStrategy train(tsp); AirplaneStrategy air(asp); Tourist lsc(&bicycle); lsc.travel(src, dest); lsc.setStrategy(&train); lsc.travel(src, dest); lsc.setStrategy(&air); lsc.travel(src, dest); return 0; }
MegaShow/college-programming
Homework/C++ Programming/2083 Travel(eden)/main.cpp
C++
mit
706
<!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>Quotes Blog</title> <!-- Bootstrap Core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Theme CSS --> <link href="css/clean-blog.min.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' 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> <!-- Navigation --> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> Menu <i class="fa fa-bars"></i> </button> <a class="navbar-brand" href="index.html">Quotes Blog</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a href="index.html">Home</a> </li> <li> <a href="about.html">About</a> </li> <li> <a href="contact.html">Contact</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <!-- Page Header --> <!-- Set your background image for this header on the line below. --> <header class="intro-header" style="background-image: url('https://px.multiscreensite.com/index.php?url=http%3A%2F%2Fwallpapercave.com%2Fwp%2FC6Vvy9v.jpg')"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div class="site-heading"> <h1>Quotes Blog</h1> <hr class="small"> <span class="subheading">A collection of great quotes I have encountered in a form of a Blogging Website :) By John Ivan R. Divina</span> </div> </div> </div> </div> </header> <!-- Main Content --> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div class="post-preview"> <a href="post1.html"> <h2 class="post-title">Yesterday is history, tomorrow is a mystery, and today is a gift that's why they call it the present </h2> <h3 class="post-subtitle"> A quote from Kung-fu Panda that teaches us that we should never let the past define who we are </h3> </a> <p class="post-meta">Posted by <a href="#">John Divina</a> on October 28, 2016</p> </div> <hr> <div class="post-preview"> <a href="post2.html"> <h2 class="post-title"> "You gave me forever within a number of days and I'm grateful for that " </h2> <h3 class="post-subtitle"> One of the quotes that seriously broke my heart; it is about and from an anime called "Your lie in April" or Shigatsu Wa Kami. The quote is about maximizing the time with a person you love before they are gone. </h3> </a> <p class="post-meta">Posted by <a href="#">John Divina</a> on October 29, 2016</p> </div> <hr> <div class="post-preview"> <a href="post3.html"> <h2 class="post-title"> "Have a nice life, I am done trying to be in it" </h2> <h3 class="post-subtitle"> We sometimes fall inlove with the people we can't have, we should realize that some may just be a chapter or our life, we can't turn back the pages of time or rewrite our story with them, We eventually get tired of chase and we somehow learn to let go. </h3> </a> <p class="post-meta">Posted by <a href="#">John Divina</a> on October 29, 2016</p> </div> </div> </div> </div> <hr> <!-- Footer --> <footer> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <ul class="list-inline text-center"> <li> <a href="#"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-twitter fa-stack-1x fa-inverse"></i> </span> </a> </li> <li> <a href="#"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-facebook fa-stack-1x fa-inverse"></i> </span> </a> </li> <li> <a href="#"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-github fa-stack-1x fa-inverse"></i> </span> </a> </li> </ul> <p class="copyright text-muted">Copyright JohnDivina 2016</p> </div> </div> </div> </footer> <!-- jQuery --> <script src="vendor/jquery/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <!-- Contact Form JavaScript --> <script src="js/jqBootstrapValidation.js"></script> <script src="js/contact_me.js"></script> <!-- Theme JavaScript --> <script src="js/clean-blog.min.js"></script> </body> </html>
JohnDivina0908/Blog
index.html
HTML
mit
7,828
#!/bin/sh set -euo pipefail VERSION=`python setup.py --version` MAJOR_BRANCH="`python setup.py --version | cut -d'.' -f1`.x" IS_DEV=false if [[ `python setup.py --version` =~ "dev" ]]; then IS_DEV=true fi echo "# Releasing pyinfra v${VERSION} (branch ${MAJOR_BRANCH}, dev=${IS_DEV})" echo "# Running tests..." pytest if [[ "${IS_DEV}" == "false" ]]; then echo "# Git tag & push..." git tag -a "v$VERSION" -m "v$VERSION" git push --tags echo "Git update major branch..." git checkout $MAJOR_BRANCH git merge current git push git checkout current else echo "Skipping major branch due to dev release" fi echo "Clear existing build/dist..." rm -rf build/* dist/* echo "Build source and wheel packages..." python setup.py sdist bdist_wheel echo "Upload w/Twine..." twine upload dist/* echo "# All done!"
Fizzadar/pyinfra
scripts/release.sh
Shell
mit
848
#!/bin/bash TMPDIR=~/.tmp if [ $# -lt 1 ]; then echo -e "\tusage: $0 <FASTA FILE 1> .. <FASTA FILE N>" exit 1 fi INPUT_FILES=$@ OUT_FILE_NAME="" for f in $INPUT_FILES; do if [ ! -f $f ]; then echo File $f does not exist. Exiting. exit 1 fi fb=$(basename $f) if [ -z $OUT_FILE_NAME ]; then OUT_FILE_NAME=${fb%.*} else OUT_FILE_NAME=${OUT_FILE_NAME}_${fb%.*} fi done PARAMS="--output=$OUT_FILE_NAME.xmfa --output-guide-tree=$OUT_FILE_NAME.tree --backbone-output=$OUT_FILE_NAME.backbone --scratch-path-1=$TMPDIR $INPUT_FILES" echo progressiveMauve $PARAMS > mauve_params.log progressiveMauve $PARAMS 2>&1 | tee mauve.log
danydoerr/large_syn_workflow
run_mauve.sh
Shell
mit
690
<!-- <section data-ng-controller="HomeController"> --> <div ng-include=" '/modules/core/views/partials/page1.view.html' "></div> <!--END HEADER SECTION --> <div ng-include=" '/modules/core/views/partials/orderform.view.html' "></div> <div ng-include=" '/modules/core/views/partials/paralax2.view.html' "></div> <div class="space-bottom"></div> <!-- ABOUT SECTION --> <div ng-include=" '/modules/core/views/partials/page2.view.html' "></div> <div class="space-bottom"></div> <!--END ABOUT SECTION --> <!--PARALLAX SECTION ONE--> <!--<div ng-include=" '/modules/core/views/partials/paralax1.view.html' "></div>--> <!-- END PARALLAX SECTION ONE --> <!--PARALLAX SECTION TWO --> <!--PRICE SECTION --> <!--<div ng-include=" '/modules/core/views/partials/page3.view.html' "></div>--> <!--END PRICE SECTION --> <!--END PARALLAX SECTION TWO --> <!--CONTACT SECTION --> <div ng-include=" '/modules/core/views/partials/page4.view.html' "></div> <div class="space-bottom"></div> <!--END CONTACT SECTION --> <!--FOOTER SECTION --> <div ng-include=" '/modules/core/views/partials/footer.view.html' "></div> <!-- </section> -->
lwhiteley/superfly
public/modules/core/views/home.client.view.html
HTML
mit
1,150
# THIS PROJECT IS NOT MAINTAINED # # USE AT YOUR OWN RISK # # angular2-uuid Angular 2 UUID generator. Uses crypto-secure PRNG window.crypto.getRandomValues() if available, otherwise fallback to Math.random(); ## Install `npm install angular2-uuid --save` ## Use Include in Angular2 / Ionic2 project with ``` import { UuidService } from 'angular2-uuid'; ... constructor(private uuid: UuidService) { ... } ... const uuid = this.uuid.generate(); ```
wulfsolter/angular2-uuid
README.md
Markdown
mit
450
// Type definitions for D3JS d3-scale module v1.0.3 // Project: https://github.com/d3/d3-scale/ // Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { CountableTimeInterval, TimeInterval } from '../d3-time'; // ------------------------------------------------------------------------------- // Shared Types and Interfaces // ------------------------------------------------------------------------------- export interface InterpolatorFactory<T, U> { (a: T, b: T): ((t: number) => U); } // ------------------------------------------------------------------------------- // Linear Scale Factory // ------------------------------------------------------------------------------- export interface ScaleLinear<Range, Output> { (value: number | { valueOf(): number }): Output; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): number; domain(): Array<number>; domain(domain: Array<number | { valueOf(): number }>): this; range(): Array<Range>; range(range: Array<Range>): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ rangeRound(range: Array<number | { valueOf(): number }>): this; clamp(): boolean; clamp(clamp: boolean): ScaleLinear<Range, Output>; interpolate(): InterpolatorFactory<any, any>; interpolate(interpolate: InterpolatorFactory<Range, Output>): this; interpolate<NewOutput>(interpolate: InterpolatorFactory<Range, NewOutput>): ScaleLinear<Range, NewOutput>; ticks(count?: number): Array<number>; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; copy(): ScaleLinear<Range, Output>; } export function scaleLinear(): ScaleLinear<number, number>; export function scaleLinear<Output>(): ScaleLinear<Output, Output>; export function scaleLinear<Range, Output>(): ScaleLinear<Range, Output>; // ------------------------------------------------------------------------------- // Power Scale Factories // ------------------------------------------------------------------------------- export interface ScalePower<Range, Output> { (value: number | { valueOf(): number }): Output; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): number; domain(): Array<number>; domain(domain: Array<number | { valueOf(): number }>): this; range(): Array<Range>; range(range: Array<Range>): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ rangeRound(range: Array<number | { valueOf(): number }>): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory<any, any>; interpolate(interpolate: InterpolatorFactory<Range, Output>): this; interpolate<NewOutput>(interpolate: InterpolatorFactory<Range, NewOutput>): ScalePower<Range, NewOutput>; ticks(count?: number): Array<number>; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; copy(): ScalePower<Range, Output>; exponent(): number; exponent(exponent: number): this; } export function scalePow(): ScalePower<number, number>; export function scalePow<Output>(): ScalePower<Output, Output>; export function scalePow<Range, Output>(): ScalePower<Range, Output>; export function scaleSqrt(): ScalePower<number, number>; export function scaleSqrt<Output>(): ScalePower<Output, Output>; export function scaleSqrt<Range, Output>(): ScalePower<Range, Output>; // ------------------------------------------------------------------------------- // Logarithmic Scale Factory // ------------------------------------------------------------------------------- export interface ScaleLogarithmic<Range, Output> { (value: number | { valueOf(): number }): Output; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): number; domain(): Array<number>; domain(domain: Array<number | { valueOf(): number }>): this; range(): Array<Range>; range(range: Array<Range>): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ rangeRound(range: Array<number | { valueOf(): number }>): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory<any, any>; interpolate(interpolate: InterpolatorFactory<Range, Output>): this; interpolate<NewOutput>(interpolate: InterpolatorFactory<Range, NewOutput>): ScaleLogarithmic<Range, NewOutput>; ticks(count?: number): Array<number>; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; copy(): ScaleLogarithmic<Range, Output>; base(): number; base(base: number): this; } export function scaleLog(): ScaleLogarithmic<number, number>; export function scaleLog<Output>(): ScaleLogarithmic<Output, Output>; export function scaleLog<Range, Output>(): ScaleLogarithmic<Range, Output>; // ------------------------------------------------------------------------------- // Identity Scale Factory // ------------------------------------------------------------------------------- export interface ScaleIdentity { (value: number | { valueOf(): number }): number; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): number; domain(): Array<number>; domain(domain: Array<number | { valueOf(): number }>): this; range(): Array<number>; range(range: Array<Range | { valueOf(): number }>): this; ticks(count?: number): Array<number>; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; copy(): ScaleIdentity; } export function scaleIdentity(): ScaleIdentity; // ------------------------------------------------------------------------------- // Time Scale Factories // ------------------------------------------------------------------------------- export interface ScaleTime<Range, Output> { (value: Date): Output; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): Date; domain(): Array<Date>; domain(domain: Array<Date>): this; range(): Array<Range>; range(range: Array<Range>): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ rangeRound(range: Array<number | { valueOf(): number }>): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory<any, any>; interpolate(interpolate: InterpolatorFactory<Range, Output>): this; interpolate<NewOutput>(interpolate: InterpolatorFactory<Range, NewOutput>): ScaleTime<Range, NewOutput>; ticks(): Array<Date>; ticks(count: number): Array<Date>; ticks(interval: TimeInterval): Array<Date>; tickFormat(): ((d: Date) => string); tickFormat(count: number, specifier?: string): ((d: Date) => string); tickFormat(interval: TimeInterval, specifier?: string): ((d: Date) => string); nice(): this; nice(count: number): this; nice(interval: CountableTimeInterval, step?: number): this; copy(): ScaleTime<Range, Output>; } export function scaleTime(): ScaleTime<number, number>; export function scaleTime<Output>(): ScaleTime<Output, Output>; export function scaleTime<Range, Output>(): ScaleTime<Range, Output>; export function scaleUtc(): ScaleTime<number, number>; export function scaleUtc<Output>(): ScaleTime<Output, Output>; export function scaleUtc<Range, Output>(): ScaleTime<Range, Output>; // ------------------------------------------------------------------------------- // Sequential Scale Factory // ------------------------------------------------------------------------------- export interface ScaleSequential<Output> { (value: number | { valueOf(): number }): Output; domain(): [number, number]; domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; clamp(): boolean; clamp(clamp: boolean): this; interpolator(): ((t: number) => Output); interpolator(interpolator: ((t: number) => Output)): this; interpolator<NewOutput>(interpolator: ((t: number) => NewOutput)): ScaleSequential<NewOutput>; copy(): ScaleSequential<Output>; } export function scaleSequential<Output>(interpolator: ((t: number) => Output)): ScaleSequential<Output>; // ------------------------------------------------------------------------------- // Color Interpolators for Sequential Scale Factory // ------------------------------------------------------------------------------- export function interpolateViridis(t: number): string; export function interpolateMagma(t: number): string; export function interpolateInferno(t: number): string; export function interpolatePlasma(t: number): string; export function interpolateRainbow(t: number): string; export function interpolateWarm(t: number): string; export function interpolateCool(t: number): string; export function interpolateCubehelixDefault(t: number): string; // ------------------------------------------------------------------------------- // Quantize Scale Factory // ------------------------------------------------------------------------------- export interface ScaleQuantize<Range> { (value: number | { valueOf(): number }): Range; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invertExtent(value: Range): [number, number]; domain(): [number, number]; domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; range(): Array<Range>; range(range: Array<Range>): this; ticks(count?: number): Array<number>; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; copy(): ScaleQuantize<Range>; } export function scaleQuantize(): ScaleQuantize<number>; export function scaleQuantize<Range>(): ScaleQuantize<Range>; // ------------------------------------------------------------------------------- // Quantile Scale Factory // ------------------------------------------------------------------------------- export interface ScaleQuantile<Range> { (value: number | { valueOf(): number }): Range; invertExtent(value: Range): [number, number]; domain(): Array<number>; domain(domain: Array<number | { valueOf(): number }>): this; range(): Array<Range>; range(range: Array<Range>): this; quantiles(): Array<number>; copy(): ScaleQuantile<Range>; } export function scaleQuantile(): ScaleQuantile<number>; export function scaleQuantile<Range>(): ScaleQuantile<Range>; // ------------------------------------------------------------------------------- // Threshold Scale Factory // ------------------------------------------------------------------------------- // TODO: review Domain Type, should be naturally orderable export interface ScaleThreshold<Domain extends number | string | Date, Range> { (value: Domain): Range; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. Otherwise, returns NaN */ invertExtent(value: Range): [Domain, Domain] | [undefined, Domain] | [Domain, undefined] | [undefined, undefined]; domain(): Array<Domain>; domain(domain: Array<Domain>): this; range(): Array<Range>; range(range: Array<Range>): this; copy(): ScaleThreshold<Domain, Range>; } export function scaleThreshold(): ScaleThreshold<number, number>; export function scaleThreshold<Domain extends number | string | Date, Range>(): ScaleThreshold<Domain, Range>; // ------------------------------------------------------------------------------- // Ordinal Scale Factory // ------------------------------------------------------------------------------- export interface ScaleOrdinal<Domain extends { toString(): string }, Range> { (x: Domain): Range; domain(): Array<Domain>; domain(domain: Array<Domain>): this; range(): Array<Range>; range(range: Array<Range>): this; unknown(): Range | { name: 'implicit' }; unknown(value: Range | { name: 'implicit' }): this; copy(): ScaleOrdinal<Domain, Range>; } export function scaleOrdinal<Range>(range?: Array<Range>): ScaleOrdinal<string, Range>; export function scaleOrdinal<Domain extends { toString(): string }, Range>(range?: Array<Range>): ScaleOrdinal<Domain, Range>; export const scaleImplicit: { name: 'implicit' }; // ------------------------------------------------------------------------------- // Band Scale Factory // ------------------------------------------------------------------------------- export interface ScaleBand<Domain extends { toString(): string }> { (x: Domain): number | undefined; domain(): Array<Domain>; domain(domain: Array<Domain>): this; range(): [number, number]; range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; round(): boolean; round(round: boolean): this; paddingInner(): number; paddingInner(padding: number): this; paddingOuter(): number; paddingOuter(padding: number): this; /** * Returns the inner padding. */ padding(): number; /** * A convenience method for setting the inner and outer padding to the same padding value. */ padding(padding: number): this; align(): number; align(align: number): this; bandwidth(): number; step(): number; copy(): ScaleBand<Domain>; } export function scaleBand(): ScaleBand<string>; export function scaleBand<Domain extends { toString(): string }>(): ScaleBand<Domain>; // ------------------------------------------------------------------------------- // Point Scale Factory // ------------------------------------------------------------------------------- export interface ScalePoint<Domain extends { toString(): string }> { (x: Domain): number | undefined; domain(): Array<Domain>; domain(domain: Array<Domain>): this; range(): [number, number]; range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; round(): boolean; round(round: boolean): this; /** * Returns the current outer padding which defaults to 0. * The outer padding determines the ratio of the range that is reserved for blank space * before the first point and after the last point. */ padding(): number; /** * Sets the outer padding to the specified value which must be in the range [0, 1]. * The outer padding determines the ratio of the range that is reserved for blank space * before the first point and after the last point. */ padding(padding: number): this; align(): number; align(align: number): this; bandwidth(): number; step(): number; copy(): ScalePoint<Domain>; } export function scalePoint(): ScalePoint<string>; export function scalePoint<Domain extends { toString(): string }>(): ScalePoint<Domain>; // ------------------------------------------------------------------------------- // Categorical Color Schemas for Ordinal Scales // ------------------------------------------------------------------------------- export const schemeCategory10: Array<string>; export const schemeCategory20: Array<string>; export const schemeCategory20b: Array<string>; export const schemeCategory20c: Array<string>;
tomwanzek/d3-v4-definitelytyped
src/d3-scale/index.d.ts
TypeScript
mit
17,011
<?PHP defined('BASEPATH') OR exit('No direct script access allowed'); echo form_open($UrlPage, array('class' => 'form-horizontal')); ?> <div class="control-group"> <label class="control-label" for="Type_PinPad">Модель пин-пада</label> <div class="controls"> <?php echo $ID_Type_PinPad; ?> </div> </div> <div class="control-group"> <label class="control-label" for="SN_Num_PinPad">Серийный номер</label> <div class="controls"> <input type="text" name="SN_Num_PinPad" value="<?php echo $SN_Num_PinPad; ?>" > <?php echo form_error('SN_Num_PinPad'); ?> </div> </div> <div class="control-group"> <div class="controls"> <button type="submit" class="btn">Сохранить</button> </div> </div> </form>
AutoTeh/term
application/views/pinpadedit.php
PHP
mit
791
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./42b41b3f1eada6aad6c6c3276a9cc0e06849ff9ca0619de07e48f43e03dfbafa.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/6b5ba6626f729d3a74196f8609b00d92e3a15c98f72a5a0628d0ce632059e5ef.html
HTML
mit
550
/* eslint no-var: [0] */ var path = require('path'), assign = require('object-assign'), pick = require('lodash.pick'); var browserWindowDefaults = { width: 600, height: 600 }; var webPreferencesDefaults = { nodeIntegration: false, javascript: true, webSecurity: false }; module.exports = function(browserWindowSettings) { var browserWindowOpts, webPreferences; browserWindowOpts = pick(browserWindowSettings || {}, [ 'width', 'height', 'x', 'y', 'useContentSize', 'webPreferences' ]); browserWindowOpts = assign({}, browserWindowDefaults, browserWindowOpts, { show: false }); webPreferences = pick(browserWindowOpts.webPreferences || {}, [ 'nodeIntegration', 'partition', 'zoomFactor', 'javascript', 'webSecurity', 'allowDisplayingInsecureContent', 'allowRunningInsecureContent', 'images', 'java', 'webgl', 'webaudio', 'plugins', 'experimentalFeatures', 'experimentalCanvasFeatures', 'overlayScrollbars', 'overlayFullscreenVideo', 'sharedWorker', 'directWrite' ]); browserWindowOpts.webPreferences = assign({}, webPreferencesDefaults, webPreferences, { preload: path.join(__dirname, 'preload.js') }); return browserWindowOpts; };
bjrmatos/electron-html-to
src/scripts/getBrowserWindowOpts.js
JavaScript
mit
1,287
package xyz.niteshsahni.cityguidepro.activity; import android.app.ActionBar; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.location.Location; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import xyz.niteshsahni.cityguidepro.extra.AllConstants; import xyz.niteshsahni.cityguidepro.extra.PrintLog; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; public class LocationFound extends Activity implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener { private Context con; // LogCat tag private static final String TAG = MainActivity.class.getSimpleName(); private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000; private Location mLastLocation; // Google client to interact with Google API private GoogleApiClient mGoogleApiClient; // boolean flag to toggle periodic location updates private boolean mRequestingLocationUpdates = false; private LocationRequest mLocationRequest; // Location updates intervals in sec private static int UPDATE_INTERVAL = 10000; // 10 sec private static int FATEST_INTERVAL = 5000; // 5 sec private static int DISPLACEMENT = 10; // 10 meters // UI elements private TextView lblLocation; private Button btnShowLocation, btnStartLocationUpdates,listButton; double latitude; double longitude; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(xyz.niteshsahni.cityguidepro.R.layout.activity_location_found); // get the action bar ActionBar actionBar = getActionBar(); // Enabling Back navigation on Action Bar icon actionBar.setDisplayHomeAsUpEnabled(true); locUI(); } private void locUI() { lblLocation = (TextView) findViewById(xyz.niteshsahni.cityguidepro.R.id.lblLocation); btnShowLocation = (Button) findViewById(xyz.niteshsahni.cityguidepro.R.id.btnShowLocation); btnStartLocationUpdates = (Button)findViewById(xyz.niteshsahni.cityguidepro.R.id.btnLocationUpdates); listButton = (Button) findViewById(xyz.niteshsahni.cityguidepro.R.id.listBtn); // First we need to check availability of play services if (checkPlayServices()) { // Building the GoogleApi client buildGoogleApiClient(); createLocationRequest(); } // Show location button click listener btnShowLocation.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { displayLocation(); } }); // Toggling the periodic location updates btnStartLocationUpdates.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { togglePeriodicLocationUpdates(); } }); // Toggling the periodic location updates listButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // AllConstants.topTitle = "BANKS LIST"; // AllConstants.query = "bank"; Intent bank = new Intent(con, MainActivity.class); bank.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(bank); } }); } @Override public void onStart() { super.onStart(); if (mGoogleApiClient != null) { mGoogleApiClient.connect(); } } @Override public void onResume() { super.onResume(); checkPlayServices(); // Resuming the periodic location updates if (mGoogleApiClient.isConnected() && mRequestingLocationUpdates) { startLocationUpdates(); } } @Override public void onStop() { super.onStop(); if (mGoogleApiClient.isConnected()) { mGoogleApiClient.disconnect(); } } @Override public void onPause() { super.onPause(); stopLocationUpdates(); } /** * Method to display the location on UI * */ public void displayLocation() { mLastLocation = LocationServices.FusedLocationApi .getLastLocation(mGoogleApiClient); if (mLastLocation != null) { latitude = mLastLocation.getLatitude(); longitude= mLastLocation.getLongitude(); AllConstants.UPlat=Double.toString(latitude); AllConstants.UPlng=Double.toString(longitude); lblLocation.setText(latitude + ", " + longitude); PrintLog.myLog("LatLong Found: LATT", +latitude + ", " + longitude); } else { lblLocation .setText("(Couldn't get the location. Make sure location is enabled on the device)"); } } /** * Method to toggle periodic location updates * */ private void togglePeriodicLocationUpdates() { if (!mRequestingLocationUpdates) { // Changing the button text btnStartLocationUpdates .setText(getString(xyz.niteshsahni.cityguidepro.R.string.btn_stop_location_updates)); mRequestingLocationUpdates = true; // Starting the location updates startLocationUpdates(); Log.d(TAG, "Periodic location updates started!"); } else { // Changing the button text btnStartLocationUpdates .setText(getString(xyz.niteshsahni.cityguidepro.R.string.btn_start_location_updates)); mRequestingLocationUpdates = false; // Stopping the location updates stopLocationUpdates(); Log.d(TAG, "Periodic location updates stopped!"); } } /** * Creating google api client object * */ protected synchronized void buildGoogleApiClient() { mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API).build(); } /** * Creating location request object * */ protected void createLocationRequest() { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(UPDATE_INTERVAL); mLocationRequest.setFastestInterval(FATEST_INTERVAL); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequest.setSmallestDisplacement(DISPLACEMENT); } /** * Method to verify google play services on the device * */ private boolean checkPlayServices() { int resultCode = GooglePlayServicesUtil .isGooglePlayServicesAvailable(this); if (resultCode != ConnectionResult.SUCCESS) { if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) { GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICES_RESOLUTION_REQUEST).show(); } else { Toast.makeText(getApplicationContext(), "This device is not supported.", Toast.LENGTH_LONG) .show(); finish(); } return false; } return true; } /** * Starting the location updates * */ protected void startLocationUpdates() { LocationServices.FusedLocationApi.requestLocationUpdates( mGoogleApiClient, mLocationRequest, this); } /** * Stopping location updates */ protected void stopLocationUpdates() { LocationServices.FusedLocationApi.removeLocationUpdates( mGoogleApiClient, this); } /** * Google api callback methods */ @Override public void onConnectionFailed(ConnectionResult result) { Log.i(TAG, "Connection failed: ConnectionResult.getErrorCode() = " + result.getErrorCode()); } @Override public void onConnected(Bundle arg0) { // Once connected with google api, get the location displayLocation(); if (mRequestingLocationUpdates) { startLocationUpdates(); } } @Override public void onConnectionSuspended(int arg0) { mGoogleApiClient.connect(); } @Override public void onLocationChanged(Location location) { // Assign the new location mLastLocation = location; Toast.makeText(getApplicationContext(), "Location changed!", Toast.LENGTH_SHORT).show(); // Displaying the new location on UI displayLocation(); } }
nsniteshsahni/City-Guide-Pro
app/src/main/java/xyz/niteshsahni/cityguidepro/activity/LocationFound.java
Java
mit
8,105
# == Schema Information # # Table name: uploaded_files # # id :integer not null, primary key # title :string # description :text # archive :string # created_at :datetime not null # updated_at :datetime not null # publication_id :integer # FactoryGirl.define do factory :uploaded_file do title "MyString" description "MyText" archive "MyString" end end
Senhordim/loop_clipagem
spec/factories/uploaded_files.rb
Ruby
mit
440
<!DOCTYPE html> <html> <head> <title>RESTQuery.java</title> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> <link rel='stylesheet' type='text/css' href='../../../../coverage.css'/> <link rel='shortcut icon' type='image/png' href='../../../../logo.png'/> <script type='text/javascript' src='../../../../coverage.js'></script> <script type='text/javascript' src='../../../../prettify.js'></script> </head> <body onload='prettyPrint()'> <table cellpadding='0' cellspacing='1'> <caption>basex-api/src/main/java/org/basex/http/rest/RESTQuery.java</caption> <tr> <td class='line'>1</td><td>&nbsp;</td> <td><pre class='prettyprint'>package org.basex.http.rest;</pre></td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'></td><td>&nbsp;</td> <td><pre class='imports prettyprint' onclick='showHideLines(this)'><div>import java.io.*; import java.util.*; import java.util.Map.Entry; import org.basex.core.*; import org.basex.core.cmd.*; import org.basex.http.*; import org.basex.query.value.type.*; </div><span>import ...</span></pre></td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'></td><td>&nbsp;</td> <td class='comment' onclick='showHideLines(this)'><div>/** * Evaluate queries via REST. * * @author BaseX Team 2005-16, BSD License * @author Christian Gruen */</div><span>/*...*/</span></td> </tr> <tr> <td class='line'>18</td><td>&nbsp;</td> <td><pre class='prettyprint'>class RESTQuery extends RESTCmd {</pre></td> </tr> <tr> <td class='line'>19</td><td>&nbsp;</td> <td><pre class='comment'> /** External variables. */</pre></td> </tr> <tr> <td class='line'>20</td><td>&nbsp;</td> <td><pre class='prettyprint'> private final Map&lt;String, String[]> vars;</pre></td> </tr> <tr> <td class='line'>21</td><td>&nbsp;</td> <td><pre class='comment'> /** Optional context value. */</pre></td> </tr> <tr> <td class='line'>22</td><td>&nbsp;</td> <td><pre class='prettyprint'> private final String value;</pre></td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'></td><td>&nbsp;</td> <td class='comment' onclick='showHideLines(this)'><div> /** * Constructor. * @param session REST Session * @param vars external variables * @param value context value */</div><span> /*...*/</span></td> </tr> <tr> <td class='line'>30</td><td>&nbsp;</td> <td><pre class='prettyprint'> RESTQuery(final RESTSession session, final Map&lt;String, String[]> vars, final String value) {</pre></td> </tr> <tr> <td class='line'>31</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l31s0'> super(session);</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>32</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l32s0'> this.vars = vars;</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>33</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l33s0'> this.value = value;</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>34</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l34s0'> }</pre> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'>36</td><td>&nbsp;</td> <td><pre class='prettyprint'> @Override</pre></td> </tr> <tr> <td class='line'>37</td><td>&nbsp;</td> <td><pre class='prettyprint'> protected void run0() throws IOException {</pre></td> </tr> <tr> <td class='line'>38</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l38s0'> query(session.context.soptions.get(StaticOptions.WEBPATH));</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>39</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l39s0'> }</pre> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'></td><td>&nbsp;</td> <td class='comment' onclick='showHideLines(this)'><div> /** * Evaluates the specified query. * @param path query path * @throws HTTPException REST exception * @throws IOException I/O exception */</div><span> /*...*/</span></td> </tr> <tr> <td class='line'>47</td><td>&nbsp;</td> <td><pre class='prettyprint'> final void query(final String path) throws IOException {</pre></td> </tr> <tr> <td class='line'>48</td><td>&nbsp;</td> <td><pre class='comment'> // set base path and serialization parameters</pre></td> </tr> <tr> <td class='line'>49</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l49s0'> final HTTPContext http = session.http;</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>50</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l50s0'> context.options.set(MainOptions.QUERYPATH, path);</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>51</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l51s0'> context.options.set(MainOptions.SERIALIZER, http.sopts());</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>52</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l52s0'> http.initResponse();</pre> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'>54</td><td class='count'>20</td> <td><pre class='prettyprint jmp'> <span id='l54s0' title='Executions: 20' class='covered'>for(final Command cmd</span> : <span id='l54s1' title='Executions: 21' class='covered'>session.commands)</span> {</pre> <ol style='display:none'></ol> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>55</td><td class='count'>21</td> <td><pre class='prettyprint jmp'> <span id='l55s0' title='Executions: 21' class='covered'>if(cmd instanceof XQuery)</span> {</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>56</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l56s0'> final XQuery xq = (XQuery) cmd;</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>57</td><td>&nbsp;</td> <td><pre class='comment'> // create query instance</pre></td> </tr> <tr> <td class='line'>58</td><td class='count'>20</td> <td><pre class='prettyprint jmp'> <span id='l58s0' title='Executions: 20' class='covered'>if(value != null)</span> <span id='l58s1' title='Executions: 0' class='uncovered'>xq.bind(null, value, NodeType.DOC.toString());</span></pre> <ol style='display:none'></ol> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'>60</td><td>&nbsp;</td> <td><pre class='comment'> // bind HTTP context and external variables</pre></td> </tr> <tr> <td class='line'>61</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l61s0'> xq.http(http);</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>62</td><td class='count'>20</td> <td><pre class='prettyprint jmp'> <span id='l62s0' title='Executions: 20' class='covered'>for(final Entry&lt;String, String[]> e</span> : <span id='l62s1' title='Executions: 6' class='covered'>vars.entrySet())</span> {</pre> <ol style='display:none'></ol> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>63</td><td class='count'>6</td> <td><pre class='prettyprint covered' id='l63s0'> final String key = e.getKey();</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>64</td><td class='count'>6</td> <td><pre class='prettyprint covered' id='l64s0'> final String[] val = e.getValue();</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>65</td><td class='count'>6</td> <td><pre class='prettyprint jmp'> <span id='l65s0' title='Executions: 6' class='covered'>if(val.length == 2)</span> <span id='l65s1' title='Executions: 0' class='uncovered'>xq.bind(key, val[0], val[1]);</span></pre> <ol style='display:none'></ol> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>66</td><td class='count'>6</td> <td><pre class='prettyprint jmp'> <span id='l66s0' title='Executions: 6' class='covered'>if(val.length == 1)</span> <span id='l66s1' title='Executions: 6' class='covered'>xq.bind(key, val[0]);</span></pre> <ol style='display:none'></ol> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>67</td><td class='count'>6</td> <td><pre class='prettyprint covered' id='l67s0'> }</pre> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'>69</td><td>&nbsp;</td> <td><pre class='comment'> // initializes the response with query serialization options</pre></td> </tr> <tr> <td class='line'>70</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l70s0'> http.sopts().assign(xq.parameters(context));</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>71</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l71s0'> http.initResponse();</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>72</td><td>&nbsp;</td> <td><pre class='prettyprint'> }</pre></td> </tr> <tr> <td class='line'>73</td><td>&nbsp;</td> <td><pre class='comment'> // run command</pre></td> </tr> <tr> <td class='line'>74</td><td class='count'>21</td> <td><pre class='prettyprint covered' id='l74s0'> run(cmd, http.res.getOutputStream());</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>75</td><td class='count'>21</td> <td><pre class='prettyprint covered' id='l75s0'> }</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>76</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l76s0'> }</pre> <ol style='display:none'></ol> </td> </tr> <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr> <tr> <td class='line'></td><td>&nbsp;</td> <td class='comment' onclick='showHideLines(this)'><div> /** * Creates a new instance of this command. * @param session REST session * @param query query * @param vars external variables * @param val context value * @return command * @throws IOException I/O exception */</div><span> /*...*/</span></td> </tr> <tr> <td class='line'>87</td><td>&nbsp;</td> <td><pre class='prettyprint'> @SuppressWarnings("unused")</pre></td> </tr> <tr> <td class='line'>88</td><td>&nbsp;</td> <td><pre class='prettyprint'> static RESTQuery get(final RESTSession session, final String query,</pre></td> </tr> <tr> <td class='line'>89</td><td>&nbsp;</td> <td><pre class='prettyprint'> final Map&lt;String, String[]> vars, final String val) throws IOException {</pre></td> </tr> <tr> <td class='line'>90</td><td class='count'>20</td> <td><pre class='prettyprint covered' id='l90s0'> return new RESTQuery(session.add(new XQuery(query)), vars, val);</pre> <ol style='display:none'></ol> </td> </tr> <tr> <td class='line'>91</td><td>&nbsp;</td> <td><pre class='prettyprint'> }</pre></td> </tr> <tr> <td class='line'>92</td><td>&nbsp;</td> <td><pre class='prettyprint'>}</pre></td> </tr> </table> </body> </html>
hideshis/scripts_for_research
MSRMiningChallenge2017/coverage-report_basex-api/org/basex/http/rest/RESTQuery.html
HTML
mit
12,789
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ApiManagement::Mgmt::V2016_07_07 module Models # # Defines values for ApiProtocolContract # module ApiProtocolContract Http = "Http" Https = "Https" end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/models/api_protocol_contract.rb
Ruby
mit
375
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2017_10_01 module Models # # List of connection monitors. # class ConnectionMonitorListResult include MsRestAzure # @return [Array<ConnectionMonitorResult>] Information about connection # monitors. attr_accessor :value # # Mapper for ConnectionMonitorListResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'ConnectionMonitorListResult', type: { name: 'Composite', class_name: 'ConnectionMonitorListResult', model_properties: { value: { client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'ConnectionMonitorResultElementType', type: { name: 'Composite', class_name: 'ConnectionMonitorResult' } } } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2017-10-01/generated/azure_mgmt_network/models/connection_monitor_list_result.rb
Ruby
mit
1,576
using System.IO; using System.Linq; using Trinity.Extensions; using Trinity.IO; using Trinity.IO.Json; namespace Trinity.Core { public class FunctionCode : ICode, ISerializable { private UInt160 _scriptHash; public byte[] Script { get; set; } public ContractParameterType[] ParameterList { get; set; } public ContractParameterType ReturnType { get; set; } public UInt160 ScriptHash { get { if (_scriptHash == null) { _scriptHash = Script.ToScriptHash(); } return _scriptHash; } } public int Size => Script.GetVarSize() + ParameterList.GetVarSize() + sizeof(ContractParameterType); void ISerializable.Deserialize(BinaryReader reader) { Script = reader.ReadVarBytes(); ParameterList = reader.ReadVarBytes().Select(p => (ContractParameterType) p).ToArray(); ReturnType = (ContractParameterType) reader.ReadByte(); } void ISerializable.Serialize(BinaryWriter writer) { writer.WriteVarBytes(Script); writer.WriteVarBytes(ParameterList.Cast<byte>().ToArray()); writer.Write((byte) ReturnType); } public JObject ToJson() { var json = new JObject(); json["hash"] = ScriptHash.ToString(); json["script"] = Script.ToHexString(); json["parameters"] = new JArray(ParameterList.Select(p => (JObject) p)); json["returntype"] = ReturnType; return json; } } }
detroitpro/trinity
src/trinity/Core/FunctionCode.cs
C#
mit
1,355
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #include "fonctions.h" /* But de la procédure : Lancer une partie ou reprendre une partie int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void gaming (int *grille, int *score) { // Initialisation des variables int successMove = 0; int gameOver = 0; int toucheAppuyee = 0; int toucheFleches = 0; int meilleurScore = getMeilleurScore(); // Tant que la partie n'est pas perdue, on continue le jeu while (gameOver == 0) { // On récupère la touche appuyée while((toucheAppuyee=getch()) == 224) { toucheFleches=getch(); // Touches directionnelles switch (toucheFleches) { // Touche gauche case 75: successMove = moveLeft(grille, score); break; // Touche droite case 77: successMove = moveRight(grille, score); break; // Touche haut case 72: successMove = moveUp(grille, score); break; // Touche bas case 80: successMove = moveDown(grille, score); break; } // Le déplacement a pu être effectué donc on peut générer un nouveau nombre if (successMove == 1) { genereNombre(grille); } resetFlags (grille); successMove = 0; // Affichage da le grille clearScreen(); afficheGrille(grille, score, meilleurScore); // Partie gagnée if (*(grille+32)==0 && testVictoire(grille)==1) { *(grille+32)=1; victoireScreen(grille, score); clearScreen(); afficheGrille(grille, score, meilleurScore); } // Patie perdue if (testGameOver(grille)==1) { gameOver=1; break; } // Partie non perdue: enregistrement de la partie dans le fichier save.txt else { ecritureGrille(grille,score); } } // Touche Esc: quitter la partie if(toucheAppuyee==27) { menu(grille, score); } } // Affichage du l'écran de partie perdue gameOverScreen(grille, score); // Retour au menu menu(grille,score); } /* But de la procédure : Initialise la grille et le score à 0 int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void initZero (int *grille, int *score) { *score = 0; int i; for (i=0; i<33; i++) { *(grille+i)=0; } } /* But de la procédure : Procédure pour faire des sauts de ligne nbLigne : Nombre de lignes à sauter */ void sauteLigne (int nbLigne) { int i; for (i=0; i<nbLigne; i++) { printf("\n"); } } /* But de la procédure : Affichage de la grille avec le score int *grille : Tableau contenant les cases de la partie int *score : Score de la partie int meilleurScore : Meilleur score */ void afficheGrille(int *grille, int *score, int meilleurScore) { // Affichage du score actuel printf("Score actuel : %d\n", *score); // Affichage du meilleur score if (*score>=meilleurScore) { printf("Meilleur Score : %d\n", *score); } else { printf("Meilleur Score : %d\n", meilleurScore); } printf("\n"); // Affichage des lignes de la grille bordureH(); afficheLigne(0,grille); bordureH(); afficheLigne(1,grille); bordureH(); afficheLigne(2,grille); bordureH(); afficheLigne(3,grille); bordureH(); } /* But de la procédure : Affiche les bordures horizontales de la grille */ void bordureH() { int i; for (i=0; i<29; i++) { printf("-"); } printf("\n"); } /* But de la procédure : Affiche la ligne contenant la valeur ainsi que les deux lignes vides qui l'entourent int ligne : Numéro de la ligne à afficher (0, 1, 2 ou 3) int *grille : Tableau contenant les cases de la partie */ void afficheLigne(int ligne,int *grille) { int i,j,k,l,nombre; l=0; for(i=0; i<3; i++) { // Affichage des deux lignes vides if (i!=1) { for (j=0; j<4; j++) { printf("| "); } printf("|\n"); } // Affichage de la ligne contenant le nombre à afficher else { for (j=0; j<4; j++) { printf("|"); nombre=*(grille + l + (ligne * 8)); for(k=0; k<6-tailleNombre(nombre); k++) { printf(" "); } if (nombre==0) { printf(" "); } else { changeColor(nombre); printf("%d", nombre); color(15); } l+=2; } printf("|\n"); } } } /* But de la fonction : Renvoie la taille d'un nombre (en digit) int nombre : Nombre dont on souhaite connaitre la taille */ int tailleNombre(int nombre) { int i=1; int j=0; while(nombre>=i) { i*=10; j++; } if (j==0) return 1; return j; } /* But de la procédure : Procédure pour effacer le contenu de la console */ void clearScreen () { system("cls"); } /* But de la procédure : Lecture du fichier save.txt pour récupérer la grille et le score enregistrés int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void lectureGrille (int *grille, int *score) { int i; FILE *fichierSave = NULL; fichierSave = fopen("save.txt", "r"); for (i=0; i<16; i++) { fscanf(fichierSave, "%d", (grille + i*2)); } fscanf(fichierSave, "%d", score); fscanf(fichierSave, "%d", (grille+32)); fclose(fichierSave); } /* But de la procédure : Enregistre la grille et le score dans le fichier save.txt int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void ecritureGrille (int *grille, int *score) { int i; FILE *fichierSave = NULL; fichierSave = fopen("save.txt", "w"); for (i=0; i<16; i++) { fprintf(fichierSave, "%d\n", *(grille+i*2)); } fprintf(fichierSave, "%d\n", *score); fprintf(fichierSave, "%d", *(grille+32)); fclose(fichierSave); } /* But des fonctions : Fonctions de déplacement et d'addition dans la grille puis incrémentation du score Return: renvoie 1 si un mouvement a été effectué, sinon 0 int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ int moveLeft (int *grille,int *score) { int ligne; int colonne; int continuer; int aajoute = 0; int adeplace = 0; int mouvementvalable=0; for(ligne=0; ligne<4; ligne++) { continuer = 1; while (continuer == 1) { // Déplacement des cases for (colonne=1; colonne<4; colonne++) { if (*(grille + (colonne*2-2) + (ligne * 8)) == 0 && *(grille + colonne*2 + (ligne * 8)) != 0 ) { *(grille + (colonne*2-2) + (ligne * 8))=*(grille + colonne*2 + (ligne * 8));//deplace le nb *(grille + (colonne*2-1) + (ligne * 8))=*(grille + (colonne*2+1) + (ligne * 8));// deplace le flag *(grille + colonne*2 + (ligne * 8)) = 0; *(grille + (colonne*2+1) + (ligne * 8)) = 0; adeplace = 1; mouvementvalable=1; } } // Ajout des cases for (colonne=1; colonne<4; colonne++) { if (*(grille + (colonne*2-2) + (ligne * 8)) == *(grille + colonne*2 + (ligne * 8)) && *(grille + (colonne*2-2) + (ligne * 8)) !=0 && *(grille + (colonne*2-1) + (ligne * 8)) == 0 && *(grille + colonne*2+1 + (ligne * 8)) == 0 ) { *(grille + (colonne*2-2) + (ligne * 8)) = *(grille + (colonne*2-2) + (ligne * 8))*2; *score += *(grille + (colonne*2-2) + (ligne * 8)); *(grille + (colonne*2-1) + (ligne * 8)) = 1; *(grille + colonne*2 + (ligne * 8)) = 0; aajoute = 1; mouvementvalable=1; } } // Sortie de la boucle: aucun déplacement + aucun ajout if(adeplace == 0 && aajoute == 0) { continuer = 0; } adeplace = 0; aajoute = 0; } } return mouvementvalable; } int moveRight (int *grille,int *score) { int ligne; int colonne; int continuer; int aajoute = 0; int adeplace = 0; int mouvementvalable=0; for(ligne=0; ligne<4; ligne++) { continuer = 1; while (continuer == 1) { // Déplacement des cases for (colonne=3; colonne>0; colonne--) { if (*(grille + (colonne*2) + (ligne * 8)) == 0 && *(grille + colonne*2-2 + (ligne * 8)) != 0 ) { *(grille + (colonne*2) + (ligne * 8))=*(grille + colonne*2-2 + (ligne * 8));//deplace le nb *(grille + (colonne*2+1) + (ligne * 8))=*(grille + (colonne*2-1) + (ligne * 8));// deplace le flag *(grille + colonne*2-2 + (ligne * 8)) = 0; *(grille + (colonne*2-1) + (ligne * 8)) = 0; adeplace = 1; mouvementvalable=1; } } // Ajout des cases for (colonne=3; colonne>0; colonne--) { if (*(grille + (colonne*2-2) + (ligne * 8)) == *(grille + colonne*2 + (ligne * 8)) && *(grille + (colonne*2-2) + (ligne * 8)) != 0 && *(grille + (colonne*2-1) + (ligne * 8)) == 0 && *(grille + colonne*2+1 + (ligne * 8)) == 0 ) { *(grille + (colonne*2) + (ligne * 8)) = *(grille + (colonne*2) + (ligne * 8))*2; *score += *(grille + (colonne*2) + (ligne * 8)); *(grille + (colonne*2+1) + (ligne * 8)) = 1; *(grille + colonne*2-2 + (ligne * 8)) = 0; aajoute = 1; mouvementvalable=1; } } // Sortie de la boucle: aucun déplacement + aucun ajout if(adeplace == 0 && aajoute == 0) { continuer = 0; } adeplace = 0; aajoute = 0; } } return mouvementvalable; } int moveUp (int *grille,int *score) { int ligne; int colonne; int continuer; int aajoute = 0; int adeplace = 0; int mouvementvalable = 0; for(colonne=0; colonne<4; colonne++) { continuer = 1; while (continuer == 1) { // Déplacement des cases for (ligne=1; ligne<4; ligne++) { if (*(grille + colonne*2 + ((ligne-1) * 8)) == 0 && *(grille + colonne*2 + (ligne * 8)) != 0 ) { *(grille + (colonne*2) + ((ligne-1) * 8))=*(grille + colonne*2 + (ligne * 8));//deplace le nb *(grille + (colonne*2+1) + ((ligne-1) * 8))=*(grille + (colonne*2+1) + (ligne * 8));// deplace le flag *(grille + colonne*2 + (ligne * 8)) = 0;//reset le nombre *(grille + (colonne*2+1) + (ligne * 8)) = 0;//reset le flag mouvementvalable=1; adeplace = 1; } } // Ajout des cases for (ligne=1; ligne<4; ligne++) { if (*(grille + (colonne*2) + ((ligne-1) * 8)) == *(grille + colonne*2 + (ligne * 8)) && *(grille + (colonne*2) + ((ligne-1) * 8)) != 0 && *(grille + (colonne*2+1) + ((ligne-1) * 8)) == 0 && *(grille + colonne*2+1 + (ligne * 8)) == 0 ) { *(grille + (colonne*2) + ((ligne-1) * 8)) = *(grille + (colonne*2) + (ligne * 8))*2;//ajout *score += *(grille + (colonne*2) + ((ligne-1) * 8)); *(grille + (colonne*2+1) + ((ligne-1) * 8)) = 1;//chmt flag *(grille + colonne*2 + (ligne * 8)) = 0;//reset nombre aajoute = 1; mouvementvalable=1; } } // Sortie de la boucle: aucun déplacement + aucun ajout if(adeplace == 0 && aajoute == 0) { continuer = 0; } adeplace = 0; aajoute = 0; } } return mouvementvalable; } int moveDown (int *grille,int *score) { int ligne; int colonne; int continuer; int aajoute = 0; int adeplace = 0; int mouvementvalable = 0; for(colonne=0; colonne<4; colonne++) { continuer = 1; while (continuer == 1) { // Déplacement des cases for (ligne=3; ligne>0; ligne--) { if (*(grille + colonne*2 + ((ligne-1) * 8)) != 0 && *(grille + colonne*2 + (ligne * 8)) == 0 ) { *(grille + (colonne*2) + (ligne * 8))=*(grille + colonne*2 + ((ligne-1) * 8));//deplace le nb *(grille + (colonne*2+1) + (ligne * 8))=*(grille + (colonne*2+1) + ((ligne-1) * 8));// deplace le flag *(grille + colonne*2 + ((ligne-1) * 8)) = 0;//reset le nombre *(grille + (colonne*2+1) + ((ligne-1) * 8)) = 0;//reset le flag adeplace = 1; mouvementvalable=1; } } // Ajout des cases for (ligne=3; ligne>0; ligne--) { if (*(grille + (colonne*2) + ((ligne-1) * 8)) == *(grille + colonne*2 + (ligne * 8)) && *(grille + (colonne*2) + ((ligne-1) * 8)) != 0 && *(grille + (colonne*2+1) + ((ligne-1) * 8)) == 0 && *(grille + colonne*2+1 + (ligne * 8)) == 0 ) { *(grille + (colonne*2) + (ligne * 8)) = *(grille + (colonne*2) + (ligne * 8))*2;//ajout *score += *(grille + (colonne*2) + (ligne * 8)); *(grille + (colonne*2+1) + (ligne * 8)) = 1;//chmt flag *(grille + colonne*2 + ((ligne-1) * 8)) = 0;//reset nombre aajoute = 1; mouvementvalable=1; } } // Sortie de la boucle: aucun déplacement + aucun ajout if(adeplace == 0 && aajoute == 0) { continuer = 0; } adeplace = 0; aajoute = 0; } } return mouvementvalable; } /* But de la procédure : Génère un nombre aléatoire dans une case libre int *grille : Tableau contenant les cases de la partie */ void genereNombre (int *grille) { int nombreAjouter = 0, i=0, compteur = 0, position = 0, compteur2 = 0; int positionTrouvee = 0; // On genere un nombre aléatoire: 2 ou 4 nombreAjouter = ((rand()%2) *2)+2; // On récupère le nombre de cases vides for (i=0; i<16; i++) { if (*(grille+i*2) == 0) { compteur ++; } } // On génère aléatoirement la postion du nouveau nombre en fonction du nombre de cases vides position = (rand()%compteur)+1; if(position!=0) { i=0; // Tant que la nouvelle position n'est pas une case vide while(positionTrouvee==0) { if (*(grille+i*2) == 0) { compteur2 ++; } if (compteur2 == position) { *(grille+i*2) = nombreAjouter; positionTrouvee=1; } i++; } } } /* But de la procédure : Initialise les booléens qui gèrent la mise en mémoire d'une addition int *grille : Tableau contenant les cases de la partie */ void resetFlags (int *grille) { int i; for (i=0; i<16; i++) { *(grille + i*2 + 1)=0; } } /* But de la fonction : Renvoie 1 si la partie est perdue, sinon 0 int *grille : Tableau contenant les cases de la partie */ int testGameOver(int* grille) { int i,j; int casePrecedente, caseSuivante; // Renvoie 0 si une case est vide for (i=0; i<16; i++) { if (*(grille + i*2)==0) { return 0; } } // Renvoie 0 si deux cases adjacentes horizontalement sont égales for (i=0; i<4; i++) { for (j=0; j<3; j++) { casePrecedente = *(grille + j*2 + i*8); caseSuivante = *(grille + j*2 + i*8 + 2); if (casePrecedente == caseSuivante) { return 0; } } } // Renvoie 0 si deux cases adjacentes verticalement sont égales for (i=0; i<3; i++) { for (j=0; j<4; j++) { casePrecedente = *(grille + j*2 + i*8); caseSuivante = *(grille + j*2 + i*8 + 8); if (casePrecedente == caseSuivante) { return 0; } } } return 1; } /* But de la procédure : Affiche le menu principal int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void menu (int *grille, int *score) { int menu = 0; // Affichage du menu clearScreen(); printf("Bienvenue dans le 2048 !"); sauteLigne(5); printf("1) Commencer une nouvelle partie"); sauteLigne(2); printf("2) Reprendre la partie"); sauteLigne(2); printf("3) Afficher les scores"); sauteLigne(2); printf("4) Demarrer le tutoriel"); sauteLigne(2); printf("5) Quitter"); sauteLigne(3); // On récupère la touche appuyée while (menu<49 || menu>53) { menu = getch(); } switch(menu) { // Nouvelle partie case 49: initZero(grille, score); genereNombre(grille); genereNombre(grille); clearScreen(); afficheGrille(grille, score , getMeilleurScore()); gaming(grille, score); break; // Charger une partie case 50: initZero(grille, score); if (testSave(grille, score) == 1) { lectureGrille(grille, score); clearScreen(); afficheGrille(grille, score, getMeilleurScore()); gaming(grille, score); } else { clearScreen(); noSave(grille, score); } break; // 10 Meilleurs Scores case 51: afficheScores(grille, score); break; // Tutoriel case 52: tutoriel(grille, score); break; // Quitter case 53: exit(0); break; } } /* But de la procédure : Procédure pour trier les 10 meilleurs scores dans le fichier scores.txt avec ajout du dernier si besoin int score : Score de la partie char *TabPseudo : Pseudo du joueur */ void triScore(int score, char *TabPseudo) { int i, j; int flagMove=0; int TabScores[11]; char TabPseudos[11][20]; int SaveScore; FILE *fichierScore = NULL; fichierScore = fopen("scores.txt", "r"); i=0; while (i<11) { fscanf(fichierScore, "%d", &SaveScore ); if (score<SaveScore || flagMove==1) { TabScores[i]=SaveScore; fscanf(fichierScore, "%s", TabPseudos[i] ); } else if (flagMove == 0) { flagMove=1; TabScores[i]=score; for (j=0; j<20; j++) { TabPseudos[i][j]=TabPseudo[j]; } i++; TabScores[i]=SaveScore; fscanf(fichierScore, "%s", TabPseudos[i] ); } i++; } fclose(fichierScore); fichierScore = fopen("scores.txt", "w"); // On réécrit les 10 meilleurs scores avec les pseudos correspondant for (i=0; i<10; i++) { fprintf(fichierScore, "%d\n", TabScores[i]); fprintf(fichierScore, "%s\n", TabPseudos[i]); } fclose(fichierScore); } /* But de la procédure : Ecran affiché lorsqu'une partie est perdue int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void gameOverScreen(int *grille, int *score) { int i; char TabPseudo[20]; printf("Vous avez perdu\n"); printf("Votre score : %d\n", *score); printf("Entrez votre pseudo (max 19 caracteres) : "); scanf("%s", TabPseudo); i=0; // Entree du pseudo while(TabPseudo[i]!='\0') { i++; if (i==20) { clearScreen(); printf("\nErreur vous n'avez pas respecte la limite !\n"); exit(99); } } triScore(*score, TabPseudo); initZero(grille, score); ecritureGrille(grille, score); } /* But de la fonction : Renvoie 1 si la partie est gagnée, sinon 0 int *grille : Tableau contenant les cases de la partie */ int testVictoire(int *grille) { int i; for (i=0; i<16; i++) { if (*(grille + i*2)==2048) { return 1; } } return 0; } /* But de la fonction : Ecran affiché lorsqu'une partie est gagnée Return: Renvoie 0 pour sortir de la fonction int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ int victoireScreen(int *grille, int *score) { int continuerJouer=0; printf("Vous avez gagne\n"); printf("Votre score actuel : %d\n", *score); printf("Voulez vous continuer a jouer ? (O/N)"); // On récupère la touche enfoncée while (continuerJouer!=78 && continuerJouer!=79 && continuerJouer!=110 && continuerJouer!=111) { continuerJouer = getch(); switch(continuerJouer) { // Touche 'n': quitter case 110: ecritureGrille(grille, score); menu(grille, score); break; // Touche 'N': quitter case 78: ecritureGrille(grille, score); menu(grille, score); break; // Touche 'o': continuer case 111: return 0; clearScreen(); afficheGrille(grille, score, getMeilleurScore()); gaming(grille, score); break; // Touche 'O': continuer case 79: return 0; clearScreen(); afficheGrille(grille, score, getMeilleurScore()); gaming(grille, score); break; } } } /* But de la procédure : Choix de la couleur à afficher en fonction du nombre à afficher int nombre : Nombre à afficher */ void changeColor(int nombre) { switch (nombre) { case 2: color(10); break; case 4: color(14); break; case 8: color(12); break; case 16: color(11); break; case 32: color(13); break; case 64: color(9); break; case 128: color(6); break; case 256: color(5); break; case 512: color(3); break; case 1024: color(4); break; } } /* But de la procédure : Gestion de la couleur de la console int c : Nombre allant de 0 à 15, chaque valeur correspondant à une couleur différente */ void color(int c) { HANDLE H=GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(H,0*16+c); } /* But de la procédure : Affiche les 10 meilleurs scores enregistrés dans le fichier scores.txt int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void afficheScores(int *grille, int *score) { int i; int quitter; int scoreAffiche; char pseudo[20]; FILE *fichierScore = NULL; fichierScore = fopen("scores.txt", "r"); clearScreen(); printf("10 meilleurs scores:\n\n"); for (i=0; i<20; i++) { // Affichage des scores if (i%2 == 0) { fscanf(fichierScore, "%d", &scoreAffiche ); if (scoreAffiche != 0) { printf("%d: %d ", (i/2)+1, scoreAffiche); } } // Affichage des pseudos else { fscanf(fichierScore, "%s", pseudo ); if (scoreAffiche != 0) { printf("%s\n", pseudo); } } } fclose(fichierScore); printf("\n"); printf("Quitter : Esc\n"); // Attente de la touche Esc: quitter quitter=0; while (quitter != 27) { quitter = getch(); } if (quitter == 27) { menu(grille, score); } } /* But de la fonction : Renvoie 1 si une partie est enregistrée dans le fichier save.txt, sinon 0 int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ int testSave(int *grille, int *score) { int i; lectureGrille(grille, score); for (i=0; i<16; i++) { if (*(grille + i*2)!=0) { return 1; } } return 0; } /* But de la procédure : Affichage lorsqu'il n'existe pas de partie enregistrée int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void noSave(int *grille, int *score) { int quitter; printf("Il n'y a pas de partie enregistree."); sauteLigne(2); printf("Quitter : Esc\n"); quitter=0; while (quitter != 27) { quitter = getch(); } if (quitter == 27) { menu(grille, score); } } /* But de la procédure : Tutoriel int *grille : Tableau contenant les cases de la partie int *score : Score de la partie */ void tutoriel(int *grille, int *score) { int mouvement=0; initZero(grille, score); grille[18]=2; grille[22]=2; clearScreen(); printf("Bienvenue dans le tutoriel du 2048.\n\n"); printf("Servez-vous des fleches directionnelles pour effectuer un deplacement.\n"); printf("Pour sortir de la partie, appuyez sur Esc.\n\n"); printf("La partie est automatiquement enregistree a chaque deplacement effectue.\n\n"); printf("La partie est gagnee lorsque le nombre 2048 est atteint.\n"); printf("La partie est perdue lorsqu'aucun deplacement n'est possible.\n\n"); system("pause"); clearScreen(); printf("Maintenant, appuyez sur la touche droite pour faire combiner les deux nombres.\n\n"); bordureH(); afficheLigne(0,grille); bordureH(); afficheLigne(1,grille); bordureH(); afficheLigne(2,grille); bordureH(); afficheLigne(3,grille); bordureH(); // Attente de la fleche directionnelle droite while (mouvement != 77) { mouvement = getch(); } mouvement=0; moveRight(grille, score); genereNombre(grille); while(victoireTuto(grille)==0) { int successMove; clearScreen(); printf("Bravo ! Maintenant, essayez d'atteindre 64.\n\n"); bordureH(); afficheLigne(0,grille); bordureH(); afficheLigne(1,grille); bordureH(); afficheLigne(2,grille); bordureH(); afficheLigne(3,grille); bordureH(); while (mouvement==0) { mouvement=getch(); } switch(mouvement) { case 75: successMove = moveLeft(grille, score); break; case 77: successMove = moveRight(grille, score); break; case 72: successMove = moveUp(grille, score); break; case 80: successMove = moveDown(grille, score); break; } if (successMove == 1) { genereNombre(grille); } resetFlags (grille); successMove = 0; mouvement=0; } clearScreen(); printf("Bravo ! Maintenant, essayez d'atteindre 64.\n\n"); bordureH(); afficheLigne(0,grille); bordureH(); afficheLigne(1,grille); bordureH(); afficheLigne(2,grille); bordureH(); afficheLigne(3,grille); bordureH(); printf("\nFelicitations, vous avez fini le tutoriel.\n\n"); system("pause"); menu(grille, score); } /* But de la fonction : Renvoie 1 si le tutoriel est réussi, sinon 0 int *grille : Tableau contenant les cases de la partie */ int victoireTuto(int *grille) { int i; for (i=0; i<16; i++) { if (*(grille+(i*2)) == 64) { return 1; } } return 0; } /* But de la fonction : Récupère le meilleur score du fichier score.txt Return: Renvoie le meilleur score */ int getMeilleurScore() { int meilleurScore; FILE *fichierScore = NULL; fichierScore = fopen("scores.txt", "r"); fscanf(fichierScore, "%d", &meilleurScore); fclose(fichierScore); return(meilleurScore); } /* But de la fonction : Test la présence du fichier scores.txt et initialise 10 scores nuls si le fichier n'existe pas */ void initScores() { int i; FILE *fichierScore = NULL; fichierScore = fopen("scores.txt", "r"); if (fichierScore == NULL) { fclose(fichierScore); fichierScore = fopen("scores.txt", "w"); for (i=0; i<10; i++) { fprintf(fichierScore, "0\n"); fprintf(fichierScore, " \n"); } fprintf(fichierScore, "\n"); } fclose(fichierScore); }
kokno/2048-c
Code_Source/fonctions.c
C
mit
29,801
package jeliot.theater; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Point; /** * ReferenceVariableActor represents graphically the * variables of the reference type. It can bind * ReferenceActor instances and render them. * * @author Pekka Uronen * @author Niko Myller * * @see jeliot.lang.Variable * @see jeliot.theater.VariableActor * @see jeliot.theater.VariableInArrayActor * @see jeliot.theater.MethodStage * @see jeliot.theater.ObjectStage */ public class ReferenceVariableActor extends VariableActor { // DOC: Document! /** * */ private int refWidth = ActorFactory.typeValWidth[9]; /** * */ private int refLen = 18; /** * */ private ReferenceActor refActor; /** * */ private ReferenceActor reservedRefActor; /* (non-Javadoc) * @see jeliot.theater.Actor#paintActor(java.awt.Graphics) */ public void paintActor(Graphics g) { int w = width; int h = height; int bw = borderWidth; // fill background g.setColor( (light == HIGHLIGHT) ? darkColor : bgcolor ); g.fillRect(bw, bw, w - 2 * bw, h - 2 * bw); // draw the name g.setFont(font); g.setColor((light == HIGHLIGHT) ? lightColor : fgcolor); g.drawString(getLabel(), namex, namey); // draw border ActorContainer parent = getParent(); g.setColor( (parent instanceof Actor) ? ( (Actor)parent ).darkColor : fgcolor ); g.drawLine(0, 0, w-1, 0); g.drawLine(0, 0, 0, h-1); g.setColor( (parent instanceof Actor) ? ( (Actor)parent ).lightColor : fgcolor ); g.drawLine(1, h-1, w-1, h-1); g.drawLine(w-1, 1, w-1, h-1); g.setColor(fgcolor); g.drawRect(1, 1, w-3, h-3); g.setColor(darkColor); g.drawLine(2, h-3, w-3, h-3); g.drawLine(w-3, 2, w-3, h-3); g.setColor(lightColor); g.drawLine(2, 2, w-3, 2); g.drawLine(2, 2, 2, h-3); // draw link if (refActor == null) { // draw reference area g.setColor(darkColor); g.fillRect(w - bw - refWidth, bw, refWidth, h - 2 * bw); g.setColor(fgcolor); int a = w - 2 + refLen; //System.out.println("w = "+w +", h = " +h); g.drawLine(w-2, h/2-1, a, h/2-1); g.drawLine(w-2, h/2+1, a, h/2+1); g.drawLine(a, h/2 - 6, a, h/2 + 6); g.drawLine(a + 2, h/2 - 6, a + 2, h/2 + 6); g.setColor(bgcolor); g.drawLine(w-2, valueh/2, a, valueh/2); g.drawLine(a+1, valueh/2 - 6, a+1, valueh/2 + 6); } else { int actx = refActor.getX(); int acty = refActor.getY(); g.translate(actx, acty); refActor.paintActor(g); g.translate(-actx, -acty); /* Point p = getRootLocation(); g.translate(-p.x, -p.y); refActor.paintActor(g); g.translate(p.x, p.y); */ } } /* (non-Javadoc) * @see jeliot.theater.Actor#setBounds(int, int, int, int) */ public void setBounds(int x, int y, int w, int h) { int oldw = getWidth(); int oldh = getHeight(); super.setBounds(x, y, w, h); if (w != oldw || h != oldh) { calcLabelPosition(); } } /* (non-Javadoc) * @see jeliot.theater.Actor#calculateSize() */ public void calculateSize() { FontMetrics fm = getFontMetrics(); int sw = fm.stringWidth(getLabel()); int sh = fm.getHeight(); setSize(2 * borderWidth + insets.right + insets.left + refWidth + sw, insets.top + insets.bottom + 4 * borderWidth + Math.max(valueh, sh)); } /** * @param refActor */ public void setReference(ReferenceActor refActor) { this.refActor = refActor; } /* (non-Javadoc) * @see jeliot.theater.VariableActor#reserve(jeliot.theater.ValueActor) */ public Point reserve(ValueActor actor) { if (actor instanceof ReferenceActor) { return reserve((ReferenceActor) actor); } return super.reserve(actor); } /** * @param actor * @return */ public Point reserve(ReferenceActor actor) { this.reservedRefActor = actor; Point rp = getRootLocation(); //int w = actor.width; //int h = actor.height; rp.translate(width - borderWidth - refWidth - 3, (height - actor.height)/2 + borderWidth); return rp; } /* (non-Javadoc) * @see jeliot.theater.VariableActor#bind() */ public void bind() { this.refActor = this.reservedRefActor; refActor.setParent(this); refActor.setLocation(width - borderWidth - refWidth - 3, (height - refActor.height)/2 + borderWidth); } /** * @param actor */ public void setValue(ReferenceActor actor) { this.reservedRefActor = actor; bind(); } /* (non-Javadoc) * @see jeliot.theater.VariableActor#getValue() */ public ValueActor getValue() { ValueActor act = (ReferenceActor) this.refActor.clone(); return act; } /** * */ public void theatreResized() { if (refActor != null) { refActor.calculateBends(); } } }
moegyver/mJeliot
Jeliot/src/jeliot/theater/ReferenceVariableActor.java
Java
mit
5,779
function load_servers(addr) { //ajax $.get(addr,function(json,status){ // same as loadServers(addr) serversElement = document.getElementById("servers-list"); var innerHtmls = ""; for (var obj in json) { innerHtmls = innerHtmls + " <li><a href=\"server.html?id="+json[obj].id+"\">"+ json[obj].displayName+"</a></li>" } console.log(json); serversElement.innerHTML=innerHtmls; //add to ServersPage $.each(json,function(idx, obj) { if(obj.id == window.servername) { $("#displayName").text(obj.displayName); } }); }); } function load_hoststatus() { $("#id").text(window.servername); console.log(window.hosts); //ajax $.get("/data/host-status.json",function(data,status){ window.hosts_status = data; $.each(data, function(idx,obj) { if(obj.id == window.servername) { $("#address").text(obj.address); $("#ip").text(obj.ip); $("#link").attr("href","http://"+obj.address); $("#status").text(obj.status); $("#delay").text(obj.delay); switch(obj.status) { case "online": $(".panel-default").addClass("panel-success");break; case "offline": $(".panel-default").addClass("panel-danger");break; case "unknown": $(".panel-default").addClass("panel-warning");break; } datestr = /Date\((\d+)\)/.exec(obj.time.value)[1]; $("#time").text(new Date(parseInt(datestr))); } }) }); } $(document).ready(function() { load_servers("../../servers.json"); load_hoststatus(); });
synusoft/HostWatcher
v2/js/serverPage.js
JavaScript
mit
1,865
// // BaseViewController.h // RouterManager // // Created by 周际航 on 2017/8/14. // Copyright © 2017年 周际航. All rights reserved. // #import <UIKit/UIKit.h> #import "XZRouterManager.h" @interface BaseViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, XZRoutableProtocol> @property (nonatomic, strong, readonly, nullable) UITableView *base_tableView; - (NSString *_Nonnull)overload_cellTextForRowAtIndexPath:(NSIndexPath *_Nonnull)indexPath NS_REQUIRES_SUPER; - (void)overload_cellDidSelectAtIndexPath:(NSIndexPath *_Nonnull)indexPath; @end
zhoujihang/ControllerRouterManager
RouterManager/RouterManager/Common/Base/BaseViewController.h
C
mit
588
// ----------------------------------------------------------------------- // <copyright file="MediaManager.cs" company=""> // TODO: Update copyright text. // </copyright> // ----------------------------------------------------------------------- namespace Crypton.AvChat.Gui.Media { using System; using System.Collections.Generic; using System.Linq; using System.Text; /// <summary> /// Accesses media elements /// </summary> internal static class MediaManager { public static Sound.SoundDirectory Sounds = new Sound.SoundDirectory(); } }
CryptonZylog/ueravchatclient
Crypton.AvChat.Gui/Media/MediaManager.cs
C#
mit
591
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>知乎 - 与世界分享你的知识、经验和见解</title> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <style> body{padding: 0;margin: 0;background: #F7FAFC;} a{text-decoration: none;} .index-box{width:300px;height: auto;margin:0 auto;margin-top: 40px;} .logo{background: url(QQ截图20161109160412.png) no-repeat;;width: 185px;height: 90px;margin:0 auto} .title{font-size: 18px;text-align: center;color: #707171;font-weight: bold;margin: 30px auto;} .index-body{text-align: center;} .nav-sliders{position: relative;display: inline-block;margin-bottom: 20px;} .nav-sliders>a{font-size: 20px;display: inline-block;width:60px ;font-family: "微软雅黑";color: #999;cursor: pointer;float: left;$width} .nav-sliders>a.active{color: #0f88eb;} .nav-sliders>span{position: absolute;height: 2px;background:#0f88eb;display:block;left: 5px;width: 50px;bottom:-8px;} .login-box{width: 300px;display: none;} .wrap{border:1px solid #d5d5d5;border-radius: 5px;background: #fff;} .wrap>div{position: relative;overflow: hidden;} .wrap>div>input{width: 95%;border:none;padding:17px 2.5%;border-radius: 5px;} .wrap>div>label.error{position: absolute;color: #c33;top: 0;line-height: 50px;transform: translate(25px,0);transition: all 0.5s ease-out;-webkit-transform: translate(25px,0);-moz-transform: translate(25px,0);opacity: 0;visibility:hidden;cursor: text;} .wrap>div>label.move{transform: translate(0,0);transition: all 0.5s ease-out;-webkit-transform: translate(0,0);-moz-transform: translate(0,0);opacity: 1;visibility: visible;} .password{border-top: solid 1px #d5d5d5 ;} .code{right:115px ;} .button{height: 40px;background:#0f88eb;text-align: center;line-height: 40px;border-radius: 5px;margin-top: 25px;color: #fff;font-family: "微软雅黑";cursor: pointer;} .remember{text-align: left;margin-top: 20px;font-family: "微软雅黑";color: #666666;} .remember>a{float:right;cursor: pointer;color: #666666;} .other{text-align: left;margin-top: 20px;font-family: "微软雅黑";color: #666666;overflow: hidden;} .other>span{font-size: 14px;float: left;margin-top: 2px;cursor: pointer;} .other>div{float: left; transition: all 1s ease-in;-webkit-transition: all 0.3s ease-in;opacity: 0;transform: translateX(-20px);-webkit-transform: translateX(-18px);-moz-transform: translateX(-18px);visibility: hidden;} .other>div>a{margin-left: 20px;color: #666666;font-size: 15px;} .other>.hidden{ transition: all 1s ease-in;display: block;-webkit-transition: all 0.3s ease-in;opacity: 1;transform: translateX(0);-webkit-transform: translateX(0);-moz-transform: translateX(0);visibility: visible;} .download{border:solid 1px #0f88eb;height: 40px;line-height: 40px;border-radius: 5px;color:#0f88eb ;font-family: "微软雅黑";margin-top: 50px;cursor: pointer;position: relative;} .download>.close{display: none;} .download .pic{display:none;position: absolute;background: #fff;bottom: 78px;width: 310px;left: -10px;z-index: 5;padding: 40px 0;border-radius: 8px;box-shadow: 0 0 8px 0 rgba(0,0,0,.15);} .registered-box{width: 300px;} .text{font-size: 14px;margin-top: 20px;font-family: "微软雅黑";color: #666666;} .text>a{color: #0f88eb;} .verification-code{position: absolute;right:22px;top: 14px;font-family: "微软雅黑";font-size: 18px;cursor: pointer;} #register:hover{opacity: 0.7;} #login:hover{opacity: 0.7;} </style> </head> <body> <div class="index-box"> <div class="index-header"> <h1 class="logo"></h1> <h2 class="title">与世界分享你的知识、经验和见解</h2> </div> <div class="index-body"> <div class="nav-sliders"> <a class="registered active">注册</a> <a class="login">登录</a> <span class="on"></span> </div> <div class="change"> <!--注册开始--> <div class="registered-box"> <div class="wrap"> <div class="phone"> <input type="text" name="" value="" id="name" placeholder="姓名"> <label class="error name">请输入姓名</label> </div> <div class="password"> <input type="tel" id="phone" value="" placeholder="手机号" max="11"> <label class="error phone restet">请输入手机号</label> </div> <div class="password"> <input type="password" id="passwor" name="" maxlength="6" value="" placeholder="密码(不少于6位)"> <label class="error passwor" >请输入密码</label> </div> <div class="password"> <input type="text" id="code" name="" maxlength="6" value="" placeholder="验证码"> <label class="error passwor code">请输入验证码</label> <div class="verification-code" id="createCade"></div> </div> </div> <div class="button" id="register">注册</div> <div class="text">点击「注册」按钮,即代表你同意<a href="/terms" target="_blank">《知乎协议》</a></div> <div class="download"> <span>下载知乎app</span> <span class="close">关闭二维码</span> <div class="pic"><img src="QQ截图20161109160031.png"></div> </div> </div> <!--注册结束--> <!--登录开始--> <div class="login-box"> <div class="wrap"> <div class="phone"> <input type="text" name="" id="login-phone" value="" placeholder="手机号或邮箱"> <label class="error phone restet">请输入手机号</label> </div> <div class="password"> <input type="password" name="" id="login-password" placeholder="密码" maxlength="6"> <label class="error phone">请输入密码</label> </div> </div> <div class="button" id="login">登录</div> <div class="remember"> <label><input type="checkbox">记住我:</label> <a>无法登陆?</a> </div> <div class="other"> <span>社交账号登录</span> <div class="other-login"> <a href="#">扣扣</a> <a href="#">微信</a> <a href="#">微博</a> </div> </div> <div class="download"> <span>下载知乎app</span> <span class="close">关闭二维码</span> <div class="pic"><img src="QQ截图20161109160031.png"></div> </div> </div> <!--登录结束--> </div> </div> </div> <script> var code;//定义一个全局验证码 $(function(){ jcPublic.register(); jcPublic.Tab(); jcPublic.login(); jcPublic.downLoad(); jcPublic.createCode(); jcPublic.clickCode(); $(".wrap>div>input").focus(function(){ $(this).css({"outline": "none" }); var $this = $(this); $this.next("label").removeClass("move")//隐藏提示信息 }) $(".other>span").on("click",function(){ $(this).parent().children("div").toggleClass("hidden"); }) }) var jcPublic = { register:function(){//注册 var currentThis = this//当前对象 $("#register").on("click",function(){ var $this = $(this); var name = $("#name").val();//姓名 var phone = $("#phone").val();//电话 var passwor = $("#passwor").val(); var Code = $("#code").val();//验证码 var p_reg = /^0{0,1}(13[0-9]|15[0-9]|153|156|18[0-9])[0-9]{8}$/;//电话验证 if(name.length==0 && phone.length==0 && passwor.length==0){//同时为空 $this.prev(".wrap").find("label").addClass("move"); return false; }else if(name == "" || name == "undefined" || name == "null"){ $this.prev(".wrap").find(".name").addClass("move"); return false; }else if(phone == "" || phone == "undefined" || phone == "null"){ $this.prev(".wrap").find(".phone").addClass("move"); return false; }else if(passwor == "" || passwor == "undefined" || passwor == null ){ $this.prev(".wrap").find(".passwor").addClass("move"); return false; }else if(Code == "" || Code == "undefined" || Code == null ){ $this.prev(".wrap").find(".code").addClass("move"); return false; }else if(code !== Code ){ $this.prev(".wrap").find(".code").html("验证码有误").addClass("move"); return currentThis.createCode();//验证码输入有误就刷新验证码重新输入 }else if(!p_reg.test(phone)){ $this.prev(".wrap").find(".restet").html("手机号码格式不正确").addClass("move"); return false; } }) }, Tab:function(){//切换注册和登录 $(".nav-sliders>a").on("click",function(){ $(this).addClass("active").siblings().removeClass("active"); var $width = $(this).width();//当前a的宽度 var $index = $(this).index();//索引 $(".on").stop(true,true).animate({"left":$width*$index+5+"px"},300); $(this).parents(".index-body").children(".change").children().eq($index).stop(true,false).show().siblings().hide(); }) }, login:function(){ $("#login").on("click",function(){ var $this = $(this); var phone = $("#login-phone").val();//电话 var passwor = $("#login-password").val(); var p_reg = /^0{0,1}(13[0-9]|15[0-9]|153|156|18[0-9])[0-9]{8}$/;//电话验证 if(phone.length==0 && passwor.length==0){//同时为空 $this.prev(".wrap").find("label").addClass("move"); return false; }else if(phone == "" || phone == "undefined" || phone == "null"){ $this.prev(".wrap").find(".phone").addClass("move"); return false; }else if(passwor == "" || passwor == "undefined" || passwor == null ){ $this.prev(".wrap").find(".passwor").addClass("move"); return false; }else if(!p_reg.test(phone)){ $this.prev(".wrap").find(".restet").html("手机号码格式不正确").addClass("move"); return false; } }) }, downLoad:function(){ $(".download").on("click",function(){ $(this).children(".pic").toggle(300); }) }, createCode:function(){//验证码 var selectChar = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');//所有候选组成验证码的字符,也可以用中文的 code=""; var codeLength=4;//验证码的长度 for(var i =0;i<codeLength;i++){ var index = Math.floor(Math.random()*selectChar.length)//随机数 code +=selectChar[index]; //$("#createCade").html(code) } return $("#createCade").html(code) }, clickCode:function(){//切换验证码 var $this = this; $("#createCade").on("click",function(){ return $this.createCode(); }) } } </script> </body> </html>
wangyongtan/H5
2016/1109-知乎登录页/index.html
HTML
mit
10,852
using System; using System.Collections.Generic; using System.Linq; using NetFusion.Bootstrap.Plugins; namespace NetFusion.Bootstrap.Health { /// <summary> /// Contains a set of module associated aspects and information about /// their current health. /// </summary> public class ModuleHealthCheck { private readonly List<HealthAspectCheck> _aspectsChecks = new(); /// <summary> /// The module type associated with the health check. /// </summary> public Type PluginModuleType { get; } /// <summary> /// List of associated module aspects and their associated health status. /// </summary> public IReadOnlyCollection<HealthAspectCheck> AspectChecks { get; } /// <summary> /// The overall worst health-check reported for a module's associated aspects. /// </summary> public HealthCheckStatusType ModuleHealth => _aspectsChecks.Any() ? _aspectsChecks.Max(ac => ac.HealthCheckStatus) : HealthCheckStatusType.Healthy; internal ModuleHealthCheck(IModuleHealthCheck pluginModule) { PluginModuleType = pluginModule?.GetType() ?? throw new ArgumentNullException(nameof(pluginModule)); AspectChecks = _aspectsChecks; } /// <summary> /// Records information about an aspect of a module with a given status used to determine /// its overall health. /// </summary> /// <param name="aspectCheck">The status associated with a specific aspect of the module.</param> public void RecordAspect(HealthAspectCheck aspectCheck) { if (aspectCheck == null) throw new ArgumentNullException(nameof(aspectCheck)); _aspectsChecks.Add(aspectCheck); } } }
grecosoft/NetFusion
netfusion/src/Core/NetFusion.Bootstrap/Health/ModuleHealthCheck.cs
C#
mit
1,830
/* @author Arun Ramakani */ package arun.solve.route.challenge.busroutechallenge.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import arun.solve.route.challenge.busroutechallenge.response.BusRouteRes; import arun.solve.route.challenge.busroutechallenge.service.DepartureArrivalRouteService; /** * * DepartureArrivalRouteRest is a rest end point class with method to find if * direct route exist between two stations * **/ @RestController public class DepartureArrivalRouteRest { private static final Logger LOGGER = LoggerFactory.getLogger(DepartureArrivalRouteRest.class.getName()); @Autowired private DepartureArrivalRouteService departureArrivalRouteService; /** * * findDirectBusRoute : find if direct route exist between two stations * * @param dep_sid * : int - departure station id * @param arr_sid * : int - Arrival station id * @return BusRouteRes - json string with departure & Arrival station id * with status if direct connection exist * **/ @RequestMapping(value = "/direct", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody BusRouteRes findDirectBusRoute( @RequestParam(value = "dep_sid", required = true) final int dep_sid, @RequestParam(value = "arr_sid", required = true) final int arr_sid) { LOGGER.info(String.format("findDirectBusRoute rest method called with departure %d and arraival %d", dep_sid, arr_sid)); return new BusRouteRes(dep_sid, arr_sid, departureArrivalRouteService.findDirectBusRoute(dep_sid, arr_sid)); } }
ArunRamakani/bus_route_challenge
src/main/java/arun/solve/route/challenge/busroutechallenge/controller/DepartureArrivalRouteRest.java
Java
mit
2,015
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./b1990c652889aea27b93c1bb3778412399d0673cda53efcd892bf98991711d89.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/36ad9dfde804dc007212275b0d841509d8b8b89803049dbb722857e5e7eb1f96.html
HTML
mit
550
# iso-form [![Build Status](https://travis-ci.org/jasoniangreen/iso-form.svg?branch=master)](https://travis-ci.org/jasoniangreen/iso-form) [![npm version](https://badge.fury.io/js/iso-form.svg)](https://badge.fury.io/js/iso-form) [![Code Climate](https://codeclimate.com/github/jasoniangreen/iso-form/badges/gpa.svg)](https://codeclimate.com/github/jasoniangreen/iso-form) [![Test Coverage](https://codeclimate.com/github/jasoniangreen/iso-form/badges/coverage.svg)](https://codeclimate.com/github/jasoniangreen/iso-form/coverage) An isomorphic, schema based form generator that can be used in the client, on the server, or even to pre-compile forms in the build phase. This is the core library that is used to register form types. Support will soon be added for pluggable "processors" that can be loaded to create types for different use cases and different frameworks. ###Example ``` var isoForm = new IsoForm(); // To use, register a type with a name and a template function isoForm.addItemType('input', function (itemData) { return '<input id="'+itemData.id+'">'; }); // Or types can be registered with strings instead isoForm.addGroupType('group', '<div>', '</div>'); var form = isoForm.build({ type:'group', items: [ { type: 'input', id: 'test' } ] }); // form.isValidSchema == true; // form.html == '<div><input id="test"></div>'; ``` Warning: This is still very much a work in progress.
jasoniangreen/iso-form
README.md
Markdown
mit
1,428
<?php declare(strict_types=1); namespace Knp\DoctrineBehaviors\Tests\ORM; use Iterator; use Knp\DoctrineBehaviors\Contract\Entity\TreeNodeInterface; use Knp\DoctrineBehaviors\Exception\TreeException; use Knp\DoctrineBehaviors\Tests\AbstractBehaviorTestCase; use Knp\DoctrineBehaviors\Tests\Fixtures\Entity\TreeNodeEntity; use Knp\DoctrineBehaviors\Tests\Fixtures\Repository\TreeNodeRepository; use Nette\Utils\Json; final class TreeNodeTest extends AbstractBehaviorTestCase { public function testBuildTree(): void { $rootTreeNodeEntity = new TreeNodeEntity(); $rootTreeNodeEntity->setId(1); $rootTreeNodeEntity->setMaterializedPath(''); $rootTreeNodeEntity->setName('root'); $treeNodeEntity2 = new TreeNodeEntity(); $treeNodeEntity2->setMaterializedPath('/1'); $treeNodeEntity2->setId(2); $treeNodeEntity2->setName('Villes'); $treeNodeEntity3 = new TreeNodeEntity(); $treeNodeEntity3->setId(3); $treeNodeEntity3->setMaterializedPath('/1/2'); $treeNodeEntity3->setName('Nantes'); $treeNodeEntity4 = new TreeNodeEntity(); $treeNodeEntity4->setId(4); $treeNodeEntity4->setMaterializedPath('/1/2/3'); $treeNodeEntity4->setName('Nantes Est'); $treeNodeEntity5 = new TreeNodeEntity(); $treeNodeEntity5->setId(5); $treeNodeEntity5->setMaterializedPath('/1/2/3'); $treeNodeEntity5->setName('Nantes Nord'); $treeNodeEntity6 = new TreeNodeEntity(); $treeNodeEntity6->setId(6); $treeNodeEntity6->setMaterializedPath('/1/2/3/5'); $treeNodeEntity6->setName('St-Mihiel'); $flatTree = [$treeNodeEntity2, $treeNodeEntity3, $treeNodeEntity4, $treeNodeEntity5, $treeNodeEntity6]; $rootTreeNodeEntity->buildTree($flatTree); $this->assertCount(1, $rootTreeNodeEntity->getChildNodes()); $this->assertCount(1, $rootTreeNodeEntity->getChildNodes()->first()->getChildNodes()); $this->assertCount(2, $rootTreeNodeEntity->getChildNodes()->first()->getChildNodes()->first()->getChildNodes()); $this->assertSame(1, $rootTreeNodeEntity->getNodeLevel()); $this->assertSame( 4, $rootTreeNodeEntity->getChildNodes() ->first() ->getChildNodes() ->first() ->getChildNodes() ->first() ->getNodeLevel() ); } public function testIsRoot(): void { $treeNodeEntity = $this->buildTree(); $this->assertTrue($treeNodeEntity->getRootNode()->isRootNode()); $this->assertTrue($treeNodeEntity->isRootNode()); } public function testIsLeaf(): void { $treeNodeEntity = $this->buildTree(); $this->assertTrue($treeNodeEntity[0][0][0]->isLeafNode()); $this->assertTrue($treeNodeEntity[1]->isLeafNode()); } public function testGetRoot(): void { $treeNodeEntity = $this->buildTree(); $this->assertSame($treeNodeEntity, $treeNodeEntity->getRootNode()); $this->assertNull($treeNodeEntity->getRootNode()->getParentNode()); $this->assertSame( $treeNodeEntity, $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getRootNode() ); } public function provideRootPaths(): Iterator { yield [$treeNodeEntity = new TreeNodeEntity(), '/0']; $treeNodeEntity->setMaterializedPath('/0/1'); yield [$treeNodeEntity = new TreeNodeEntity(), '/']; $treeNodeEntity->setMaterializedPath('/'); yield [$treeNodeEntity = new TreeNodeEntity(), '/']; $treeNodeEntity->setMaterializedPath(''); yield [$treeNodeEntity = new TreeNodeEntity(), '/test']; $treeNodeEntity->setMaterializedPath('/test'); yield [$treeNodeEntity = new TreeNodeEntity(), '/0']; $treeNodeEntity->setMaterializedPath('/0/1/2/3/4/5/6/'); } /** * @dataProvider provideIsChildNodeOf() */ public function testTestisChildNodeOf(TreeNodeInterface $child, TreeNodeInterface $parent, bool $expected): void { $this->assertSame($expected, $child->isChildNodeOf($parent)); } public function provideIsChildNodeOf(): Iterator { $treeNodeEntity = $this->buildTree(); yield [$treeNodeEntity[0][0], $treeNodeEntity[0], true]; yield [$treeNodeEntity[0][0][0], $treeNodeEntity[0][0], true]; yield [$treeNodeEntity[0][0][0], $treeNodeEntity[0], false]; yield [$treeNodeEntity[0][0][0], $treeNodeEntity[0][0][0], false]; } public function provideToArray(): array { return [ 1 => [ 'node' => '', 'children' => [ 2 => [ 'node' => '', 'children' => [ 4 => [ 'node' => '', 'children' => [ 5 => [ 'node' => '', 'children' => [], ], ], ], ], ], 3 => [ 'node' => '', 'children' => [], ], ], ], ]; } public function testToArray(): void { $expected = $this->provideToArray(); $treeNodeEntity = $this->buildTree(); $this->assertSame($expected, $treeNodeEntity->toArray()); } public function testToJson(): void { $expected = $this->provideToArray(); $treeNodeEntity = $this->buildTree(); $this->assertSame(Json::encode($expected), $treeNodeEntity->toJson()); } public function testToFlatArray(): void { $expected = [ 1 => '', 2 => '----', 4 => '------', 5 => '--------', 3 => '----', ]; $this->assertSame($expected, $this->buildTree()->toFlatArray()); } public function testArrayAccess(): void { $tree = $this->buildTree(); $treeNodeEntity45 = new TreeNodeEntity(); $treeNodeEntity45->setId(45); $tree[] = $treeNodeEntity45; $treeNodeEntity46 = new TreeNodeEntity(); $treeNodeEntity46->setId(46); $tree[] = $treeNodeEntity46; $this->assertCount(4, $tree->getChildNodes()); $treeNodeEntity47 = new TreeNodeEntity(); $treeNodeEntity47->setId(47); $tree[2][] = $treeNodeEntity47; $treeNodeEntity48 = new TreeNodeEntity(); $treeNodeEntity48->setId(48); $tree[2][] = $treeNodeEntity48; $this->assertSame(2, $tree[2]->getChildNodes()->count()); $this->assertTrue(isset($tree[2][1])); $this->assertFalse(isset($tree[2][1][2])); unset($tree[2][1]); $this->assertFalse(isset($tree[2][1])); } public function testSetChildNodeOf(): void { $root1 = new TreeNodeEntity(); $root1->setId(1); $child1 = new TreeNodeEntity(); $child1->setId(2); $this->assertTrue($root1->isRootNode()); $child1->setChildNodeOf($root1); $this->assertTrue($child1->isChildNodeOf($root1)); $this->assertSame('/1', $child1->getMaterializedPath()); $root2 = new TreeNodeEntity(); $root2->setId(3); $child2 = new TreeNodeEntity(); $child2->setId(4); $root2->setChildNodeOf(null); $this->assertTrue($root2->isRootNode()); $child2->setChildNodeOf($root2); $this->assertSame($root2->getRealMaterializedPath(), $child2->getParentMaterializedPath()); $this->assertTrue($child2->isChildNodeOf($root2)); $this->assertSame('/3', $child2->getMaterializedPath()); } public function testTestsetChildNodeOfWithoutId(): void { $this->expectException(TreeException::class); $this->expectExceptionMessage('You must provide an id for this node if you want it to be part of a tree.'); $parentTreeNode = new TreeNodeEntity(); $parentTreeNode->setMaterializedPath('/0'); $childTreeNode = new TreeNodeEntity(); $childTreeNode->setMaterializedPath('/0/1'); $childTreeNode->setChildNodeOf($parentTreeNode); } public function testChildrenCount(): void { $treeNodeEntity = $this->buildTree(); $this->assertCount(2, $treeNodeEntity->getChildNodes()); $this->assertCount(1, $treeNodeEntity->getChildNodes()->get(0)->getChildNodes()); } public function testGetPath(): void { $treeNodeEntity = $this->buildTree(); $this->assertSame('/1', $treeNodeEntity->getRealMaterializedPath()); $this->assertSame('/1/2', $treeNodeEntity->getChildNodes()->get(0)->getRealMaterializedPath()); $this->assertSame( '/1/2/4', $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getRealMaterializedPath() ); $this->assertSame( '/1/2/4/5', $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getRealMaterializedPath() ); $childChildItem = $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0); $childChildChildItem = $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getChildNodes() ->get(0); $childChildItem->setChildNodeOf($treeNodeEntity); $this->assertSame('/1/4', $childChildItem->getRealMaterializedPath(), 'The path has been updated fo the node'); $this->assertSame( '/1/4/5', $childChildChildItem->getRealMaterializedPath(), 'The path has been updated fo the node and all its descendants' ); $this->assertTrue( $treeNodeEntity->getChildNodes() ->contains($childChildItem), 'The children collection has been updated to reference the moved node' ); } public function testMoveChildren(): void { $treeNodeEntity = $this->buildTree(); $childChildItem = $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0); $childChildChildItem = $treeNodeEntity->getChildNodes() ->get(0) ->getChildNodes() ->get(0) ->getChildNodes() ->get(0); $this->assertSame(4, $childChildChildItem->getNodeLevel(), 'The level is well calcuated'); $childChildItem->setChildNodeOf($treeNodeEntity); $this->assertSame('/1/4', $childChildItem->getRealMaterializedPath(), 'The path has been updated fo the node'); $this->assertSame( '/1/4/5', $childChildChildItem->getRealMaterializedPath(), 'The path has been updated fo the node and all its descendants' ); $this->assertTrue( $treeNodeEntity->getChildNodes() ->contains($childChildItem), 'The children collection has been updated to reference the moved node' ); $this->assertSame(3, $childChildChildItem->getNodeLevel(), 'The level has been updated'); } public function testGetTree(): void { /** @var TreeNodeRepository $repository */ $repository = $this->entityManager->getRepository(TreeNodeEntity::class); $entity = new TreeNodeEntity(); $entity->setId(1); $secondEntity = new TreeNodeEntity(); $secondEntity->setId(2); $entity[0] = $secondEntity; $thirdEntity = new TreeNodeEntity(); $thirdEntity->setId(3); $entity[0][0] = $thirdEntity; $this->entityManager->persist($entity); $this->entityManager->persist($entity[0]); $this->entityManager->persist($entity[0][0]); $this->entityManager->flush(); $tree = $repository->getTree(); $this->assertSame($tree[0][0], $entity[0][0]); } private function buildTree(): TreeNodeEntity { $item = new TreeNodeEntity(); $item->setMaterializedPath(''); $item->setId(1); $childItem = new TreeNodeEntity(); $childItem->setMaterializedPath('/1'); $childItem->setId(2); $childItem->setChildNodeOf($item); $secondChildItem = new TreeNodeEntity(); $secondChildItem->setMaterializedPath('/1'); $secondChildItem->setId(3); $secondChildItem->setChildNodeOf($item); $childChildItem = new TreeNodeEntity(); $childChildItem->setId(4); $childChildItem->setMaterializedPath('/1/2'); $childChildItem->setChildNodeOf($childItem); $childChildChildItem = new TreeNodeEntity(); $childChildChildItem->setId(5); $childChildChildItem->setMaterializedPath('/1/2/4'); $childChildChildItem->setChildNodeOf($childChildItem); return $item; } }
KnpLabs/DoctrineBehaviors
tests/ORM/TreeNodeTest.php
PHP
mit
13,523
require 'spec_helper' feature 'Admin session handling' do let(:admin) { create(:admin) } scenario 'signs in with valid email and password' do sign_in_admin admin current_path.should == admins_services_path end scenario 'cannot sign in with invalid email and password' do sign_in_admin admin, password: 'invalid' current_path.should == new_admin_session_path page.should have_content "Correo o contraseña inválidos" end scenario 'signs out and is redirected to the root page' do sign_in_admin admin page.find('a[href="/admins/sign_out"]').click page.should have_content 'Iniciar sesión' current_url.should eq root_url end end
acrogenesis-lab/reporte-ciudadano
spec/features/admin/session_handling_spec.rb
Ruby
mit
686
#ifndef MESH_H #define MESH_H #include <Animator.hpp> #include <Config.hpp> #include <Joint.hpp> #include <Math.hpp> #include <OpenGL.hpp> #include <memory> #include <vector> class Material; class Shader; class Mesh { public: struct Primitive { GLuint VAO; GLenum Mode; GLsizei Count; GLenum Type; GLsizei Offset; std::shared_ptr<Material> _Material; }; enum AttributeID : GLint { POSITION = 0, NORMAL = 1, TEXCOORD = 2, TANGENT = 3, JOINTS_0 = 4, WEIGHTS_0 = 5, COLOR = 6, }; Mesh() = default; /* Functions */ Mesh(GLuint vao, GLenum mode, GLsizei count, GLenum type, GLsizei offset, std::shared_ptr<Material> material); Mesh(GLuint vao, GLenum mode, GLsizei count, GLenum type, GLsizei offset, std::shared_ptr<Material> material, Joint rootJoint, int jointCount); Mesh(std::vector<Primitive>&&); bool LoadFromData(std::vector<Primitive>&& primitives); void Update(const float dt); void Render(Shader * shader, glm::mat4 modelMat); void doAnimation(Animation animation) { _mAnimator.DoAnimation(animation); } Joint GetRootJoint() { return _mRootJoint; } std::vector<glm::mat4> GetJointTransforms(); void AddJointsToArray(Joint headJoint, std::vector<glm::mat4> jointMatrices); private: std::vector<Primitive> _mPrimitives; // Joints Joint _mRootJoint; int _mJointCount; // Animator Animator _mAnimator; // Not sure how to handle these yet, they need to be part of the rendering //glm::vec3 _mJointIDs; this will be an int //glm::vec3 _mVertexWeights; this will be a float }; #endif // MESH_H
benjinx/Temporality
include/Mesh.hpp
C++
mit
1,755
# #calibrate.py # #calibrate fits images using darks, flats, and bias frames #corrected image = (image - bias - k(dark-bias))/flat #for k=1, i.e. image exp = dark exp, corrected image = (image - dark)/flat import os import glob import math import subprocess import re import sys import datetime import shutil from decimal import Decimal from astropy.io import fits from astropy import wcs from astropy import log log.setLevel('ERROR') from astropy import units as u import ccdproc import numpy as np def logme( str ): log.write(str + "\n") print str return #MODIFY THESE FIELDS AS NEEDED! #input path *with* ending forward slash input_path='./' #output path *with* ending forward slash output_path='./calibrated/' #log file name log_fname = 'log.calibrate.txt' #suffix for output files, if any... output_suffix='.calibrated' #used in master calibration filenames date_suffix = datetime.datetime.now().strftime('%Y%m%d.%H%M%S') #master bias frame #folder with bias component frames *including* ending forward slash bias_path='./bias/' bias_master = 'mbias.' + date_suffix + '.fits' #master dark frame #folder with dark component frames *including* ending forward slash dark_path='./dark/' dark_is_bias_corrected = False dark_bias = None dark_master = 'mdark.' + date_suffix + '.fits' #master flat frame #folder with bias component frames *including* ending forward slash flat_path='./flat/' flat_is_bias_corrected = False flat_bias = None flat_is_dark_corrected = False flat_dark = None flat_ave_exptime = 0 flat_master = 'mflat.' + date_suffix + '.fits' #name of exposure variable in FITS header file exposure_label='EXPTIME' log=open(log_fname, 'a+') #trim image? set range here, or set to '' to disable trim_range = '' if(len(sys.argv) == 5): naxis1_start = int(sys.argv[1]) naxis1_end = int(sys.argv[2]) naxis2_start = int(sys.argv[3]) naxis2_end = int(sys.argv[4]) trim_range = '[%d:%d, %d:%d]'%(naxis1_start, naxis1_end, naxis2_start, naxis2_end) #starts at 1, inclusive logme('Trimming images to NAXIS1=%d to %d, NAXIS2=%d to %d.'%(naxis1_start, naxis1_end, naxis2_start, naxis2_end)) #does output directory exist? If not, create it try: os.mkdir(output_path) except: pass #bias #create master bias frame im=glob.glob(bias_path+'*.fits')+glob.glob(bias_path+'*.fit') if(len(im) <= 0): logme('Error. Bias calibration frame(s) not found (%s).' % bias_path) log.close() sys.exit(-1) biases = None for i in range(0,len(im)): if(biases): biases += ','+im[i] else: biases = im[i] #if there is just one, make it two of the same for the combine! if (len(im) == 1): biases += ','+im[0] bias_path += 'master/' try: os.mkdir(bias_path) except: pass bias_path += bias_master logme('Creating master bias frame (%s)...'%(bias_path)) bias = ccdproc.combine(biases, method='median', unit='adu', add_keyword=False) #trim it, if necessary if(len(trim_range) > 0): bias = ccdproc.trim_image(bias, trim_range); #write master frame to file hdulist = bias.to_hdu() hdulist.writeto(bias_path, clobber=True) #dark #create master dark frame im=glob.glob(dark_path+'*.fits')+glob.glob(dark_path+'*.fit') if(len(im) <= 0): logme('Error. Dark calibration frame(s) not found (%s).' % dark_path) log.close() sys.exit(-1) darks = None bias_header = None for i in range(0,len(im)): #is (any) dark bias corrected? header = fits.getheader(im[i]) if(header.get('BIAS') != None): dark_is_bias_corrected = True dark_bias = header.get('BIAS') elif(header.get('BIASCORR') != None): dark_is_bias_corrected = True dark_bias = header.get('BIASCORR') if(darks): darks += ','+im[i] else: darks = im[i] #if there is just one, make it two of the same for the combine! if (len(im) == 1): darks += ','+im[0] dark_path += 'master/' try: os.mkdir(dark_path) except: pass dark_path += dark_master logme('Creating master dark frame (%s)...'%(dark_path)) dark = ccdproc.combine(darks, method='median', unit='adu', add_keyword=False, **{'verify': 'ignore'}) #trim it, if necessary if(len(trim_range) > 0): dark = ccdproc.trim_image(dark, trim_range); #bias correct, if necessary if(not dark_is_bias_corrected): #logme('Subtracting master bias frame from master dark frame...') dark = ccdproc.subtract_bias(dark, bias, add_keyword=False) dark_bias = bias_master else: logme('Master dark frame is *already* bias corrected (%s).'%dark_bias) #write master dark frame hdulist = dark.to_hdu() #add bias correction to header header=hdulist[0].header header['BIASCORR'] = dark_bias hdulist.writeto(dark_path, clobber=True) #flat #create master flat frame im=glob.glob(flat_path+'*.fits')+glob.glob(flat_path+'*.fit') if(len(im) <= 0): logme('Error. Flat calibration frame(s) not found (%s).' % flat_path) log.close() sys.exit(-1) flats = None count = 0 flat_corrected = None #check a few things in these flat component frames for i in range(0,len(im)): header = fits.getheader(im[i]) #is this flat bias corrected? if(header.get('BIAS') != None): flat_is_bias_corrected = True flat_bias = header.get('BIAS') elif(header.get('BIASCORR') != None): flat_is_bias_corrected = True flat_bias = header.get('BIASCORR') #is this flat dark corrected? if(header.get('DARK') != None): flat_is_dark_corrected = True flat_dark = header.get('DARK') elif(header.get('DARKCORR') != None): flat_is_dark_corrected = True flat_dark = header.get('DARKCORR') flat_corrected = "%s"%(im[i].rsplit('.',1)[0])+".corrected" shutil.copy(im[i], flat_corrected) #trim as necessary if(len(trim_range) > 0): flat = ccdproc.CCDData.read(flat_corrected, unit='adu', relax=True) flat = ccdproc.trim_image(flat, trim_range) hdulist = flat.to_hdu() hdulist.writeto(flat_corrected, clobber=True) #bias correct, if necessary if(not flat_is_bias_corrected): #logme('Subtracting master bias frame from flat frame...') flat = ccdproc.CCDData.read(flat_corrected, unit='adu', relax=True) #trim it, if necessary #if(len(trim_range) > 0): # flat = ccdproc.trim_image(flat, trim_range); #flat = ccdproc.subtract_bias(flat, bias, add_keyword=False) hdulist = flat.to_hdu() #add bias correction to header header=hdulist[0].header header['BIASCORR'] = flat_bias hdulist.writeto(flat_corrected, clobber=True) flat_bias = bias_master else: logme('Flat frame (%s) is *already* bias corrected (%s).'%(im[i],flat_bias)) #dark correct, if necessary if(not flat_is_dark_corrected): #logme('Subtracting master dark frame from flat frame...') flat = ccdproc.CCDData.read(flat_corrected, unit='adu', relax=True) ##trim it, if necessary #if(len(trim_range) > 0): # flat = ccdproc.trim_image(flat, trim_range); flat = ccdproc.subtract_dark(flat, dark, scale=True, exposure_time=exposure_label, exposure_unit=u.second, add_keyword=False) hdulist = flat.to_hdu() #add bias correction to header header=hdulist[0].header header['DARKCORR'] = dark_bias hdulist.writeto(flat_corrected, clobber=True) flat_dark = dark_master else: logme('Flat frame (%s) is *already* dark corrected (%s).'%(im[i],flat_dark) ) if(flats): flats += ','+flat_corrected else: flats = flat_corrected #calc average exposure time for potential dark correction if(header.get('EXPTIME') != None): #print header.get('EXPTIME') try: exptime = float(header.get('EXPTIME')) flat_ave_exptime += exptime except ValueError: logme('Exposure time (EXPTIME) is not a float (%s).'%(header.get('EXPTIME'))) count += 1 #calc average exposure time #if(count > 0): # flat_ave_exptime = flat_ave_exptime/count # flat.header['EXPTIME'] = flat_ave_exptime # logme("Average exposure time for flats is %f"%flat_ave_exptime) #if there is just one, make it two of the same! if (len(im) == 1): flats += ','+flat_corrected flat_path += 'master/' try: os.mkdir(flat_path) except: pass flat_path += flat_master logme('Creating master flat frame (%s)...'%(flat_path)) #scale the flat component frames to have the same mean value, 10000.0 scaling_func = lambda arr: 10000.0/np.ma.median(arr) #combine them flat = ccdproc.combine(flats, method='median', scale=scaling_func, unit='adu', add_keyword=False) ##trim it, if necessary #if(len(trim_range) > 0): # #logme('Trimming flat image (%s)...'%(trim_range)) # flat = ccdproc.trim_image(flat, trim_range); #write master flat frame hdulist = flat.to_hdu() #add bias correction to header header=hdulist[0].header header['BIASCORR'] = flat_bias header['DARKCORR'] = flat_dark if(count > 0): flat_ave_exptime = flat_ave_exptime/count header['EXPTIME'] = flat_ave_exptime hdulist.writeto(flat_path, clobber=True) #get a list of all FITS files in the input directory fits_files=glob.glob(input_path+'*.fits')+glob.glob(input_path+'*.fit') #loop through all qualifying files and perform plate-solving logme('Calibrating images in %s' %input_path) for fits_file in fits_files: #open image image = ccdproc.CCDData.read(fits_file, unit='adu', relax=True) #trim it, if necessary if(len(trim_range) > 0): image = ccdproc.trim_image(image, trim_range); #subtract bias from light, dark, and flat frames image = ccdproc.subtract_bias(image, bias, add_keyword=False) image = ccdproc.subtract_dark(image, dark, scale=True, exposure_time=exposure_label, exposure_unit=u.second, add_keyword=False) image = ccdproc.flat_correct(image, flat, add_keyword=False) #save calibrated image output_file = "%s"%(fits_file.rsplit('.',1)[0])+output_suffix+".fits" output_file = output_file.rsplit('/',1)[1] output_file = output_path+output_file #scale calibrated image back to int16, some FITS programs don't like float hdulist = image.to_hdu() hdulist[0].scale('int16', bzero=32768) hdulist[0].header['BIASCORR'] = bias_master hdulist[0].header['DARKCORR'] = dark_master hdulist[0].header['FLATCORR'] = flat_master if(len(trim_range) > 0): hdulist[0].header['NAXIS1'] = '%d'%((naxis1_end-naxis1_start)) hdulist[0].header['NAXIS2'] = '%d'%((naxis2_end-naxis2_start)) hdulist.writeto(output_file, clobber=True) logme('Calibrated %d images and saved to %s.' %(len(fits_files),output_path)) log.close()
mcnowinski/various-and-sundry
lightcurve/super.calibrate.py
Python
mit
10,853
<?php /** * Myblocks * * Myblocks * * @package project * @author Serge J. <jey@tut.by> * @copyright http://www.atmatic.eu/ (c) * @version 0.1 (wizard, 14:09:42 [Sep 23, 2014]) */ // // class myblocks extends module { /** * myblocks * * Module class constructor * * @access private */ function myblocks() { $this->name="myblocks"; $this->title="<#LANG_MODULE_MYBLOCKS#>"; $this->module_category="<#LANG_SECTION_SETTINGS#>"; $this->checkInstalled(); } /** * saveParams * * Saving module parameters * * @access public */ function saveParams($data=0) { $p=array(); if (IsSet($this->id)) { $p["id"]=$this->id; } if (IsSet($this->view_mode)) { $p["view_mode"]=$this->view_mode; } if (IsSet($this->edit_mode)) { $p["edit_mode"]=$this->edit_mode; } if (IsSet($this->data_source)) { $p["data_source"]=$this->data_source; } if (IsSet($this->tab)) { $p["tab"]=$this->tab; } return parent::saveParams($p); } /** * getParams * * Getting module parameters from query string * * @access public */ function getParams() { global $id; global $mode; global $view_mode; global $edit_mode; global $data_source; global $tab; if (isset($id)) { $this->id=$id; } if (isset($mode)) { $this->mode=$mode; } if (isset($view_mode)) { $this->view_mode=$view_mode; } if (isset($edit_mode)) { $this->edit_mode=$edit_mode; } if (isset($data_source)) { $this->data_source=$data_source; } if (isset($tab)) { $this->tab=$tab; } } /** * Run * * Description * * @access public */ function run() { global $session; $out=array(); if ($this->action=='admin') { $this->admin($out); } else { $this->usual($out); } if (IsSet($this->owner->action)) { $out['PARENT_ACTION']=$this->owner->action; } if (IsSet($this->owner->name)) { $out['PARENT_NAME']=$this->owner->name; } $out['VIEW_MODE']=$this->view_mode; $out['EDIT_MODE']=$this->edit_mode; $out['MODE']=$this->mode; $out['ACTION']=$this->action; $out['DATA_SOURCE']=$this->data_source; $out['TAB']=$this->tab; if ($this->single_rec) { $out['SINGLE_REC']=1; } $this->data=$out; $p=new parser(DIR_TEMPLATES.$this->name."/".$this->name.".html", $this->data, $this); $this->result=$p->result; } /** * BackEnd * * Module backend * * @access public */ function admin(&$out) { if (isset($this->data_source) && !$_GET['data_source'] && !$_POST['data_source']) { $out['SET_DATASOURCE']=1; } if ($this->data_source=='myblocks' || $this->data_source=='') { if ($this->view_mode=='' || $this->view_mode=='search_myblocks') { $this->search_myblocks($out); } if ($this->view_mode=='edit_myblocks') { $this->edit_myblocks($out, $this->id); } if ($this->view_mode=='delete_myblocks') { $this->delete_myblocks($this->id); $this->redirect("?data_source=myblocks"); } } if (isset($this->data_source) && !$_GET['data_source'] && !$_POST['data_source']) { $out['SET_DATASOURCE']=1; } if ($this->data_source=='myblocks_categories') { if ($this->view_mode=='' || $this->view_mode=='search_myblocks_categories') { $this->search_myblocks_categories($out); } if ($this->view_mode=='edit_myblocks_categories') { $this->edit_myblocks_categories($out, $this->id); } if ($this->view_mode=='delete_myblocks_categories') { $this->delete_myblocks_categories($this->id); $this->redirect("?data_source=myblocks_categories"); } } } /** * FrontEnd * * Module frontend * * @access public */ function usual(&$out) { $this->admin($out); } /** * myblocks search * * @access public */ function search_myblocks(&$out) { require(DIR_MODULES.$this->name.'/myblocks_search.inc.php'); } /** * myblocks edit/add * * @access public */ function edit_myblocks(&$out, $id) { require(DIR_MODULES.$this->name.'/myblocks_edit.inc.php'); } /** * myblocks delete record * * @access public */ function delete_myblocks($id) { $rec=SQLSelectOne("SELECT * FROM myblocks WHERE ID='$id'"); // some action for related tables SQLExec("DELETE FROM myblocks WHERE ID='".$rec['ID']."'"); } /** * myblocks_categories search * * @access public */ function search_myblocks_categories(&$out) { require(DIR_MODULES.$this->name.'/myblocks_categories_search.inc.php'); } /** * myblocks_categories edit/add * * @access public */ function edit_myblocks_categories(&$out, $id) { require(DIR_MODULES.$this->name.'/myblocks_categories_edit.inc.php'); } /** * myblocks_categories delete record * * @access public */ function delete_myblocks_categories($id) { $rec=SQLSelectOne("SELECT * FROM myblocks_categories WHERE ID='$id'"); // some action for related tables SQLExec("DELETE FROM myblocks_categories WHERE ID='".$rec['ID']."'"); } /** * Install * * Module installation routine * * @access private */ function install($data='') { parent::install(); } /** * Uninstall * * Module uninstall routine * * @access public */ function uninstall() { SQLExec('DROP TABLE IF EXISTS myblocks'); SQLExec('DROP TABLE IF EXISTS myblocks_categories'); parent::uninstall(); } /** * dbInstall * * Database installation routine * * @access private */ function dbInstall() { /* myblocks - Myblocks myblocks_categories - Myblocks Categories */ $data = <<<EOD myblocks: ID int(10) unsigned NOT NULL auto_increment myblocks: TITLE varchar(255) NOT NULL DEFAULT '' myblocks: CATEGORY_ID int(10) NOT NULL DEFAULT '0' myblocks: BLOCK_TYPE char(10) NOT NULL DEFAULT '' myblocks: BLOCK_COLOR int(10) NOT NULL DEFAULT '0' myblocks: SCRIPT_ID int(10) NOT NULL DEFAULT '0' myblocks: LINKED_OBJECT varchar(255) NOT NULL DEFAULT '' myblocks: LINKED_PROPERTY varchar(255) NOT NULL DEFAULT '' myblocks_categories: ID int(10) unsigned NOT NULL auto_increment myblocks_categories: TITLE varchar(255) NOT NULL DEFAULT '' EOD; parent::dbInstall($data); } // -------------------------------------------------------------------- } /* * * TW9kdWxlIGNyZWF0ZWQgU2VwIDIzLCAyMDE0IHVzaW5nIFNlcmdlIEouIHdpemFyZCAoQWN0aXZlVW5pdCBJbmMgd3d3LmFjdGl2ZXVuaXQuY29tKQ== * */ ?>
lekster/md_new
modules/myblocks/myblocks.class.php
PHP
mit
6,288
import java.util.Scanner; /** * Created by 000 on 4.4.2017 г.. */ public class exersiceTriangle1 { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int n = Integer.parseInt(reader.nextLine()); for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { if (i%2 != 0) { System.out.print("$"); } else { System.out.print("*"); } } System.out.println(); } } }
sineochk/Softuni-courses
Programming Basics - march 2017/Exercises/5. DrawingWithLoops/src/exersiceTriangle1.java
Java
mit
560
-- The task is to refactor given functions into more Haskell idiomatic style ------------------------ (1) ---------------------------- -- Before: fun1 :: [Integer] -> Integer fun1 [] = 1 fun1 (x:xs) | even x = (x - 2) * fun1 xs | otherwise = fun1 xs -- After: fun1' :: [Integer] -> Integer fun1' = product . map (subtract 2) . (filter even) ------------------------ (2) ---------------------------- -- Before: fun2 :: Integer -> Integer fun2 1 = 0 fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1) -- After fun2' :: Integer -> Integer fun2' = sum .filter even .takeWhile (>1) .iterate (\x -> if (even x) then (x `div` 2) else (3*x + 1))
vaibhav276/haskell_cs194_assignments
higher_order/Wholemeal.hs
Haskell
mit
702
/** * Test case for knListItemArrowIcon. * Runs with mocha. */ "use strict"; const knListItemArrowIcon = require('../lib/kn_list_item_arrow_icon.js'), assert = require('assert'); describe('kn-list-item-arrow-icon', () => { before((done) => { done(); }); after((done) => { done(); }); it('Kn list item arrow icon', (done) => { done(); }); });
kanna-lab/kanna-lib-components
test/kn_list_item_arrow_icon_test.js
JavaScript
mit
404
--- layout: post title: If Only He Practiced It date: '2004-11-05 01:34:35 -0700' mt_id: 830 blog_id: 1 post_id: 830 basename: if-only-he-practiced-it categories: - politics --- <br />Quote from John Kerry's <a href="http://www.johnkerry.com/pressroom/speeches/spc_2004_1103.html">concession speech</a>: "But in an American election, there are no losers, because whether or not our candidates are successful, the next morning we all wake up as Americans. And that&#x2014;that is the greatest privilege and the most remarkable good fortune that can come to us on earth."<br /><br />If only we had a politician who really understood what it means to be an American instead of one just mouthing bromides while acting to undercut everything that's great about America.<br /><br /><br />
bbrown/bbrown.github.com
_posts/2004-11-05-if-only-he-practiced-it.markdown
Markdown
mit
783
/** * Class GameController * @author Patricio Ferreira <3dimentionar@gmail.com> * Copyright (c) 2017 nahuelio. All rights reserved. **/ #include <iostream> #include "headers/GameController.h" #include "headers/WindowController.h" #include "game/headers/ViewportController.h" #include "game/headers/KeyboardController.h" #include "../headers/Game.h" using namespace game_controller; /** Constructors **/ GameController::GameController() {}; /** Members **/ GameController *GameController::_instance = 0; /** Methods **/ GameController *GameController::instance() { if(!_instance) _instance = new GameController(); return _instance; }; GameController *GameController::initialize() { Screen *screen = ((WindowController *) Game::instance()->get("Window"))->getScreen(); this->shaderController = ((ShaderController *) Game::instance()->get("Shader")); ((ViewportController *) Game::instance()->get("Viewport")) ->setViewport(screen->CTX_X, screen->CTX_Y, screen->HD_WIDTH, screen->HD_HEIGHT); return this; }; GameController *GameController::bindings() { ((KeyboardController *) Game::instance()->get("Keyboard"))->run(); return this; }; GameController *GameController::loadShaders() { this->shaderController->load("VertexShader", GL_VERTEX_SHADER); this->shaderController->load("FragmentShader", GL_FRAGMENT_SHADER); return this; }; GameController *GameController::start() { Screen *screen = ((WindowController *) Game::instance()->get("Window"))->getScreen(); unsigned int program = this->shaderController->getProgramWith(); // Terminology: // VBO: vertex buffer objects // VAO: vertex attribute objects // EBO: element buffer objets unsigned int vbo, vao; float vertices[] = { -0.9f, -0.9f, 0.0f, 0.0f, 0.9f, 0.0f, 0.9f, -0.9f, 0.0f }; glGenVertexArrays(1, &vao); glGenBuffers(1, &vbo); // VBO -> Creates Buffer and puts the vertices inside the GPU glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); glBindVertexArray(vao); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void *) 0); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); while(!glfwWindowShouldClose(screen->window)) { glClearColor(0.2f, 0.3f, 0.3f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(program); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLES, 0, 3); glfwSwapBuffers(screen->window); glfwPollEvents(); } glDeleteVertexArrays(1, &vao); glDeleteBuffers(1, &vbo); this->terminate(); return this; }; Controller *GameController::run() { printf("OpenGL Version: [%s]\n", glGetString(GL_VERSION)); return (Controller *) this->initialize()->bindings()->loadShaders()->start(); }
kuakman/game
src/com/nahuelio/game/controller/GameController.cpp
C++
mit
2,948
Mobird.defineModule('modules/scroller', function(require, exports, module) { var elementStyle = document.createElement('div').style; var vendor = (function() { var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'], transform, i = 0, l = vendors.length; for (; i < l; i++) { transform = vendors[i] + 'ransform'; if (transform in elementStyle) { return vendors[i].substr(0, vendors[i].length - 1); } } return false; })(); function prefixStyle(style) { if (vendor === false) { return false; } if (vendor === '') { return style; } return vendor + style.charAt(0).toUpperCase() + style.substr(1); } var transformPrefix = prefixStyle('transform'); var utils = { addEvent: function(el, type, fn, capture) { el.addEventListener(type, fn, !!capture); }, removeEvent: function(el, type, fn, capture) { el.removeEventListener(type, fn, !!capture); }, prefixPointerEvent: function(pointerEvent) { return window.MSPointerEvent ? 'MSPointer' + pointerEvent.charAt(9).toUpperCase() + pointerEvent.substr(10) : pointerEvent; }, momentum: function(current, start, time, lowerMargin, wrapperSize, deceleration) { var distance = current - start, speed = Math.abs(distance) / time, destination, duration; deceleration = deceleration === undefined ? 0.0006 : deceleration; destination = current + (speed * speed) / (2 * deceleration) * (distance < 0 ? -1 : 1); duration = speed / deceleration; if (destination < lowerMargin) { destination = wrapperSize ? lowerMargin - (wrapperSize / 2.5 * (speed / 8)) : lowerMargin; distance = Math.abs(destination - current); duration = distance / speed; } else if (destination > 0) { destination = wrapperSize ? wrapperSize / 2.5 * (speed / 8) : 0; distance = Math.abs(current) + destination; duration = distance / speed; } return { destination: Math.round(destination), duration: duration }; }, hasTransform: transformPrefix !== false, hasPerspective: prefixStyle('perspective') in elementStyle, hasTouch: 'ontouchstart' in window, hasPointer: window.PointerEvent || window.MSPointerEvent, // IE10 is prefixed hasTransition: prefixStyle('transition') in elementStyle, isBadAndroid: /Android /.test(window.navigator.appVersion) && !(/Chrome\/\d/.test(window.navigator.appVersion)), style: { transform: transformPrefix, transitionTimingFunction: prefixStyle('transitionTimingFunction'), transitionDuration: prefixStyle('transitionDuration'), transitionDelay: prefixStyle('transitionDelay'), transformOrigin: prefixStyle('transformOrigin') }, hasClass: function(e, c) { var re = new RegExp("(^|\\s)" + c + "(\\s|$)"); return re.test(e.className); }, addClass: function(e, c) { if (utils.hasClass(e, c)) { return; } var newclass = e.className.split(' '); newclass.push(c); e.className = newclass.join(' '); }, removeClass: function(e, c) { if (!utils.hasClass(e, c)) { return; } var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g'); e.className = e.className.replace(re, ' '); }, offset: function(el) { var left = -el.offsetLeft, top = -el.offsetTop; // jshint -W084 while (el = el.offsetParent) { left -= el.offsetLeft; top -= el.offsetTop; } // jshint +W084 return { left: left, top: top }; }, preventDefaultException: function(el, exceptions) { for (var i in exceptions) { if (exceptions[i].test(el[i])) { return true; } } return false; }, eventType: { touchstart: 1, touchmove: 1, touchend: 1, mousedown: 2, mousemove: 2, mouseup: 2, pointerdown: 3, pointermove: 3, pointerup: 3, MSPointerDown: 3, MSPointerMove: 3, MSPointerUp: 3 }, ease: { quadratic: { style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', fn: function(k) { return k * (2 - k); } }, circular: { style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1) fn: function(k) { return Math.sqrt(1 - (--k * k)); } }, back: { style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)', fn: function(k) { var b = 4; return (k = k - 1) * k * ((b + 1) * k + b) + 1; } }, bounce: { style: '', fn: function(k) { if ((k /= 1) < (1 / 2.75)) { return 7.5625 * k * k; } else if (k < (2 / 2.75)) { return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; } else if (k < (2.5 / 2.75)) { return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; } else { return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; } } }, elastic: { style: '', fn: function(k) { var f = 0.22, e = 0.4; if (k === 0) { return 0; } if (k == 1) { return 1; } return (e * Math.pow(2, -10 * k) * Math.sin((k - f / 4) * (2 * Math.PI) / f) + 1); } } }, tap: function(e, eventName) { var ev = document.createEvent('Event'); ev.initEvent(eventName, true, true); ev.pageX = e.pageX; ev.pageY = e.pageY; e.target.dispatchEvent(ev); }, click: function(e) { var target = e.target, ev; if (!(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName)) { ev = document.createEvent('MouseEvents'); ev.initMouseEvent('click', true, true, e.view, 1, target.screenX, target.screenY, target.clientX, target.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, 0, null); ev._constructed = true; target.dispatchEvent(ev); } } }; function Scroller(el, options) { this.wrapper = typeof el == 'string' ? document.querySelector(el) : el; this.scroller = this.wrapper.children[0]; this.scrollerStyle = this.scroller.style; // cache style for better performance this.options = { resizeScrollbars: true, mouseWheelSpeed: 20, snapThreshold: 0.334, // INSERT POINT: OPTIONS startX: 0, startY: 0, scrollY: true, directionLockThreshold: 5, momentum: true, bounce: true, bounceTime: 600, bounceEasing: '', preventDefault: true, preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ }, HWCompositing: true, useTransition: true, useTransform: true }; for (var i in options) { this.options[i] = options[i]; } // Normalize options this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : ''; this.options.useTransition = utils.hasTransition && this.options.useTransition; this.options.useTransform = utils.hasTransform && this.options.useTransform; this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough; this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault; // If you want eventPassthrough I have to lock one of the axes this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY; this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX; // With eventPassthrough we also need lockDirection mechanism this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough; this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold; this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing; this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling; if (this.options.tap === true) { this.options.tap = 'tap'; } if (this.options.shrinkScrollbars == 'scale') { this.options.useTransition = false; } this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1; // INSERT POINT: NORMALIZATION // Some defaults this.x = 0; this.y = 0; this.directionX = 0; this.directionY = 0; this._events = {}; // INSERT POINT: DEFAULTS this._init(); this.refresh(); this.scrollTo(this.options.startX, this.options.startY); this.enable(); } Scroller.prototype = { _init: function() { this._initEvents(); if (this.options.scrollbars || this.options.indicators) { this._initIndicators(); } if (this.options.mouseWheel) { this._initWheel(); } if (this.options.snap) { this._initSnap(); } if (this.options.keyBindings) { this._initKeys(); } // INSERT POINT: _init }, destroy: function() { this._initEvents(true); this._execEvent('destroy'); }, _transitionEnd: function(e) { if (e.target != this.scroller || !this.isInTransition) { return; } this._transitionTime(); if (!this.resetPosition(this.options.bounceTime)) { this.isInTransition = false; this._execEvent('scrollEnd'); } }, _start: function(e) { // React to left mouse button only if (utils.eventType[e.type] != 1) { if (e.button !== 0) { return; } } if (!this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated)) { return; } if (this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException)) { e.preventDefault(); } var point = e.touches ? e.touches[0] : e, pos; this.initiated = utils.eventType[e.type]; this.moved = false; this.distX = 0; this.distY = 0; this.directionX = 0; this.directionY = 0; this.directionLocked = 0; this._transitionTime(); this.startTime = Mobird.now(); if (this.options.useTransition && this.isInTransition) { this.isInTransition = false; pos = this.getComputedPosition(); this._translate(Math.round(pos.x), Math.round(pos.y)); this._execEvent('scrollEnd'); } else if (!this.options.useTransition && this.isAnimating) { this.isAnimating = false; this._execEvent('scrollEnd'); } this.startX = this.x; this.startY = this.y; this.absStartX = this.x; this.absStartY = this.y; this.pointX = point.pageX; this.pointY = point.pageY; this._execEvent('beforeScrollStart'); }, _move: function(e) { if (!this.enabled || utils.eventType[e.type] !== this.initiated) { return; } if (this.options.preventDefault) { // increases performance on Android? TODO: check! e.preventDefault(); } var point = e.touches ? e.touches[0] : e, deltaX = point.pageX - this.pointX, deltaY = point.pageY - this.pointY, timestamp = Mobird.now(), newX, newY, absDistX, absDistY; this.pointX = point.pageX; this.pointY = point.pageY; this.distX += deltaX; this.distY += deltaY; absDistX = Math.abs(this.distX); absDistY = Math.abs(this.distY); // We need to move at least 10 pixels for the scrolling to initiate if (timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10)) { return; } // If you are scrolling in one direction lock the other if (!this.directionLocked && !this.options.freeScroll) { if (absDistX > absDistY + this.options.directionLockThreshold) { this.directionLocked = 'h'; // lock horizontally } else if (absDistY >= absDistX + this.options.directionLockThreshold) { this.directionLocked = 'v'; // lock vertically } else { this.directionLocked = 'n'; // no lock } } if (this.directionLocked == 'h') { if (this.options.eventPassthrough == 'vertical') { e.preventDefault(); } else if (this.options.eventPassthrough == 'horizontal') { this.initiated = false; return; } deltaY = 0; } else if (this.directionLocked == 'v') { if (this.options.eventPassthrough == 'horizontal') { e.preventDefault(); } else if (this.options.eventPassthrough == 'vertical') { this.initiated = false; return; } deltaX = 0; } deltaX = this.hasHorizontalScroll ? deltaX : 0; deltaY = this.hasVerticalScroll ? deltaY : 0; newX = this.x + deltaX; newY = this.y + deltaY; // Slow down if outside of the boundaries if (newX > 0 || newX < this.maxScrollX) { newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX; } if (newY > 0 || newY < this.maxScrollY) { newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY; } this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0; this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0; if (!this.moved) { this._execEvent('scrollStart'); } this.moved = true; this._translate(newX, newY); /* REPLACE START: _move */ if (timestamp - this.startTime > 300) { this.startTime = timestamp; this.startX = this.x; this.startY = this.y; } /* REPLACE END: _move */ }, _end: function(e) { if (!this.enabled || utils.eventType[e.type] !== this.initiated) { return; } if (this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException)) { e.preventDefault(); } var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, duration = Mobird.now() - this.startTime, newX = Math.round(this.x), newY = Math.round(this.y), distanceX = Math.abs(newX - this.startX), distanceY = Math.abs(newY - this.startY), time = 0, easing = ''; this.isInTransition = 0; this.initiated = 0; this.endTime = Mobird.now(); // reset if we are outside of the boundaries if (this.resetPosition(this.options.bounceTime)) { return; } this.scrollTo(newX, newY); // ensures that the last position is rounded // we scrolled less than 10 pixels if (!this.moved) { if (this.options.tap) { utils.tap(e, this.options.tap); } if (this.options.click) { utils.click(e); } this._execEvent('scrollCancel'); return; } if (this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100) { this._execEvent('flick'); return; } // start momentum animation if needed if (this.options.momentum && duration < 300) { momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 }; momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 }; newX = momentumX.destination; newY = momentumY.destination; time = Math.max(momentumX.duration, momentumY.duration); this.isInTransition = 1; } if (this.options.snap) { var snap = this._nearestSnap(newX, newY); this.currentPage = snap; time = this.options.snapSpeed || Math.max( Math.max( Math.min(Math.abs(newX - snap.x), 1000), Math.min(Math.abs(newY - snap.y), 1000) ), 300); newX = snap.x; newY = snap.y; this.directionX = 0; this.directionY = 0; easing = this.options.bounceEasing; } // INSERT POINT: _end if (newX != this.x || newY != this.y) { // change easing function when scroller goes out of the boundaries if (newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY) { easing = utils.ease.quadratic; } this.scrollTo(newX, newY, time, easing); return; } this._execEvent('scrollEnd'); }, _resize: function() { var that = this; clearTimeout(this.resizeTimeout); this.resizeTimeout = setTimeout(function() { that.refresh(); }, this.options.resizePolling); }, resetPosition: function(time) { var x = this.x, y = this.y; time = time || 0; if (!this.hasHorizontalScroll || this.x > 0) { x = 0; } else if (this.x < this.maxScrollX) { x = this.maxScrollX; } if (!this.hasVerticalScroll || this.y > 0) { y = 0; } else if (this.y < this.maxScrollY) { y = this.maxScrollY; } if (x == this.x && y == this.y) { return false; } this.scrollTo(x, y, time, this.options.bounceEasing); return true; }, disable: function() { this.enabled = false; }, enable: function() { this.enabled = true; }, refresh: function() { var rf = this.wrapper.offsetHeight; // Force reflow this.wrapperWidth = this.wrapper.clientWidth; this.wrapperHeight = this.wrapper.clientHeight; /* REPLACE START: refresh */ this.scrollerWidth = this.scroller.offsetWidth; this.scrollerHeight = this.scroller.offsetHeight; this.maxScrollX = this.wrapperWidth - this.scrollerWidth; this.maxScrollY = this.wrapperHeight - this.scrollerHeight; /* REPLACE END: refresh */ this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0; this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0; if (!this.hasHorizontalScroll) { this.maxScrollX = 0; this.scrollerWidth = this.wrapperWidth; } if (!this.hasVerticalScroll) { this.maxScrollY = 0; this.scrollerHeight = this.wrapperHeight; } this.endTime = 0; this.directionX = 0; this.directionY = 0; this.wrapperOffset = utils.offset(this.wrapper); this._execEvent('refresh'); this.resetPosition(); // INSERT POINT: _refresh }, on: function(type, fn) { if (!this._events[type]) { this._events[type] = []; } this._events[type].push(fn); }, off: function(type, fn) { if (!this._events[type]) { return; } var index = this._events[type].indexOf(fn); if (index > -1) { this._events[type].splice(index, 1); } }, _execEvent: function(type) { if (!this._events[type]) { return; } var i = 0, l = this._events[type].length; if (!l) { return; } for (; i < l; i++) { this._events[type][i].apply(this, [].slice.call(arguments, 1)); } }, scrollBy: function(x, y, time, easing) { x = this.x + x; y = this.y + y; time = time || 0; this.scrollTo(x, y, time, easing); }, scrollTo: function(x, y, time, easing) { easing = easing || utils.ease.circular; this.isInTransition = this.options.useTransition && time > 0; if (!time || (this.options.useTransition && easing.style)) { this._transitionTimingFunction(easing.style); this._transitionTime(time); this._translate(x, y); } else { this._animate(x, y, time, easing.fn); } }, scrollToElement: function(el, time, offsetX, offsetY, easing) { el = el.nodeType ? el : this.scroller.querySelector(el); if (!el) { return; } var pos = utils.offset(el); pos.left -= this.wrapperOffset.left; pos.top -= this.wrapperOffset.top; // if offsetX/Y are true we center the element to the screen if (offsetX === true) { offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2); } if (offsetY === true) { offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2); } pos.left -= offsetX || 0; pos.top -= offsetY || 0; pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left; pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top; time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x - pos.left), Math.abs(this.y - pos.top)) : time; this.scrollTo(pos.left, pos.top, time, easing); }, _transitionTime: function(time) { time = time || 0; this.scrollerStyle[utils.style.transitionDuration] = time + 'ms'; if (!time && utils.isBadAndroid) { this.scrollerStyle[utils.style.transitionDuration] = '0.001s'; } if (this.indicators) { for (var i = this.indicators.length; i--;) { this.indicators[i].transitionTime(time); } } // INSERT POINT: _transitionTime }, _transitionTimingFunction: function(easing) { this.scrollerStyle[utils.style.transitionTimingFunction] = easing; if (this.indicators) { for (var i = this.indicators.length; i--;) { this.indicators[i].transitionTimingFunction(easing); } } // INSERT POINT: _transitionTimingFunction }, _translate: function(x, y) { if (this.options.useTransform) { /* REPLACE START: _translate */ this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ; /* REPLACE END: _translate */ } else { x = Math.round(x); y = Math.round(y); this.scrollerStyle.left = x + 'px'; this.scrollerStyle.top = y + 'px'; } this.x = x; this.y = y; if (this.indicators) { for (var i = this.indicators.length; i--;) { this.indicators[i].updatePosition(); } } // INSERT POINT: _translate }, _initEvents: function(remove) { var eventType = remove ? utils.removeEvent : utils.addEvent, target = this.options.bindToWrapper ? this.wrapper : window; eventType(window, 'orientationchange', this); eventType(window, 'resize', this); if (this.options.click) { eventType(this.wrapper, 'click', this, true); } if (!this.options.disableMouse) { eventType(this.wrapper, 'mousedown', this); eventType(target, 'mousemove', this); eventType(target, 'mousecancel', this); eventType(target, 'mouseup', this); } if (utils.hasPointer && !this.options.disablePointer) { eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this); eventType(target, utils.prefixPointerEvent('pointermove'), this); eventType(target, utils.prefixPointerEvent('pointercancel'), this); eventType(target, utils.prefixPointerEvent('pointerup'), this); } if (utils.hasTouch && !this.options.disableTouch) { eventType(this.wrapper, 'touchstart', this); eventType(target, 'touchmove', this); eventType(target, 'touchcancel', this); eventType(target, 'touchend', this); } eventType(this.scroller, 'transitionend', this); eventType(this.scroller, 'webkitTransitionEnd', this); eventType(this.scroller, 'oTransitionEnd', this); eventType(this.scroller, 'MSTransitionEnd', this); }, getComputedPosition: function() { var matrix = window.getComputedStyle(this.scroller, null), x, y; if (this.options.useTransform) { matrix = matrix[utils.style.transform].split(')')[0].split(', '); x = +(matrix[12] || matrix[4]); y = +(matrix[13] || matrix[5]); } else { x = +matrix.left.replace(/[^-\d.]/g, ''); y = +matrix.top.replace(/[^-\d.]/g, ''); } return { x: x, y: y }; }, _initIndicators: function() { var interactive = this.options.interactiveScrollbars, customStyle = typeof this.options.scrollbars != 'string', indicators = [], indicator; var that = this; this.indicators = []; if (this.options.scrollbars) { // Vertical scrollbar if (this.options.scrollY) { indicator = { el: createDefaultScrollbar('v', interactive, this.options.scrollbars), interactive: interactive, defaultScrollbars: true, customStyle: customStyle, resize: this.options.resizeScrollbars, shrink: this.options.shrinkScrollbars, fade: this.options.fadeScrollbars, listenX: false }; this.wrapper.appendChild(indicator.el); indicators.push(indicator); } // Horizontal scrollbar if (this.options.scrollX) { indicator = { el: createDefaultScrollbar('h', interactive, this.options.scrollbars), interactive: interactive, defaultScrollbars: true, customStyle: customStyle, resize: this.options.resizeScrollbars, shrink: this.options.shrinkScrollbars, fade: this.options.fadeScrollbars, listenY: false }; this.wrapper.appendChild(indicator.el); indicators.push(indicator); } } if (this.options.indicators) { // TODO: check concat compatibility indicators = indicators.concat(this.options.indicators); } for (var i = indicators.length; i--;) { this.indicators.push(new Indicator(this, indicators[i])); } // TODO: check if we can use array.map (wide compatibility and performance issues) function _indicatorsMap(fn) { for (var i = that.indicators.length; i--;) { fn.call(that.indicators[i]); } } if (this.options.fadeScrollbars) { this.on('scrollEnd', function() { _indicatorsMap(function() { this.fade(); }); }); this.on('scrollCancel', function() { _indicatorsMap(function() { this.fade(); }); }); this.on('scrollStart', function() { _indicatorsMap(function() { this.fade(1); }); }); this.on('beforeScrollStart', function() { _indicatorsMap(function() { this.fade(1, true); }); }); } this.on('refresh', function() { _indicatorsMap(function() { this.refresh(); }); }); this.on('destroy', function() { _indicatorsMap(function() { this.destroy(); }); delete this.indicators; }); }, _initWheel: function() { utils.addEvent(this.wrapper, 'wheel', this); utils.addEvent(this.wrapper, 'mousewheel', this); utils.addEvent(this.wrapper, 'DOMMouseScroll', this); this.on('destroy', function() { utils.removeEvent(this.wrapper, 'wheel', this); utils.removeEvent(this.wrapper, 'mousewheel', this); utils.removeEvent(this.wrapper, 'DOMMouseScroll', this); }); }, _wheel: function(e) { if (!this.enabled) { return; } e.preventDefault(); e.stopPropagation(); var wheelDeltaX, wheelDeltaY, newX, newY, that = this; if (this.wheelTimeout === undefined) { that._execEvent('scrollStart'); } // Execute the scrollEnd event after 400ms the wheel stopped scrolling clearTimeout(this.wheelTimeout); this.wheelTimeout = setTimeout(function() { that._execEvent('scrollEnd'); that.wheelTimeout = undefined; }, 400); if ('deltaX' in e) { if (e.deltaMode === 1) { wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed; wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed; } else { wheelDeltaX = -e.deltaX; wheelDeltaY = -e.deltaY; } } else if ('wheelDeltaX' in e) { wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed; wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed; } else if ('wheelDelta' in e) { wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed; } else if ('detail' in e) { wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed; } else { return; } wheelDeltaX *= this.options.invertWheelDirection; wheelDeltaY *= this.options.invertWheelDirection; if (!this.hasVerticalScroll) { wheelDeltaX = wheelDeltaY; wheelDeltaY = 0; } if (this.options.snap) { newX = this.currentPage.pageX; newY = this.currentPage.pageY; if (wheelDeltaX > 0) { newX--; } else if (wheelDeltaX < 0) { newX++; } if (wheelDeltaY > 0) { newY--; } else if (wheelDeltaY < 0) { newY++; } this.goToPage(newX, newY); return; } newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0); newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0); if (newX > 0) { newX = 0; } else if (newX < this.maxScrollX) { newX = this.maxScrollX; } if (newY > 0) { newY = 0; } else if (newY < this.maxScrollY) { newY = this.maxScrollY; } this.scrollTo(newX, newY, 0); // INSERT POINT: _wheel }, _initSnap: function() { this.currentPage = {}; if (typeof this.options.snap == 'string') { this.options.snap = this.scroller.querySelectorAll(this.options.snap); } this.on('refresh', function() { var i = 0, l, m = 0, n, cx, cy, x = 0, y, stepX = this.options.snapStepX || this.wrapperWidth, stepY = this.options.snapStepY || this.wrapperHeight, el; this.pages = []; if (!this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight) { return; } if (this.options.snap === true) { cx = Math.round(stepX / 2); cy = Math.round(stepY / 2); while (x > -this.scrollerWidth) { this.pages[i] = []; l = 0; y = 0; while (y > -this.scrollerHeight) { this.pages[i][l] = { x: Math.max(x, this.maxScrollX), y: Math.max(y, this.maxScrollY), width: stepX, height: stepY, cx: x - cx, cy: y - cy }; y -= stepY; l++; } x -= stepX; i++; } } else { el = this.options.snap; l = el.length; n = -1; for (; i < l; i++) { if (i === 0 || el[i].offsetLeft <= el[i - 1].offsetLeft) { m = 0; n++; } if (!this.pages[m]) { this.pages[m] = []; } x = Math.max(-el[i].offsetLeft, this.maxScrollX); y = Math.max(-el[i].offsetTop, this.maxScrollY); cx = x - Math.round(el[i].offsetWidth / 2); cy = y - Math.round(el[i].offsetHeight / 2); this.pages[m][n] = { x: x, y: y, width: el[i].offsetWidth, height: el[i].offsetHeight, cx: cx, cy: cy }; if (x > this.maxScrollX) { m++; } } } this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0); // Update snap threshold if needed if (this.options.snapThreshold % 1 === 0) { this.snapThresholdX = this.options.snapThreshold; this.snapThresholdY = this.options.snapThreshold; } else { this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold); this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold); } }); this.on('flick', function() { var time = this.options.snapSpeed || Math.max( Math.max( Math.min(Math.abs(this.x - this.startX), 1000), Math.min(Math.abs(this.y - this.startY), 1000) ), 300); this.goToPage( this.currentPage.pageX + this.directionX, this.currentPage.pageY + this.directionY, time ); }); }, _nearestSnap: function(x, y) { if (!this.pages.length) { return { x: 0, y: 0, pageX: 0, pageY: 0 }; } var i = 0, l = this.pages.length, m = 0; // Check if we exceeded the snap threshold if (Math.abs(x - this.absStartX) < this.snapThresholdX && Math.abs(y - this.absStartY) < this.snapThresholdY) { return this.currentPage; } if (x > 0) { x = 0; } else if (x < this.maxScrollX) { x = this.maxScrollX; } if (y > 0) { y = 0; } else if (y < this.maxScrollY) { y = this.maxScrollY; } for (; i < l; i++) { if (x >= this.pages[i][0].cx) { x = this.pages[i][0].x; break; } } l = this.pages[i].length; for (; m < l; m++) { if (y >= this.pages[0][m].cy) { y = this.pages[0][m].y; break; } } if (i == this.currentPage.pageX) { i += this.directionX; if (i < 0) { i = 0; } else if (i >= this.pages.length) { i = this.pages.length - 1; } x = this.pages[i][0].x; } if (m == this.currentPage.pageY) { m += this.directionY; if (m < 0) { m = 0; } else if (m >= this.pages[0].length) { m = this.pages[0].length - 1; } y = this.pages[0][m].y; } return { x: x, y: y, pageX: i, pageY: m }; }, goToPage: function(x, y, time, easing) { easing = easing || this.options.bounceEasing; if (x >= this.pages.length) { x = this.pages.length - 1; } else if (x < 0) { x = 0; } if (y >= this.pages[x].length) { y = this.pages[x].length - 1; } else if (y < 0) { y = 0; } var posX = this.pages[x][y].x, posY = this.pages[x][y].y; time = time === undefined ? this.options.snapSpeed || Math.max( Math.max( Math.min(Math.abs(posX - this.x), 1000), Math.min(Math.abs(posY - this.y), 1000) ), 300) : time; this.currentPage = { x: posX, y: posY, pageX: x, pageY: y }; this.scrollTo(posX, posY, time, easing); }, next: function(time, easing) { var x = this.currentPage.pageX, y = this.currentPage.pageY; x++; if (x >= this.pages.length && this.hasVerticalScroll) { x = 0; y++; } this.goToPage(x, y, time, easing); }, prev: function(time, easing) { var x = this.currentPage.pageX, y = this.currentPage.pageY; x--; if (x < 0 && this.hasVerticalScroll) { x = 0; y--; } this.goToPage(x, y, time, easing); }, _initKeys: function(e) { // default key bindings var keys = { pageUp: 33, pageDown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40 }; var i; // if you give me characters I give you keycode if (typeof this.options.keyBindings == 'object') { for (i in this.options.keyBindings) { if (typeof this.options.keyBindings[i] == 'string') { this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0); } } } else { this.options.keyBindings = {}; } for (i in keys) { this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i]; } utils.addEvent(window, 'keydown', this); this.on('destroy', function() { utils.removeEvent(window, 'keydown', this); }); }, _key: function(e) { if (!this.enabled) { return; } var snap = this.options.snap, // we are using this alot, better to cache it newX = snap ? this.currentPage.pageX : this.x, newY = snap ? this.currentPage.pageY : this.y, now = Mobird.now(), prevTime = this.keyTime || 0, acceleration = 0.250, pos; if (this.options.useTransition && this.isInTransition) { pos = this.getComputedPosition(); this._translate(Math.round(pos.x), Math.round(pos.y)); this.isInTransition = false; } this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0; switch (e.keyCode) { case this.options.keyBindings.pageUp: if (this.hasHorizontalScroll && !this.hasVerticalScroll) { newX += snap ? 1 : this.wrapperWidth; } else { newY += snap ? 1 : this.wrapperHeight; } break; case this.options.keyBindings.pageDown: if (this.hasHorizontalScroll && !this.hasVerticalScroll) { newX -= snap ? 1 : this.wrapperWidth; } else { newY -= snap ? 1 : this.wrapperHeight; } break; case this.options.keyBindings.end: newX = snap ? this.pages.length - 1 : this.maxScrollX; newY = snap ? this.pages[0].length - 1 : this.maxScrollY; break; case this.options.keyBindings.home: newX = 0; newY = 0; break; case this.options.keyBindings.left: newX += snap ? -1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.up: newY += snap ? 1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.right: newX -= snap ? -1 : 5 + this.keyAcceleration >> 0; break; case this.options.keyBindings.down: newY -= snap ? 1 : 5 + this.keyAcceleration >> 0; break; default: return; } if (snap) { this.goToPage(newX, newY); return; } if (newX > 0) { newX = 0; this.keyAcceleration = 0; } else if (newX < this.maxScrollX) { newX = this.maxScrollX; this.keyAcceleration = 0; } if (newY > 0) { newY = 0; this.keyAcceleration = 0; } else if (newY < this.maxScrollY) { newY = this.maxScrollY; this.keyAcceleration = 0; } this.scrollTo(newX, newY, 0); this.keyTime = now; }, _animate: function(destX, destY, duration, easingFn) { var that = this, startX = this.x, startY = this.y, startTime = Mobird.now(), destTime = startTime + duration; function step() { var now = Mobird.now(), newX, newY, easing; if (now >= destTime) { that.isAnimating = false; that._translate(destX, destY); if (!that.resetPosition(that.options.bounceTime)) { that._execEvent('scrollEnd'); } return; } now = (now - startTime) / duration; easing = easingFn(now); newX = (destX - startX) * easing + startX; newY = (destY - startY) * easing + startY; that._translate(newX, newY); if (that.isAnimating) { Mobird.requestAnimationFrame(step); } } this.isAnimating = true; step(); }, handleEvent: function(e) { switch (e.type) { case 'touchstart': case 'pointerdown': case 'MSPointerDown': case 'mousedown': this._start(e); break; case 'touchmove': case 'pointermove': case 'MSPointerMove': case 'mousemove': this._move(e); break; case 'touchend': case 'pointerup': case 'MSPointerUp': case 'mouseup': case 'touchcancel': case 'pointercancel': case 'MSPointerCancel': case 'mousecancel': this._end(e); break; case 'orientationchange': case 'resize': this._resize(); break; case 'transitionend': case 'webkitTransitionEnd': case 'oTransitionEnd': case 'MSTransitionEnd': this._transitionEnd(e); break; case 'wheel': case 'DOMMouseScroll': case 'mousewheel': this._wheel(e); break; case 'keydown': this._key(e); break; case 'click': if (!e._constructed) { e.preventDefault(); e.stopPropagation(); } break; } } }; function createDefaultScrollbar(direction, interactive, type) { var scrollbar = document.createElement('div'), indicator = document.createElement('div'); if (type === true) { scrollbar.style.cssText = 'position:absolute;z-index:9999'; indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px'; } indicator.className = 'mo-scroll-bar-indicator'; if (direction == 'h') { if (type === true) { scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0'; indicator.style.height = '100%'; } scrollbar.className = 'mo-scroll-bar-h'; } else { if (type === true) { scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px'; indicator.style.width = '100%'; } scrollbar.className = 'mo-scroll-bar-v'; } scrollbar.style.cssText += ';overflow:hidden'; if (!interactive) { scrollbar.style.pointerEvents = 'none'; } scrollbar.appendChild(indicator); return scrollbar; } function Indicator(scroller, options) { this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el; this.wrapperStyle = this.wrapper.style; this.indicator = this.wrapper.children[0]; this.indicatorStyle = this.indicator.style; this.scroller = scroller; this.options = { listenX: true, listenY: true, interactive: false, resize: true, defaultScrollbars: false, shrink: false, fade: false, speedRatioX: 0, speedRatioY: 0 }; for (var i in options) { this.options[i] = options[i]; } this.sizeRatioX = 1; this.sizeRatioY = 1; this.maxPosX = 0; this.maxPosY = 0; if (this.options.interactive) { if (!this.options.disableTouch) { utils.addEvent(this.indicator, 'touchstart', this); utils.addEvent(window, 'touchend', this); } if (!this.options.disablePointer) { utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this); utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this); } if (!this.options.disableMouse) { utils.addEvent(this.indicator, 'mousedown', this); utils.addEvent(window, 'mouseup', this); } } if (this.options.fade) { this.wrapperStyle[utils.style.transform] = this.scroller.translateZ; this.wrapperStyle[utils.style.transitionDuration] = utils.isBadAndroid ? '0.001s' : '0ms'; this.wrapperStyle.opacity = '0'; } } Indicator.prototype = { handleEvent: function(e) { switch (e.type) { case 'touchstart': case 'pointerdown': case 'MSPointerDown': case 'mousedown': this._start(e); break; case 'touchmove': case 'pointermove': case 'MSPointerMove': case 'mousemove': this._move(e); break; case 'touchend': case 'pointerup': case 'MSPointerUp': case 'mouseup': case 'touchcancel': case 'pointercancel': case 'MSPointerCancel': case 'mousecancel': this._end(e); break; } }, destroy: function() { if (this.options.interactive) { utils.removeEvent(this.indicator, 'touchstart', this); utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this); utils.removeEvent(this.indicator, 'mousedown', this); utils.removeEvent(window, 'touchmove', this); utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this); utils.removeEvent(window, 'mousemove', this); utils.removeEvent(window, 'touchend', this); utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this); utils.removeEvent(window, 'mouseup', this); } if (this.options.defaultScrollbars) { this.wrapper.parentNode.removeChild(this.wrapper); } }, _start: function(e) { var point = e.touches ? e.touches[0] : e; e.preventDefault(); e.stopPropagation(); this.transitionTime(); this.initiated = true; this.moved = false; this.lastPointX = point.pageX; this.lastPointY = point.pageY; this.startTime = Mobird.now(); if (!this.options.disableTouch) { utils.addEvent(window, 'touchmove', this); } if (!this.options.disablePointer) { utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this); } if (!this.options.disableMouse) { utils.addEvent(window, 'mousemove', this); } this.scroller._execEvent('beforeScrollStart'); }, _move: function(e) { var point = e.touches ? e.touches[0] : e, deltaX, deltaY, newX, newY, timestamp = Mobird.now(); if (!this.moved) { this.scroller._execEvent('scrollStart'); } this.moved = true; deltaX = point.pageX - this.lastPointX; this.lastPointX = point.pageX; deltaY = point.pageY - this.lastPointY; this.lastPointY = point.pageY; newX = this.x + deltaX; newY = this.y + deltaY; this._pos(newX, newY); // INSERT POINT: indicator._move e.preventDefault(); e.stopPropagation(); }, _end: function(e) { if (!this.initiated) { return; } this.initiated = false; e.preventDefault(); e.stopPropagation(); utils.removeEvent(window, 'touchmove', this); utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this); utils.removeEvent(window, 'mousemove', this); if (this.scroller.options.snap) { var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y); var time = this.options.snapSpeed || Math.max( Math.max( Math.min(Math.abs(this.scroller.x - snap.x), 1000), Math.min(Math.abs(this.scroller.y - snap.y), 1000) ), 300); if (this.scroller.x != snap.x || this.scroller.y != snap.y) { this.scroller.directionX = 0; this.scroller.directionY = 0; this.scroller.currentPage = snap; this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing); } } if (this.moved) { this.scroller._execEvent('scrollEnd'); } }, transitionTime: function(time) { time = time || 0; this.indicatorStyle[utils.style.transitionDuration] = time + 'ms'; if (!time && utils.isBadAndroid) { this.indicatorStyle[utils.style.transitionDuration] = '0.001s'; } }, transitionTimingFunction: function(easing) { this.indicatorStyle[utils.style.transitionTimingFunction] = easing; }, refresh: function() { this.transitionTime(); if (this.options.listenX && !this.options.listenY) { this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none'; } else if (this.options.listenY && !this.options.listenX) { this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none'; } else { this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none'; } if (this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll) { utils.addClass(this.wrapper, 'mo-scroll-bar'); utils.addClass(this.wrapper, 'mo-scroll-bar-both'); utils.removeClass(this.wrapper, 'iScrollLoneScrollbar'); if (this.options.defaultScrollbars && this.options.customStyle) { if (this.options.listenX) { this.wrapper.style.right = '8px'; } else { this.wrapper.style.bottom = '8px'; } } } else { utils.addClass(this.wrapper, 'mo-scroll-bar'); utils.removeClass(this.wrapper, 'mo-scroll-bar-both'); utils.addClass(this.wrapper, 'mo-scroll-bar-lo'); if (this.options.defaultScrollbars && this.options.customStyle) { if (this.options.listenX) { this.wrapper.style.right = '2px'; } else { this.wrapper.style.bottom = '2px'; } } } var r = this.wrapper.offsetHeight; // force refresh if (this.options.listenX) { this.wrapperWidth = this.wrapper.clientWidth; if (this.options.resize) { this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8); this.indicatorStyle.width = this.indicatorWidth + 'px'; } else { this.indicatorWidth = this.indicator.clientWidth; } this.maxPosX = this.wrapperWidth - this.indicatorWidth; if (this.options.shrink == 'clip') { this.minBoundaryX = -this.indicatorWidth + 8; this.maxBoundaryX = this.wrapperWidth - 8; } else { this.minBoundaryX = 0; this.maxBoundaryX = this.maxPosX; } this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX)); } if (this.options.listenY) { this.wrapperHeight = this.wrapper.clientHeight; if (this.options.resize) { this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8); this.indicatorStyle.height = this.indicatorHeight + 'px'; } else { this.indicatorHeight = this.indicator.clientHeight; } this.maxPosY = this.wrapperHeight - this.indicatorHeight; if (this.options.shrink == 'clip') { this.minBoundaryY = -this.indicatorHeight + 8; this.maxBoundaryY = this.wrapperHeight - 8; } else { this.minBoundaryY = 0; this.maxBoundaryY = this.maxPosY; } this.maxPosY = this.wrapperHeight - this.indicatorHeight; this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY)); } this.updatePosition(); }, updatePosition: function() { var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0, y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0; if (!this.options.ignoreBoundaries) { if (x < this.minBoundaryX) { if (this.options.shrink == 'scale') { this.width = Math.max(this.indicatorWidth + x, 8); this.indicatorStyle.width = this.width + 'px'; } x = this.minBoundaryX; } else if (x > this.maxBoundaryX) { if (this.options.shrink == 'scale') { this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8); this.indicatorStyle.width = this.width + 'px'; x = this.maxPosX + this.indicatorWidth - this.width; } else { x = this.maxBoundaryX; } } else if (this.options.shrink == 'scale' && this.width != this.indicatorWidth) { this.width = this.indicatorWidth; this.indicatorStyle.width = this.width + 'px'; } if (y < this.minBoundaryY) { if (this.options.shrink == 'scale') { this.height = Math.max(this.indicatorHeight + y * 3, 8); this.indicatorStyle.height = this.height + 'px'; } y = this.minBoundaryY; } else if (y > this.maxBoundaryY) { if (this.options.shrink == 'scale') { this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8); this.indicatorStyle.height = this.height + 'px'; y = this.maxPosY + this.indicatorHeight - this.height; } else { y = this.maxBoundaryY; } } else if (this.options.shrink == 'scale' && this.height != this.indicatorHeight) { this.height = this.indicatorHeight; this.indicatorStyle.height = this.height + 'px'; } } this.x = x; this.y = y; if (this.scroller.options.useTransform) { this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ; } else { this.indicatorStyle.left = x + 'px'; this.indicatorStyle.top = y + 'px'; } }, _pos: function(x, y) { if (x < 0) { x = 0; } else if (x > this.maxPosX) { x = this.maxPosX; } if (y < 0) { y = 0; } else if (y > this.maxPosY) { y = this.maxPosY; } x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x; y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y; this.scroller.scrollTo(x, y); }, fade: function(val, hold) { if (hold && !this.visible) { return; } clearTimeout(this.fadeTimeout); this.fadeTimeout = null; var time = val ? 250 : 500, delay = val ? 0 : 300; val = val ? '1' : '0'; this.wrapperStyle[utils.style.transitionDuration] = time + 'ms'; this.fadeTimeout = setTimeout((function(val) { this.wrapperStyle.opacity = val; this.visible = +val; }).bind(this, val), delay); } }; module.exports = Scroller; });
pinkpoppy/practice
Mobrid/packages/modules/scroller/index.js
JavaScript
mit
56,242
/*global $:true, Backbone:true, _:true, App:true */ /*jshint browser:true */ /*jshint strict:false */ App.Models.Controller = Backbone.Model.extend({ defaults: { socket: false }, initialize: function(opts) { } });
simonswain/lancaster
lib/server/public/js/models/controller.js
JavaScript
mit
228
/* eslint-disable no-undef */ /* eslint-disable no-unused-vars */ const documents = { indexList: [] }; const elements = { indexInput: null, indexTable: null }; function isCorrect(index) { return index.length === 6; } function addIndex(index) { documents.indexList.push(index); elements.indexTable.append('<tr><td>' + index + '</td></tr>'); } function sendToPrint() { const toPush = ''; if (documents.indexList.length % 6 !== 0) { while (documents.indexList.length % 6 !== 0) { documents.indexList.push(toPush); } } nw.Window.open('modules/f20-print/html/print.html', { 'show': false }, (win) => { win.maximize(); // data is the list win.window.data = documents.indexList; }); } function initModule() { elements.indexInput = $('#indexInput'); elements.indexInput.mask('999999'); elements.indexTable = $('#indexTable'); $('#addIndexButton').button().click((event) => { const index = elements.indexInput.val(); if (isCorrect(index)) { addIndex(index); } else { alert(global.strings.f20_print.badFormat); } elements.indexInput.focus(); }); $('#printIndexesButton').button().click((event) => { sendToPrint(); }); }
apt-ma/posthelper-desktop
src/modules/f20-print/js/main.js
JavaScript
mit
1,213
import time def check_vertical(matrix): max_product = 0 for row in xrange(0, len(matrix)-3): for col in xrange(0, len(matrix)): product = matrix[row][col] * matrix[row+1][col] * matrix[row+2][col] * matrix[row+3][col] max_product = max(product, max_product) return max_product def check_horizontal(matrix): max_product = 0 for row in xrange(0, len(matrix)): for col in xrange(0, len(matrix)-3): product = reduce(lambda x,y: x*y, matrix[row][col:col+3]) max_product = max(product, max_product) return max_product def check_left_diagonal(matrix): max_product = 0 for row in xrange(0, len(matrix)-3): for col in xrange(0, len(matrix)-3): product = matrix[row][col] * matrix[row+1][col+1] * matrix[row+2][col+2] * matrix[row+3][col+3] max_product = max(product, max_product) return max_product def check_right_diagonal(matrix): max_product = 0 for row in xrange(0, len(matrix)-3): for col in xrange(0, len(matrix)-3): product = matrix[row+3][col] * matrix[row+2][col+1] * matrix[row+1][col+2] * matrix[row][col+3] max_product = max(product, max_product) return max_product def main(): with open("011.txt", "r") as f: # Read the matrix from the text file, and store in an integet 2-dimensional array matrix = [] for line in f.readlines(): matrix.append([int(num) for num in line.split(" ")]) # print matrix # Check the matrix along the various directions, and find the max product of four adjacent numbers print("The result is %d." % max(check_vertical(matrix), check_horizontal(matrix), check_left_diagonal(matrix), check_right_diagonal(matrix))) if __name__ == '__main__': start = time.time() main() done = time.time() print("The solution took %.4f seconds to compute." % (done - start))
CianciuStyles/project-euler
011.py
Python
mit
1,763
.footer { position: relative; clear: both; box-sizing: border-box; height: 60px; margin-top: -60px; padding: 15px; border-top: 1px solid #e7e7e7; line-height: 30px; p { color: #777; } }
fs/backbone-base
app/stylesheets/modules/footer.css
CSS
mit
211
<?php namespace OreSpark\Bundle\DoctrineBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('ore_spark_doctrine'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
tylerbeal/ore-spark-symfony2
src/OreSpark/Bundle/DoctrineBundle/DependencyInjection/Configuration.php
PHP
mit
897
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='TrackedPosition', fields=[ ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('time', models.DateTimeField()), ('latitude', models.FloatField()), ('longitude', models.FloatField()), ('altitude', models.FloatField()), ('accuracy', models.FloatField()), ], options={ 'ordering': ['id'], }, bases=(models.Model,), ), migrations.CreateModel( name='TrackingKey', fields=[ ('key', models.CharField(max_length=32, primary_key=True, serialize=False)), ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), ], options={ }, bases=(models.Model,), ), migrations.CreateModel( name='TrackingSession', fields=[ ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('start_time', models.DateTimeField()), ('end_time', models.DateTimeField(null=True, blank=True)), ('active', models.BooleanField(default=True)), ('viewkey', models.CharField(max_length=32)), ('is_cleaned', models.BooleanField(default=False)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ], options={ }, bases=(models.Model,), ), migrations.AddField( model_name='trackedposition', name='session', field=models.ForeignKey(to='tracker.TrackingSession'), preserve_default=True, ), ]
nyrocron/tracking-server
tracker/migrations/0001_initial.py
Python
mit
2,159
<!doctype html> <!-- Minimal Mistakes Jekyll Theme 4.5.1 by Michael Rose Copyright 2017 Michael Rose - mademistakes.com | @mmistakes Free for personal and commercial use under the MIT license https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt --> <html lang="en" class="no-js"> <head> <meta charset="utf-8"> <!-- begin SEO --> <title>IPOP</title> <meta name="description" content="IP-Over-P2P, Open-source User-centric Software Virtual Network"> <meta name="author" content=""> <meta property="og:locale" content="en"> <meta property="og:site_name" content="IPOP"> <meta property="og:title" content="IPOP"> <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "Person", "name" : "IPOP", "url" : null, "sameAs" : null } </script> <!-- end SEO --> <link href="/feed.xml" type="application/atom+xml" rel="alternate" title="IPOP Feed"> <!-- http://t.co/dKP3o1e --> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; </script> <!-- For all browsers --> <link rel="stylesheet" href="/assets/css/main.css"> <!--[if lte IE 9]> <style> /* old IE unsupported flexbox fixes */ .greedy-nav .site-title { padding-right: 3em; } .greedy-nav button { position: absolute; top: 0; right: 0; height: 100%; } </style> <![endif]--> <meta http-equiv="cleartype" content="on"> <!-- start custom head snippets --> <!-- insert favicons. use http://realfavicongenerator.net/ --> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="manifest" href="/manifest.json"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> <meta name="theme-color" content="#ffffff"> <!-- end custom head snippets --> </head> <body class="layout--wiki"> <!--[if lt IE 9]> <div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div> <![endif]--> <div class="masthead"> <div class="masthead__inner-wrap"> <div class="masthead__menu"> <nav id="site-nav" class="greedy-nav"> <a class="site-title" href="/">IPOP</a> <ul class="visible-links"> <li class="masthead__menu-item"><a href="/about/">About</a></li> <li class="masthead__menu-item"><a href="/wiki/Quick-Start">Quick Start</a></li> <li class="masthead__menu-item"><a href="/download">Download</a></li> <li class="masthead__menu-item"><a href="/learn/">Learn</a></li> <li class="masthead__menu-item"><a href="/wiki/">Wiki</a></li> <li class="masthead__menu-item"><a href="/whitepaper/">White Paper</a></li> <li class="masthead__menu-item"><a href="/contribute/">Contribute</a></li> <li class="masthead__menu-item"><a href="/contact/">Contact</a></li> </ul> <button><div class="navicon"></div></button> <ul class="hidden-links hidden"></ul> </nav> </div> </div> </div> <div id="main" role="main"> <article class="page" itemscope itemtype="http://schema.org/CreativeWork"> <div class="page__inner-wrap"> <section class="page__content" itemprop="text"> <aside class="sidebar__right"> <nav class="toc"> <header><h4 class="nav__title"><i class="fa fa-file-text"></i> On This Page</h4></header> <ul class="section-nav"> <li class="toc-entry toc-h1"><a href="#configuration">Configuration</a> <ul> <li class="toc-entry toc-h2"><a href="#required-external-configuration-file-keys">Required External Configuration File Keys</a></li> <li class="toc-entry toc-h2"><a href="#optionaldefault-keys">Optional/Default Keys</a></li> </ul> </li> </ul> </nav> </aside> <h1 id="configuration">Configuration</h1> <p>An external configuration file is needed when running IPOP. A <a href="https://github.com/ipop-project/Controllers/blob/master/controller/sample-gvpn-config.json">sample configuration file</a> is provided with the Controllers source code. Default configuration settings are provided in <a href="https://github.com/ipop-project/Controllers/blob/master/controller/framework/fxlib.py">fxlib.py</a>.</p> <p>The external configuration file and the settings in fxlib.py are merged. If a key is provided in both files, the key in the external configuration file will take precedence.</p> <h2 id="required-external-configuration-file-keys">Required External Configuration File Keys</h2> <table> <thead> <tr> <th>Qualified Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>XmppClient.XmppDetails[0].AddressHost</td> <td>XMPP server domain or IP address</td> </tr> <tr> <td>XmppClient.XmppDetails[0].Port</td> <td>XMPP port</td> </tr> <tr> <td>XmppClient.XmppDetails[0].TapName</td> <td>Tap device name used matching one specified in TincanInterface.Vnets</td> </tr> <tr> <td>XmppClient.XmppDetails[0].AuthenticationMethod</td> <td>Node authentication mode (values: “password” or “x509”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].Username</td> <td>XMPP credential user ID (AuthenticationMethod=”password”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].Password</td> <td>XMPP credential password (AuthenticationMethod=”password”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].TrustStore</td> <td>Truststore path containing XMPP server certificate file (AuthenticationMethod=”x509”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].CertDirectory</td> <td>IPOP node certificate directory (AuthenticationMethod=”x509”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].CertFile</td> <td>IPOP node public key filename (AuthenticationMethod=”x509”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].keyfile</td> <td>IPOP node private key filename (AuthenticationMethod=”x509”)</td> </tr> <tr> <td>XmppClient.XmppDetails[0].AcceptUntrustedServer</td> <td>Trusted XMPP server</td> </tr> <tr> <td>TincanInterface.Vnets[0].Name</td> <td>Name of Tap Device</td> </tr> <tr> <td>TincanInterface.Vents[0].IP4</td> <td>Virtual ipv4 address given to the node</td> </tr> <tr> <td>TincanInterface.Vnets[0].IP4PrefixLen</td> <td>Virtual ipv4 address prefix</td> </tr> <tr> <td>TincanInteface.Vnets[0].MTU4</td> <td>Maximum Transmission Unit for Virtual net</td> </tr> <tr> <td>TincanInteface.Vnets[0].XMPPModuleName</td> <td>Name of XMPP Module to use</td> </tr> <tr> <td>TincanInteface.Vnets[0].TapName</td> <td>Name of Tap Device</td> </tr> <tr> <td>TincanInteface.Vnets[0].Description</td> <td> </td> </tr> <tr> <td>TincanInteface.Vnets[0].IgnoredNetworkInterfaces</td> <td> </td> </tr> <tr> <td>TincanInteface.Vnets[0].L2TunnellingEnabled</td> <td> </td> </tr> <tr> <td>CFx.Model</td> <td>Type of VPN (“SocialVPN” or “GroupVPN”)</td> </tr> </tbody> </table> <h2 id="optionaldefault-keys">Optional/Default Keys</h2> <table> <thead> <tr> <th>Qualified Name</th> <th>Default Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>XmppClient.Enabled</td> <td>true</td> <td>Enable XmppClient module(Required by current codebase)</td> </tr> <tr> <td>XmppClient.TimerInterval</td> <td>10</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>XmppClient.MessagePerIntervalDelay</td> <td>10</td> <td>No. of XMPP messages after which the delay has to be increased</td> </tr> <tr> <td>XmppClient.InitialAdvertismentDelay</td> <td>5</td> <td>Intitial delay for Peer XMPP messages</td> </tr> <tr> <td>XmppClient.XmppAdvrtDelay</td> <td>5</td> <td>Incremental delay for XMPP messages</td> </tr> <tr> <td>XmppClient.MaxAdvertismentDelay</td> <td>30</td> <td>Max XMPP Message delay</td> </tr> <tr> <td>XmppClient.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface", "XmppClient"]</code></td> <td>XMPP module dependencies</td> </tr> <tr> <td>TincanInterface.buf_size</td> <td>65507</td> <td>Max buffer size for Tincan Messages</td> </tr> <tr> <td>TincanInterface.SocketReadWaitTime</td> <td>15</td> <td>Socket read wait time for Tincan Messages</td> </tr> <tr> <td>TincanInterface.ctr_recv_port</td> <td>5801</td> <td>Controller UDP Listening Port</td> </tr> <tr> <td>TincanInterface.ip6_prefix</td> <td>“fd50:0dbc:41f2:4a3c”</td> <td> </td> </tr> <tr> <td>TincanInterface.ctrl_send_port</td> <td>5800</td> <td>Tincan UDP Listening Port</td> </tr> <tr> <td>TincanInterface.localhost</td> <td>“127.0.0.1”</td> <td> </td> </tr> <tr> <td>TincanInterface.localhost6</td> <td>”::1”</td> <td> </td> </tr> <tr> <td>TincanInterface.dependencies</td> <td><code class="highlighter-rouge">["Logger"]</code></td> <td>dependencies of TincanInterface module</td> </tr> <tr> <td>TincanInterface.Stun</td> <td>None</td> <td>List of usable STUN servers e.g.: <code class="highlighter-rouge">["stun.l.google.com:19302"]</code></td> </tr> <tr> <td>TincanInterface.Turn</td> <td>None</td> <td>List of usable TURN servers with transport address, username, and password in format <code class="highlighter-rouge">[{ "Address": "***:19302", "User": "***", "Password": "***"}]</code></td> </tr> <tr> <td>Logger.LogLevel</td> <td>“WARNING”</td> <td>Level of logging verbosity (values: “ERROR”, “INFO”, “DEBUG”, “WARNING”)</td> </tr> <tr> <td>Logger.LogOption</td> <td>“FILE”</td> <td>Method of Logging output (values: “FILE”, “CONSOLE”)</td> </tr> <tr> <td>Logger.LogFilePath</td> <td>”./logs/”</td> <td>If LogOption=”FILE”, specify path log files will output</td> </tr> <tr> <td>Logger.CtrlLogFileName</td> <td>“ctrl.log”</td> <td>If LogOption=”FILE”, specify file name of Controller log</td> </tr> <tr> <td>Logger.TincanLogFileName</td> <td>“tincan.log”</td> <td>If LogOption=”FILE”, specify file name of Tincan log</td> </tr> <tr> <td>Logger.LogFileSize</td> <td>1000000</td> <td>Log file size specified in bytes</td> </tr> <tr> <td>Logger.ConsoleLevel</td> <td>None</td> <td> </td> </tr> <tr> <td>Logger.BackupFileCount</td> <td>5</td> <td># of files to hold logging history</td> </tr> <tr> <td>CFx.local_uid</td> <td>””</td> <td>Attribute to store node UID needed by Statereport and SVPN</td> </tr> <tr> <td>CFx.uid_size</td> <td>40</td> <td># of bytes for node UID</td> </tr> <tr> <td>CFx.ipopVerRel</td> <td>ipopVerRel (Variable in fxlib.py)</td> <td>Release Version String</td> </tr> <tr> <td>LinkManager.Enabled</td> <td>true</td> <td>Enables LinkManager module (Required by current codebase)</td> </tr> <tr> <td>LinkManager.TimerInterval</td> <td>10</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>LinkManager.InitialLinkTTL</td> <td>120</td> <td>Intial Time to Live for a p2p link in seconds</td> </tr> <tr> <td>LinkManager.LinkPulse</td> <td>180</td> <td>Time to Live for an online p2p link in seconds</td> </tr> <tr> <td>LinkManager.MaxConnRetry</td> <td>5</td> <td>Max connection retry attempts for each p2p link</td> </tr> <tr> <td>LinkManager.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface"]</code></td> <td>LinkManager module dependencies</td> </tr> <tr> <td>BroadcastForwarder.Enabled</td> <td>true</td> <td>Enables BroadcastForwarder module</td> </tr> <tr> <td>BroadcastForwarder.TimerInterval</td> <td>10</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>BroadcastForwarder.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface", "LinkManager"]</code></td> <td>BroadcastForwarder module dependencies</td> </tr> <tr> <td>ArpCache.Enabled</td> <td>true</td> <td>Enables ArpCache module</td> </tr> <tr> <td>ArpCache.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface", "LinkManager"]</code></td> <td>ArpCache module dependencies</td> </tr> <tr> <td>IPMulticast.Enabled</td> <td>false</td> <td>Enables IPMulticast module</td> </tr> <tr> <td>IPMulticast.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface", "LinkManager"]</code></td> <td>IPMulticast module dependencies</td> </tr> <tr> <td>BaseTopologyManager.Enabled</td> <td>true</td> <td>Enables BaseTopologyManager module</td> </tr> <tr> <td>BaseTopologyManager.TimerInterval</td> <td>10</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>BaseTopologyManager.dependencies</td> <td><code class="highlighter-rouge">["Logger", "TincanInterface", "XmppClient"]</code></td> <td>BaseTopologyManager module dependencies</td> </tr> <tr> <td>OverlayVisualizer.Enabled</td> <td>false</td> <td>Enables OverlayVisualizer module</td> </tr> <tr> <td>OverlayVisualizer.TimerInterval</td> <td>5</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>OverlayVisualizer.WebServiceAddress</td> <td>“:8080/insertdata”</td> <td>Visualizer webservice URL</td> </tr> <tr> <td>OverlayVisualizer.NodeName</td> <td>””</td> <td>Interval to send data to the visualizer</td> </tr> <tr> <td>OverlayVisualizer.dependencies</td> <td><code class="highlighter-rouge">["Logger", "BaseTopologyManager"]</code></td> <td>OverlayVisualizer module dependencies</td> </tr> <tr> <td>StatReport.Enabled</td> <td>false</td> <td>Enables StatReport module</td> </tr> <tr> <td>StatReport.TimerInterval</td> <td>200</td> <td>Timer thread interval in seconds</td> </tr> <tr> <td>StatReport.StatServerAddress</td> <td>“metrics.ipop-project.org”</td> <td>Webservice to send stats</td> </tr> <tr> <td>StatReport.StatServerPort</td> <td>8080</td> <td>Port of StatReport webservice</td> </tr> <tr> <td>StatReport.dependencies</td> <td><code class="highlighter-rouge">["Logger"]</code></td> <td>StatReport module dependencies</td> </tr> </tbody> </table> </section> </div> </article> <div class="sidebar"> <nav class="nav__list"> <div class="wiki-top-links"> <a href="../wiki" class="display-unset">Wiki Home</a> / <a href="../wikipages" class="display-unset">Wiki Pages</a> </div> <ul> <li><strong>Deploying IPOP-VPN</strong> <ul> <li><a href="Quick-Start">Quick Start</a></li> <li><a href="Use-IPOP,-Intro">Installation</a></li> <li> <table> <tbody> <tr> <td>[[Configuration</td> <td>Understanding the IPOP Configuration]]</td> </tr> </tbody> </table> </li> </ul> </li> <li><strong>Development Guide</strong> <ul> <li><a href="Development-Workflow">Development Workflow</a></li> <li><a href="Coding-Guidelines">Coding Guidelines</a></li> <li><a href="Build-IPOP,-Intro">Building the Code</a></li> <li><a href="IPOP-Scale-test-Walkthrough">Testing Your Build</a></li> <li><a href="Controller-Framework">Controller Framework</a></li> <li><a href="Controller-API">Controller API</a></li> <li><a href="Build-WebRTC-Libraries,-Intro">Building WebRTC Libraries</a></li> </ul> </li> <li><strong>General Documentation</strong> <ul> <li><a href="FAQs">FAQs</a></li> <li><a href="Troubleshooting">Troubleshooting</a></li> <li><a href="Planning-Your-Network">Planning Your Network</a></li> <li><a href="Coding-Challenges">Coding Challenges</a></li> <li><a href="Known-Issues">Known Issues</a></li> <li><a href="Getting-Help">Getting Help</a></li> <li><a href="How-to-Contribute">How to Contribute</a></li> </ul> </li> </ul> </section> </div> </article> </div> </nav> </div> </div> <div class="page__footer"> <footer> <!-- start custom footer snippets --> <!-- end custom footer snippets --> <!-- <div class="page__footer-follow"> <ul class="social-icons"> <li><strong>Follow:</strong></li> --> <!-- <li><a href="/feed.xml"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li> --> <!-- </ul> </div> --> <div class="page__footer-copyright footer-address"> <div class="float-left"> <img src="/assets/images/uf_small.png" class="padding-bottom-right" /><img src="/assets/images/nsf_small.png" class="padding-bottom-right" /> </div> <i class="fa fa-address-card-o" aria-hidden="true"></i> <a href="http://www.acis.ufl.edu" rel="nofollow" target="_blank">ACIS Lab</a>, P.O. Box 116200, 339 Larsen Hall, Gainesville, FL 32611-6200; 352.392.4964<br /> <a href="http://www.ece.ufl.edu/" rel="nofollow" target="_blank">Department of Electrical & Computer Engineering</a><br /> <a href="http://www.eng.ufl.edu/" rel="nofollow" target="_blank">College of Engineering</a>, <a href="http://www.ufl.edu/" rel="nofollow" target="_blank">University of Florida</a> </div> <div class="page__footer-copyright footer-links"> <div> <a href="/contact">Contact</a> | <a href="/contact/#mailing-list-subscription">Mailing List</a> | <a href="https://ipopvpn.slack.com/">Slack Channel</a> | <a href="/sitemap">Sitemap</a><br /> <div>Powered by <a href="http://jekyllrb.com" rel="nofollow" target="_blank">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow" target="_blank">Minimal Mistakes</a><br /> &copy; 2019 IPOP - <a href="http://www.acis.ufl.edu" rel="nofollow" target="_blank">ACIS Lab</a> </div> </div> </div> <div class="page__footer-copyright footer-sponsor clear-both">This material is based upon work supported in part by the National Science Foundation under Grants No. 1234983, 1339737 and 1527415.</div> </footer> </div> <script src="/assets/js/main.min.js"></script> </body> </html>
vahid-dan/ipop-project.github.io
_site/wiki/Configuration.html
HTML
mit
20,183
package jiguang.chat.activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import butterknife.Bind; import butterknife.ButterKnife; import cn.jpush.im.android.api.JMessageClient; import cn.jpush.im.android.api.callback.GetAvatarBitmapCallback; import cn.jpush.im.android.api.callback.GetGroupInfoCallback; import cn.jpush.im.android.api.model.GroupInfo; import jiguang.chat.R; import jiguang.chat.utils.photochoose.ChoosePhoto; import jiguang.chat.utils.photochoose.PhotoUtils; /** * Created by ${chenyn} on 2017/9/18. */ public class GroupAvatarActivity extends BaseActivity implements View.OnClickListener { @Bind(R.id.ll_back) LinearLayout llBack; @Bind(R.id.iv_save) ImageView ivSave; @Bind(R.id.iv_groupAvatar) ImageView ivGroupAvatar; ChoosePhoto mChoosePhoto; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_group_avatar); ButterKnife.bind(this); llBack.setOnClickListener(this); ivSave.setOnClickListener(this); if (getIntent().getStringExtra("groupAvatar") != null) { ivGroupAvatar.setImageBitmap(BitmapFactory.decodeFile(getIntent().getStringExtra("groupAvatar"))); } else { JMessageClient.getGroupInfo(getIntent().getLongExtra("groupID", 0), new GetGroupInfoCallback() { @Override public void gotResult(int i, String s, GroupInfo groupInfo) { if (i == 0) { groupInfo.getBigAvatarBitmap(new GetAvatarBitmapCallback() { @Override public void gotResult(int i, String s, Bitmap bitmap) { if (i == 0) { ivGroupAvatar.setImageBitmap(bitmap); } } }); } } }); } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.ll_back: finish(); break; case R.id.iv_save: mChoosePhoto = new ChoosePhoto(); mChoosePhoto.setGroupAvatarChangeListener(GroupAvatarActivity.this, getIntent().getLongExtra("groupID", 0)); mChoosePhoto.showPhotoDialog(GroupAvatarActivity.this); break; default: break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case PhotoUtils.INTENT_CROP: case PhotoUtils.INTENT_TAKE: case PhotoUtils.INTENT_SELECT: mChoosePhoto.photoUtils.onActivityResult(GroupAvatarActivity.this, requestCode, resultCode, data); break; } } }
jpush/jchat-android
chatapp/src/main/java/jiguang/chat/activity/GroupAvatarActivity.java
Java
mit
3,130
<!DOCTYPE html> <html ng-app="OgilvyOne"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Log in</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Theme style --> <link rel="stylesheet" href="/ng-dist/dist/admin.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/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body class="hold-transition login-page" ng-cloak> <div ng-view></div> <script src="/ng-dist/dist/lib.js"></script> <script src="/ng-dist/dist/app.js"></script> <script src="/ng-dist/dist/admin.js"></script> </body> </html>
trantuanckc/ogilvyone-blog
server/views/login.html
HTML
mit
1,001
<?php namespace eMapper\Regex; use eMapper\Mapper; /** * Tests parsing an array mapping expression * * @author emaphp * @group regex */ class ArrayRegexTest extends \PHPUnit_Framework_TestCase { const REGEX = Mapper::ARRAY_TYPE_REGEX; public function testSimpleArray1() { $expr = 'array'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(1, $matches); $this->assertEquals('array', $matches[0]); } public function testSimpleArray2() { $expr = 'arr'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(1, $matches); $this->assertEquals('arr', $matches[0]); } public function testArrayList1() { $expr = 'array[]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(4, $matches); $this->assertEquals('[]', $matches[3]); } public function testArrayList2() { $expr = 'arr[]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(4, $matches); $this->assertEquals('[]', $matches[3]); } public function testArrayGroupedList1() { $expr = 'array<category>'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(2, $matches); $this->assertEquals('category', $matches[1]); } public function testArrayGroupedList2() { $expr = 'arr<category>'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(2, $matches); $this->assertEquals('category', $matches[1]); } public function testArrayGroupedList3() { $expr = 'array<category:int>'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(3, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('int', $matches[2]); } public function testArrayGroupedList4() { $expr = 'arr<category:int>'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(3, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('int', $matches[2]); } public function testArrayIndexedList1() { $expr = 'array[product_id]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('[product_id]', $matches[3]); $this->assertEquals('product_id', $matches[4]); } public function testArrayIndexedList2() { $expr = 'arr[product_id]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('[product_id]', $matches[3]); $this->assertEquals('product_id', $matches[4]); } public function testArrayIndexedList3() { $expr = 'array[product_id:int]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(6, $matches); $this->assertEquals('[product_id:int]', $matches[3]); $this->assertEquals('product_id', $matches[4]); $this->assertEquals('int', $matches[5]); } public function testArrayIndexedList4() { $expr = 'arr[product_id:int]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(6, $matches); $this->assertEquals('[product_id:int]', $matches[3]); $this->assertEquals('product_id', $matches[4]); $this->assertEquals('int', $matches[5]); } public function testArrayIndexedList5() { $expr = 'array[0]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('[0]', $matches[3]); $this->assertEquals('0', $matches[4]); } public function testArrayIndexedList6() { $expr = 'arr[1]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('[1]', $matches[3]); $this->assertEquals('1', $matches[4]); } public function testArrayGroupedIndexedList1() { $expr = 'array<category>[product_id]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('[product_id]', $matches[3]); $this->assertEquals('product_id', $matches[4]); } public function testArrayGroupedIndexedList2() { $expr = 'array<category:string>[product_id]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(5, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('string', $matches[2]); $this->assertEquals('[product_id]', $matches[3]); $this->assertEquals('product_id', $matches[4]); } public function testArrayGroupedIndexedList3() { $expr = 'array<category>[product_id:int]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(6, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('[product_id:int]', $matches[3]); $this->assertEquals('product_id', $matches[4]); $this->assertEquals('int', $matches[5]); } public function testArrayGroupedIndexedList4() { $expr = 'array<category:string>[product_id:int]'; $result = preg_match(self::REGEX, $expr, $matches); $this->assertEquals(1, $result); $this->assertCount(6, $matches); $this->assertEquals('category', $matches[1]); $this->assertEquals('string', $matches[2]); $this->assertEquals('[product_id:int]', $matches[3]); $this->assertEquals('product_id', $matches[4]); $this->assertEquals('int', $matches[5]); } } ?>
emaphp/eMapper
tests/eMapper/Regex/ArrayRegexTest.php
PHP
mit
5,806
package com.ami.gui2go; import android.app.Activity; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; public class UserGuideActivity extends Activity { ListView topicsList; WebView helpWebView; ProgressDialog progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_guide_activity); topicsList = (ListView) findViewById(R.id.topicsList); topicsList.setChoiceMode(ListView.CHOICE_MODE_SINGLE); helpWebView = (WebView) findViewById(R.id.helpWebView); helpWebView.getSettings().setJavaScriptEnabled(true); helpWebView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY); helpWebView.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { if (progressBar.isShowing()) { progressBar.dismiss(); } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(UserGuideActivity.this, "Error loading page: " + description, Toast.LENGTH_SHORT).show(); } }); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.helpTopics, android.R.layout.simple_list_item_activated_1); topicsList.setAdapter(adapter); topicsList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ((ListView) parent).setItemChecked(position, true); String urlToLoad = new String(); switch(position){ case 0: urlToLoad = "http://gui2go.blogspot.com/p/gui2go-help.html"; break; case 1: urlToLoad = "http://gui2go.blogspot.com/p/gui-2-go-help-activity-management.html"; break; case 2: urlToLoad = "http://gui2go.blogspot.com/p/placing-and-editing-widgets.html"; break; case 3: urlToLoad = "http://gui2go.blogspot.com/p/gui-2-go-help-exporting-your-files.html"; break; } progressBar = ProgressDialog.show(UserGuideActivity.this, "Loading help page...", "Loading...",true,true,new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { helpWebView.stopLoading(); } }); helpWebView.loadUrl(urlToLoad); } }); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return (true); } return super.onOptionsItemSelected(item); } }
amigold/Gui2Go
src/com/ami/gui2go/UserGuideActivity.java
Java
mit
3,114
=begin = rds.rb *Copyright*:: (C) 2013 by Novu, LLC *Author(s)*:: Tamara Temple <tamara.temple@novu.com> *Since*:: 2013-02-26 *License*:: GPLv3 *Version*:: 0.0.1 == Description =end require 'fog' module Rds::S3::Backup class MyRDSException < RuntimeError ; end class MyRDS def initialize(opts) @opts = opts end def rds # Memoize @rds @rds ||= get_rds_connection() end def server # Memoize @server @server ||= get_rds_server(@opts['rds_instance_id']) end # Restore the production database from the most recent snapshot def restore_db begin self.rds.restore_db_instance_from_db_snapshot(new_snap.id, backup_server_id, {"DBSubnetGroupName" => @opts['db_subnet_group_name'], "DBInstanceClass" => @opts['db_instance_type'] } ) rescue Exception => e raise MyRDSException.new("Error in #{self.class}:restore_db: #{e.class}: #{e}") end end # Dump the database to the backup file name def dump(backup_file_name) @mysqlcmds ||= ::Rds::S3::Backup::MySqlCmds.new(backup_server.endpoint['Address'], @opts['mysql_username'], @opts['mysql_password'], @opts['mysql_database']) @mysqlcmds.dump(backup_file_path(backup_file_name)) # returns the dump file path end # Convert personal data in the production data into random generic data def obfuscate @mysqlcmds ||= ::Rds::S3::Backup::MySqlCmds.new(backup_server.endpoint['Address'], @opts['mysql_username'], @opts['mysql_password'], @opts['mysql_database']) @mysqlcmds.exec(@opts['obfuscate_sql']) end def backup_file_path(backup_file_name) File.join(@opts['dump_directory'], backup_file_name) end def backup_server_id @backup_server_id ||= "#{self.server.id}-s3-dump-server-#{@opts['timestamp']}" end def new_snap unless @new_snap self.server.snapshots.new(:id => snap_name).save @new_snap = self.server.snapshots.get(snap_name) (0..1).each {|i| $logger.debug "#{__FILE__}:#{__LINE__}: Waiting for new_snap server to be ready: #{i}"; @new_snap.wait_for { ready? } } # ready? sometimes lies end @new_snap end def backup_server @backup_server ||= get_rds_server(backup_server_id) (0..1).each {|i| $logger.debug "#{__FILE__}:#{__LINE__}: Waiting for backup_server to be ready: #{i}" ; @backup_server.wait_for {ready? } } # won't get fooled again! @backup_server end def snap_name @snap_name ||= "s3-dump-snap-#{@opts['timestamp']}" end def get_rds_connection() options = { :aws_access_key_id => @opts['aws_access_key_id'], :aws_secret_access_key => @opts['aws_secret_access_key'], :region => @opts['aws_region']} Fog.timeout=@opts['fog_timeout'] begin connection = Fog::AWS::RDS.new(options) rescue Exception => e raise MyRDSException.new("Error in #{self.class}#get_rds_connection: #{e.class}: #{e}") end raise MyRDSException.new("Unable to make RDS connection") if connection.nil? connection end def get_rds_server(id) begin server = self.rds.servers.get(id) rescue Exception => e raise MyRDSException.new("Error getting server in #{self.class}#get_rds_server: #{e.class}: #{e}") end raise MyRDSException.new("Server is nil for #{id}") if server.nil? server end def destroy unless @new_snap.nil? (0..1).each {|i| $logger.debug "#{__FILE__}:#{__LINE__}: Waiting for new_snap server to be ready in #{self.class}#destroy: #{i}"; @new_snap.wait_for { ready? } } @new_snap.destroy end unless @backup_server.nil? (0..1).each {|i| $logger.debug "#{__FILE__}:#{__LINE__}: Waiting for backup server to be ready in #{self.class}#destroy: #{i}"; @backup_server.wait_for {ready? } } @backup_server.destroy(nil) end end end end
novu/rds-s3-backup-gem
lib/rds-s3-backup/myrds.rb
Ruby
mit
4,502
<div class="form-group"> <label for="Username" class="control-label">Username</label> <input class="form-control" #name type="text" autofocus placeholder="Username"> </div> <div class="form-group"> <label for="Password" class="control-label">Password</label> <input class="form-control" #pwd type="password" placeholder="Password"> </div> <div class="form-group"> <label for="SecretKey" class="control-label">Secret Key</label> <p> Secret key (supplied by admin) has to be provided in order to register. </p> <input class="form-control" #key type="password" placeholder="SecretKey"> </div> <div class="form-group"> </div> <div class="form-group"> <button type="button" (click)="register(name.value, pwd.value, key.value)" class="btn btn-success custom-btn">Register</button> </div> <error-notification [errorMessage]="errorMessage"></error-notification>
antonsirocka/angular2-moviedb
src/MovieDatabase_NetCoreApp/wwwroot/app/components/register/register.component.html
HTML
mit
922
export {default} from 'ember-frost-demo-components/components/frost-file-node/component'
sophypal/ember-frost-demo-components
app/components/frost-file-node.js
JavaScript
mit
89
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\ZendBundle\ZendBundle(), new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Symfony\Bundle\DoctrineBundle\DoctrineBundle(), new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Odino\BlogBundle\OdinoBlogBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Symfony\Bundle\WebConfiguratorBundle\SymfonyWebConfiguratorBundle(); } return $bundles; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); } public function registerRootDir() { return __DIR__; } }
odino/odino_org
app/AppKernel.php
PHP
mit
1,265
import { getEvent, eventMap } from '../../src/module/moveRow/event'; import { EMPTY_TPL_KEY } from '../../src/common/constants'; describe('drag', () => { describe('getEvent', () => { let events = null; beforeEach(() => { }); afterEach(() => { events = null; }); it('基础验证', () => { expect(getEvent).toBeDefined(); expect(getEvent.length).toBe(1); }); it('执行验证', () => { events = getEvent('test'); expect(events.start.events).toBe('mousedown.gmLineDrag'); expect(events.start.target).toBe('test'); expect(events.start.selector).toBe(`tr:not([${EMPTY_TPL_KEY}])`); expect(events.doing.events).toBe('mousemove.gmLineDrag'); expect(events.doing.target).toBe('body'); expect(events.doing.selector).toBeUndefined(); expect(events.abort.events).toBe('mouseup.gmLineDrag'); expect(events.abort.target).toBe('body'); expect(events.abort.selector).toBeUndefined(); }); }); describe('eventMap', () => { it('基础验证', () => { expect(eventMap).toEqual({}); }); }); });
baukh789/GridManager
test/moveRow/event_test.js
JavaScript
mit
1,254
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="It is only with the heart that one can see rightly; what is essentiall is invisiable to the eye."> <meta name="keywords" content=""> <meta name="theme-color" content="#000000"> <title>凸集优化(1) - 鱼叔叔写字的地方 | Roth's Blog</title> <!-- Web App Manifest --> <link rel="manifest" href="/pwa/manifest.json"> <!-- Favicon --> <link rel="shortcut icon" href="/img/myicon.ico"> <!-- Canonical URL --> <link rel="canonical" href="http://localhost:4000/optimization/2016/11/07/CH2.1/"> <!-- Bootstrap Core CSS --> <link rel="stylesheet" href="/css/bootstrap.min.css"> <!-- Custom CSS --> <link rel="stylesheet" href="/css/hux-blog.min.css"> <!-- Pygments Github CSS --> <link rel="stylesheet" href="/css/syntax.css"> <!-- search --> <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css"> <!-- Custom Fonts --> <!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> --> <!-- Hux change font-awesome CDN to qiniu --> <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']], displayMath: [ ['$$', '$$'], ["\[", "\]"] ], skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'], processEscapes: true }, displayAlign: "center", displayIndent: "2em", TeX: { equationNumbers: { autoNumber: ["AMS"], useLabelIds: true } }, "HTML-CSS": { linebreaks: { automatic: true }, scale: 85 }, SVG: { linebreaks: { automatic: true } } }); </script> <!-- Hux Delete, sad but pending in China <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' 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]--> <!-- ga & ba script hoook --> <script></script> </head> <!-- hack iOS CSS :active style --> <body ontouchstart=""> <!-- Navigation --> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle"> <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="/"></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div id="huxblog_navbar"> <div class="navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li> <a href="/">Home</a> </li> <li> <a href="/about/">It's me</a> </li> <li> <a href="/Projects/">Projetcs</a> </li> <li> <a href="/RMD/">Rmarkdown Posts</a> </li> <li> <a href="/tags/">Tags</a> </li> </ul> </div> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <script> // Drop Bootstarp low-performance Navbar // Use customize navbar with high-quality material design animation // in high-perf jank-free CSS3 implementation var $body = document.body; var $toggle = document.querySelector('.navbar-toggle'); var $navbar = document.querySelector('#huxblog_navbar'); var $collapse = document.querySelector('.navbar-collapse'); var __HuxNav__ = { close: function(){ $navbar.className = " "; // wait until animation end. setTimeout(function(){ // prevent frequently toggle if($navbar.className.indexOf('in') < 0) { $collapse.style.height = "0px" } },400) }, open: function(){ $collapse.style.height = "auto" $navbar.className += " in"; } } // Bind Event $toggle.addEventListener('click', function(e){ if ($navbar.className.indexOf('in') > 0) { __HuxNav__.close() }else{ __HuxNav__.open() } }) /** * Since Fastclick is used to delegate 'touchstart' globally * to hack 300ms delay in iOS by performing a fake 'click', * Using 'e.stopPropagation' to stop 'touchstart' event from * $toggle/$collapse will break global delegation. * * Instead, we use a 'e.target' filter to prevent handler * added to document close HuxNav. * * Also, we use 'click' instead of 'touchstart' as compromise */ document.addEventListener('click', function(e){ if(e.target == $toggle) return; if(e.target.className == 'icon-bar') return; __HuxNav__.close(); }) </script> <!-- Image to hack wechat --> <!-- <img src="/img/icon_wechat.png" width="0" height="0"> --> <!-- <img src="/img/home-bg.jpg" width="0" height="0"> --> <script> (function () { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; document.getElementsByTagName("head")[0].appendChild(script); })(); </script> <!-- Post Header --> <style type="text/css"> header.intro-header{ position: relative; background-image: url('/img/home-bg.jpg') } </style> <header class="intro-header" > <div class="header-mask"></div> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div class="post-heading"> <div class="tags"> <a class="tag" href="/tags/#optimization" title="optimization">optimization</a> </div> <h1>凸集优化(1)</h1> <h2 class="subheading"></h2> <span class="meta">Posted by 鱼叔叔|Roth on November 7, 2016</span> </div> </div> </div> </div> </header> <!-- Post Content --> <article> <div class="container"> <div class="row"> <!-- Post Container --> <div class=" col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 post-container"> <p>该系列posts是笔者学习Dimitri .P Bertsekas所写的 Nonlinear Programming 2ed 中文版时整理的笔记。 下面是关于第二章无约束优化内容的整理。</p> <p>这一章打算分成二篇posts来展现,分别讨论</p> <ul> <li>约束优化问题的最优性条件</li> <li>可行方向法求解凸集上的优化问题</li> </ul> <p>本文讨论约束优化问题的最优性条件。</p> <ul id="markdown-toc"> <li><a href="#section" id="markdown-toc-section">约束优化问题</a> <ul> <li><a href="#section-1" id="markdown-toc-section-1">最优解的存在性</a></li> <li><a href="#section-2" id="markdown-toc-section-2">最优解的充要条件</a></li> <li><a href="#section-3" id="markdown-toc-section-3">凸集上的投影</a></li> </ul> </li> </ul> <p>这一章我们考虑带约束的优化问题</p> <script type="math/tex; mode=display">\mathop{min}_{x\in X}\qquad f(x)</script> <p>其中</p> <ul> <li>X是非空凸集</li> <li>函数 $f$ 是连续可微的</li> </ul> <p>另外我们称$X$为可行域,里面的点$x$为可行解。</p> <h2 id="section">约束优化问题</h2> <h3 id="section-1">最优解的存在性</h3> <p>不像在无约束优化问题,在一定条件下我们可以使用Weisterass保证最优解的存在性,带约束的问题中往往不能满足这些条件。所幸的是Marguerite Frank and Philip Wolfe给出了如下定理:</p> <p>If a quadratic function $f$ is bounded below on a nonempty polyhedron $X$, then $f$ attains its infimum on $X$. (That is, there exists a vector $x_* \in X$ such that $f(x_* )\leq f(x),\forall x\in X$.)</p> <p>其中$f$形如</p> <script type="math/tex; mode=display">f(x)=x^TQx+c^Tx+d</script> <p>且只要求$Q$是对称矩阵,不需要半正定。</p> <h3 id="section-2">最优解的充要条件</h3> <p>【最优解的一阶必要性条件】如果 $x_* $ 是 $f$ 在 凸集$X$ 上的局部最小值点,那么$\forall x\in X$有</p> <script type="math/tex; mode=display">\nabla f(x_* )(x-x_* )\geq 0</script> <p>【最优解的一阶充要条件】如果 $f$ 是 凸集$X$ 上的凸函数,那么$x_* $ 是 $f$ 在 $X$ 上的全局最小值点$\Leftrightarrow$$\forall x\in X$有</p> <script type="math/tex; mode=display">\nabla f(x_* )(x-x_* )\geq 0</script> <p>【最优解的二阶必要性条件】如果 $x_* $ 是二阶可微连续函数 $f$ 在 凸集$X$ 上的局部最小值点,那么对一切满足$\nabla f(x_* )(x-x_* )\geq 0$的$x$,有</p> <script type="math/tex; mode=display">(x-x_* )^T\nabla^2 f(x_* )(x-x_* )\geq 0</script> <p>【最优解的二阶充分性条件】如果 $f$ 是 凸集$X$ 上的二阶连续可导凸函数,且存在$x_* \in X$,使得对于任意的$x\in X$,$\nabla f(x_* )(x-x_* )\geq 0$。若下面任意条件成立,则$x_* $是局部最小值点:</p> <ul> <li>X是一个多面体,并且对于一切满足$\nabla f(x_* )(x-x_* )\geq 0$及$x\neq x_* $的$x\in X$,成立</li> </ul> <script type="math/tex; mode=display">(x-x_* )^T\nabla^2 f(x_* )(x-x_* )>0</script> <ul> <li>存在$a&gt;0$,使得对于任意$x\in X$,成立</li> </ul> <script type="math/tex; mode=display">(x-x_* )^T\nabla^2 f(x_* )(x-x_* )\geq a\vert \vert x-x_* \vert \vert ^2</script> <p><strong>Remark</strong></p> <ol> <li> <p><code class="highlighter-rouge">最优解的一阶必要性条件</code>的几何解释: 在局部最小值点$x_* $处的梯度$\nabla f(x_* )$与所有的可行变分,$x-x_* ,x\in X$,的夹角都小于等于$90^\circ$。 特别当约束集 $X$ 非凸时,最优性的必要条件不成立。 <img src="http://ogfa13jyv.bkt.clouddn.com/Snip20161109_9.png" alt="Snip20161109_9" /> <img src="http://ogfa13jyv.bkt.clouddn.com/Snip20161109_11.png" alt="Snip20161109_11" /></p> </li> <li> <p><code class="highlighter-rouge">最优解的一阶充要条件</code>中,运用了平行于Chapter 1中的结论,即:令 $f:X\vert \rightarrow R$为凸集 $X$ 上的一个凸函数,则在 $X$上的 $f$最小值点也是 $X$上的全局最小值点。</p> </li> </ol> <p><strong>例: 带边界约束的优化问题</strong></p> <p>考虑带边界的优化问题</p> <script type="math/tex; mode=display">\mathop{min}_{x\in X}\qquad f(x)</script> <p>其中可行域$X={x\in R^n\vert a_i\leq x\leq b_i, i=1,2,..,n}$, $a_i,b_i$是给定的常数,下面分三种情况讨论:</p> <ul> <li> <p>最小值点$x_* $在下边界点处取到,即${x_* }_i=a_i$</p> <p>利用最优解的一阶必要性条件,我们可以得到</p> <script type="math/tex; mode=display">\sum_{i=1}^n \frac{\partial f(x_* )}{\partial x_i}(x_i-{x_* }_i) \geq 0</script> <p>固定$i$, 构造如下的$x$: $x_i=a_i+\delta_i$,其中$\delta_i&gt;0$ ,且对一切$j\neq i,x_j={x_* }_j$。</p> <p>则有$\frac{\partial f(x_* )}{\partial x_i}\delta_i\geq 0$,进而推出</p> <script type="math/tex; mode=display">\frac{\partial f(x_* )}{\partial x_i}\geq 0</script> </li> <li> <p>最小值点$x_* $在上边界点处取到,即${x_* }_i=b_i$</p> <p>与上例类似,只需取$x_i=b_j-\delta_j$,其中$\delta_i&gt;0$, 易得</p> <script type="math/tex; mode=display">\frac{\partial f(x_* )}{\partial x_i}\leq 0</script> </li> <li> <p>最小值点$x_* $在内部取到,即$a_i &lt;{x_* }_i &lt;b_i$</p> <p>固定$i$, 构造如下的$x$:</p> <script type="math/tex; mode=display">x_i={x_* }_i+\delta_i</script> <p>其中$\delta_i&gt;0$且保证$x_i ={x_* }_i+\delta_i&lt;b_i$.同时对一切$j\neq i$</p> <script type="math/tex; mode=display">x_j={x_* }_j</script> <p>则有$\frac{\partial f(x_* )}{\partial x_i }\geq 0$; 如果构造$x$为</p> <script type="math/tex; mode=display">x_i={x_*}_i -\delta_i</script> <p>其中$\delta_i&gt;0$且保证$x_i ={x_* }_i -\delta_i &gt; a_i$, 且对一切$ j\neq i, x_j ={x*}_j $。则有</p> <script type="math/tex; mode=display">\frac{\partial f(x_* )}{\partial x_i }\leq 0</script> <p>综上可得</p> <script type="math/tex; mode=display">\frac{\partial f(x_* )}{\partial x_i}=0</script> </li> </ul> <h3 id="section-3">凸集上的投影</h3> <p>现在考虑一个有很强直观几何意义的优化问题</p> <script type="math/tex; mode=display">\mathop{min}_{x\in X}\qquad \vert \vert z-x\vert \vert ^2</script> <p>其中 $z\in R^n$。从几何上理解这个问题就是,在$R^n$的子集$X$中找到一个点$x_* \in X$,使得$x_* $与$z$在欧式距离意义下最近,我们称这个优化问题为投影问题</p> <p>为了解决这个,优化问题,我们引入下面这个定理</p> <p>【投影定理】设$X$是$R^n$的非空闭凸子集:</p> <ul> <li>【存在性命题】对每一$z\in R^n$,存在唯一的$x_* \in X$,使得对一切$x\in X,\vert \vert z-x\vert \vert $达到最小。我们称$x_* $为$z$在$X$上的投影,用$[z]^+$表示。</li> <li>【判定条件】给定$z\in R^n$,一个向量$x_* $等于$[z]^+$当且仅当对一切$x\in X$</li> </ul> <script type="math/tex">(z-x_* )(x-x_* )\leq 0</script> <ul> <li>当$X$是一个子空间时,一个向量$x_* $等于$[z]^+$当且仅当$z-x_* $正交于$X$,即对一切$x\in X$</li> </ul> <script type="math/tex; mode=display">x^T(z-x_* )=0</script> <p><strong>Remark</strong></p> <ol> <li> <p><code class="highlighter-rouge">判定条件</code>的几何解释</p> <p><img src="http://ogfa13jyv.bkt.clouddn.com/Snip20161110_4.png" alt="Snip20161110_4" /></p> </li> <li> <p>子空间情形的几何解释</p> <p><img src="http://ogfa13jyv.bkt.clouddn.com/projection.png" alt="projection" /></p> </li> </ol> <p><strong>例子:等式约束的二次问题</strong></p> <p><img src="http://ogfa13jyv.bkt.clouddn.com/Snip20161110_6.png" alt="Snip20161110_6" /></p> <hr style="visibility: hidden;"> <ul class="pager"> <li class="previous"> <a href="/optimization/2016/11/02/CH1.5/" data-toggle="tooltip" data-placement="top" title="无约束优化(5)"> Previous<br> <span>无约束优化(5)</span> </a> </li> <li class="next"> <a href="/optimization/2016/11/14/CH2.2/" data-toggle="tooltip" data-placement="top" title="凸集优化(2)"> Next<br> <span>凸集优化(2)</span> </a> </li> </ul> <!-- 多说评论框 start --> <div class="comment"> <div class="ds-thread" data-thread-key="/optimization/2016/11/07/CH2.1" data-title="凸集优化(1)" data-url="http://localhost:4000/optimization/2016/11/07/CH2.1/" > </div> </div> <!-- 多说评论框 end --> </div> <!-- Side Catalog Container --> <!-- Sidebar Container --> <div class=" col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 sidebar-container"> <!-- Featured Tags --> <section> <hr class="hidden-sm hidden-xs"> <h5><a href="/tags/">FEATURED TAGS</a></h5> <div class="tags"> <a href="/tags/#optimization" title="optimization" rel="12"> optimization </a> </div> </section> <!-- Friends Blog --> </div> </div> </div> </article> <!-- 多说公共JS代码 start (一个网页只需插入一次) --> <script type="text/javascript"> // dynamic User by Hux var _user = 'rothdyt'; // duoshuo comment query. var duoshuoQuery = {short_name: _user }; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; 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> <!-- 多说公共JS代码 end --> <!-- async load function --> <script> function async(u, c) { var d = document, t = 'script', o = d.createElement(t), s = d.getElementsByTagName(t)[0]; o.src = u; if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); } s.parentNode.insertBefore(o, s); } </script> <!-- anchor-js, Doc:http://bryanbraun.github.io/anchorjs/ --> <script> async("//cdnjs.cloudflare.com/ajax/libs/anchor-js/1.1.1/anchor.min.js",function(){ anchors.options = { visible: 'always', placement: 'right', icon: '#' }; anchors.add().remove('.intro-header h1').remove('.subheading').remove('.sidebar-container h5'); }) </script> <style> /* place left on bigger screen */ @media all and (min-width: 800px) { .anchorjs-link{ position: absolute; left: -0.75em; font-size: 1.1em; margin-top : -0.1em; } } </style> <!-- Footer --> <footer> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <ul class="list-inline text-center"> <!-- add Weibo, Zhihu by Hux, add target = "_blank" to <a> by Hux --> <li> <a target="_blank" href="https://github.com/Rothdyt"> <span class="fa-stack fa-lg"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-github fa-stack-1x fa-inverse"></i> </span> </a> </li> </ul> <p class="copyright text-muted"> Copyright &copy; 2016 <br> Theme by <a href="http://huangxuan.me">Hux</a> | <iframe style="margin-left: 2px; margin-bottom:-5px;" frameborder="0" scrolling="0" width="91px" height="20px" src="https://ghbtns.com/github-btn.html?user=huxpro&repo=huxpro.github.io&type=star&count=true" > </iframe> </p> </div> </div> </div> <div class="cb-search-tool" style="position: fixed; top: 0px ; bottom: 0px; left: 0px; right: 0px; opacity: 0.95; background-color: #111111; z-index: 9999; display: none;"> <input type="text" class="form-control cb-search-content" id="cb-search-content" style="position: fixed; top: 60px" placeholder="Tittle Date Tags" > <div style="position: fixed; top: 16px; right: 16px;"> <img src="/search/img/cb-close.png" id="cb-close-btn"/> </div> </div> <div style="position: fixed; right: 16px; bottom: 20px;"> <img src="/search/img/cb-search.png" id="cb-search-btn" title="双击ctrl试一下"/> </div> <link rel="stylesheet" href="/search/css/cb-search.css"> <!-- jQuery --> <script src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script> <script src="/search/js/bootstrap3-typeahead.min.js"></script> <script src="/search/js/cb-search.js"></script> </footer> <!-- Bootstrap Core JavaScript --> <script src="/js/bootstrap.min.js "></script> <!-- Bootstrap Core JavaScript --> <script src="//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <!-- Custom Theme JavaScript --> <script src="/js/hux-blog.min.js "></script> <!-- Service Worker --> <script type="text/javascript"> if(navigator.serviceWorker){ // For security reasons, a service worker can only control the pages that are in the same directory level or below it. That's why we put sw.js at ROOT level. navigator.serviceWorker .register('/sw.js') .then((registration) => {console.log('Service Worker Registered. ', registration)}) .catch((error) => {console.log('ServiceWorker registration failed: ', error)}) } </script> <!-- async load function --> <script> function async(u, c) { var d = document, t = 'script', o = d.createElement(t), s = d.getElementsByTagName(t)[0]; o.src = u; if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); } s.parentNode.insertBefore(o, s); } </script> <!-- Because of the native support for backtick-style fenced code blocks right within the Markdown is landed in Github Pages, From V1.6, There is no need for Highlight.js, so Huxblog drops it officially. - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0 - https://help.github.com/articles/creating-and-highlighting-code-blocks/ - https://github.com/jneen/rouge/wiki/list-of-supported-languages-and-lexers --> <!-- <script> async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){ hljs.initHighlightingOnLoad(); }) </script> <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet"> --> <!-- jquery.tagcloud.js --> <script> // only load tagcloud.js in tag.html if($('#tag_cloud').length !== 0){ async('/js/jquery.tagcloud.js',function(){ $.fn.tagcloud.defaults = { //size: {start: 1, end: 1, unit: 'em'}, color: {start: '#bbbbee', end: '#0085a1'}, }; $('#tag_cloud a').tagcloud(); }) } </script> <!--fastClick.js --> <script> async("//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js", function(){ var $nav = document.querySelector("nav"); if($nav) FastClick.attach($nav); }) </script> <!-- Google Analytics --> <!-- Baidu Tongji --> <!-- Side Catalog --> <!-- Image to hack wechat --> <img src="/img/icon_wechat.png" width="0" height="0" /> <!-- Migrate from head to bottom, no longer block render and still work --> </body> </html>
Rothdyt/rothdyt.github.com
_site/optimization/2016/11/07/CH2.1/index.html
HTML
mit
25,275
package org.lcr.server.entity; import java.io.Serializable; import java.util.Date; @SuppressWarnings("unused") public class AccessTokenEntity implements Serializable { private static final long serialVersionUID = 3204873801685152409L; private String loginName; private String password; private String accessToken; private Integer expiresIn; private Date startDate; private String userId; public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getAccessToken() { return accessToken; } public void setAccessToken(String accessToken) { this.accessToken = accessToken; } public Integer getExpiresIn() { return expiresIn; } public void setExpiresIn(Integer expiresIn) { this.expiresIn = expiresIn; } }
lcrappserver/app-server
appserver/src/main/java/org/lcr/server/entity/AccessTokenEntity.java
Java
mit
1,263
output = function() { navigator.camera.getPicture(function(imageData) { cb({ imageData: $.create(imageData) }); }, function(err) { cb({ error: $.create(err) }); }, { quality: $.quality, sourceType: Camera.PictureSourceType[$.sourceType], allowEdit: $.allowEdit, encodingType: Camera.EncodingType[$.encodingType], targetWidth: $.targetWidth, targetHeight: $.targetHeight }); };
nodule/phonegap
nodes/getPicture/node.js
JavaScript
mit
417
#!/usr/bin/env bash . util.sh checkroot ufw allow 80/tcp || { log "Failed to add firewall rule"; exit 1; } ufw allow 443/tcp || { log "Failed to add firewall rule"; exit 1; } ufw allow ${SSH_PORT}/tcp || { log "Failed to add firewall rule"; exit 1; } ufw allow ${OPENVPN_PORT}/udp || { log "Failed to add firewall rule"; exit 1; } ufw enable || { log "Failed to enable firewall."; exit 1; }
ppruitt/site
scripts/configure_firewall.sh
Shell
mit
399
module Czechit VERSION = "0.0.1" end
michalvich/czechit
lib/czechit/version.rb
Ruby
mit
39
<extend name="template/base_index" /> <block name="area_header"> <link rel="stylesheet" href="__CSS__/shangjia.css"> </block> <block name="area_body"> <include file='Widget/sjtop' /> <div class="seller_main clearfix" controller="seller/common"> <div class="seller_content_wrap"> <div class="seller_content" style="padding-top: 10px;"> <div class="content"> <h1> 账户安全 </h1> <div> <table class="renzheng-table"> <colgroup> <col width="100px"> <col width="620px"> <col width="120px"> </colgroup> <tbody> <tr> <td> <div style="width: 520px; padding: 50px;"> <if condition="$entity['email'] eq ''"> <i class="am-icon-envelope-o" font-size: 60px;width: 80px; margin-left: 15px;></i> <span class="text-warning">你尚未绑定邮箱</span> <else/> <i class="am-icon-envelope-o" style="color: deeppink; font-size: 60px;width: 80px; margin-left: 15px;"></i> <span class="text-success">你已绑定邮箱[ {$entity['email']}]</span> </if> </div> </td> <td> <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1" > <div class="am-modal-dialog"> <div class="am-modal-hd">邮箱验证 <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a> </div> <form action="{:U('Home/Usersj/email')}" method="post"> <div class="am-modal-bd"> <input type="hidden" name="id" value="{$entity['id']}" /> <input type="text" name="email" value="{$entity['email']}"> <input style="font-family: '微软雅黑'; font-size: 13px; border-radius:5px ; margin-top: -8px;" class="am-btn-danger am-btn-xs" type="submit" value="确认" /> </div> </form> </div> </div> <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-2" > <div class="am-modal-dialog"> <div class="am-modal-hd">手机更换 <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a> </div> <form action="{:U('Home/Usersj/phone')}" method="post"> <div class="am-modal-bd"> <input type="hidden" name="id" value="{$entity['id']}" /> <input type="text" class="email" name="phone" value="{$entity['mobile']}"> <input style="font-family: '微软雅黑'; font-size: 13px; border-radius:5px ; margin-top: -8px;" class="am-btn-danger am-btn-xs" type="submit" value="确认" /> </div> </form> </div> </div> <button class="am-btn am-btn-primary am-btn-xs" style="font-family: '微软雅黑'; font-size: 13px; width: 60px; height: 30px;line-height: 10px; padding: 10px; border-radius:5px ;" data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 400, height: 225}">修改</button> </tr> </tbody> </table> <table class="renzheng-table"> <colgroup> <col width="100px"> <col width="620px"> <col width="120px"> </colgroup> <tbody> <tr> <td> <div style="width: 520px; padding: 50px;"> <if condition="$entity['mobile'] eq ''"> <i class="am-icon-mobile" style="font-size: 60px;width: 80px; margin-left: 15px;"></i> <span class="text-warning">你尚未绑定手机</span> <else/> <i class="am-icon-mobile" style="color: deeppink; font-size: 60px; width: 80px; margin-left: 15px;"></i> <span class="text-success">你已绑定手机[ {$entity['mobile']}]</span> </if> </div> </td> <td> <button class="am-btn am-btn-primary am-btn-xs" style="font-family: '微软雅黑'; font-size: 13px; width: 60px; height: 30px;line-height: 10px; padding: 10px; border-radius:5px ;" data-am-modal="{target: '#doc-modal-2', closeViaDimmer: 0, width: 400, height: 225}">更换</button> </tr> </tbody> </table> </div> </div> </div> </div> <include file='Widget/sjleft' /> </div> </block> <block name="area_footer"> </block>
h136799711/201506bbjie
Application/Home/View/default/Usersj/sj_zhaq.html
HTML
mit
4,402
<?php if(!defined('INCLUDE_CHECK')) header("Location: 404.php"); /* Database config */ //Local $db_host = 'localhost'; $db_user = 'root'; $db_pass = 'password'; $db_database = 'kunalsha_fashioncents_blog'; /* Server $db_host = 'sql308.byethost22.com'; $db_user = 'b22_19030898'; $db_pass = 'F4shion$ents'; $db_database = 'b22_19030898_fashioncents'; */ /* End config */ //example hange //$link = mysql_connect($db_host,$db_user,$db_pass) or die('Unable to establish a DB connection'); $GLOBALS['bloglink'] = mysqli_connect($db_host,$db_user,$db_pass,$db_database); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }
KKsharma99/fashioncents
blogconnect.php
PHP
mit
718