code stringlengths 4 991k | repo_name stringlengths 6 116 | path stringlengths 4 249 | language stringclasses 30 values | license stringclasses 15 values | size int64 4 991k | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2008 Andreas Gaida
Copyright (C) 2008 Ralph Schreyer
Copyright (C) 2008 Klaus Spanderen
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
<quantlib-dev@lists.sf.net>. The license is also available online at
<http://quantlib.org/license.shtml>.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
/*! \file secondordermixedderivativeop.hpp
\brief second order mixed derivative linear operator
*/
#ifndef quantlib_second_order_mixed_derivative_hpp
#define quantlib_second_order_mixed_derivative_hpp
#include <ql/methods/finitedifferences/operators/ninepointlinearop.hpp>
namespace QuantLib {
class SecondOrderMixedDerivativeOp : public NinePointLinearOp {
public:
SecondOrderMixedDerivativeOp(
Size d0, Size d1, const boost::shared_ptr<FdmMesher>& mesher);
};
}
#endif
| EuroPlusFinance/Software | Quantum Trading Platforms/QuantLib-1.4/ql/methods/finitedifferences/operators/secondordermixedderivativeop.hpp | C++ | gpl-2.0 | 1,383 | [
30522,
1013,
1008,
1011,
1008,
1011,
5549,
1024,
1039,
1009,
1009,
1025,
21628,
1011,
9381,
1024,
1018,
1025,
27427,
4765,
1011,
21628,
2015,
1011,
5549,
1024,
9152,
2140,
1025,
1039,
1011,
3937,
1011,
16396,
1024,
1018,
1011,
1008,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
namespace Azure.Search.Documents.Indexes.Models
{
/// <summary> Text analytics entity recognition. </summary>
public partial class EntityRecognitionSkill : SearchIndexerSkill
{
/// <summary> Initializes a new instance of EntityRecognitionSkill. </summary>
/// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an upstream skill. </param>
/// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. </param>
public EntityRecognitionSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingEntry> outputs) : base(inputs, outputs)
{
if (inputs == null)
{
throw new ArgumentNullException(nameof(inputs));
}
if (outputs == null)
{
throw new ArgumentNullException(nameof(outputs));
}
Categories = new List<EntityCategory>();
ODataType = "#Microsoft.Skills.Text.EntityRecognitionSkill";
}
/// <summary> Initializes a new instance of EntityRecognitionSkill. </summary>
/// <param name="oDataType"> Identifies the concrete type of the skill. </param>
/// <param name="name"> The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. </param>
/// <param name="description"> The description of the skill which describes the inputs, outputs, and usage of the skill. </param>
/// <param name="context"> Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. </param>
/// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an upstream skill. </param>
/// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. </param>
/// <param name="categories"> A list of entity categories that should be extracted. </param>
/// <param name="defaultLanguageCode"> A value indicating which language code to use. Default is en. </param>
/// <param name="includeTypelessEntities"> Determines whether or not to include entities which are well known but don't conform to a pre-defined type. If this configuration is not set (default), set to null or set to false, entities which don't conform to one of the pre-defined types will not be surfaced. </param>
/// <param name="minimumPrecision"> A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. </param>
internal EntityRecognitionSkill(string oDataType, string name, string description, string context, IList<InputFieldMappingEntry> inputs, IList<OutputFieldMappingEntry> outputs, IList<EntityCategory> categories, EntityRecognitionSkillLanguage? defaultLanguageCode, bool? includeTypelessEntities, double? minimumPrecision) : base(oDataType, name, description, context, inputs, outputs)
{
Categories = categories ?? new List<EntityCategory>();
DefaultLanguageCode = defaultLanguageCode;
IncludeTypelessEntities = includeTypelessEntities;
MinimumPrecision = minimumPrecision;
ODataType = oDataType ?? "#Microsoft.Skills.Text.EntityRecognitionSkill";
}
/// <summary> A value indicating which language code to use. Default is en. </summary>
public EntityRecognitionSkillLanguage? DefaultLanguageCode { get; set; }
/// <summary> Determines whether or not to include entities which are well known but don't conform to a pre-defined type. If this configuration is not set (default), set to null or set to false, entities which don't conform to one of the pre-defined types will not be surfaced. </summary>
public bool? IncludeTypelessEntities { get; set; }
/// <summary> A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. </summary>
public double? MinimumPrecision { get; set; }
}
}
| stankovski/azure-sdk-for-net | sdk/search/Azure.Search.Documents/src/Generated/Models/EntityRecognitionSkill.cs | C# | apache-2.0 | 4,800 | [
30522,
1013,
1013,
9385,
1006,
1039,
1007,
7513,
3840,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
7000,
2104,
1996,
10210,
6105,
1012,
1013,
1013,
1026,
8285,
1011,
7013,
1013,
1028,
1001,
19701,
3085,
4487,
19150,
2478,
2291,
1025,
2478,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
{% include head.html %}
<!--
<script type="text/javascript"
src="/js/MathJax.js?config=TeX-AMS-MML_HTMLorMML,/js/config/TeX-AMS-MML_HTMLorMML.js">
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
</script>
-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ], processEscapes: true },
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<body>
{% include header.html %}
{{ content }}
{% include footer.html %}
{% include backToTop.html %}
<script src="{{ " /js/main.js " | prepend: site.baseurl }}" charset="utf-8"></script>
<script src="{{ " /js/scroll.min.js " | prepend: site.baseurl }}" charset="utf-8"></script>
</body>
</html>
| abcamus/abcamus.github.io | _layouts/default.html | HTML | mit | 1,117 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1063,
1003,
2421,
2132,
1012,
16129,
1003,
1065,
1026,
999,
1011,
1011,
1026,
5896,
2828,
1027,
1000,
3793,
1013,
9262,
22483,
1000,
5034,
2278,
1027,
1000,
1013,
1046,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Boost.Assign library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/assign/
//
#ifndef BOOST_ASSIGN_STD_MAP_HPP
#define BOOST_ASSIGN_STD_MAP_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/assign/list_inserter.hpp>
#include <boost/config.hpp>
#include <map>
namespace boost
{
namespace assign
{
template< class K, class V, class C, class A, class P >
inline list_inserter< assign_detail::call_insert< std::map<K,V,C,A> >, P >
operator+=( std::map<K,V,C,A>& m, const P& p )
{
return insert( m )( p );
}
template< class K, class V, class C, class A, class P >
inline list_inserter< assign_detail::call_insert< std::multimap<K,V,C,A> >, P >
operator+=( std::multimap<K,V,C,A>& m, const P& p )
{
return insert( m )( p );
}
}
}
#endif
| hpl1nk/nonamegame | xray/SDK/include/boost/assign/std/map.hpp | C++ | gpl-3.0 | 1,085 | [
30522,
1013,
1013,
12992,
1012,
23911,
3075,
1013,
1013,
1013,
1013,
9385,
15321,
16173,
8064,
5054,
2494,
1011,
2432,
1012,
2224,
1010,
14080,
1998,
1013,
1013,
4353,
2003,
3395,
2000,
1996,
12992,
4007,
6105,
1010,
2544,
1013,
1013,
1015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package AlgoBinarysearchSort;
/*
SORT is well studied, classic algorithms
trade off is memory vs speed
Other factors are stable, adaptive, worse case O(?)
O(NlogN) is practically used
MergeSort and QuickSort are efficient and good for general cases
O(n^2)
other sorts like selection/insertion/bubblesort are only used for special case
like small or almost sorted array.
*/
import java.util.Random;
public class AlgoBasicSortingComparison {
// Selection Sort, O(n^2)
// ========================
// start from offset 0, then 1, record it as smallest
// compare with the rest of array, if there is smaller, swap
//
// in-place algorithm, not stable
// requires at most n-1 swaps, good for expensive data moving system
public void SelectionSort() {
int smallest;
for (int out = 0; out < data.length - 1; out++) {
// find the index of smallest value
smallest = out;
for (int inner = out + 1; inner < data.length; inner++) {
if (data[inner] < data[smallest])
smallest = inner;
}
swap(out, smallest);
}
}
// Insertion Sort, O(n^2)
// ========================
// outer loop starts from 1, inner loop start from 0 to outer loop
// in-place algorithm, stable
public void InsertionSort() {
int cur;
for (int out = 1; out < data.length; out++) {
// save data to be inserted
cur = data[out];
for (int inner = 0; inner < out; inner++) {
if (cur <= data[inner]) {
// shift right one space to empty a spot
System.arraycopy(data, inner, data, inner + 1, out - inner);
data[inner] = cur;
// after one insert, break, no need to check others in this inner loop
// this is because outer loop start from 1 and it ensures all previous elements
// are already sorted in previous inner loop runs
break;
}
}
}
}
public void InsertionSort_passinData(int[] da1, int start, int end) {
int insert;
// Note, outer loop starts from 1, inner loop start from 0 to outer loop
for (int next = start + 1; next < end; next++) {
insert = da1[next];
for (int i = start; i < next; i++) {
if (data[i] > insert) {
// shift right to empty a spot
System.arraycopy(data, i, data, i + 1, next - i);
data[i] = insert;
// after one insert, break, no need to check others in this inner loop
// this is because outer loop start from 1 and it ensures all previous elements
// are already sorted in previous inner loop runs
break;
}
}
}
}
// Bubble Sort, O(n^2)
// ========================
// scan through the whole list repeatedly. compare neighbor and swap
// stop when no swap was done in previous scan
// most simple one. used rarely
public void bubblesort() {
int j;
boolean swapflag = true;
while (swapflag) {
swapflag = false;
for (j = 0; j < data.length - 1; j++) {
if (data[j] < data[j + 1]) {
swap(j, j + 1);
swapflag = true;
}
}
}
}
//
// Merge Sort, O(nlog(n)), very important concept.
// ========================
// merge step does the heavylifting.
// PROS: the best, average and worse-case running times are all __O(nlog(n))__
// CONS: requires O(n) additional memory. For a large dataset, they need to be split into multiple smaller files to fit memory
//
public void MergeSort() {
MergeSortRecursive(data, 0, data.length - 1);
}
public void MergeSortRecursive(int[] dat, int low, int high) {
if ((high - low) < 2) { // can call other type of Sort algorithm like if ((high - low) < 10), insertionSort();
return;
}
int middle = (low + high) / 2;
MergeSortRecursive(dat, low, middle);
MergeSortRecursive(dat, middle + 1, high);
util_mergeArray(dat, low, middle, middle + 1, high);
}
// merge two sorted list. This alone is a typical interview coding question
private void util_mergeArray(int[] dat, int left, int middle1, int middle2, int right) {
int lIndex = left;
int rIndex = middle2;
int c = left;
int[] combined = new int[dat.length]; // new array to save combining results
// A. merge two subarrays while there are elements in both
while (lIndex <= middle1 && rIndex <= right) {
if (dat[lIndex] <= dat[rIndex]) {
combined[c++] = dat[lIndex++];
} else {
combined[c++] = dat[rIndex++];
}
}
// B. copy rest of whichever array remains
if (lIndex == middle2) { // left array is empty
while (rIndex <= right) {
combined[c++] = dat[rIndex++];
}
} else {
while (lIndex <= middle1) {
combined[c++] = dat[lIndex++];
}
}
// C. copy back, only touch those elements sorted in this round of merge
for (int i = left; i <= right; i++) { // this assumes middle2 = middle1+1. otherwise, need to handle that
dat[i] = combined[i];
}
}
public String util_subarray(int low, int high) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < low; i++) {
sb.append(" ");
}
for (int i = low; i <= high; i++) {
sb.append(" ");
sb.append(data[i]);
}
return sb.toString();
}
public String toString() {
return util_subarray(0, data.length - 1);
}
// Quicksort, most powerful
// ========================
// PROS: best and average case are O(nlog(n))
// CONS: worse case is O(n^2)
// divide-and-conquer, efficiency depends on the pivot value
// Simple solution requires extra memory while optimized solution doesn't
public int[] quicksortI_Simple(int[] dat) {
if (dat.length < 2) {
return dat;
}
int pivotIndex = dat.length / 2;
int pivotValue = dat[pivotIndex];
int leftCount = 0;
// A. count how many are less than the pivot
for (int i = 0; i < dat.length; i++) {
if (dat[i] < pivotValue) {
++leftCount;
}
}
// B. Allocate the arrays and create the subsets
int[] left = new int[leftCount];
int[] right = new int[dat.length - leftCount];
int l = 0, r = 0;
for (int i = 0; i < dat.length; i++) {
if (i == pivotIndex)
continue;
int val = dat[i];
if (val < pivotValue) {
left[l++] = val;
} else {
right[r++] = val;
}
}
// C. Sort the subsets
left = quicksortI_Simple(left);
right = quicksortI_Simple(right);
// D. combine the sorted arrays and the pivot back into the original array
System.arraycopy(left, 0, dat, 0, left.length);
dat[left.length] = pivotValue;
System.arraycopy(right, 0, dat, left.length + 1, right.length);
return dat;
}
//
// QuicksortII without extra memory
//
public void quicksortOptimized(int[] dat) {
quicksortII_NoExtraMemory(dat, 0, data.length - 1);
}
public void quicksortII_NoExtraMemory(int[] dat, int left, int right) {
int pivotValue = dat[(left + right) / 2];
int i = left;
int j = right;
// create subsets, in-place swap
while (i <= j) {
// find the leftmost value greater or equal to pivot
while (dat[i] < pivotValue) i++;
// find the rightmost value less or equal to pivot
while (dat[j] > pivotValue) j--;
// value equals to the pivot may end up in either partition. But Sort is still correct
// if the values are in the wrong order, swap them
if (i <= j) {
swaparrayindex(dat, i, j);
i++;
j--;
}
}
// apply the algorithm to the partitions we made, if any
quicksortII_NoExtraMemory(dat, left, i);
quicksortII_NoExtraMemory(dat, j, right);
}
//
// Shell Sort, O(NLogN)
// ========================
public void ShellSort(Comparable[] a) {
int N = a.length;
// 3x+1 increment sequence: 1, 4, 13, 40, 121, 364, 1093, ...
int h = 1;
while (h < N / 3) {
h = 3 * h + 1;
}
while (h >= 1) {
// h-Sort the array
for (int i = h; i < N; i++) {
for (int j = i; j >= h && sortUtilLess(a[j], a[j - h]); j -= h) {
exch(a, j, j - h);
}
}
assert isHsorted(a, h);
h /= 3;
}
assert isSorted(a);
}
// is v < w ?
private boolean sortUtilLess(Comparable v, Comparable w) {
return (v.compareTo(w) < 0);
}
/* debugging routine */
private boolean isSorted(Comparable[] a) {
for (int i = 1; i < a.length; i++)
if (sortUtilLess(a[i], a[i - 1])) return false;
return true;
}
// is the array h-sorted?
private boolean isHsorted(Comparable[] a, int h) {
for (int i = h; i < a.length; i++)
if (sortUtilLess(a[i], a[i - h])) return false;
return true;
}
// Heap Sort, O(NLogN)
// ========================
public void sort(Comparable[] pq) {
int N = pq.length;
for (int k = N / 2; k >= 1; k--) {
sink(pq, k, N);
}
while (N > 1) {
exch(pq, 1, N--);
sink(pq, 1, N);
}
}
/* Helper functions to restore the heap invariant */
private void sink(Comparable[] pq, int k, int N) {
while (2 * k <= N) {
int j = 2 * k;
if (j < N && heapSortUtilless(pq, j, j + 1)) {
j++;
}
if (!heapSortUtilless(pq, k, j)) {
break;
}
exch(pq, k, j);
k = j;
}
}
/*
* Indices are "off-by-one" to support 1-based indexing.
*/
private boolean heapSortUtilless(Comparable[] pq, int i, int j) {
return pq[i - 1].compareTo(pq[j - 1]) < 0;
}
// Other utilities
// exchange a[i] and a[j]
public void exch(Object[] a, int i, int j) {
Object swap = a[i];
a[i] = a[j];
a[j] = swap;
}
public void swap(int i, int j) {
int temp = data[i];
data[i] = data[j];
data[j] = temp;
}
public void swaparrayindex(int[] indata, int i, int j) {
int temp = indata[i];
indata[i] = indata[j];
indata[j] = temp;
}
private static final Random gen = new Random();
private int[] data;
public AlgoBasicSortingComparison(int size) {
data = new int[size];
for (int k = 0; k < size; k++) {
data[k] = gen.nextInt(50);
}
}
public static void main(String[] args) {
// selectionsort ss = new SelectionSort();
int i;
final Random gen = new Random();
int[] listtosort = new int[30];
for (i = 0; i < 30; i++) {
listtosort[i] = gen.nextInt(90);
}
for (int it : listtosort) {
System.out.printf("%d ", it);
}
System.out.printf("before Sort\n");
// TODO listtosort = selectionsort (listtosort);
for (int it : listtosort) {
System.out.printf("%d ", it);
}
System.out.printf("after Sort\n");
}
public String util_remainingElements(int low, int high) {
StringBuilder temp = new StringBuilder();
for (int i = 0; i < low; i++)
temp.append(" ");
for (int i = low; i <= high; i++)
temp.append(data[i] + " ");
temp.append("\n");
return temp.toString();
}
public String toString_touse() {
return util_remainingElements(0, data.length - 1);
}
}
| BeyondSkyCoder/BeyondCoder | leetcode/java/AlgoBinarysearchSort/AlgoBasicSortingComparison.java | Java | apache-2.0 | 13,104 | [
30522,
7427,
2632,
3995,
21114,
24769,
14644,
18069,
11589,
1025,
1013,
1008,
4066,
2003,
2092,
3273,
1010,
4438,
13792,
3119,
2125,
2003,
3638,
5443,
3177,
2060,
5876,
2024,
6540,
1010,
19293,
1010,
4788,
2553,
1051,
1006,
1029,
1007,
1051... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "merror/domain/description.h"
#include <utility>
#include "gtest/gtest.h"
#include "merror/domain/base.h"
#include "merror/domain/defer.h"
#include "merror/macros.h"
namespace merror {
namespace {
template <class F>
struct LazyStream {
friend std::ostream& operator<<(std::ostream& o, const LazyStream& p) {
p.f(o);
return o;
}
F f;
};
template <class F>
LazyStream<F> GStreamable(LazyStream<F> f) {
return f;
}
template <class F>
constexpr LazyStream<F> MakeLazyStream(F f) {
return {std::move(f)};
}
struct ExpectedBuilderDescription {};
template <class Base>
struct MyPolicy : Base {
struct Acceptor {
bool IsError() const { return !val; }
bool GetCulprit() const { return false; }
bool val;
};
template <class R>
Acceptor Verify(Ref<R, bool> val) const {
return {val.Get()};
}
template <class Self = MyPolicy>
constexpr auto GetCopy() const ->
typename std::decay<decltype(Defer<Self>(this)->derived())>::type {
return Defer<Self>(this)->derived();
}
};
template <class Base>
struct MyBuilder : Base {
void BuildError() && {
std::string_view expected =
GetAnnotationOr<ExpectedBuilderDescription>(*this, std::string_view());
std::string_view actual = GetBuilderDescription(*this);
EXPECT_EQ(expected, actual);
EXPECT_EQ(!expected.data(), !actual.data());
}
typename Base::BuilderType&& CheckPolicyDescription(
std::string_view expected) && {
std::string_view actual = GetPolicyDescription(*this);
EXPECT_EQ(expected, actual);
EXPECT_EQ(!expected.data(), !actual.data());
return std::move(this->derived());
}
template <class X = void>
auto
ExpectBuilderDescription(std::string_view expected) && -> decltype(AddAnnotation<
ExpectedBuilderDescription>(
Defer<X>(std::move(*this)), expected)) {
return AddAnnotation<ExpectedBuilderDescription>(std::move(*this),
expected);
}
};
constexpr auto MyDomain =
Domain<MyPolicy, MyBuilder>().With(DescriptionBuilder());
TEST(PolicyDescription, Nothing) {
auto F = [] {
static constexpr auto& MErrorDomain = MyDomain;
return MERROR().CheckPolicyDescription(std::string_view());
};
F();
}
TEST(PolicyDescription, StringLiteral) {
auto F = [] {
static constexpr auto MErrorDomain = MyDomain << "hello";
return MERROR().CheckPolicyDescription("hello");
};
F();
}
TEST(PolicyDescription, TwoStringLiterals) {
auto F = [] {
static constexpr auto MErrorDomain = MyDomain << "hello"
<< " world";
return MERROR().CheckPolicyDescription("hello world");
};
F();
}
TEST(PolicyDescription, ConstexprStringView) {
auto F = [] {
constexpr std::string_view s = "hello";
// Cannot be constexpr because -c opt uses gcc diagnoses.
static const auto MErrorDomain = MyDomain << s << " world " << s;
return MERROR().CheckPolicyDescription("hello world hello");
};
F();
}
TEST(PolicyDescription, NoConstExprStringView) {
auto F = [] {
std::string s("42");
static const auto MErrorDomain = MyDomain << std::string_view(s);
return MERROR().CheckPolicyDescription("42");
};
F();
}
TEST(PolicyDescription, NoConstExpConstCharPtr) {
auto F = [] {
static const auto MErrorDomain = MyDomain << std::string("hello").c_str();
return MERROR().CheckPolicyDescription("hello");
};
F();
}
TEST(PolicyDescription, String) {
auto F = [] {
static const auto MErrorDomain = MyDomain << std::string("hello");
return MERROR().CheckPolicyDescription("hello");
};
F();
}
TEST(PolicyDescription, TwoInts) {
auto F = [] {
static constexpr auto MErrorDomain = MyDomain << 1 << std::hex << 16
<< std::endl;
return MERROR().CheckPolicyDescription("110\n");
};
F();
}
TEST(PolicyDescription, LazyDump) {
auto F = [] {
int a = 1;
static const auto MErrorDomain =
MyDomain << MakeLazyStream([&](std::ostream& o) { o << a; });
MERROR().CheckPolicyDescription("1");
a = 3;
MERROR().CheckPolicyDescription("3");
};
F();
}
TEST(PolicyDescription, Cref) {
auto F = [] {
int a = 1;
static const auto MErrorDomain = MyDomain << std::cref(a);
MERROR().CheckPolicyDescription("1");
a = 3;
MERROR().CheckPolicyDescription("3");
};
F();
}
TEST(PolicyDescription, NoCref) {
auto F = [] {
int a = 1;
static const auto MErrorDomain = MyDomain << a;
MERROR().CheckPolicyDescription("1");
a = 3;
MERROR().CheckPolicyDescription("1");
};
F();
}
TEST(PolicyDescription, DumpVars) {
auto F = [] {
int a = 1;
static const auto MErrorDomain = MyDomain << [&](auto& o) { o << a; };
MERROR().CheckPolicyDescription("1");
a = 3;
MERROR().CheckPolicyDescription("3");
};
F();
}
TEST(PolicyDescription, Nested) {
static constexpr auto MErrorDomain = MyDomain << "hello"
<< " world!";
auto F = [] {
int a = 1;
MERROR_DOMAIN() << [&](auto& o) { o << a; };
MERROR().CheckPolicyDescription("hello world!\n1");
a = 3;
MERROR().CheckPolicyDescription("hello world!\n3");
};
F();
}
TEST(PolicyDescription, NestedTwo) {
static constexpr auto MErrorDomain = MyDomain << "hello"
<< " world!";
auto F = [] {
int a = 1;
MERROR_DOMAIN() << [&](auto& o) { o << a; };
{
MERROR_DOMAIN() << "dumb "
<< " thing";
MERROR().CheckPolicyDescription("hello world!\n1\ndumb thing");
a = 3;
MERROR().CheckPolicyDescription("hello world!\n3\ndumb thing");
}
};
F();
}
TEST(PolicyDescription, Rvalue) {
static constexpr auto MErrorDomain = MyDomain.GetCopy() << "hello"
<< " world!";
auto F = [] {
int a = 1;
MERROR_DOMAIN().GetCopy() << [&](auto& o) { o << a; };
MERROR().CheckPolicyDescription("hello world!\n1");
a = 3;
MERROR().CheckPolicyDescription("hello world!\n3");
};
F();
}
TEST(BuilderDescription, Nothing) {
auto F = [] {
static constexpr auto& MErrorDomain = MyDomain;
return MERROR().ExpectBuilderDescription(std::string_view());
};
F();
}
TEST(BuilderDescription, Something) {
auto F = [] {
static constexpr auto& MErrorDomain = MyDomain;
return MERROR().ExpectBuilderDescription("42") << 4 << 2;
};
F();
}
TEST(BuilderDescription, Manipulators) {
auto F = [] {
static constexpr auto& MErrorDomain = MyDomain;
return MERROR().ExpectBuilderDescription("10\n")
<< std::hex << 16 << std::endl;
};
F();
}
TEST(BuilderDescription, LazyBuilder) {
auto F = [] {
auto Fail = [] {
ADD_FAILURE();
return 0;
};
static constexpr auto& MErrorDomain = MyDomain;
MVERIFY(true) << Fail();
};
F();
}
} // namespace
} // namespace merror
| google/merror | merror/domain/description_test.cc | C++ | apache-2.0 | 7,671 | [
30522,
1013,
1013,
9385,
25682,
8224,
11775,
1013,
1013,
1013,
1013,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1013,
1013,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
published: true
title: Oops.
layout: post
---
Just testing this out. | soemu/soemu.github.io | _posts/2015-07-14-oops.markdown | Markdown | mit | 78 | [
30522,
1011,
1011,
1011,
2405,
1024,
2995,
2516,
1024,
1051,
11923,
1012,
9621,
1024,
2695,
1011,
1011,
1011,
2074,
5604,
2023,
2041,
1012,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (c) 2011 by The Authors.
* Published under the LGPL 2.1 license.
* See /license-notice.txt for the full text of the license notice.
* See /license.txt for the full text of the license.
*/
describe('jsts.algorithm.InteriorPointArea', function() {
var ipa;
it('can be constructed', function() {
var shell = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(2, 2),
new jsts.geom.Coordinate(6, 2),
new jsts.geom.Coordinate(6, 6),
new jsts.geom.Coordinate(2, 6),
new jsts.geom.Coordinate(2, 2)
]);
var polygon = new jsts.geom.Polygon(shell);
ipa = new jsts.algorithm.InteriorPointArea(polygon);
expect(ipa).toBeDefined();
});
it('interior point of simple square', function() {
var validCoord = new jsts.geom.Coordinate(4, 4);
expect(ipa.getInteriorPoint().distance(validCoord)).toEqual(0);
});
it('interior point of square with hole', function() {
var shell = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(2, 2),
new jsts.geom.Coordinate(8, 2),
new jsts.geom.Coordinate(8, 6),
new jsts.geom.Coordinate(2, 6),
new jsts.geom.Coordinate(2, 2)
]);
var hole = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(3, 3),
new jsts.geom.Coordinate(3, 5),
new jsts.geom.Coordinate(6, 5),
new jsts.geom.Coordinate(6, 3),
new jsts.geom.Coordinate(3, 3)
]);
var polygon = new jsts.geom.Polygon(shell, [hole]);
ipa = new jsts.algorithm.InteriorPointArea(polygon);
var validCoord = new jsts.geom.Coordinate(7, 4);
expect(ipa.getInteriorPoint().distance(validCoord)).toEqual(0);
});
it('interior point of the widest horizontal intersection in geometry collection', function() {
var shell1 = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(2, 2),
new jsts.geom.Coordinate(4, 2),
new jsts.geom.Coordinate(4, 4),
new jsts.geom.Coordinate(2, 4),
new jsts.geom.Coordinate(2, 2)
]);
var polygon1 = new jsts.geom.Polygon(shell1);
var shell2 = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(5, 5),
new jsts.geom.Coordinate(11, 5),
new jsts.geom.Coordinate(11, 7),
new jsts.geom.Coordinate(5, 7),
new jsts.geom.Coordinate(5, 5)
]);
var polygon2 = new jsts.geom.Polygon(shell2);
var shell3 = new jsts.geom.LinearRing([
new jsts.geom.Coordinate(12, 12),
new jsts.geom.Coordinate(15, 12),
new jsts.geom.Coordinate(15, 25),
new jsts.geom.Coordinate(12, 25),
new jsts.geom.Coordinate(12, 12)
]);
var polygon3 = new jsts.geom.Polygon(shell3);
var gc = new jsts.geom.GeometryCollection([polygon1, polygon2, polygon3]);
ipa = new jsts.algorithm.InteriorPointArea(gc);
var validCoord = new jsts.geom.Coordinate(8, 6);
expect(ipa.getInteriorPoint().distance(validCoord)).toEqual(0);
});
});
| mileswwatkins/ABiteBetweenUs | utilities/scripts/jsts/test/spec/jsts/algorithm/InteriorPointArea.js | JavaScript | apache-2.0 | 3,213 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2249,
2011,
1996,
6048,
1012,
1008,
2405,
2104,
1996,
1048,
21600,
2140,
1016,
1012,
1015,
6105,
1012,
1008,
2156,
1013,
6105,
30524,
2005,
1996,
2440,
3793,
1997,
1996,
6105,
1012,
1008,
1013,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.iyzipay.sample.subscription;
import com.iyzipay.IyzipayResource;
import com.iyzipay.model.Currency;
import com.iyzipay.model.Locale;
import com.iyzipay.model.Status;
import com.iyzipay.model.subscription.SubscriptionPricingPlan;
import com.iyzipay.model.subscription.enumtype.SubscriptionPaymentInterval;
import com.iyzipay.model.subscription.enumtype.SubscriptionPaymentType;
import com.iyzipay.request.subscription.CreateSubscriptionPricingPlanRequest;
import com.iyzipay.request.subscription.UpdateSubscriptionPricingPlanRequest;
import com.iyzipay.sample.Sample;
import org.junit.Test;
import java.math.BigDecimal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class SubscriptionPricingPlanSample extends Sample {
@Test
public void should_create() {
CreateSubscriptionPricingPlanRequest createSubscriptionPricingPlanRequest = new CreateSubscriptionPricingPlanRequest();
createSubscriptionPricingPlanRequest.setPlanPaymentType(SubscriptionPaymentType.RECURRING.name());
createSubscriptionPricingPlanRequest.setName("caner-pricing-plan-2");
createSubscriptionPricingPlanRequest.setPrice(BigDecimal.TEN);
createSubscriptionPricingPlanRequest.setCurrencyCode(Currency.TRY.name());
createSubscriptionPricingPlanRequest.setPaymentInterval(SubscriptionPaymentInterval.WEEKLY.name());
createSubscriptionPricingPlanRequest.setPaymentIntervalCount(1);
createSubscriptionPricingPlanRequest.setTrialPeriodDays(10);
createSubscriptionPricingPlanRequest.setRecurrenceCount(9);
createSubscriptionPricingPlanRequest.setLocale(Locale.TR.name());
createSubscriptionPricingPlanRequest.setConversationId("12345678");
SubscriptionPricingPlan response = SubscriptionPricingPlan.create("c777b5b0-bc79-4f3f-ac1f-71c064990939", createSubscriptionPricingPlanRequest, options);
assertEquals(response.getStatus(), Status.SUCCESS.getValue());
assertNotNull(response.getSubscriptionPricingPlanData().getPlanPaymentType());
assertNotNull(response.getSubscriptionPricingPlanData().getName());
assertNotNull(response.getSubscriptionPricingPlanData().getPrice());
assertNotNull(response.getSubscriptionPricingPlanData().getCurrencyCode());
assertNotNull(response.getSubscriptionPricingPlanData().getPaymentInterval());
assertNotNull(response.getSubscriptionPricingPlanData().getPaymentIntervalCount());
assertNotNull(response.getSubscriptionPricingPlanData().getTrialPeriodDays());
assertNotNull(response.getSubscriptionPricingPlanData().getRecurrenceCount());
assertNotNull(response.getSubscriptionPricingPlanData().getReferenceCode());
assertNotNull(response.getSubscriptionPricingPlanData().getProductReferenceCode());
assertNotNull(response.getSubscriptionPricingPlanData().getCreatedDate());
}
@Test
public void should_update() {
UpdateSubscriptionPricingPlanRequest updateSubscriptionPricingPlanRequest = new UpdateSubscriptionPricingPlanRequest();
updateSubscriptionPricingPlanRequest.setName("caner-pricing-plan");
updateSubscriptionPricingPlanRequest.setTrialPeriodDays(13);
updateSubscriptionPricingPlanRequest.setLocale(Locale.TR.name());
updateSubscriptionPricingPlanRequest.setConversationId("12345678");
SubscriptionPricingPlan response = SubscriptionPricingPlan.update("553d006c-da91-46d3-81a4-8297881d6b9e", updateSubscriptionPricingPlanRequest, options);
assertEquals(response.getStatus(), Status.SUCCESS.getValue());
assertEquals(response.getSubscriptionPricingPlanData().getTrialPeriodDays(), updateSubscriptionPricingPlanRequest.getTrialPeriodDays());
assertNotNull(response.getSubscriptionPricingPlanData().getCreatedDate());
assertNotNull(response.getSubscriptionPricingPlanData().getCurrencyCode());
assertNotNull(response.getSubscriptionPricingPlanData().getName());
assertNotNull(response.getSubscriptionPricingPlanData().getPaymentInterval());
assertNotNull(response.getSubscriptionPricingPlanData().getPaymentIntervalCount());
assertNotNull(response.getSubscriptionPricingPlanData().getPlanPaymentType());
assertNotNull(response.getSubscriptionPricingPlanData().getPrice());
assertNotNull(response.getSubscriptionPricingPlanData().getProductReferenceCode());
assertNotNull(response.getSubscriptionPricingPlanData().getRecurrenceCount());
}
@Test
public void should_retrieve() {
SubscriptionPricingPlan response = SubscriptionPricingPlan.retrieve("553d006c-da91-46d3-81a4-8297881d6b9e", options);
//then
assertEquals(response.getStatus(), Status.SUCCESS.getValue());
}
@Test
public void should_delete() {
IyzipayResource response = SubscriptionPricingPlan.delete("ffa7b210-7990-4a3b-ad2c-e57774e8ec24", options);
assertEquals(response.getStatus(), Status.SUCCESS.getValue());
}
} | iyzico/iyzipay-java | src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanSample.java | Java | mit | 5,069 | [
30522,
7427,
4012,
1012,
1045,
2100,
5831,
4502,
2100,
1012,
7099,
1012,
15002,
1025,
12324,
4012,
1012,
1045,
2100,
5831,
4502,
2100,
1012,
1045,
2100,
5831,
4502,
16363,
6499,
3126,
3401,
1025,
12324,
4012,
1012,
1045,
2100,
5831,
4502,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
use pocketmine\network\protocol\Info;
use pocketmine\plugin\PluginBase;
use pocketmine\plugin\PluginLoadOrder;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
use raklib\RakLib;
/*
* Called when a critical exception occurs that the server can't continue past.
* Saved to a file or optionally sent to a server (see pocketmine.yml configuration options)
*/
class CrashDump{
/** @var Server */
private $server;
private $fp;
private $time;
private $data = [];
private $encodedData = null;
private $path;
public function __construct(Server $server){
$this->time = time();
$this->server = $server;
if(!is_dir($this->server->getDataPath()) . "CrashDumps")
mkdir($this->server->getDataPath() . "CrashDumps");
$this->path = $this->server->getDataPath() . "CrashDumps/" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
$this->fp = @fopen($this->path, "wb");
if(!is_resource($this->fp)){
throw new \RuntimeException("Could not create Crash Dump");
}
$this->data["time"] = $this->time;
$this->addLine($this->server->getName() . " Crash Dump " . date("D M j H:i:s T Y", $this->time));
$this->addLine();
$this->baseCrash();
$this->generalData();
$this->pluginsData();
$this->extraData();
$this->encodeData();
}
public function getPath(){
return $this->path;
}
public function getEncodedData(){
return $this->encodedData;
}
public function getData(){
return $this->data;
}
private function encodeData(){
$this->addLine();
$this->addLine("----------------------REPORT THE DATA BELOW THIS LINE-----------------------");
$this->addLine();
$this->addLine("===BEGIN CRASH DUMP===");
$this->encodedData = zlib_encode(json_encode($this->data, JSON_UNESCAPED_SLASHES), ZLIB_ENCODING_DEFLATE, 9);
foreach(str_split(base64_encode($this->encodedData), 76) as $line){
$this->addLine($line);
}
$this->addLine("===END CRASH DUMP===");
}
private function pluginsData(){
if(class_exists("pocketmine\\plugin\\PluginManager", false)){
$this->addLine();
$this->addLine("Loaded plugins:");
$this->data["plugins"] = [];
foreach($this->server->getPluginManager()->getPlugins() as $p){
$d = $p->getDescription();
$this->data["plugins"][$d->getName()] = [
"name" => $d->getName(),
"version" => $d->getVersion(),
"authors" => $d->getAuthors(),
"api" => $d->getCompatibleApis(),
"enabled" => $p->isEnabled(),
"depends" => $d->getDepend(),
"softDepends" => $d->getSoftDepend(),
"main" => $d->getMain(),
"load" => $d->getOrder() === PluginLoadOrder::POSTWORLD ? "POSTWORLD" : "STARTUP",
"website" => $d->getWebsite()
];
$this->addLine($d->getName() . " " . $d->getVersion() . " by " . implode(", ", $d->getAuthors()) . " for API(s) " . implode(", ", $d->getCompatibleApis()));
}
}
}
private function extraData(){
global $arguments;
if($this->server->getProperty("auto-report.send-settings", true) !== false){
$this->data["parameters"] = (array) $arguments;
$this->data["server.properties"] = @file_get_contents($this->server->getDataPath() . "server.properties");
$this->data["server.properties"] = preg_replace("#^rcon\\.password=(.*)$#m", "rcon.password=******", $this->data["server.properties"]);
$this->data["pocketmine.yml"] = @file_get_contents($this->server->getDataPath() . "pocketmine.yml");
$this->data["katana.yml"] = @file_get_contents($this->server->getDataPath() . "katana.yml");
}else{
$this->data["pocketmine.yml"] = "";
$this->data["katana.yml"] = "";
$this->data["server.properties"] = "";
$this->data["parameters"] = [];
}
$extensions = [];
foreach(get_loaded_extensions() as $ext){
$extensions[$ext] = phpversion($ext);
}
$this->data["extensions"] = $extensions;
if($this->server->getProperty("auto-report.send-phpinfo", true) !== false){
ob_start();
phpinfo();
$this->data["phpinfo"] = ob_get_contents();
ob_end_clean();
}
}
private function baseCrash(){
global $lastExceptionError, $lastError;
if(isset($lastExceptionError)){
$error = $lastExceptionError;
}else{
$error = (array) error_get_last();
$error["trace"] = @getTrace(3);
$errorConversion = [
E_ERROR => "E_ERROR",
E_WARNING => "E_WARNING",
E_PARSE => "E_PARSE",
E_NOTICE => "E_NOTICE",
E_CORE_ERROR => "E_CORE_ERROR",
E_CORE_WARNING => "E_CORE_WARNING",
E_COMPILE_ERROR => "E_COMPILE_ERROR",
E_COMPILE_WARNING => "E_COMPILE_WARNING",
E_USER_ERROR => "E_USER_ERROR",
E_USER_WARNING => "E_USER_WARNING",
E_USER_NOTICE => "E_USER_NOTICE",
E_STRICT => "E_STRICT",
E_RECOVERABLE_ERROR => "E_RECOVERABLE_ERROR",
E_DEPRECATED => "E_DEPRECATED",
E_USER_DEPRECATED => "E_USER_DEPRECATED",
];
$error["fullFile"] = $error["file"];
$error["file"] = cleanPath($error["file"]);
$error["type"] = isset($errorConversion[$error["type"]]) ? $errorConversion[$error["type"]] : $error["type"];
if(($pos = strpos($error["message"], "\n")) !== false){
$error["message"] = substr($error["message"], 0, $pos);
}
}
if(isset($lastError)){
$this->data["lastError"] = $lastError;
}
$this->data["error"] = $error;
unset($this->data["error"]["fullFile"]);
unset($this->data["error"]["trace"]);
$this->addLine("Error: " . $error["message"]);
$this->addLine("File: " . $error["file"]);
$this->addLine("Line: " . $error["line"]);
$this->addLine("Type: " . $error["type"]);
if(strpos($error["file"], "src/pocketmine/") === false and strpos($error["file"], "src/raklib/") === false and file_exists($error["fullFile"])){
$this->addLine();
$this->addLine("THIS CRASH WAS CAUSED BY A PLUGIN");
$this->data["plugin"] = true;
$reflection = new \ReflectionClass(PluginBase::class);
$file = $reflection->getProperty("file");
$file->setAccessible(true);
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
$filePath = \pocketmine\cleanPath($file->getValue($plugin));
if(strpos($error["file"], $filePath) === 0){
$this->data["plugin"] = $plugin->getName();
$this->addLine("BAD PLUGIN: " . $plugin->getDescription()->getFullName());
break;
}
}
}else{
$this->data["plugin"] = false;
}
$this->addLine();
$this->addLine("Code:");
$this->data["code"] = [];
if($this->server->getProperty("auto-report.send-code", true) !== false){
$file = @file($error["fullFile"], FILE_IGNORE_NEW_LINES);
for($l = max(0, $error["line"] - 10); $l < $error["line"] + 10; ++$l){
$this->addLine("[" . ($l + 1) . "] " . @$file[$l]);
$this->data["code"][$l + 1] = @$file[$l];
}
}
$this->addLine();
$this->addLine("Backtrace:");
foreach(($this->data["trace"] = $error["trace"]) as $line){
$this->addLine($line);
}
$this->addLine();
}
private function generalData(){
$version = new VersionString();
$this->data["general"] = [];
$this->data["general"]["version"] = $version->get(false);
$this->data["general"]["build"] = $version->getBuild();
$this->data["general"]["protocol"] = Info::CURRENT_PROTOCOL;
$this->data["general"]["api"] = \pocketmine\API_VERSION;
$this->data["general"]["git"] = \pocketmine\GIT_COMMIT;
$this->data["general"]["raklib"] = RakLib::VERSION;
$this->data["general"]["uname"] = php_uname("a");
$this->data["general"]["php"] = phpversion();
$this->data["general"]["zend"] = zend_version();
$this->data["general"]["php_os"] = PHP_OS;
$this->data["general"]["os"] = Utils::getOS();
$this->addLine("Katana version: " . $version->get(false) . " #" . $version->getBuild() . " [Protocol " . Info::CURRENT_PROTOCOL . "; API " . API_VERSION . "]");
$this->addLine("Git commit: " . GIT_COMMIT);
$this->addLine("uname -a: " . php_uname("a"));
$this->addLine("PHP Version: " . phpversion());
$this->addLine("Zend version: " . zend_version());
$this->addLine("OS : " . PHP_OS . ", " . Utils::getOS());
}
public function addLine($line = ""){
fwrite($this->fp, $line . PHP_EOL);
}
public function add($str){
fwrite($this->fp, $str);
}
} | Hydreon/Katana | src/pocketmine/CrashDump.php | PHP | lgpl-3.0 | 8,822 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1035,
1008,
1064,
1035,
1032,
1035,
1035,
1035,
1035,
1035,
1035,
1064,
1064,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
@protocol PBSViewServiceInterface <NSObject>
- (void)dismissWithResult:(id <NSSecureCoding>)arg1;
@end
| lechium/ATVWebRemote | remotetest/PineBoard.app Headers/PBSViewServiceInterface-Protocol.h | C | mit | 265 | [
30522,
1013,
1013,
1013,
1013,
7013,
2011,
2465,
1011,
15653,
1017,
1012,
1019,
1006,
4185,
2978,
1007,
1012,
1013,
1013,
1013,
1013,
2465,
1011,
15653,
2003,
9385,
1006,
1039,
1007,
2722,
1011,
2687,
1010,
2456,
1011,
2541,
1010,
2432,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# QCWeChatPay
- 微信 APP 支付 Demo
- 开发环境:Xcode 8.2,WeChatSDK-1.7.5,AFNetworking-3.1.0
- 微信 APP 支付集成说明见 [QianChia 的博客](http://www.cnblogs.com/QianChia/p/6206153.html)。
| QianChia/QCWeChatPay | README.md | Markdown | mit | 216 | [
30522,
1001,
25196,
8545,
7507,
25856,
4710,
1011,
100,
1767,
10439,
100,
100,
9703,
1011,
100,
100,
100,
100,
1993,
1060,
16044,
1022,
1012,
1016,
1989,
2057,
7507,
3215,
2094,
2243,
1011,
1015,
1012,
1021,
1012,
1019,
1989,
21358,
7159,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* PCMCIA/Cardbus */
#include "qemu-common.h"
typedef struct {
qemu_irq irq;
int attached;
const char *slot_string;
const char *card_string;
} PCMCIASocket;
void pcmcia_socket_register(PCMCIASocket *socket);
void pcmcia_socket_unregister(PCMCIASocket *socket);
void pcmcia_info(Monitor *mon);
struct PCMCIACardState {
void *state;
PCMCIASocket *slot;
int (*attach)(void *state);
int (*detach)(void *state);
const uint8_t *cis;
int cis_len;
/* Only valid if attached */
uint8_t (*attr_read)(void *state, uint32_t address);
void (*attr_write)(void *state, uint32_t address, uint8_t value);
uint16_t (*common_read)(void *state, uint32_t address);
void (*common_write)(void *state, uint32_t address, uint16_t value);
uint16_t (*io_read)(void *state, uint32_t address);
void (*io_write)(void *state, uint32_t address, uint16_t value);
};
#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
#define CISTPL_END 0xff /* Tuple End */
#define CISTPL_ENDMARK 0xff
/* dscm1xxxx.c */
PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv);
| KernelAnalysisPlatform/KlareDbg | tracers/qemu/decaf/hw/pcmcia.h | C | gpl-3.0 | 1,868 | [
30522,
1013,
1008,
7473,
12458,
2401,
1013,
4003,
8286,
1008,
1013,
1001,
2421,
1000,
1053,
6633,
2226,
1011,
2691,
1012,
1044,
1000,
21189,
12879,
2358,
6820,
6593,
1063,
1053,
6633,
2226,
1035,
20868,
4160,
20868,
4160,
1025,
20014,
4987,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
abstract class ModuleGridEngine extends ModuleGridEngineCore
{
}
| timetre/tnk | web/store/override/classes/module/ModuleGridEngine.php | PHP | mit | 74 | [
30522,
1026,
1029,
25718,
10061,
2465,
11336,
16523,
5178,
3070,
3170,
8908,
11336,
16523,
5178,
3070,
3170,
17345,
1063,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
This file is part of libzmq, the ZeroMQ core engine in C++.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
As a special exception, the Contributors give you permission to link
this library with independent modules to produce an executable,
regardless of the license terms of these independent modules, and to
copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the
terms and conditions of the license of that module. An independent
module is a module which is not derived from or based on this library.
If you modify this library, you must extend this exception to your
version of the library.
libzmq is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "macros.hpp"
#include "msg.hpp"
#include "../include/zmq.h"
#include <string.h>
#include <stdlib.h>
#include <new>
#include "stdint.hpp"
#include "likely.hpp"
#include "metadata.hpp"
#include "err.hpp"
// Check whether the sizes of public representation of the message (zmq_msg_t)
// and private representation of the message (zmq::msg_t) match.
typedef char zmq_msg_size_check
[2 * ((sizeof (zmq::msg_t) == sizeof (zmq_msg_t)) != 0) - 1];
bool zmq::msg_t::check ()
{
return u.base.type >= type_min && u.base.type <= type_max;
}
int zmq::msg_t::init (void* data_, size_t size_,
msg_free_fn* ffn_, void* hint,
content_t* content_)
{
if (size_ < max_vsm_size) {
int const rc = init_size(size_);
if (rc != -1)
{
memcpy(data(), data_, size_);
return 0;
}
else
{
return -1;
}
}
else if(content_)
{
return init_external_storage(content_, data_, size_, ffn_, hint);
}
else
{
return init_data(data_, size_, ffn_, hint);
}
}
int zmq::msg_t::init ()
{
u.vsm.metadata = NULL;
u.vsm.type = type_vsm;
u.vsm.flags = 0;
u.vsm.size = 0;
u.vsm.group[0] = '\0';
u.vsm.routing_id = 0;
u.vsm.fd = retired_fd;
return 0;
}
int zmq::msg_t::init_size (size_t size_)
{
if (size_ <= max_vsm_size) {
u.vsm.metadata = NULL;
u.vsm.type = type_vsm;
u.vsm.flags = 0;
u.vsm.size = (unsigned char) size_;
u.vsm.group[0] = '\0';
u.vsm.routing_id = 0;
u.vsm.fd = retired_fd;
}
else {
u.lmsg.metadata = NULL;
u.lmsg.type = type_lmsg;
u.lmsg.flags = 0;
u.lmsg.group[0] = '\0';
u.lmsg.routing_id = 0;
u.lmsg.fd = retired_fd;
u.lmsg.content = NULL;
if (sizeof (content_t) + size_ > size_)
u.lmsg.content = (content_t*) malloc (sizeof (content_t) + size_);
if (unlikely (!u.lmsg.content)) {
errno = ENOMEM;
return -1;
}
u.lmsg.content->data = u.lmsg.content + 1;
u.lmsg.content->size = size_;
u.lmsg.content->ffn = NULL;
u.lmsg.content->hint = NULL;
new (&u.lmsg.content->refcnt) zmq::atomic_counter_t ();
}
return 0;
}
int zmq::msg_t::init_external_storage(content_t* content_, void* data_, size_t size_,
msg_free_fn *ffn_, void* hint_)
{
zmq_assert(NULL != data_);
zmq_assert(NULL != content_);
u.zclmsg.metadata = NULL;
u.zclmsg.type = type_zclmsg;
u.zclmsg.flags = 0;
u.zclmsg.group[0] = '\0';
u.zclmsg.routing_id = 0;
u.zclmsg.fd = retired_fd;
u.zclmsg.content = content_;
u.zclmsg.content->data = data_;
u.zclmsg.content->size = size_;
u.zclmsg.content->ffn = ffn_;
u.zclmsg.content->hint = hint_;
new (&u.zclmsg.content->refcnt) zmq::atomic_counter_t();
return 0;
}
int zmq::msg_t::init_data (void *data_, size_t size_,
msg_free_fn *ffn_, void *hint_)
{
// If data is NULL and size is not 0, a segfault
// would occur once the data is accessed
zmq_assert (data_ != NULL || size_ == 0);
// Initialize constant message if there's no need to deallocate
if (ffn_ == NULL) {
u.cmsg.metadata = NULL;
u.cmsg.type = type_cmsg;
u.cmsg.flags = 0;
u.cmsg.data = data_;
u.cmsg.size = size_;
u.cmsg.group[0] = '\0';
u.cmsg.routing_id = 0;
u.cmsg.fd = retired_fd;
}
else {
u.lmsg.metadata = NULL;
u.lmsg.type = type_lmsg;
u.lmsg.flags = 0;
u.lmsg.group[0] = '\0';
u.lmsg.routing_id = 0;
u.lmsg.fd = retired_fd;
u.lmsg.content = (content_t*) malloc (sizeof (content_t));
if (!u.lmsg.content) {
errno = ENOMEM;
return -1;
}
u.lmsg.content->data = data_;
u.lmsg.content->size = size_;
u.lmsg.content->ffn = ffn_;
u.lmsg.content->hint = hint_;
new (&u.lmsg.content->refcnt) zmq::atomic_counter_t ();
}
return 0;
}
int zmq::msg_t::init_delimiter ()
{
u.delimiter.metadata = NULL;
u.delimiter.type = type_delimiter;
u.delimiter.flags = 0;
u.delimiter.group[0] = '\0';
u.delimiter.routing_id = 0;
u.delimiter.fd = retired_fd;
return 0;
}
int zmq::msg_t::init_join ()
{
u.base.metadata = NULL;
u.base.type = type_join;
u.base.flags = 0;
u.base.group[0] = '\0';
u.base.routing_id = 0;
u.base.fd = retired_fd;
return 0;
}
int zmq::msg_t::init_leave ()
{
u.base.metadata = NULL;
u.base.type = type_leave;
u.base.flags = 0;
u.base.group[0] = '\0';
u.base.routing_id = 0;
u.base.fd = retired_fd;
return 0;
}
int zmq::msg_t::close ()
{
// Check the validity of the message.
if (unlikely (!check ())) {
errno = EFAULT;
return -1;
}
if (u.base.type == type_lmsg) {
// If the content is not shared, or if it is shared and the reference
// count has dropped to zero, deallocate it.
if (!(u.lmsg.flags & msg_t::shared) ||
!u.lmsg.content->refcnt.sub (1)) {
// We used "placement new" operator to initialize the reference
// counter so we call the destructor explicitly now.
u.lmsg.content->refcnt.~atomic_counter_t ();
if (u.lmsg.content->ffn)
u.lmsg.content->ffn (u.lmsg.content->data,
u.lmsg.content->hint);
free (u.lmsg.content);
}
}
if (is_zcmsg())
{
zmq_assert( u.zclmsg.content->ffn );
// If the content is not shared, or if it is shared and the reference
// count has dropped to zero, deallocate it.
if (!(u.zclmsg.flags & msg_t::shared) ||
!u.zclmsg.content->refcnt.sub (1)) {
// We used "placement new" operator to initialize the reference
// counter so we call the destructor explicitly now.
u.zclmsg.content->refcnt.~atomic_counter_t ();
u.zclmsg.content->ffn (u.zclmsg.content->data,
u.zclmsg.content->hint);
}
}
if (u.base.metadata != NULL) {
if (u.base.metadata->drop_ref ()) {
LIBZMQ_DELETE(u.base.metadata);
}
u.base.metadata = NULL;
}
// Make the message invalid.
u.base.type = 0;
return 0;
}
int zmq::msg_t::move (msg_t &src_)
{
// Check the validity of the source.
if (unlikely (!src_.check ())) {
errno = EFAULT;
return -1;
}
int rc = close ();
if (unlikely (rc < 0))
return rc;
*this = src_;
rc = src_.init ();
if (unlikely (rc < 0))
return rc;
return 0;
}
int zmq::msg_t::copy (msg_t &src_)
{
// Check the validity of the source.
if (unlikely (!src_.check ())) {
errno = EFAULT;
return -1;
}
int rc = close ();
if (unlikely (rc < 0))
return rc;
if (src_.u.base.type == type_lmsg ) {
// One reference is added to shared messages. Non-shared messages
// are turned into shared messages and reference count is set to 2.
if (src_.u.lmsg.flags & msg_t::shared)
src_.u.lmsg.content->refcnt.add (1);
else {
src_.u.lmsg.flags |= msg_t::shared;
src_.u.lmsg.content->refcnt.set (2);
}
}
if (src_.is_zcmsg()) {
// One reference is added to shared messages. Non-shared messages
// are turned into shared messages and reference count is set to 2.
if (src_.u.zclmsg.flags & msg_t::shared)
src_.refcnt()->add (1);
else {
src_.u.zclmsg.flags |= msg_t::shared;
src_.refcnt()->set (2);
}
}
if (src_.u.base.metadata != NULL)
src_.u.base.metadata->add_ref ();
*this = src_;
return 0;
}
void *zmq::msg_t::data ()
{
// Check the validity of the message.
zmq_assert (check ());
switch (u.base.type) {
case type_vsm:
return u.vsm.data;
case type_lmsg:
return u.lmsg.content->data;
case type_cmsg:
return u.cmsg.data;
case type_zclmsg:
return u.zclmsg.content->data;
default:
zmq_assert (false);
return NULL;
}
}
size_t zmq::msg_t::size ()
{
// Check the validity of the message.
zmq_assert (check ());
switch (u.base.type) {
case type_vsm:
return u.vsm.size;
case type_lmsg:
return u.lmsg.content->size;
case type_zclmsg:
return u.zclmsg.content->size;
case type_cmsg:
return u.cmsg.size;
default:
zmq_assert (false);
return 0;
}
}
unsigned char zmq::msg_t::flags ()
{
return u.base.flags;
}
void zmq::msg_t::set_flags (unsigned char flags_)
{
u.base.flags |= flags_;
}
void zmq::msg_t::reset_flags (unsigned char flags_)
{
u.base.flags &= ~flags_;
}
zmq::fd_t zmq::msg_t::fd ()
{
return u.base.fd;
}
void zmq::msg_t::set_fd (fd_t fd_)
{
u.base.fd = fd_;
}
zmq::metadata_t *zmq::msg_t::metadata () const
{
return u.base.metadata;
}
void zmq::msg_t::set_metadata (zmq::metadata_t *metadata_)
{
assert (metadata_ != NULL);
assert (u.base.metadata == NULL);
metadata_->add_ref ();
u.base.metadata = metadata_;
}
void zmq::msg_t::reset_metadata ()
{
if (u.base.metadata) {
if (u.base.metadata->drop_ref ()) {
LIBZMQ_DELETE(u.base.metadata);
}
u.base.metadata = NULL;
}
}
bool zmq::msg_t::is_identity () const
{
return (u.base.flags & identity) == identity;
}
bool zmq::msg_t::is_credential () const
{
return (u.base.flags & credential) == credential;
}
bool zmq::msg_t::is_delimiter () const
{
return u.base.type == type_delimiter;
}
bool zmq::msg_t::is_vsm () const
{
return u.base.type == type_vsm;
}
bool zmq::msg_t::is_cmsg () const
{
return u.base.type == type_cmsg;
}
bool zmq::msg_t::is_zcmsg() const
{
return u.base.type == type_zclmsg;
}
bool zmq::msg_t::is_join() const
{
return u.base.type == type_join;
}
bool zmq::msg_t::is_leave() const
{
return u.base.type == type_leave;
}
void zmq::msg_t::add_refs (int refs_)
{
zmq_assert (refs_ >= 0);
// Operation not supported for messages with metadata.
zmq_assert (u.base.metadata == NULL);
// No copies required.
if (!refs_)
return;
// VSMs, CMSGS and delimiters can be copied straight away. The only
// message type that needs special care are long messages.
if (u.base.type == type_lmsg || is_zcmsg() ) {
if (u.base.flags & msg_t::shared)
refcnt()->add (refs_);
else {
refcnt()->set (refs_ + 1);
u.base.flags |= msg_t::shared;
}
}
}
bool zmq::msg_t::rm_refs (int refs_)
{
zmq_assert (refs_ >= 0);
// Operation not supported for messages with metadata.
zmq_assert (u.base.metadata == NULL);
// No copies required.
if (!refs_)
return true;
// If there's only one reference close the message.
if ( (u.base.type != type_zclmsg && u.base.type != type_lmsg) || !(u.base.flags & msg_t::shared)) {
close ();
return false;
}
// The only message type that needs special care are long and zcopy messages.
if (u.base.type == type_lmsg && !u.lmsg.content->refcnt.sub(refs_)) {
// We used "placement new" operator to initialize the reference
// counter so we call the destructor explicitly now.
u.lmsg.content->refcnt.~atomic_counter_t ();
if (u.lmsg.content->ffn)
u.lmsg.content->ffn (u.lmsg.content->data, u.lmsg.content->hint);
free (u.lmsg.content);
return false;
}
if (is_zcmsg() && !u.zclmsg.content->refcnt.sub(refs_)) {
// storage for rfcnt is provided externally
if (u.zclmsg.content->ffn) {
u.zclmsg.content->ffn(u.zclmsg.content->data, u.zclmsg.content->hint);
}
return false;
}
return true;
}
uint32_t zmq::msg_t::get_routing_id ()
{
return u.base.routing_id;
}
int zmq::msg_t::set_routing_id (uint32_t routing_id_)
{
if (routing_id_) {
u.base.routing_id = routing_id_;
return 0;
}
errno = EINVAL;
return -1;
}
int zmq::msg_t::reset_routing_id ()
{
u.base.routing_id = 0;
return 0;
}
const char * zmq::msg_t::group ()
{
return u.base.group;
}
int zmq::msg_t::set_group (const char * group_)
{
return set_group (group_, strlen (group_));
}
int zmq::msg_t::set_group (const char * group_, size_t length_)
{
if (length_> ZMQ_GROUP_MAX_LENGTH)
{
errno = EINVAL;
return -1;
}
strncpy (u.base.group, group_, length_);
u.base.group[length_] = '\0';
return 0;
}
zmq::atomic_counter_t *zmq::msg_t::refcnt()
{
switch(u.base.type)
{
case type_lmsg:
return &u.lmsg.content->refcnt;
case type_zclmsg:
return &u.zclmsg.content->refcnt;
default:
zmq_assert(false);
return NULL;
}
}
| jemc/libzmq | src/msg.cpp | C++ | gpl-3.0 | 14,727 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2289,
1011,
2355,
16884,
2004,
3264,
1999,
1996,
6048,
5371,
2023,
5371,
2003,
2112,
1997,
5622,
2497,
2480,
2213,
4160,
1010,
1996,
5717,
2213,
4160,
4563,
3194,
1999,
1039,
1009,
1009,
1012,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='BlockStructureConfiguration',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
('num_versions_to_keep', models.IntegerField(default=5, null=True, blank=True)),
('cache_timeout_in_seconds', models.IntegerField(default=86400, null=True, blank=True)),
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
],
options={
'db_table': 'block_structure_config',
},
),
]
| edx/edx-platform | openedx/core/djangoapps/content/block_structure/migrations/0001_config.py | Python | agpl-3.0 | 1,174 | [
30522,
2013,
6520,
23422,
1012,
16962,
12324,
9230,
2015,
1010,
4275,
12324,
6520,
23422,
1012,
16962,
1012,
4275,
1012,
3972,
20624,
2239,
2013,
6520,
23422,
1012,
9530,
2546,
12324,
10906,
2465,
9230,
1006,
9230,
2015,
1012,
9230,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict'
let
ugly = require('gulp-uglify')
,gulp = require('gulp')
,watch = require('gulp-watch')
,plumber = require('gulp-plumber')
,newer = require('gulp-newer')
,stylus = require('gulp-stylus')
,jade = require('gulp-jade')
,concat = require('gulp-concat')
,rename = require('gulp-rename')
,runSequence = require('run-sequence')
,_ = require('lodash')
,path = require('path')
,fs = require('fs')
,spawn = require('cross-spawn')
let
cssFolder = __dirname + '/public/css'
,jsFolder = __dirname + '/public/js'
,views = __dirname + '/views'
,stylusOptions = {
compress: true
}
,uglyOptions = {
}
gulp.task('stylus', function() {
gulp.src(cssFolder + '/*.styl')
/*
.pipe(newer({
dest: cssFolder
,map: function(path) {
return path.replace(/\.styl$/, '.css')
}
}))
*/
.pipe(plumber())
.pipe(stylus(stylusOptions))
.pipe(gulp.dest(cssFolder))
})
gulp.task('ugly', function() {
gulp.src(jsFolder + '/*.js')
.pipe(newer({
dest: jsFolder
,map: function(path) {
return path.replace(/\.dev.js$/, '.min.js')
}
}))
.pipe(plumber())
.pipe(rename(function (path) {
path.basename = path.basename.replace('.dev', '.min')
}))
.pipe(gulp.dest(jsFolder))
.pipe(ugly(uglyOptions))
.pipe(gulp.dest(jsFolder))
})
let config = require('./config')
let pack = require('./package.json')
let packj = require('./node_modules/jade-press/package.json')
config.version = pack.version
config.siteDesc = packj.description
gulp.task('jade', function() {
gulp.src(views + '/*.jade')
.pipe(plumber())
.pipe(jade({
locals: config
}))
.pipe(gulp.dest(__dirname))
})
gulp.task('server', function (cb) {
var runner = spawn(
'node'
,['server']
,{
stdio: 'inherit'
}
)
runner.on('exit', function (code) {
process.exit(code)
})
runner.on('error', function (err) {
cb(err)
})
})
gulp.task('watch', function () {
runSequence('server')
watch([cssFolder + '/*.styl', cssFolder + '/parts/*.styl'], function() {
runSequence('stylus')
})
watch(jsFolder, function() {
runSequence('ugly')
})
watch([
views + '/*.jade'
,views + '/parts/*.jade'
], function() {
runSequence('jade')
}
)
})
gulp.task('default', ['watch'])
gulp.task('dist', function() {
runSequence('stylus', 'ugly', 'jade')
}) | jade-press/jade-press.org | gulpfile.js | JavaScript | mit | 2,290 | [
30522,
1005,
2224,
9384,
1005,
2292,
9200,
1027,
5478,
1006,
1005,
26546,
1011,
1057,
25394,
12031,
1005,
1007,
1010,
26546,
1027,
5478,
1006,
1005,
26546,
1005,
1007,
1010,
3422,
1027,
5478,
1006,
1005,
26546,
1011,
3422,
1005,
1007,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
(function ($) {
$(document).ready(function() {
var highestCol = Math.max($('.first-menu .pane-content').height(),$('.middle-menu .pane-content').height(),$('.last-menu .pane-content').height());
/*.first-menu .pane-content, .middle-menu .pane-content, .last-menu .pane-content
$('.elements').height(highestCol);*/
alert(highestCol);
});
})(jQuery);
| l0c0/consulados | sites/all/themes/embajada/equals_height.js | JavaScript | gpl-2.0 | 372 | [
30522,
1006,
3853,
1006,
1002,
1007,
1063,
1002,
1006,
6254,
1007,
1012,
3201,
1006,
3853,
1006,
1007,
1063,
13075,
3284,
30524,
1005,
1012,
2197,
1011,
12183,
1012,
6090,
2063,
1011,
4180,
1005,
1007,
1012,
4578,
1006,
1007,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* 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.
*/
/*
* Created by IntelliJ IDEA.
* User: yole
* Date: 17.11.2006
* Time: 17:36:42
*/
package com.intellij.openapi.vcs.changes.patch;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
public class PatchFileType implements FileType {
public static final PatchFileType INSTANCE = new PatchFileType();
public static final String NAME = "PATCH";
@NotNull
@NonNls
public String getName() {
return NAME;
}
@NotNull
public String getDescription() {
return VcsBundle.message("patch.file.type.description");
}
@NotNull
@NonNls
public String getDefaultExtension() {
return "patch";
}
@Nullable
public Icon getIcon() {
return AllIcons.Nodes.Pointcut;
}
public boolean isBinary() {
return false;
}
public boolean isReadOnly() {
return false;
}
@Nullable
@NonNls
public String getCharset(@NotNull VirtualFile file, final byte[] content) {
return null;
}
}
| ernestp/consulo | platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/PatchFileType.java | Java | apache-2.0 | 1,803 | [
30522,
1013,
1008,
1008,
9385,
2456,
1011,
2268,
6892,
10024,
7076,
1055,
1012,
1054,
1012,
1051,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// $Id: HTTP_Service_Handler.cpp 82739 2008-09-16 12:20:46Z johnnyw $
#define ACE_BUILD_SVC_DLL
#include "ace/OS.h"
#include "ace/Get_Opt.h"
#include "jaws3/Concurrency.h"
#include "HTTP_Service_Handler.h"
#include "HTTP_States.h"
#include "HTTP_Data.h"
JAWS_HTTP_Service_Handler::JAWS_HTTP_Service_Handler (void)
: JAWS_Protocol_Handler (JAWS_HTTP_Read_Request::instance (), & this->data_)
, data_ (this)
{
}
int
JAWS_HTTP_Service_Handler::open (void *)
{
int result = JAWS_Concurrency::instance ()->putq (this);
if (result < 0)
return -1;
return 0;
}
int
JAWS_HTTP_Service_Handler::close (unsigned long)
{
delete this;
return 0;
}
int
JAWS_HTTP_Acceptor::init (int argc, ACE_TCHAR *argv[])
{
ACE_Get_Opt opt (argc, argv, ACE_TEXT("p:"));
unsigned short p = 0;
int c;
while ((c = opt ()) != -1)
switch (c)
{
case 'p':
p = (unsigned short) ACE_OS::atoi (opt.optarg);
break;
default:
break;
}
if (p == 0)
p = 8000;
if (this->open (ACE_INET_Addr (p)) == -1)
{
ACE_DEBUG ((LM_DEBUG, "%p\n", "ACE_Acceptor::open"));
return -1;
}
return 0;
}
ACE_SVC_FACTORY_DEFINE (JAWS_HTTP_Acceptor)
| binghuo365/BaseLab | 3rd/ACE-5.7.0/ACE_wrappers/apps/JAWS3/http/HTTP_Service_Handler.cpp | C++ | mit | 1,204 | [
30522,
1013,
1013,
1002,
8909,
1024,
8299,
1035,
2326,
1035,
28213,
1012,
18133,
2361,
6445,
2581,
23499,
2263,
1011,
5641,
1011,
2385,
2260,
1024,
2322,
1024,
4805,
2480,
5206,
2860,
1002,
1001,
9375,
9078,
1035,
3857,
1035,
17917,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/i2c.h>
#include <linux/i2c/sx150x.h>
#include <linux/i2c/isl9519.h>
#include <linux/gpio.h>
#include <linux/msm_ssbi.h>
#include <linux/regulator/gpio-regulator.h>
#include <linux/mfd/pm8xxx/pm8921.h>
#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <linux/slimbus/slimbus.h>
#include <linux/bootmem.h>
#include <linux/msm_kgsl.h>
#ifdef CONFIG_ANDROID_PMEM
#include <linux/android_pmem.h>
#endif
#include <linux/cyttsp.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/qcom_crypto_device.h>
#include <linux/platform_data/qcom_wcnss_device.h>
#include <linux/leds.h>
#include <linux/leds-pm8xxx.h>
#include <linux/i2c/atmel_mxt_ts.h>
#include <linux/msm_tsens.h>
#include <linux/ks8851.h>
#include <linux/i2c/isa1200.h>
#include <linux/gpio_keys.h>
#include <linux/memory.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/setup.h>
#include <asm/hardware/gic.h>
#include <asm/mach/mmc.h>
#include <mach/board.h>
#include <mach/msm_iomap.h>
#include <mach/msm_spi.h>
#ifdef CONFIG_USB_MSM_OTG_72K
#include <mach/msm_hsusb.h>
#else
#include <linux/usb/msm_hsusb.h>
#endif
#include <linux/usb/android.h>
#include <mach/usbdiag.h>
#include <mach/socinfo.h>
#include <mach/rpm.h>
#include <mach/gpio.h>
#include <mach/gpiomux.h>
#include <mach/msm_bus_board.h>
#include <mach/msm_memtypes.h>
#include <mach/dma.h>
#include <mach/msm_xo.h>
#include <mach/restart.h>
#ifdef CONFIG_WCD9310_CODEC
#include <linux/slimbus/slimbus.h>
#include <linux/mfd/wcd9310/core.h>
#include <linux/mfd/wcd9310/pdata.h>
#endif
#include <linux/ion.h>
#include <mach/ion.h>
#include <mach/mdm2.h>
#include <mach/msm_rtb.h>
#include "timer.h"
#include "devices.h"
#include "devices-msm8x60.h"
#include "spm.h"
#include "pm.h"
#include <mach/cpuidle.h>
#include "rpm_resources.h"
#include <mach/mpm.h>
#include "acpuclock.h"
#include "rpm_log.h"
#include "smd_private.h"
#include "pm-boot.h"
#include "msm_watchdog.h"
#include "board-8930.h"
static struct platform_device msm_fm_platform_init = {
.name = "iris_fm",
.id = -1,
};
#define KS8851_RST_GPIO 89
#define KS8851_IRQ_GPIO 90
#define HAP_SHIFT_LVL_OE_GPIO 47
#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
struct sx150x_platform_data msm8930_sx150x_data[] = {
[SX150X_CAM] = {
.gpio_base = GPIO_CAM_EXPANDER_BASE,
.oscio_is_gpo = false,
.io_pullup_ena = 0x0,
.io_pulldn_ena = 0xc0,
.io_open_drain_ena = 0x0,
.irq_summary = -1,
},
};
#endif
#define MSM_PMEM_ADSP_SIZE 0x7800000
#define MSM_PMEM_AUDIO_SIZE 0x2B4000
#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
#else
#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
#endif
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
#define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000
#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
#define MSM_ION_MFC_SIZE SZ_8K
#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
#define MSM_ION_HEAP_NUM 8
#else
#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
#define MSM_ION_HEAP_NUM 1
#endif
#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
static int __init pmem_kernel_ebi1_size_setup(char *p)
{
pmem_kernel_ebi1_size = memparse(p, NULL);
return 0;
}
early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
#endif
#ifdef CONFIG_ANDROID_PMEM
static unsigned pmem_size = MSM_PMEM_SIZE;
static int __init pmem_size_setup(char *p)
{
pmem_size = memparse(p, NULL);
return 0;
}
early_param("pmem_size", pmem_size_setup);
static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
static int __init pmem_adsp_size_setup(char *p)
{
pmem_adsp_size = memparse(p, NULL);
return 0;
}
early_param("pmem_adsp_size", pmem_adsp_size_setup);
static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
static int __init pmem_audio_size_setup(char *p)
{
pmem_audio_size = memparse(p, NULL);
return 0;
}
early_param("pmem_audio_size", pmem_audio_size_setup);
#endif
#ifdef CONFIG_ANDROID_PMEM
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
static struct android_pmem_platform_data android_pmem_pdata = {
.name = "pmem",
.allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
.cached = 1,
.memory_type = MEMTYPE_EBI1,
};
static struct platform_device android_pmem_device = {
.name = "android_pmem",
.id = 0,
.dev = {.platform_data = &android_pmem_pdata},
};
static struct android_pmem_platform_data android_pmem_adsp_pdata = {
.name = "pmem_adsp",
.allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
.cached = 0,
.memory_type = MEMTYPE_EBI1,
};
static struct platform_device android_pmem_adsp_device = {
.name = "android_pmem",
.id = 2,
.dev = { .platform_data = &android_pmem_adsp_pdata },
};
#endif
static struct android_pmem_platform_data android_pmem_audio_pdata = {
.name = "pmem_audio",
.allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
.cached = 0,
.memory_type = MEMTYPE_EBI1,
};
static struct platform_device android_pmem_audio_device = {
.name = "android_pmem",
.id = 4,
.dev = { .platform_data = &android_pmem_audio_pdata },
};
#endif
#define DSP_RAM_BASE_8960 0x8da00000
#define DSP_RAM_SIZE_8960 0x1800000
static int dspcrashd_pdata_8960 = 0xDEADDEAD;
static struct resource resources_dspcrashd_8960[] = {
{
.name = "msm_dspcrashd",
.start = DSP_RAM_BASE_8960,
.end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
.flags = IORESOURCE_DMA,
},
};
static struct platform_device msm_device_dspcrashd_8960 = {
.name = "msm_dspcrashd",
.num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
.resource = resources_dspcrashd_8960,
.dev = { .platform_data = &dspcrashd_pdata_8960 },
};
static struct memtype_reserve msm8930_reserve_table[] __initdata = {
[MEMTYPE_SMI] = {
},
[MEMTYPE_EBI0] = {
.flags = MEMTYPE_FLAGS_1M_ALIGN,
},
[MEMTYPE_EBI1] = {
.flags = MEMTYPE_FLAGS_1M_ALIGN,
},
};
#if defined(CONFIG_MSM_RTB)
static struct msm_rtb_platform_data msm_rtb_pdata = {
.size = SZ_1M,
};
static int __init msm_rtb_set_buffer_size(char *p)
{
int s;
s = memparse(p, NULL);
msm_rtb_pdata.size = ALIGN(s, SZ_4K);
return 0;
}
early_param("msm_rtb_size", msm_rtb_set_buffer_size);
static struct platform_device msm_rtb_device = {
.name = "msm_rtb",
.id = -1,
.dev = {
.platform_data = &msm_rtb_pdata,
},
};
#endif
static void __init reserve_rtb_memory(void)
{
#if defined(CONFIG_MSM_RTB)
msm8930_reserve_table[MEMTYPE_EBI1].size += msm_rtb_pdata.size;
#endif
}
static void __init size_pmem_devices(void)
{
#ifdef CONFIG_ANDROID_PMEM
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
android_pmem_adsp_pdata.size = pmem_adsp_size;
android_pmem_pdata.size = pmem_size;
#endif
android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
#endif
}
static void __init reserve_memory_for(struct android_pmem_platform_data *p)
{
msm8930_reserve_table[p->memory_type].size += p->size;
}
static void __init reserve_pmem_memory(void)
{
#ifdef CONFIG_ANDROID_PMEM
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
reserve_memory_for(&android_pmem_adsp_pdata);
reserve_memory_for(&android_pmem_pdata);
#endif
reserve_memory_for(&android_pmem_audio_pdata);
msm8930_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
#endif
}
static int msm8930_paddr_to_memtype(unsigned int paddr)
{
return MEMTYPE_EBI1;
}
#ifdef CONFIG_ION_MSM
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
.permission_type = IPT_TYPE_MM_CARVEOUT,
.align = PAGE_SIZE,
};
static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
.permission_type = IPT_TYPE_MFC_SHAREDMEM,
.align = PAGE_SIZE,
};
static struct ion_co_heap_pdata co_ion_pdata = {
.adjacent_mem_id = INVALID_HEAP_ID,
.align = PAGE_SIZE,
};
static struct ion_co_heap_pdata fw_co_ion_pdata = {
.adjacent_mem_id = ION_CP_MM_HEAP_ID,
.align = SZ_128K,
};
#endif
/**
* These heaps are listed in the order they will be allocated. Due to
* video hardware restrictions and content protection the FW heap has to
* be allocated adjacent (below) the MM heap and the MFC heap has to be
* allocated after the MM heap to ensure MFC heap is not more than 256MB
* away from the base address of the FW heap.
* However, the order of FW heap and MM heap doesn't matter since these
* two heaps are taken care of by separate code to ensure they are adjacent
* to each other.
* Don't swap the order unless you know what you are doing!
*/
static struct ion_platform_data ion_pdata = {
.nr = MSM_ION_HEAP_NUM,
.heaps = {
{
.id = ION_SYSTEM_HEAP_ID,
.type = ION_HEAP_TYPE_SYSTEM,
.name = ION_VMALLOC_HEAP_NAME,
},
#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
{
.id = ION_CP_MM_HEAP_ID,
.type = ION_HEAP_TYPE_CP,
.name = ION_MM_HEAP_NAME,
.size = MSM_ION_MM_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &cp_mm_ion_pdata,
},
{
.id = ION_MM_FIRMWARE_HEAP_ID,
.type = ION_HEAP_TYPE_CARVEOUT,
.name = ION_MM_FIRMWARE_HEAP_NAME,
.size = MSM_ION_MM_FW_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &fw_co_ion_pdata,
},
{
.id = ION_CP_MFC_HEAP_ID,
.type = ION_HEAP_TYPE_CP,
.name = ION_MFC_HEAP_NAME,
.size = MSM_ION_MFC_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &cp_mfc_ion_pdata,
},
{
.id = ION_SF_HEAP_ID,
.type = ION_HEAP_TYPE_CARVEOUT,
.name = ION_SF_HEAP_NAME,
.size = MSM_ION_SF_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &co_ion_pdata,
},
{
.id = ION_IOMMU_HEAP_ID,
.type = ION_HEAP_TYPE_IOMMU,
.name = ION_IOMMU_HEAP_NAME,
},
{
.id = ION_QSECOM_HEAP_ID,
.type = ION_HEAP_TYPE_CARVEOUT,
.name = ION_QSECOM_HEAP_NAME,
.size = MSM_ION_QSECOM_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &co_ion_pdata,
},
{
.id = ION_AUDIO_HEAP_ID,
.type = ION_HEAP_TYPE_CARVEOUT,
.name = ION_AUDIO_HEAP_NAME,
.size = MSM_ION_AUDIO_SIZE,
.memory_type = ION_EBI_TYPE,
.extra_data = (void *) &co_ion_pdata,
},
#endif
}
};
static struct platform_device ion_dev = {
.name = "ion-msm",
.id = 1,
.dev = { .platform_data = &ion_pdata },
};
#endif
static void reserve_ion_memory(void)
{
#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
msm8930_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
#endif
}
static void __init reserve_mdp_memory(void)
{
msm8930_mdp_writeback(msm8930_reserve_table);
}
static void __init msm8930_calculate_reserve_sizes(void)
{
size_pmem_devices();
reserve_pmem_memory();
reserve_ion_memory();
reserve_mdp_memory();
reserve_rtb_memory();
}
static struct reserve_info msm8930_reserve_info __initdata = {
.memtype_reserve_table = msm8930_reserve_table,
.calculate_reserve_sizes = msm8930_calculate_reserve_sizes,
.paddr_to_memtype = msm8930_paddr_to_memtype,
};
static int msm8930_memory_bank_size(void)
{
return 1<<29;
}
static void __init locate_unstable_memory(void)
{
struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
unsigned long bank_size;
unsigned long low, high;
bank_size = msm8930_memory_bank_size();
low = meminfo.bank[0].start;
high = mb->start + mb->size;
/* Check if 32 bit overflow occured */
if (high < mb->start)
high = ~0UL;
low &= ~(bank_size - 1);
if (high - low <= bank_size)
return;
msm8930_reserve_info.bank_size = bank_size;
#ifdef CONFIG_ENABLE_DMM
msm8930_reserve_info.low_unstable_address = mb->start -
MIN_MEMORY_BLOCK_SIZE + mb->size;
msm8930_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
pr_info("low unstable address %lx max size %lx bank size %lx\n",
msm8930_reserve_info.low_unstable_address,
msm8930_reserve_info.max_unstable_size,
msm8930_reserve_info.bank_size);
#else
msm8930_reserve_info.low_unstable_address = 0;
msm8930_reserve_info.max_unstable_size = 0;
#endif
}
static void __init place_movable_zone(void)
{
#ifdef CONFIG_ENABLE_DMM
movable_reserved_start = msm8930_reserve_info.low_unstable_address;
movable_reserved_size = msm8930_reserve_info.max_unstable_size;
pr_info("movable zone start %lx size %lx\n",
movable_reserved_start, movable_reserved_size);
#endif
}
static void __init msm8930_early_memory(void)
{
reserve_info = &msm8930_reserve_info;
locate_unstable_memory();
place_movable_zone();
}
static void __init msm8930_reserve(void)
{
msm_reserve();
}
static int msm8930_change_memory_power(u64 start, u64 size,
int change_type)
{
return soc_change_memory_power(start, size, change_type);
}
static void __init msm8930_allocate_memory_regions(void)
{
msm8930_allocate_fb_region();
}
#ifdef CONFIG_WCD9310_CODEC
#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
* 4 micbiases are used to power various analog and digital
* microphones operating at 1800 mV. Technically, all micbiases
* can source from single cfilter since all microphones operate
* at the same voltage level. The arrangement below is to make
* sure all cfilters are exercised. LDO_H regulator ouput level
* does not need to be as high as 2.85V. It is choosen for
* microphone sensitivity purpose.
*/
static struct tabla_pdata tabla_platform_data = {
.slimbus_slave_device = {
.name = "tabla-slave",
.e_addr = {0, 0, 0x10, 0, 0x17, 2},
},
.irq = MSM_GPIO_TO_INT(62),
.irq_base = TABLA_INTERRUPT_BASE,
.num_irqs = NR_TABLA_IRQS,
/*TODO: Replace this with right PM8038 gpio */
#ifndef MSM8930_PHASE_2
.reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
#endif
.micbias = {
.ldoh_v = TABLA_LDOH_2P85_V,
.cfilt1_mv = 1800,
.cfilt2_mv = 1800,
.cfilt3_mv = 1800,
.bias1_cfilt_sel = TABLA_CFILT1_SEL,
.bias2_cfilt_sel = TABLA_CFILT2_SEL,
.bias3_cfilt_sel = TABLA_CFILT3_SEL,
.bias4_cfilt_sel = TABLA_CFILT3_SEL,
}
};
static struct slim_device msm_slim_tabla = {
.name = "tabla-slim",
.e_addr = {0, 1, 0x10, 0, 0x17, 2},
.dev = {
.platform_data = &tabla_platform_data,
},
};
static struct tabla_pdata tabla20_platform_data = {
.slimbus_slave_device = {
.name = "tabla-slave",
.e_addr = {0, 0, 0x60, 0, 0x17, 2},
},
.irq = MSM_GPIO_TO_INT(62),
.irq_base = TABLA_INTERRUPT_BASE,
.num_irqs = NR_TABLA_IRQS,
/*TODO: Replace this with right PM8038 gpio */
#ifndef MSM8930_PHASE_2
.reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
#endif
.micbias = {
.ldoh_v = TABLA_LDOH_2P85_V,
.cfilt1_mv = 1800,
.cfilt2_mv = 1800,
.cfilt3_mv = 1800,
.bias1_cfilt_sel = TABLA_CFILT1_SEL,
.bias2_cfilt_sel = TABLA_CFILT2_SEL,
.bias3_cfilt_sel = TABLA_CFILT3_SEL,
.bias4_cfilt_sel = TABLA_CFILT3_SEL,
}
};
static struct slim_device msm_slim_tabla20 = {
.name = "tabla2x-slim",
.e_addr = {0, 1, 0x60, 0, 0x17, 2},
.dev = {
.platform_data = &tabla20_platform_data,
},
};
#endif
static struct slim_boardinfo msm_slim_devices[] = {
#ifdef CONFIG_WCD9310_CODEC
{
.bus_num = 1,
.slim_slave = &msm_slim_tabla,
},
{
.bus_num = 1,
.slim_slave = &msm_slim_tabla20,
},
#endif
/* add more slimbus slaves as needed */
};
#define MSM_WCNSS_PHYS 0x03000000
#define MSM_WCNSS_SIZE 0x280000
static struct resource resources_wcnss_wlan[] = {
{
.start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
.end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
.name = "wcnss_wlanrx_irq",
.flags = IORESOURCE_IRQ,
},
{
.start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
.end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
.name = "wcnss_wlantx_irq",
.flags = IORESOURCE_IRQ,
},
{
.start = MSM_WCNSS_PHYS,
.end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
.name = "wcnss_mmio",
.flags = IORESOURCE_MEM,
},
{
.start = 84,
.end = 88,
.name = "wcnss_gpios_5wire",
.flags = IORESOURCE_IO,
},
};
static struct qcom_wcnss_opts qcom_wcnss_pdata = {
.has_48mhz_xo = 1,
};
static struct platform_device msm_device_wcnss_wlan = {
.name = "wcnss_wlan",
.id = 0,
.num_resources = ARRAY_SIZE(resources_wcnss_wlan),
.resource = resources_wcnss_wlan,
.dev = {.platform_data = &qcom_wcnss_pdata},
};
#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
#define QCE_SIZE 0x10000
#define QCE_0_BASE 0x18500000
#define QCE_HW_KEY_SUPPORT 0
#define QCE_SHA_HMAC_SUPPORT 1
#define QCE_SHARE_CE_RESOURCE 1
#define QCE_CE_SHARED 0
static struct resource qcrypto_resources[] = {
[0] = {
.start = QCE_0_BASE,
.end = QCE_0_BASE + QCE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "crypto_channels",
.start = DMOV_CE_IN_CHAN,
.end = DMOV_CE_OUT_CHAN,
.flags = IORESOURCE_DMA,
},
[2] = {
.name = "crypto_crci_in",
.start = DMOV_CE_IN_CRCI,
.end = DMOV_CE_IN_CRCI,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "crypto_crci_out",
.start = DMOV_CE_OUT_CRCI,
.end = DMOV_CE_OUT_CRCI,
.flags = IORESOURCE_DMA,
},
};
static struct resource qcedev_resources[] = {
[0] = {
.start = QCE_0_BASE,
.end = QCE_0_BASE + QCE_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.name = "crypto_channels",
.start = DMOV_CE_IN_CHAN,
.end = DMOV_CE_OUT_CHAN,
.flags = IORESOURCE_DMA,
},
[2] = {
.name = "crypto_crci_in",
.start = DMOV_CE_IN_CRCI,
.end = DMOV_CE_IN_CRCI,
.flags = IORESOURCE_DMA,
},
[3] = {
.name = "crypto_crci_out",
.start = DMOV_CE_OUT_CRCI,
.end = DMOV_CE_OUT_CRCI,
.flags = IORESOURCE_DMA,
},
};
#endif
#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
.ce_shared = QCE_CE_SHARED,
.shared_ce_resource = QCE_SHARE_CE_RESOURCE,
.hw_key_support = QCE_HW_KEY_SUPPORT,
.sha_hmac = QCE_SHA_HMAC_SUPPORT,
};
static struct platform_device qcrypto_device = {
.name = "qcrypto",
.id = 0,
.num_resources = ARRAY_SIZE(qcrypto_resources),
.resource = qcrypto_resources,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &qcrypto_ce_hw_suppport,
},
};
#endif
#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
.ce_shared = QCE_CE_SHARED,
.shared_ce_resource = QCE_SHARE_CE_RESOURCE,
.hw_key_support = QCE_HW_KEY_SUPPORT,
.sha_hmac = QCE_SHA_HMAC_SUPPORT,
};
static struct platform_device qcedev_device = {
.name = "qce",
.id = 0,
.num_resources = ARRAY_SIZE(qcedev_resources),
.resource = qcedev_resources,
.dev = {
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &qcedev_ce_hw_suppport,
},
};
#endif
#define MDM2AP_ERRFATAL 70
#define AP2MDM_ERRFATAL 95
#define MDM2AP_STATUS 69
#define AP2MDM_STATUS 94
#define AP2MDM_PMIC_RESET_N 80
#define AP2MDM_KPDPWR_N 81
static struct resource mdm_resources[] = {
{
.start = MDM2AP_ERRFATAL,
.end = MDM2AP_ERRFATAL,
.name = "MDM2AP_ERRFATAL",
.flags = IORESOURCE_IO,
},
{
.start = AP2MDM_ERRFATAL,
.end = AP2MDM_ERRFATAL,
.name = "AP2MDM_ERRFATAL",
.flags = IORESOURCE_IO,
},
{
.start = MDM2AP_STATUS,
.end = MDM2AP_STATUS,
.name = "MDM2AP_STATUS",
.flags = IORESOURCE_IO,
},
{
.start = AP2MDM_STATUS,
.end = AP2MDM_STATUS,
.name = "AP2MDM_STATUS",
.flags = IORESOURCE_IO,
},
{
.start = AP2MDM_PMIC_RESET_N,
.end = AP2MDM_PMIC_RESET_N,
.name = "AP2MDM_PMIC_RESET_N",
.flags = IORESOURCE_IO,
},
{
.start = AP2MDM_KPDPWR_N,
.end = AP2MDM_KPDPWR_N,
.name = "AP2MDM_KPDPWR_N",
.flags = IORESOURCE_IO,
},
};
static struct mdm_platform_data mdm_platform_data = {
.mdm_version = "2.5",
};
static struct platform_device mdm_device = {
.name = "mdm2_modem",
.id = -1,
.num_resources = ARRAY_SIZE(mdm_resources),
.resource = mdm_resources,
.dev = {
.platform_data = &mdm_platform_data,
},
};
static struct platform_device *mdm_devices[] __initdata = {
&mdm_device,
};
#define MSM_SHARED_RAM_PHYS 0x80000000
static void __init msm8930_map_io(void)
{
msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
msm_map_msm8930_io();
if (socinfo_init() < 0)
pr_err("socinfo_init() failed!\n");
}
static void __init msm8930_init_irq(void)
{
msm_mpm_irq_extn_init();
gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
(void *)MSM_QGIC_CPU_BASE);
/* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
mb();
}
static void __init msm8930_init_buses(void)
{
#ifdef CONFIG_MSM_BUS_SCALING
msm_bus_rpm_set_mt_mask();
msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
msm_bus_apps_fabric.dev.platform_data =
&msm_bus_8960_apps_fabric_pdata;
msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
#endif
}
static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
.max_clock_speed = 15060000,
};
#ifdef CONFIG_USB_MSM_OTG_72K
static struct msm_otg_platform_data msm_otg_pdata;
#else
static struct msm_otg_platform_data msm_otg_pdata = {
.mode = USB_OTG,
.otg_control = OTG_PMIC_CONTROL,
.phy_type = SNPS_28NM_INTEGRATED_PHY,
.pmic_id_irq = PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE),
.power_budget = 750,
};
#endif
#ifdef CONFIG_USB_EHCI_MSM_HSIC
#define HSIC_HUB_RESET_GPIO 91
static struct msm_hsic_host_platform_data msm_hsic_pdata = {
.strobe = 150,
.data = 151,
};
#else
static struct msm_hsic_host_platform_data msm_hsic_pdata;
#endif
#define PID_MAGIC_ID 0x71432909
#define SERIAL_NUM_MAGIC_ID 0x61945374
#define SERIAL_NUMBER_LENGTH 127
#define DLOAD_USB_BASE_ADD 0x2A03F0C8
struct magic_num_struct {
uint32_t pid;
uint32_t serial_num;
};
struct dload_struct {
uint32_t reserved1;
uint32_t reserved2;
uint32_t reserved3;
uint16_t reserved4;
uint16_t pid;
char serial_number[SERIAL_NUMBER_LENGTH];
uint16_t reserved5;
struct magic_num_struct magic_struct;
};
static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
{
struct dload_struct __iomem *dload = 0;
dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
if (!dload) {
pr_err("%s: cannot remap I/O memory region: %08x\n",
__func__, DLOAD_USB_BASE_ADD);
return -ENXIO;
}
pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
__func__, dload, pid, snum);
/* update pid */
dload->magic_struct.pid = PID_MAGIC_ID;
dload->pid = pid;
/* update serial number */
dload->magic_struct.serial_num = 0;
if (!snum) {
memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
goto out;
}
dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
out:
iounmap(dload);
return 0;
}
static struct android_usb_platform_data android_usb_pdata = {
.update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
};
static struct platform_device android_usb_device = {
.name = "android_usb",
.id = -1,
.dev = {
.platform_data = &android_usb_pdata,
},
};
static uint8_t spm_wfi_cmd_sequence[] __initdata = {
0x03, 0x0f,
};
static uint8_t spm_power_collapse_without_rpm[] __initdata = {
0x00, 0x24, 0x54, 0x10,
0x09, 0x03, 0x01,
0x10, 0x54, 0x30, 0x0C,
0x24, 0x30, 0x0f,
};
static uint8_t spm_power_collapse_with_rpm[] __initdata = {
0x00, 0x24, 0x54, 0x10,
0x09, 0x07, 0x01, 0x0B,
0x10, 0x54, 0x30, 0x0C,
0x24, 0x30, 0x0f,
};
static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
[0] = {
.mode = MSM_SPM_MODE_CLOCK_GATING,
.notify_rpm = false,
.cmd = spm_wfi_cmd_sequence,
},
[1] = {
.mode = MSM_SPM_MODE_POWER_COLLAPSE,
.notify_rpm = false,
.cmd = spm_power_collapse_without_rpm,
},
[2] = {
.mode = MSM_SPM_MODE_POWER_COLLAPSE,
.notify_rpm = true,
.cmd = spm_power_collapse_with_rpm,
},
};
static struct msm_spm_platform_data msm_spm_data[] __initdata = {
[0] = {
.reg_base_addr = MSM_SAW0_BASE,
.reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
#if defined(CONFIG_MSM_AVS_HW)
.reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
.reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
#endif
.reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
.vctl_timeout_us = 50,
.num_modes = ARRAY_SIZE(msm_spm_seq_list),
.modes = msm_spm_seq_list,
},
[1] = {
.reg_base_addr = MSM_SAW1_BASE,
.reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
#if defined(CONFIG_MSM_AVS_HW)
.reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
.reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
#endif
.reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
.vctl_timeout_us = 50,
.num_modes = ARRAY_SIZE(msm_spm_seq_list),
.modes = msm_spm_seq_list,
},
};
static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
0x00, 0x20, 0x03, 0x20,
0x00, 0x0f,
};
static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
0x00, 0x20, 0x34, 0x64,
0x48, 0x07, 0x48, 0x20,
0x50, 0x64, 0x04, 0x34,
0x50, 0x0f,
};
static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
0x00, 0x10, 0x34, 0x64,
0x48, 0x07, 0x48, 0x10,
0x50, 0x64, 0x04, 0x34,
0x50, 0x0F,
};
static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
[0] = {
.mode = MSM_SPM_L2_MODE_RETENTION,
.notify_rpm = false,
.cmd = l2_spm_wfi_cmd_sequence,
},
[1] = {
.mode = MSM_SPM_L2_MODE_GDHS,
.notify_rpm = true,
.cmd = l2_spm_gdhs_cmd_sequence,
},
[2] = {
.mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
.notify_rpm = true,
.cmd = l2_spm_power_off_cmd_sequence,
},
};
static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
[0] = {
.reg_base_addr = MSM_SAW_L2_BASE,
.reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
.reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
.modes = msm_spm_l2_seq_list,
.num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
},
};
#/* TODO: Remove this once PM8038 physically becomes
* available.
*/
#ifndef MSM8930_PHASE_2
#define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
#define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
#else
#define ISA1200_HAP_EN_GPIO 77
#define ISA1200_HAP_LEN_GPIO 78
#define ISA1200_HAP_CLK PM8038_GPIO_PM_TO_SYS(7)
#endif
#ifndef MSM8930_PHASE_2
static struct msm_xo_voter *xo_handle_d1;
#endif
static int isa1200_power(int on)
{
#ifndef MSM8930_PHASE_2
int rc = 0;
gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on);
rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) :
msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF);
if (rc < 0) {
pr_err("%s: failed to %svote for TCXO D1 buffer%d\n",
__func__, on ? "" : "de-", rc);
goto err_xo_vote;
}
return 0;
err_xo_vote:
gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on);
return rc;
#else
gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
return 0;
#endif
}
static int isa1200_dev_setup(bool enable)
{
int rc = 0;
#ifndef MSM8930_PHASE_2
struct pm_gpio hap_gpio_config = {
.direction = PM_GPIO_DIR_OUT,
.pull = PM_GPIO_PULL_NO,
.out_strength = PM_GPIO_STRENGTH_HIGH,
.function = PM_GPIO_FUNC_NORMAL,
.inv_int_pol = 0,
.vin_sel = 2,
.output_buffer = PM_GPIO_OUT_BUF_CMOS,
.output_value = 0,
};
if (enable == true) {
rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config);
if (rc) {
pr_err("%s: pm8921 gpio %d config failed(%d)\n",
__func__, PM_HAP_EN_GPIO, rc);
return rc;
}
rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config);
if (rc) {
pr_err("%s: pm8921 gpio %d config failed(%d)\n",
__func__, PM_HAP_LEN_GPIO, rc);
return rc;
}
rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe");
if (rc) {
pr_err("%s: unable to request gpio %d (%d)\n",
__func__, HAP_SHIFT_LVL_OE_GPIO, rc);
return rc;
}
rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0);
if (rc) {
pr_err("%s: Unable to set direction\n", __func__);
goto free_gpio;
}
xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200");
if (IS_ERR(xo_handle_d1)) {
rc = PTR_ERR(xo_handle_d1);
pr_err("%s: failed to get the handle for D1(%d)\n",
__func__, rc);
goto gpio_set_dir;
}
} else {
gpio_free(HAP_SHIFT_LVL_OE_GPIO);
msm_xo_put(xo_handle_d1);
}
return 0;
gpio_set_dir:
gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0);
free_gpio:
gpio_free(HAP_SHIFT_LVL_OE_GPIO);
return rc;
#else
struct pm_gpio hap_clk_gpio_config = {
.direction = PM_GPIO_DIR_OUT,
.pull = PM_GPIO_PULL_NO,
.out_strength = PM_GPIO_STRENGTH_HIGH,
.function = PM_GPIO_FUNC_1,
.inv_int_pol = 0,
.vin_sel = PM_GPIO_VIN_S4,
.output_buffer = PM_GPIO_OUT_BUF_CMOS,
.output_value = 0,
};
rc = pm8xxx_gpio_config(ISA1200_HAP_CLK, &hap_clk_gpio_config);
if (rc) {
pr_err("%s: pm8038 gpio %d config failed(%d)\n",
__func__, ISA1200_HAP_CLK, rc);
return rc;
}
rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
if (rc) {
pr_err("%s: gpio_request for %d gpio failed rc(%d)\n",
__func__, ISA1200_HAP_CLK, rc);
goto fail_gpio_req;
}
rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
if (rc) {
pr_err("%s: gpio_direction_output failed for %d gpio rc(%d)\n",
__func__, ISA1200_HAP_CLK, rc);
goto fail_gpio_dir;
}
return 0;
fail_gpio_dir:
gpio_free(ISA1200_HAP_CLK);
fail_gpio_req:
return rc;
#endif
}
static struct isa1200_regulator isa1200_reg_data[] = {
#ifndef MSM8930_PHASE_2
{
.name = "vcc_i2c",
.min_uV = ISA_I2C_VTG_MIN_UV,
.max_uV = ISA_I2C_VTG_MAX_UV,
.load_uA = ISA_I2C_CURR_UA,
},
#else
{
.name = "vddp",
.min_uV = ISA_I2C_VTG_MIN_UV,
.max_uV = ISA_I2C_VTG_MAX_UV,
.load_uA = ISA_I2C_CURR_UA,
},
#endif
};
static struct isa1200_platform_data isa1200_1_pdata = {
.name = "vibrator",
.dev_setup = isa1200_dev_setup,
.power_on = isa1200_power,
#ifndef MSM8930_PHASE_2
.hap_en_gpio = PM_HAP_EN_GPIO,
.hap_len_gpio = PM_HAP_LEN_GPIO,
#else
.hap_en_gpio = ISA1200_HAP_EN_GPIO,
.hap_len_gpio = ISA1200_HAP_LEN_GPIO,
#endif
.max_timeout = 15000,
.mode_ctrl = PWM_GEN_MODE,
.pwm_fd = {
.pwm_div = 256,
},
.is_erm = false,
.smart_en = true,
.ext_clk_en = true,
.chip_en = 1,
.regulator_info = isa1200_reg_data,
.num_regulators = ARRAY_SIZE(isa1200_reg_data),
};
static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
{
I2C_BOARD_INFO("isa1200_1", 0x90>>1),
.platform_data = &isa1200_1_pdata,
},
};
#define CYTTSP_TS_GPIO_IRQ 11
#define CYTTSP_TS_SLEEP_GPIO 50
#define CYTTSP_TS_RESOUT_N_GPIO 52
/*virtual key support */
static ssize_t tma340_vkeys_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return snprintf(buf, 200,
__stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
"\n");
}
static struct kobj_attribute tma340_vkeys_attr = {
.attr = {
.mode = S_IRUGO,
},
.show = &tma340_vkeys_show,
};
static struct attribute *tma340_properties_attrs[] = {
&tma340_vkeys_attr.attr,
NULL
};
static struct attribute_group tma340_properties_attr_group = {
.attrs = tma340_properties_attrs,
};
static int cyttsp_platform_init(struct i2c_client *client)
{
int rc = 0;
static struct kobject *tma340_properties_kobj;
tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
tma340_properties_kobj = kobject_create_and_add("board_properties",
NULL);
if (tma340_properties_kobj)
rc = sysfs_create_group(tma340_properties_kobj,
&tma340_properties_attr_group);
if (!tma340_properties_kobj || rc)
pr_err("%s: failed to create board_properties\n",
__func__);
return 0;
}
static struct cyttsp_regulator regulator_data[] = {
{
.name = "vdd",
.min_uV = CY_TMA300_VTG_MIN_UV,
.max_uV = CY_TMA300_VTG_MAX_UV,
.hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
.lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
},
/* TODO: Remove after runtime PM is enabled in I2C driver */
{
.name = "vcc_i2c",
.min_uV = CY_I2C_VTG_MIN_UV,
.max_uV = CY_I2C_VTG_MAX_UV,
.hpm_load_uA = CY_I2C_CURR_UA,
.lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
},
};
static struct cyttsp_platform_data cyttsp_pdata = {
.panel_maxx = 634,
.panel_maxy = 1166,
.disp_maxx = 616,
.disp_maxy = 1023,
.disp_minx = 0,
.disp_miny = 16,
.flags = 0x01,
.gen = CY_GEN3, /* or */
.use_st = CY_USE_ST,
.use_mt = CY_USE_MT,
.use_hndshk = CY_SEND_HNDSHK,
.use_trk_id = CY_USE_TRACKING_ID,
.use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
.use_gestures = CY_USE_GESTURES,
.fw_fname = "cyttsp_8960_cdp.hex",
/* activate up to 4 groups
* and set active distance
*/
.gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
CY_GEST_GRP3 | CY_GEST_GRP4 |
CY_ACT_DIST,
/* change act_intrvl to customize the Active power state
* scanning/processing refresh interval for Operating mode
*/
.act_intrvl = CY_ACT_INTRVL_DFLT,
/* change tch_tmout to customize the touch timeout for the
* Active power state for Operating mode
*/
.tch_tmout = CY_TCH_TMOUT_DFLT,
/* change lp_intrvl to customize the Low Power power state
* scanning/processing refresh interval for Operating mode
*/
.lp_intrvl = CY_LP_INTRVL_DFLT,
.sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
.resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
.irq_gpio = CYTTSP_TS_GPIO_IRQ,
.regulator_info = regulator_data,
.num_regulators = ARRAY_SIZE(regulator_data),
.init = cyttsp_platform_init,
.correct_fw_ver = 9,
};
static struct i2c_board_info cyttsp_info[] __initdata = {
{
I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
.platform_data = &cyttsp_pdata,
#ifndef CY_USE_TIMER
.irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
#endif /* CY_USE_TIMER */
},
};
#define MXT_TS_GPIO_IRQ 11
#define MXT_TS_RESET_GPIO 52
static const u8 mxt_config_data_8930[] = {
/* T6 Object */
0, 0, 0, 0, 0, 0,
/* T38 Object */
15, 1, 0, 15, 12, 11, 0, 0,
/* T7 Object */
48, 255, 25,
/* T8 Object */
27, 0, 5, 1, 0, 0, 8, 8, 0, 0,
/* T9 Object */
131, 0, 0, 19, 11, 0, 16, 35, 1, 3,
10, 15, 1, 11, 4, 5, 40, 10, 54, 2,
43, 4, 0, 0, 0, 0, 143, 40, 143, 80,
18, 15, 50, 50, 2,
/* T15 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
/* T18 Object */
0, 0,
/* T19 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
/* T23 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
/* T25 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
/* T40 Object */
0, 0, 0, 0, 0,
/* T42 Object */
0, 0, 0, 0, 0, 0, 0, 0,
/* T46 Object */
0, 3, 16, 48, 0, 0, 1, 0, 0,
/* T47 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* T48 Object */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
};
static ssize_t mxt224e_vkeys_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return snprintf(buf, 200,
__stringify(EV_KEY) ":" __stringify(KEY_BACK) ":65:938:90:90"
":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":208:938:90:90"
":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":348:938:90:90"
":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":490:938:90:90"
"\n");
}
static struct kobj_attribute mxt224e_vkeys_attr = {
.attr = {
.mode = S_IRUGO,
},
.show = &mxt224e_vkeys_show,
};
static struct attribute *mxt224e_properties_attrs[] = {
&mxt224e_vkeys_attr.attr,
NULL
};
static struct attribute_group mxt224e_properties_attr_group = {
.attrs = mxt224e_properties_attrs,
};
static void mxt_init_vkeys_8930(void)
{
int rc = 0;
static struct kobject *mxt224e_properties_kobj;
mxt224e_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts";
mxt224e_properties_kobj = kobject_create_and_add("board_properties",
NULL);
if (mxt224e_properties_kobj)
rc = sysfs_create_group(mxt224e_properties_kobj,
&mxt224e_properties_attr_group);
if (!mxt224e_properties_kobj || rc)
pr_err("%s: failed to create board_properties\n",
__func__);
return;
}
static struct mxt_config_info mxt_config_array[] = {
{
.config = mxt_config_data_8930,
.config_length = ARRAY_SIZE(mxt_config_data_8930),
.family_id = 0x81,
.variant_id = 0x01,
.version = 0x10,
.build = 0xAA,
},
};
static struct mxt_platform_data mxt_platform_data_8930 = {
.config_array = mxt_config_array,
.config_array_size = ARRAY_SIZE(mxt_config_array),
.panel_minx = 0,
.panel_maxx = 566,
.panel_miny = 0,
.panel_maxy = 1067,
.disp_minx = 0,
.disp_maxx = 540,
.disp_miny = 0,
.disp_maxy = 960,
.irqflags = IRQF_TRIGGER_FALLING,
#ifdef MSM8930_PHASE_2
.digital_pwr_regulator = true,
#endif
.i2c_pull_up = true,
.reset_gpio = MXT_TS_RESET_GPIO,
.irq_gpio = MXT_TS_GPIO_IRQ,
};
static struct i2c_board_info mxt_device_info_8930[] __initdata = {
{
I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
.platform_data = &mxt_platform_data_8930,
.irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
},
};
#ifdef MSM8930_PHASE_2
#define GPIO_VOLUME_UP PM8038_GPIO_PM_TO_SYS(3)
#define GPIO_VOLUME_DOWN PM8038_GPIO_PM_TO_SYS(8)
#define GPIO_CAMERA_SNAPSHOT PM8038_GPIO_PM_TO_SYS(10)
#define GPIO_CAMERA_FOCUS PM8038_GPIO_PM_TO_SYS(11)
static struct gpio_keys_button keys_8930[] = {
{
.code = KEY_VOLUMEUP,
.type = EV_KEY,
.desc = "volume_up",
.gpio = GPIO_VOLUME_UP,
.wakeup = 1,
.active_low = 1,
},
{
.code = KEY_VOLUMEDOWN,
.type = EV_KEY,
.desc = "volume_down",
.gpio = GPIO_VOLUME_DOWN,
.wakeup = 1,
.active_low = 1,
},
{
.code = KEY_CAMERA_FOCUS,
.type = EV_KEY,
.desc = "camera_focus",
.gpio = GPIO_CAMERA_FOCUS,
.wakeup = 1,
.active_low = 1,
},
{
.code = KEY_CAMERA_SNAPSHOT,
.type = EV_KEY,
.desc = "camera_snapshot",
.gpio = GPIO_CAMERA_SNAPSHOT,
.wakeup = 1,
.active_low = 1,
},
};
/* Add GPIO keys for 8930 */
static struct gpio_keys_platform_data gpio_keys_8930_pdata = {
.buttons = keys_8930,
.nbuttons = 4,
};
static struct platform_device gpio_keys_8930 = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &gpio_keys_8930_pdata,
},
};
#endif /* MSM8930_PHASE_2 */
static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
.clk_freq = 100000,
.src_clk_rate = 24000000,
};
static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
.clk_freq = 100000,
.src_clk_rate = 24000000,
};
static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
.clk_freq = 100000,
.src_clk_rate = 24000000,
};
static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
.clk_freq = 100000,
.src_clk_rate = 24000000,
};
static struct msm_rpm_platform_data msm_rpm_data = {
.reg_base_addrs = {
[MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
[MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
[MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
[MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
},
.irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
.irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
.irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
.msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
.msm_apps_ipc_rpm_val = 4,
};
static struct ks8851_pdata spi_eth_pdata = {
.irq_gpio = KS8851_IRQ_GPIO,
.rst_gpio = KS8851_RST_GPIO,
};
static struct spi_board_info spi_board_info[] __initdata = {
{
.modalias = "ks8851",
.irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
.max_speed_hz = 19200000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
.platform_data = &spi_eth_pdata
},
{
.modalias = "dsi_novatek_3d_panel_spi",
.max_speed_hz = 10800000,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
},
};
static struct platform_device msm_device_saw_core0 = {
.name = "saw-regulator",
.id = 0,
.dev = {
.platform_data = &msm8930_saw_regulator_core0_pdata,
},
};
static struct platform_device msm_device_saw_core1 = {
.name = "saw-regulator",
.id = 1,
.dev = {
.platform_data = &msm8930_saw_regulator_core1_pdata,
},
};
static struct tsens_platform_data msm_tsens_pdata = {
.slope = {910, 910, 910, 910, 910},
.tsens_factor = 1000,
.hw_type = MSM_8960,
.tsens_num_sensor = 5,
};
#ifdef CONFIG_MSM_FAKE_BATTERY
static struct platform_device fish_battery_device = {
.name = "fish_battery",
};
#endif
#ifndef MSM8930_PHASE_2
/* 8930 Phase 1 */
static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = PM8921_MPP_PM_TO_SYS(7),
.dev = {
.platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
},
};
static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = 91,
.dev = {
.platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
},
};
#else
/* 8930 Phase 2 */
static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = 63,
.dev = {
.platform_data =
&msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_5V],
},
};
static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = {
.name = GPIO_REGULATOR_DEV_NAME,
.id = 97,
.dev = {
.platform_data =
&msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_OTG_SW],
},
};
#endif
static struct platform_device msm8930_device_rpm_regulator __devinitdata = {
.name = "rpm-regulator",
.id = -1,
.dev = {
/*
* TODO: When physical 8930/PM8038 hardware becomes
* available, replace msm_rpm_regulator_pdata
* with 8930 rpm regulator object.
*/
#if !defined(MSM8930_PHASE_2)
.platform_data = &msm_rpm_regulator_pdata,
#endif
},
};
static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
.phys_addr_base = 0x0010C000,
.reg_offsets = {
[MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
[MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
},
.phys_size = SZ_8K,
.log_len = 4096, /* log's buffer length in bytes */
.log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
};
static struct platform_device msm_rpm_log_device = {
.name = "msm_rpm_log",
.id = -1,
.dev = {
.platform_data = &msm_rpm_log_pdata,
},
};
static struct platform_device *common_devices[] __initdata = {
&msm8960_device_dmov,
&msm_device_smd,
&msm8960_device_uart_gsbi5,
&msm_device_uart_dm6,
&msm_device_saw_core0,
&msm_device_saw_core1,
&msm8930_device_ext_5v_vreg,
#ifndef MSM8930_PHASE_2
&msm8930_device_ext_l2_vreg,
#endif
&msm8960_device_ssbi_pmic,
#ifdef MSM8930_PHASE_2
&msm8930_device_ext_otg_sw_vreg,
#endif
&msm_8960_q6_lpass,
&msm_8960_q6_mss_fw,
&msm_8960_q6_mss_sw,
&msm_8960_riva,
&msm_pil_tzapps,
&msm_pil_vidc,
&msm8960_device_qup_spi_gsbi1,
&msm8960_device_qup_i2c_gsbi3,
&msm8960_device_qup_i2c_gsbi4,
&msm8960_device_qup_i2c_gsbi10,
&msm8960_device_qup_i2c_gsbi12,
&msm_slim_ctrl,
&msm_device_wcnss_wlan,
#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
&qcrypto_device,
#endif
#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
&qcedev_device,
#endif
#ifdef CONFIG_MSM_ROTATOR
&msm_rotator_device,
#endif
&msm_device_sps,
#ifdef CONFIG_MSM_FAKE_BATTERY
&fish_battery_device,
#endif
#ifdef CONFIG_ANDROID_PMEM
#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
&android_pmem_device,
&android_pmem_adsp_device,
#endif
&android_pmem_audio_device,
#endif
&msm_device_vidc,
&msm_device_bam_dmux,
&msm_fm_platform_init,
#ifdef CONFIG_HW_RANDOM_MSM
&msm_device_rng,
#endif
&msm_rpm_device,
#ifdef CONFIG_ION_MSM
&ion_dev,
#endif
&msm_rpm_log_device,
&msm_rpm_stat_device,
&msm_device_tz_log,
#ifdef CONFIG_MSM_QDSS
&msm_etb_device,
&msm_tpiu_device,
&msm_funnel_device,
&msm_etm_device,
#endif
&msm_device_dspcrashd_8960,
&msm8960_device_watchdog,
#ifdef MSM8930_PHASE_2
&gpio_keys_8930,
#endif
#ifdef CONFIG_MSM_RTB
&msm_rtb_device,
#endif
&msm8960_device_cache_erp,
};
static struct platform_device *cdp_devices[] __initdata = {
&msm8960_device_otg,
&msm8960_device_gadget_peripheral,
&msm_device_hsusb_host,
&android_usb_device,
&msm_pcm,
&msm_pcm_routing,
&msm_cpudai0,
&msm_cpudai1,
&msm_cpudai_hdmi_rx,
&msm_cpudai_bt_rx,
&msm_cpudai_bt_tx,
&msm_cpudai_fm_rx,
&msm_cpudai_fm_tx,
&msm_cpudai_auxpcm_rx,
&msm_cpudai_auxpcm_tx,
&msm_cpu_fe,
&msm_stub_codec,
&msm_kgsl_3d0,
#ifdef CONFIG_MSM_KGSL_2D
&msm_kgsl_2d0,
&msm_kgsl_2d1,
#endif
#ifdef CONFIG_MSM_GEMINI
&msm8960_gemini_device,
#endif
&msm_voice,
&msm_voip,
&msm_lpa_pcm,
&msm_cpudai_afe_01_rx,
&msm_cpudai_afe_01_tx,
&msm_cpudai_afe_02_rx,
&msm_cpudai_afe_02_tx,
&msm_pcm_afe,
&msm_compr_dsp,
&msm_cpudai_incall_music_rx,
&msm_cpudai_incall_record_rx,
&msm_cpudai_incall_record_tx,
&msm_pcm_hostless,
&msm_bus_apps_fabric,
&msm_bus_sys_fabric,
&msm_bus_mm_fabric,
&msm_bus_sys_fpb,
&msm_bus_cpss_fpb,
};
static void __init msm8930_i2c_init(void)
{
msm8960_device_qup_i2c_gsbi4.dev.platform_data =
&msm8960_i2c_qup_gsbi4_pdata;
msm8960_device_qup_i2c_gsbi3.dev.platform_data =
&msm8960_i2c_qup_gsbi3_pdata;
msm8960_device_qup_i2c_gsbi10.dev.platform_data =
&msm8960_i2c_qup_gsbi10_pdata;
msm8960_device_qup_i2c_gsbi12.dev.platform_data =
&msm8960_i2c_qup_gsbi12_pdata;
}
static void __init msm8930_gfx_init(void)
{
uint32_t soc_platform_version = socinfo_get_version();
if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
struct kgsl_device_platform_data *kgsl_3d0_pdata =
msm_kgsl_3d0.dev.platform_data;
kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000;
kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000;
}
}
static struct msm_cpuidle_state msm_cstates[] __initdata = {
{0, 0, "C0", "WFI",
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
{0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
{0, 2, "C2", "POWER_COLLAPSE",
MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
{1, 0, "C0", "WFI",
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
{1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
};
static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
[MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
.idle_supported = 1,
.suspend_supported = 1,
.idle_enabled = 0,
.suspend_enabled = 0,
},
[MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
.idle_supported = 1,
.suspend_supported = 1,
.idle_enabled = 0,
.suspend_enabled = 0,
},
[MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
.idle_supported = 1,
.suspend_supported = 1,
.idle_enabled = 1,
.suspend_enabled = 1,
},
[MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
.idle_supported = 0,
.suspend_supported = 1,
.idle_enabled = 0,
.suspend_enabled = 0,
},
[MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
.idle_supported = 1,
.suspend_supported = 1,
.idle_enabled = 0,
.suspend_enabled = 0,
},
[MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
.idle_supported = 1,
.suspend_supported = 0,
.idle_enabled = 1,
.suspend_enabled = 0,
},
};
static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
{
MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
100, 8000, 100000, 1,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
true,
2000, 6000, 60100000, 3000,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
false,
4200, 5000, 60350000, 3500,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
false,
6300, 4500, 65350000, 4800,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
false,
7000, 3500, 66600000, 5150,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
false,
11700, 2500, 67850000, 5500,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
false,
13800, 2000, 71850000, 6800,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
false,
29700, 500, 75850000, 8800,
},
{
MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
false,
29700, 0, 76350000, 9800,
},
};
static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
.mode = MSM_PM_BOOT_CONFIG_TZ,
};
#ifdef CONFIG_I2C
#define I2C_SURF 1
#define I2C_FFA (1 << 1)
#define I2C_RUMI (1 << 2)
#define I2C_SIM (1 << 3)
#define I2C_FLUID (1 << 4)
#define I2C_LIQUID (1 << 5)
struct i2c_registry {
u8 machs;
int bus;
struct i2c_board_info *info;
int len;
};
static void __init msm8930_init_hsic(void)
{
#ifdef CONFIG_USB_EHCI_MSM_HSIC
uint32_t version = socinfo_get_version();
pr_info("%s: version:%d mtp:%d\n", __func__,
SOCINFO_VERSION_MAJOR(version),
machine_is_msm8930_mtp());
if ((SOCINFO_VERSION_MAJOR(version) == 1) ||
machine_is_msm8930_mtp() ||
machine_is_msm8930_fluid())
return;
platform_device_register(&msm_device_hsic_host);
#endif
}
#ifdef CONFIG_ISL9519_CHARGER
static struct isl_platform_data isl_data __initdata = {
.valid_n_gpio = 0, /* Not required when notify-by-pmic */
.chg_detection_config = NULL, /* Not required when notify-by-pmic */
.max_system_voltage = 4200,
.min_system_voltage = 3200,
.chgcurrent = 1000, /* 1900, */
.term_current = 400, /* Need fine tuning */
.input_current = 2048,
};
static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
{
I2C_BOARD_INFO("isl9519q", 0x9),
.irq = 0, /* Not required when notify-by-pmic */
.platform_data = &isl_data,
},
};
#endif /* CONFIG_ISL9519_CHARGER */
static struct i2c_registry msm8960_i2c_devices[] __initdata = {
#ifdef CONFIG_ISL9519_CHARGER
{
I2C_LIQUID,
MSM_8930_GSBI10_QUP_I2C_BUS_ID,
isl_charger_i2c_info,
ARRAY_SIZE(isl_charger_i2c_info),
},
#endif /* CONFIG_ISL9519_CHARGER */
{
I2C_SURF | I2C_FFA | I2C_FLUID,
MSM_8930_GSBI3_QUP_I2C_BUS_ID,
cyttsp_info,
ARRAY_SIZE(cyttsp_info),
},
#ifndef MSM8930_PHASE_2
{
I2C_LIQUID,
MSM_8930_GSBI10_QUP_I2C_BUS_ID,
msm_isa1200_board_info,
ARRAY_SIZE(msm_isa1200_board_info),
},
#else
{
I2C_FFA | I2C_FLUID,
MSM_8930_GSBI10_QUP_I2C_BUS_ID,
msm_isa1200_board_info,
ARRAY_SIZE(msm_isa1200_board_info),
},
#endif
{
I2C_SURF,
MSM_8930_GSBI3_QUP_I2C_BUS_ID,
mxt_device_info_8930,
ARRAY_SIZE(mxt_device_info_8930),
},
};
#endif /* CONFIG_I2C */
static void __init register_i2c_devices(void)
{
#ifdef CONFIG_I2C
u8 mach_mask = 0;
int i;
#ifdef CONFIG_MSM_CAMERA
struct i2c_registry msm8930_camera_i2c_devices = {
I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
MSM_8930_GSBI4_QUP_I2C_BUS_ID,
msm8930_camera_board_info.board_info,
msm8930_camera_board_info.num_i2c_board_info,
};
#endif
/* Build the matching 'supported_machs' bitmask */
if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp())
mach_mask = I2C_SURF;
else if (machine_is_msm8930_fluid())
mach_mask = I2C_FLUID;
else if (machine_is_msm8930_mtp() || machine_is_msm8627_mtp())
mach_mask = I2C_FFA;
else
pr_err("unmatched machine ID in register_i2c_devices\n");
/* Run the array and install devices as appropriate */
for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
if (msm8960_i2c_devices[i].machs & mach_mask)
i2c_register_board_info(msm8960_i2c_devices[i].bus,
msm8960_i2c_devices[i].info,
msm8960_i2c_devices[i].len);
}
#ifdef CONFIG_MSM_CAMERA
if (msm8930_camera_i2c_devices.machs & mach_mask)
i2c_register_board_info(msm8930_camera_i2c_devices.bus,
msm8930_camera_i2c_devices.info,
msm8930_camera_i2c_devices.len);
#endif
#endif
}
static void __init msm8930_cdp_init(void)
{
if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
pr_err("meminfo_init() failed!\n");
msm_tsens_early_init(&msm_tsens_pdata);
BUG_ON(msm_rpm_init(&msm_rpm_data));
BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels,
ARRAY_SIZE(msm_rpmrs_levels)));
regulator_suppress_info_printing();
if (msm_xo_init())
pr_err("Failed to initialize XO votes\n");
platform_device_register(&msm8930_device_rpm_regulator);
msm_clock_init(&msm8960_clock_init_data);
msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
msm8930_init_gpiomux();
msm8960_device_qup_spi_gsbi1.dev.platform_data =
&msm8960_qup_spi_gsbi1_pdata;
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
/*
* TODO: When physical 8930/PM8038 hardware becomes
* available, remove this block or add the config
* option.
*/
#ifndef MSM8930_PHASE_2
msm8960_init_pmic();
#else
msm8930_init_pmic();
#endif
msm8930_i2c_init();
msm8930_gfx_init();
msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
msm_spm_l2_init(msm_spm_l2_data);
msm8930_init_buses();
platform_add_devices(msm_footswitch_devices,
msm_num_footswitch_devices);
platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
/*
* TODO: When physical 8930/PM8038 hardware becomes
* available, remove this block or add the config
* option.
*/
#ifndef MSM8930_PHASE_2
msm8960_pm8921_gpio_mpp_init();
#else
msm8930_pm8038_gpio_mpp_init();
#endif
platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
msm8930_init_hsic();
msm8930_init_cam();
msm8930_init_mmc();
acpuclk_init(&acpuclk_8930_soc_data);
if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp())
mxt_init_vkeys_8930();
register_i2c_devices();
msm8930_init_fb();
slim_register_board_info(msm_slim_devices,
ARRAY_SIZE(msm_slim_devices));
msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
msm_pm_data);
change_memory_power = &msm8930_change_memory_power;
BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
if (PLATFORM_IS_CHARM25())
platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
}
MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP")
.map_io = msm8930_map_io,
.reserve = msm8930_reserve,
.init_irq = msm8930_init_irq,
.handle_irq = gic_handle_irq,
.timer = &msm_timer,
.init_machine = msm8930_cdp_init,
.init_early = msm8930_allocate_memory_regions,
.init_very_early = msm8930_early_memory,
MACHINE_END
MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP")
.map_io = msm8930_map_io,
.reserve = msm8930_reserve,
.init_irq = msm8930_init_irq,
.handle_irq = gic_handle_irq,
.timer = &msm_timer,
.init_machine = msm8930_cdp_init,
.init_early = msm8930_allocate_memory_regions,
.init_very_early = msm8930_early_memory,
MACHINE_END
MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID")
.map_io = msm8930_map_io,
.reserve = msm8930_reserve,
.init_irq = msm8930_init_irq,
.handle_irq = gic_handle_irq,
.timer = &msm_timer,
.init_machine = msm8930_cdp_init,
.init_early = msm8930_allocate_memory_regions,
.init_very_early = msm8930_early_memory,
MACHINE_END
MACHINE_START(MSM8627_CDP, "QCT MSM8627 CDP")
.map_io = msm8930_map_io,
.reserve = msm8930_reserve,
.init_irq = msm8930_init_irq,
.handle_irq = gic_handle_irq,
.timer = &msm_timer,
.init_machine = msm8930_cdp_init,
.init_early = msm8930_allocate_memory_regions,
.init_very_early = msm8930_early_memory,
MACHINE_END
MACHINE_START(MSM8627_MTP, "QCT MSM8627 MTP")
.map_io = msm8930_map_io,
.reserve = msm8930_reserve,
.init_irq = msm8930_init_irq,
.handle_irq = gic_handle_irq,
.timer = &msm_timer,
.init_machine = msm8930_cdp_init,
.init_early = msm8930_allocate_memory_regions,
.init_very_early = msm8930_early_memory,
MACHINE_END
| animania260/android_ani-kernel_galaxy_reverb | arch/arm/mach-msm/board-8930.c | C | gpl-2.0 | 57,343 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2249,
1011,
2262,
1010,
3642,
13158,
7057,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1025,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# encoding: utf-8
# main.py, copyright 2014 by Marko Čibej <marko@cibej.org>
#
# This file is part of SvgMapper. Full sources and documentation
# are available here: https://github.com/tumbislav/SvgMapper
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# Full licence is in the file LICENSE and at http://www.gnu.org/copyleft/gpl.html
__author__ = 'Marko Čibej'
import argparse
from svgmapper import *
from helper import logger
def main(config, resources=None, maps=None, simulate=False):
logger.info('Starting job')
with SvgMapper() as mapper:
mapper.load_config(config, resources)
if maps:
mapper.replace_targets(maps)
if not simulate:
mapper.run()
logger.info('Finished')
def parse_args():
parser = argparse.ArgumentParser(description='Transform maps in SVG format in various ways.')
parser.add_argument('config_file', help='The name of the configuration file')
parser.add_argument('-r', '--resource', help='Additional resource file(s)',
action='append', metavar='resource_file')
parser.add_argument('-m', '--map', help='Map(s) to run instead of those listed in config file', metavar='map_name')
parser.add_argument('-v', '--verbosity', help='Set verbosity: 0=errors only, 1=warnings, 2=info, 3=debug',
type=int, choices=range(0, 3), dest='verbosity')
parser.add_argument('-l', '--log', help='Output to named log file', metavar=('level(0-3)', 'logFile'), nargs=2)
parser.add_argument('-s', '--simulate', help='Don\'t actually do anything, just parse all the configurations',
action='store_true')
return parser.parse_args()
def set_logging(the_log, verbosity):
log_levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
logger.setLevel(logging.DEBUG)
if the_log:
level = log_levels[int(the_log[0])]
lf = logging.FileHandler(the_log[1], mode='w')
lf.setLevel(level)
lf.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
logger.addHandler(lf)
lc = logging.StreamHandler()
if verbosity:
lc.setLevel(log_levels[verbosity])
else:
lc.setLevel(log_levels[2])
logger.addHandler(lc)
| tumbislav/SvgMapper | src/main.py | Python | gpl-3.0 | 2,923 | [
30522,
1001,
17181,
1024,
21183,
2546,
1011,
1022,
1001,
2364,
1012,
1052,
2100,
1010,
9385,
2297,
2011,
28003,
25022,
4783,
3501,
1026,
28003,
1030,
25022,
4783,
3501,
1012,
8917,
1028,
1001,
1001,
2023,
5371,
2003,
2112,
1997,
17917,
2169... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/// @file core/thread_sched.hh
// Uniqos -- Unique Operating System
// (C) 2012-2015 KATO Takeshi
//
// Uniqos is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// Uniqos is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CORE_THREAD_SCHED_HH_
#define CORE_THREAD_SCHED_HH_
#include <core/thread.hh>
class cpu_node;
class mempool;
class thread_sched
{
public:
thread_sched(cpu_node* _owner_cpu);
void init();
cause::pair<thread*> start();
cause::t attach_boot_thread(thread* t);
void attach(thread* t);
void detach(thread* t);
thread* sleep_current_thread_np();
void ready(thread* t);
void ready_np(thread* t);
thread* get_running_thread() { return running_thread; }
void set_running_thread(thread* t);
thread* switch_next_thread();
thread* exit_thread(thread* t);
void dump();
private:
void _ready(thread* t);
private:
cpu_node* const owner_cpu;
thread* running_thread;
spin_rwlock thread_state_lock;
typedef fchain<thread, &thread::thread_sched_chainnode> thread_chain;
thread_chain ready_queue;
thread_chain sleeping_queue;
};
#endif // include guard
| takeneco/uniqos | core/include/core/thread_sched.hh | C++ | gpl-3.0 | 1,615 | [
30522,
1013,
1013,
1013,
1030,
5371,
4563,
1013,
11689,
1035,
8040,
9072,
1012,
1044,
2232,
1013,
1013,
4895,
18515,
2891,
1011,
1011,
4310,
4082,
2291,
1013,
1013,
1006,
1039,
1007,
2262,
1011,
2325,
27496,
3138,
4048,
1013,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from .StateBase import StateBase
from neo.Core.Fixed8 import Fixed8
from neo.Core.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.Core.AssetType import AssetType
from neo.Core.UInt160 import UInt160
from neo.Core.Cryptography.Crypto import Crypto
from neo.Core.Cryptography.ECCurve import EllipticCurve, ECDSA
from neo.Core.Size import Size as s
from neo.Core.Size import GetVarSize
class AssetState(StateBase):
def Size(self):
return super(AssetState, self).Size() + s.uint256 + s.uint8 + GetVarSize(
self.Name) + self.Amount.Size() + self.Available.Size() + s.uint8 + s.uint8 + self.Fee.Size() + s.uint160 + self.Owner.Size() + s.uint160 + s.uint160 + s.uint32 + s.uint8
def __init__(self, asset_id=None, asset_type=None, name=None, amount=None, available=None,
precision=0, fee_mode=0, fee=None, fee_addr=None, owner=None,
admin=None, issuer=None, expiration=None, is_frozen=False):
"""
Create an instance.
Args:
asset_id (UInt256):
asset_type (neo.Core.AssetType):
name (str): the asset name.
amount (Fixed8):
available (Fixed8):
precision (int): number of decimals the asset has.
fee_mode (int):
fee (Fixed8):
fee_addr (UInt160): where the fee will be send to.
owner (EllipticCurve.ECPoint):
admin (UInt160): the administrator of the asset.
issuer (UInt160): the issuer of the asset.
expiration (UInt32): the block number on which the asset expires.
is_frozen (bool):
"""
self.AssetId = asset_id
self.AssetType = asset_type
self.Name = name
self.Amount = Fixed8(0) if amount is None else amount
self.Available = Fixed8(0) if available is None else available
self.Precision = precision
self.FeeMode = fee_mode
self.Fee = Fixed8(0) if fee is None else fee
self.FeeAddress = UInt160(data=bytearray(20)) if fee_addr is None else fee_addr
if owner is not None and type(owner) is not EllipticCurve.ECPoint:
raise Exception("Owner must be ECPoint Instance")
self.Owner = owner
self.Admin = admin
self.Issuer = issuer
self.Expiration = expiration
self.IsFrozen = is_frozen
# def Size(self):
# return super(AssetState, self).Size()
@staticmethod
def DeserializeFromDB(buffer):
"""
Deserialize full object.
Args:
buffer (bytes, bytearray, BytesIO): (Optional) data to create the stream from.
Returns:
AssetState:
"""
m = StreamManager.GetStream(buffer)
reader = BinaryReader(m)
account = AssetState()
account.Deserialize(reader)
StreamManager.ReleaseStream(m)
return account
def Deserialize(self, reader):
"""
Deserialize full object.
Args:
reader (neo.Core.IO.BinaryReader):
"""
super(AssetState, self).Deserialize(reader)
self.AssetId = reader.ReadUInt256()
self.AssetType = ord(reader.ReadByte())
self.Name = reader.ReadVarString()
position = reader.stream.tell()
try:
self.Amount = reader.ReadFixed8()
except Exception:
reader.stream.seek(position)
self.Amount = reader.ReadFixed8()
self.Available = reader.ReadFixed8()
self.Precision = ord(reader.ReadByte())
# fee mode
reader.ReadByte()
self.Fee = reader.ReadFixed8()
self.FeeAddress = reader.ReadUInt160()
self.Owner = ECDSA.Deserialize_Secp256r1(reader)
self.Admin = reader.ReadUInt160()
self.Issuer = reader.ReadUInt160()
self.Expiration = reader.ReadUInt32()
self.IsFrozen = reader.ReadBool()
def Serialize(self, writer):
"""
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
"""
super(AssetState, self).Serialize(writer)
writer.WriteUInt256(self.AssetId)
writer.WriteByte(self.AssetType)
writer.WriteVarString(self.Name)
if self.Amount.value > -1:
writer.WriteFixed8(self.Amount, unsigned=True)
else:
writer.WriteFixed8(self.Amount)
if type(self.Available) is not Fixed8:
raise Exception("AVAILABLE IS NOT FIXED 8!")
writer.WriteFixed8(self.Available, unsigned=True)
writer.WriteByte(self.Precision)
writer.WriteByte(b'\x00')
writer.WriteFixed8(self.Fee)
writer.WriteUInt160(self.FeeAddress)
self.Owner.Serialize(writer)
writer.WriteUInt160(self.Admin)
writer.WriteUInt160(self.Issuer)
writer.WriteUInt32(self.Expiration)
writer.WriteBool(self.IsFrozen)
def GetName(self):
"""
Get the asset name based on its type.
Returns:
str: 'NEO' or 'NEOGas'
"""
if self.AssetType == AssetType.GoverningToken:
return "NEO"
elif self.AssetType == AssetType.UtilityToken:
return "NEOGas"
if type(self.Name) is bytes:
return self.Name.decode('utf-8')
return self.Name
def ToJson(self):
"""
Convert object members to a dictionary that can be parsed as JSON.
Returns:
dict:
"""
return {
'assetId': self.AssetId.To0xString(),
'assetType': self.AssetType,
'name': self.GetName(),
'amount': self.Amount.value,
'available': self.Available.value,
'precision': self.Precision,
'fee': self.Fee.value,
'address': self.FeeAddress.ToString(),
'owner': self.Owner.ToString(),
'admin': Crypto.ToAddress(self.Admin),
'issuer': Crypto.ToAddress(self.Issuer),
'expiration': self.Expiration,
'is_frozen': self.IsFrozen
}
def Clone(self):
return AssetState(asset_id=self.AssetId, asset_type=self.AssetType, name=self.Name, amount=self.Amount, available=self.Available, precision=self.Precision, fee=self.Fee, fee_addr=self.FeeAddress, owner=self.Owner, admin=self.Admin, issuer=self.Issuer, expiration=self.Expiration, is_frozen=self.IsFrozen)
| hal0x2328/neo-python | neo/Core/State/AssetState.py | Python | mit | 6,477 | [
30522,
2013,
1012,
2110,
15058,
12324,
2110,
15058,
2013,
9253,
1012,
4563,
1012,
4964,
2620,
12324,
4964,
2620,
2013,
9253,
1012,
4563,
1012,
22834,
1012,
12441,
16416,
4063,
12324,
12441,
16416,
4063,
2013,
9253,
1012,
22834,
1012,
3638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package net.smartrss.admin.model.entity.enumerated;
/**
* Created by Alexander on 02.02.2016.
*/
public enum FeedAccountStatus {
ACTIVE,
INACTIVE
}
| alexborlis/pl_test | analyzer/src/main/java/net/smartrss/admin/model/entity/enumerated/FeedAccountStatus.java | Java | mit | 159 | [
30522,
7427,
5658,
1012,
6047,
2869,
2015,
1012,
4748,
10020,
1012,
2944,
1012,
9178,
1012,
4372,
17897,
9250,
1025,
1013,
1008,
1008,
1008,
2580,
2011,
3656,
2006,
6185,
1012,
6185,
1012,
2355,
1012,
1008,
1013,
2270,
4372,
2819,
5438,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const ISO6391 = require('iso-639-1');
module.exports = eleventy => {
// Transforms given date string into local date string
// Requires full-icu and NODE_ICU_DATA=node_modules/full-icu to function
eleventy.addFilter('date', (date, locale = 'en-US', format = {}) => new Date(date).toLocaleDateString(locale, format));
// Transforms given URL into a URL for the given locale
eleventy.addFilter('localeURL', (url, locale) => {
const changed = url.split('/');
if (changed[changed.length - 1] === '') {
changed.splice(-1, 1);
}
changed.splice(1, 1, locale);
return changed.join('/');
});
// Returns the native name for the language code
eleventy.addFilter('langName', code => ISO6391.getNativeName(code));
};
| chromeos/static-site-scaffold-modules | modules/static-site-scaffold/lib/11ty/l10n.js | JavaScript | apache-2.0 | 1,344 | [
30522,
1013,
1008,
1008,
1008,
9385,
10476,
8224,
11775,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
\chapter{Plugin Jenkins}
\section{Contexte initial}
Jenkins est un logiciel d'intégration continue, il est utilisé à SAP dans le contexte des tests . Son rôle est d'intégrer les différents projets, tels que configurés par l'utilisateur, et de mettre à disposition les résultats obtenus. Il permet d'avoir un retour régulier sur l'état des builds et du résultat de leurs tests.\\
Un plugin permettant une vision globale sur l'état des builds est déjà en place, Radiator. La figure \ref{figure:reportingPluginEnvironmentAfter} page \pageref{figure:reportingPluginEnvironmentAfter} présente son environnement d'utilisation. Nous pouvons y voir les développeurs et les ST qui alimentent le code hébergé sur Perforce. Jenkins utilise ce code dans ses diverses intégrations. Au centre, le plugin permet un retour visuel rapide des livraisons Perforce.\\
Ce plugin est aussi conçu pour fonctionner avec un autre plugin, le plugin Claim. Il permet à quelqu'un visitant la page d'un job en échec de le \textquote{claimer}, inscrivant son identifiant ainsi qu'un message à destination de quiconque visiterait cette même page. Ceci permet de signaler que l'investigation est en cours.\\
\begin{figure}[!h]
\centering
\includegraphics{images/reportingPluginEnvironmentAfter.jpg}
\caption{L'environnement d'utilisation du plugin}
\label{figure:reportingPluginEnvironmentAfter}
\end{figure}
Pour résumer ses caractéristiques principales, c'est un plugin qui permet :
\begin{itemize}
\item d'afficher un écran où chaque couleur correspond à un statut de build
\item de rassembler les jobs par leurs préfixes communs
\item de prendre en compte les claims
\end{itemize}
L'inconvénient est que le plugin Radiator ne permet pas de rajouter supplémentaire. Voici la liste des différents états gérés par ce plugin :
\begin{description}
\item[SUCCESS] Le projet compile correctement et tous les tests sont passés
\item[ABORTED] La compilation a été arrêtée en cours d'exécution
\item[FAILURE] Le code ne compile pas
\item[ERROR] Erreur de l'exécution dans Jenkins
\item[NOT BUILT] Le projet n'a pas été compilé
\item[UNSTABLE] Des tests JUnit ne sont pas passés mais le code compile
\item[CLAIM] Le job en échec a été claim par quelqu'un
\end{description}
Tel qu'il se présente le plugin ne permet pas de donner des informations autres que celles issues de Jenkins ou du plugin Claim. Il ne permet donc pas de donner de renseignements sur le defect associé à ce job. Tenir compte du defect permettrait de faire ressortir les régressions et autres erreurs, séparant ainsi les échecs pris en charge de ceux qui ne le sont pas.\\
\textbf{Problématique}\hfill \\ \indent
L'affichage n'est plus représentatif de la réalité, car le statut vert correspond en réalité deux status:
\begin{itemize}
\item la réussite d'un job
\item l'échec avec defect d'un job
\end{itemize}
L'objet de la mission est donc de pouvoir définir un nouveau statut dans l'affichage, pouvoir choisir quand ce statut sera utilisé et pouvoir ajuster l'ordre de leurs priorités.\\
La dernière chose importante est de faire en sorte que l'utilisation du plugin soit générique et pas bornée à notre contexte d'utilisation.
\textbf{La solution propos\'{e}e}\hfill \\ \indent
Suite à la mission précédente, nous avons maintenant accès aux informations relatives aux defects (celles-ci sont enregistrées dans les archives des builds sur le serveur Jenkins), dans un fichier XML que nous avons nommé test-defects (exemple page \pageref{testdefectxml}).\\
Dans un 1\up{er} temps, et en tant qu'exercice, il faudra réaliser un plugin offrant les mêmes possibilités d'affichage des statut des builds que Radiator. C'est-à-dire rassembler les jobs par préfixe et afficher le résultat général de tous ces groupes ainsi créés sur un unique écran. Ajouté aux caractéristiques, ce plugin doit pouvoir prendre en compte les informations du plugin Claim.\\ \indent
Dans un second temps, il faudra pouvoir ajouter un ou plusieurs statut(s) supplémentaire(s) et ré-ajuster leur ordre de priorité. L'ajout de ce nouveau statut doit être générique de sorte qu'un statut quelconque puisse être ajouté.\\
Le plugin est donc capable de receuillir des informations dans des fichiers sans savoir au préalable, comment seront structurées ces données. Rappelons que, lors de l'exécution des tests, un fichier test-defect est généré contenant la liste\footnote{Au format xml} des jobs avec defect (exemple page \pageref{testdefectxml}).
\lstinputlisting[language=java,label=testdefectxml]{scripts/test-defects.xml}
\section{Organisation du travail}
Tout au long de cette mission mon emploi du temps s'est articulé autour des meeting hebdomadaires, en fin de semaine, avec manager pour faire le point sur l'évolution du projet, présenter le produit lorsqu'il y avait une nouvelle fonctionnalité importante qui avait été implémentée et fixer les objectifs de la semaine qui allait suivre.\\
D'autre part, au minimum une heure par semaine, je faisait un \textquote{code review} avec Fabien, memebre de équipe et aussi commanditaire de ce projet.
\section{\'{E}tude préalable}
Les 1\up{er} impératifs ont été de maitriser le langage et les outils qui me permettraient de mener ce projet à terme. Je n'avais jamais entendu parler de Jenkins ou d'un quelconque logiciel d'intégration continue, et a forciori sur la manière de l'étendre.
Avant toute étude portant sur ce que j'allais développer, je me suis renseigné sur Jenkins. Je me suis rendu sur sa documentation officiel pour en apprendre plus à ce sujet.\\
Ensuite, j'ai installé Jenkins et quelques plugins, tels qu'ils sont utilisés à SAP, de manière à me familiariser avec ceux-ci. J'ai examiner le comportement de Jenkins en l'utilisant de la manière la plus simple possible.\\
\'{E}tant un logiciel d'intégration continu, j'ai créé des projets vides (avec implémentation de tests JUnit rudimentaires) avec différents comportements lors de la compilation. Cela m'a permis d'observer le comprtement de Jenkins.\\
J'ai d'abord commencé par avoir quelques problèmes à mettre en place mon Jenkins mais ja m'en suis sorti rapidement, les problèmes n'étant que des configurations de bases sur les chemin d'accès utilisés par Jenkins. En l'occurrence le \gls{JDK} et le répertoire Maven (par souci de rapidité j'ai utilisé maven pour créer mes projets, Jenkins devais donc conna\^{i}tre son emplacement pour avoir accès à mes configurations).\\
La première chose que j'ai remarqué, et qui a été ma principale incompréhension au début, était que je ne comprenais pas la différence entre les statuts Jenkins et les statuts JUnit. Ce qui portait à confusion était leur vocubulaire, qui était en contradiction. Par exemple le statut failure de Jenkins correspond au statut Unstable de Jenkins, pour complexifier un peu la chose il existe aussi un statut failure dans Jenkins!\\
J'ai donc fait un comparatif, simplifié, de ces différents
\vspace{0.5cm}
\begin{tabular}{|l|rr|c|c|}
\hline
\textbf{Description du projet} & \textbf{Status JUnit} & \textbf{Statut Jenkins}\\
\hline
projet vide et sans test & NA & Success\\
projet vide et avec test réussi & Passed & Success\\
projet vide avec test qui échoue & Failure & Unstable\\
projet avec erreur de compilation & NA & Error\\
\hline
\end{tabular}
\vspace{0.5cm}
Passée cette étape d'installations et de configurations, je me suis penché sur la marche à suivre pour implémenter un plugin Jenkins.\\
La principale difficulté que j'ai eu à développer ce plugin a été de trouver l'information, il est connu sur internet que la documentation de Jenkins, lorsqu'il s'agit de l'étendre, n'est pas claire. Mais la documentation officielle\footnote{\url{https://wiki.jenkins-ci.org/display/JENKINS/Extend+Jenkins}} offre un bel éventail de ce qu'il est possible de faire, décrit les différentes technologies constituant Jenkins et offre un tutoriel trivial mais suffisant pour comprendre les bases.\\
\section{Le 1\up{er} plugin}
Je me suis d'abord rendu sur la page du tutoriel officiel de Jenkins\footnote{\url{https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial}} afin d'obtenir un plugin fonctionnel avec lequel je pouvais faire mes expériences (il existe un plugin \textquote{Hello world} de base, celui à partir duquel j'ai fais une grande partie de mes expérimentations). Ensuite j'ai suivi un autre tutoriel\footnote{\url{https://cleantestcode.wordpress.com/2013/11/03/how-to-write-a-jenkins-plugin-part-1/}} non-officiel mais considérablement plus riche dans lequel j'ai appris une grande partie de ce que je sais aujourd'hui sur le développement d'un plugin Jenkins.\\
\subsection{Configuration}
Pour faire mon premier plugin je me suis basé sur le archétype proposé par \gls{Maven}, le fameux \textquote{Hello world}. Maven a besoin de configurations supplémentaires dans son settings.xml\footnote{Situé dans le répertoire \texttildelow/.m2} pour pouvoir récupérer les sources relatives à Jenkins. C'est-à-dire télécharger toutes les dépendances nécessaires à la compilation.\\
Dans \textquote{pluginGroups} il faut ajouter la ligne suivante :
\begin{lstlisting}
<pluginGroup>org.jenkins-ci.tools</pluginGroup>
\end{lstlisting}
Et dans \textquote{profiles} il faut ajouter le profil suivant :
\begin{lstlisting}[language=xml]
<profile>
<id>jenkins</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
\end{lstlisting}
L'attribut de la balise \textquote{activeByDefault} est, ici, à false, parce que c'est ce qui est conseillé sur beaucoup de sites. Mais j'ai eu des problèmes, que j'ai mis un certain temps à résoudre, à cause de cet attribut.\\
Grâce à \gls{Maven} il suffit de créer un répertoire et de se placer dedans (en ligne de commande), et d'exécuter la commande ci-dessous :
\begin{lstlisting}[language=xml]
mvn hpi:create
\end{lstlisting}
\`{A} partir de là, le projet est créé et j'ai pu commencer à travailler dessus.
\subsection{Génération du squelette}
\`{A} l'exécution de cette commande, il est demandé de renseigner le groupId et l'artifactId, le groupId peut être org.jenkins-ci.plugins et l'artifactId est le nom du plugin. Cette commande crée l'arborescence du projet ainsi que les fichiers de base.
\`{A} la génération du squelette du plugin nous obtenons un plugin qui compile, dont l'architecture est présentée figure \ref{figure:hpiCreate} page \pageref{figure:hpiCreate}.\\
\begin{figure}[h]
\centering
\includegraphics{images/hpiCreate.png}
\caption{Architecture d'un plugin Jenkins généré par maven}
\label{figure:hpiCreate}
\end{figure}
%\vspace{\stretch{1}}
Plusieurs fichiers sont générés et il est très important de conna\^{i}tre leur utilité car il est impossible de les déplacer ou de les renommer, c'est différents fichiers sont imposés par Jenkins. J'ai lis du temps à le comprendre et à chercher pourquoi mon code ne fonctionnait pas, et s'il existe un moyen de passer outre cette norme, je ne le connaîs pas encore :
\begin{tabular}{|l|p{0.7\linewidth}|}
\hline
\textbf{Nom du fichier} & \textbf{Description} \\
\hline
index.jelly & Description utilisée à la création d'une nouvelle instance du plugin \\
config.jelly & Correspond à la page d'une instance du plugin \\
global.jelly & Correspond à la page de configuration générale du plugin \\
HelloWorldBuilder.java & Implémentation d'exemple du plugin \\
help-name.html & Fichier d'aide à la configuration lorsque clic sur le symbole d'aide \\
help-useFrench.html & Fichier d'aide à la configuration lorsque clic sur le symbole d'aide \\
\hline
\end{tabular}
\subsection{Déploiement du squelette du plugin}
J'ai eu quelque difficulté à comprendre la logique d'intégration du plugin à Jenkins. Mais J'ai trouvé deux méthodes qui fonctionnent plutôt bien. Plutôt car j'ai rencontré certains problèmes avec ces deux procédés. \`{A} certains moments, alors je n'avais pas modifier le code, je ne pouvais plus appliquer l'une ou l'autre de ces méthodes car la compilation ne fonctionnait pas.\\
Ces deux méthodes sont les suivantes, mais je ne les aies pas appliquées très longtemps, car j'ai trouvé une bien meilleure solution pour exécuter mon plugin.\\
\textbf{Installation \textquote{\`{a} la main}}\hfill \\ \indent
En ligne de commande et depuis la racine du projet\footnote{\`{a} l'emplacement du POM.xml}, il faut exécuter la commande suivante :
\begin{lstlisting}
mvn clean install -Pjenkins
\end{lstlisting}
Celle-ci va télécharger les sources nécessaires, les compiler, exécuter les tests et, si tout se passe bien, générer le fichier .hpi dans le dossier target.\\
Ceci fait, il faut se rendre dans Jenkins (par exemple http://localhost:8080/), s'identifier et aller dans les paramètres avancés de gestion de plugins. Ici, il faut renseigner le chemin d'accès vers le .hpi (extension reconnue par Jenkins comme étant un plugin) et terminer.\\
\textbf{Commande du plugin Jenkins de maven}\hfill \\ \indent
En ligne de commande et depuis la racine du projet, il faut exécuter la commande suivante :
\begin{lstlisting}
mvn hpi:run -Djetty.port=8090 -Pjenkins
\end{lstlisting}
Cette commande va déployer une instances de Jenkins propre à maven, ce qui nous permet d'exécuter le plugin et le debugger. On peut très bien omettre de préciser le port utilisé si celui par défaut\footnote{port 8080} est disponible, mais il vaut mieux éviter. Une fois que le déploiement est terminé, maven signale que \textquote{Jenkins is fully up and running} nous pouvons aller voir Jenkins à l'url \emph{http://localhost:8080/jenkins} qui devrait ressembler à la figure \ref{figure:firstJenkinsWhenGenerateTheSkeletonPlugin} page \pageref{figure:firstJenkinsWhenGenerateTheSkeletonPlugin}.
\begin{figure}[!h]
\centering
\includegraphics[width=\textwidth]{images/firstJenkinsWhenGenerateTheSkeletonPlugin.png}
\caption{Jenkins à l'exécution de la commande maven qui l'encapsule}
\label{figure:firstJenkinsWhenGenerateTheSkeletonPlugin}
\end{figure}
\section{Implémentation de la base du nouveau plugin}
Jenkins possède beaucoup de points d'extensions et, à cette étape, il faut déterminer lequel, ainsi que la classe à étendre. Ce choix m'a posé beaucoup de problème au début et je n'ai jamais su comment répondre à cette question. Je me suis plutôt inspiré du plugin Radiator car celui-ci fonctionnait déjà!\\
Mais plus tard, quand j'ai commencé à être plus à l'aise avec ce concept de point d'extension j'ai pu déterminer une stratégie pour savoir lequel utiliser. Mais pour cela il faut déjà conna\^{i}tre Jenkins ainsi que son code. Par exemple, dans mon cas où je souhaite afficher la liste des jobs, en parcourant la liste des points d'extensions disponibles, nous pouvons trouver \emph{View}, dont l'une de ses implémentations est \emph{ListView}; sa description étant \textquote{Displays Jobs in a flat list view}. En observant la javadoc, on peut trouver la méthode nous donnant accès aux projetx associés à la vue (figure \ref{figure:listviewJavaDoc} page \pageref{figure:listviewJavaDoc}).
\subsection{Import du code dans l'IDE}
Au début de mon travail sur l'implémentation du plugin, j'ai rencontré beaucoup de problèmes pour compiler et tester mon plugin. Il m'était d'ailleurs complètement impossible de le debugger, je perdais beaucoup de temps avec toutes les manipulations que j'étais obligé de faire juste pour tester une ligne de code.\\
Mon premier IDE pour développer ce plugin était \gls{Eclipse}. \`{A} force de perdre autant de temps et de me retrouver confronter à des problèmes n'ayant rien à voir avec l'implémentation du plugin, j'ai fini par chercher une solution avec un membre de mon équipe. Alors nous sommes allé voir un membre d'une autre équipe qui avais déjà implémenter un plugin Jenkins pour en savoir plus sur la méthode qu'il avait adoptée. Au sortir de ce meeting j'ai aussitôt installé \gls{Netbeans}, lui aussi avais rencontré les mêmes problèmes que moi et avais aussi mis un certain temps à trouver la solution.\\
L'utilisation de Netbeans (et de son plugin Jenkins) facilite l'implémentation du code et, surtout, m'a permis de me focaliser sur les problèmes liés au plugin plutôt qu'à ceux liés aux outils de développement.\\
\subsection{Implémentation de la base du plugin}
Avant de pouvoir se concentrer sur l'implementation des fonctionnalités du plugin, il faut encore savoir où écrire le code et comment nommer ses fichier. Car comme j'ne ai déjà parlé précédemment, Jenkins respecte une architecture stricte pour aller chercher les différents codes que composent ses plugin. \`{A} l'heure actuelle, je n'ai pas encore compris toutes les subtilités de cette architecture.\\
Lors de mes première expériences, je me basais sur des plugin déjà existant pour voir comment les développeurs avaient nommés leurs différents fichiers. Mais plus tard, à force de fouiller dans le code de Jenkins, j'ai découvert une méthode bien plus efficace pour répondre à cette question.\\
Pour savoir comment doit se nommer le fichier de configuration de Listview, par exemple, je suis aller chercher l'emplacement de son fichier de configuration. L'arborescence de ce fichier, dans le code de Jenkins, est illustrée figure \ref{figure:listviewJavaDoc} page \pageref{figure:listviewJavaDoc}. Il convient maintenant de copier ce fichier et de le coller dans le répertoire \emph{ressources} de notre projet. Et voilà, j'ai dans mon plugin un fichier de configuration qui sera reconnu par Jenkins et contenant le code par défaut.\\
\begin{figure}[!h]
\centering
\includegraphics{images/listviewSearch.png}
\caption{Chemin d'accès au fichier de configuration par défaut}
\label{figure:listviewSearch}
\end{figure}
%Après quelques tests rapides, on s'aperçoit que beaucoup de code, css ou JavaScript, est exécuté lorsque l'on accède à la page. Il faut donc réinitialiser le css pour travailler dans de bonnes conditions. Premièrement, on supprime l'affichage du header, footer et side-panel de Jenkins (cf figure \ref{figure:cssInit} page \pageref{figure:cssInit}) et deuxièmement on supprime l'affichage du side-panel, après chargement de la page (cf figure \ref{figure:cssInitJS} page \pageref{figure:cssInitJS}).\\
%
%\begin{figure}[!h]
%\centering
%\includegraphics{images/cssInit.png}
%\caption{Initialisation des css avant chargement}
%\label{figure:cssInit}
%\end{figure}
%
%\begin{figure}[!h]
%\centering
%\includegraphics{images/cssInitJS.png}
%\caption{Initialisation des css après chargement}
%\label{figure:cssInitJS}
%\end{figure}
\section{Travail réalisé}
\`{A} partir du moment où j'ai compris la logique d'implémentation d'un plugin Jenkins, j'ai enfin pu me concentrer sur ma mission.\\
Je me suis fixé comme premier objectif d'afficher une nouvelle vue que j'aurais implémentée moi-même : typiquement un écran blanc n'affichant que chaine de caractère issue de mon implémentation \gls{Java}, cet objectif simple permet de faire le lien entre l'interface graphique, codée en jelly, et le code \gls{Java}.\\
J'ai trouvé dans la documentation de Jenkins les quelques éléments qui allais me permettre de réaliser ceci : les deux objets \textquote{it} et \textquote{from}, ces deux objets me permettent d'accéder à la classe principale de mon plugin. Il permettent d'accéder aux méthodes et propriétés de l'instance du plugin.\\
Les appels ne se font pas de la même manière mais se basent toujours sur ces deux objets.\\
L'accès aux attributs se fait en l'appelant simplement de la manière suivante :
\begin{lstlisting}
<j:set var="maVariable" value="${from.maPropiete}">
<j:set var="maVariable2" value="${from.maPropiete2}">
\end{lstlisting}
Cela permet de d'initialiser une variable jelly et de lui donner la valeur de la proprité souhaitée.
L'accès aux méthode se fait un peu différemment :
\begin{lstlisting}
%<j:invoke var="maVariable" on="${from}" method="nomDUneMehode">
\end{lstlisting}
Et de la même manière, cette exemple permet d'appeler une méthode depuis l'objet from dont le retour est placé dans la variable jelly.\\
La logique d'implémentation du jelly est assez simple en soit et je me la suit rapidement appropriée. J'ai trouvé très agréable d'utiliser aussi facilement mon \gls{Java} depuis mon jelly, car celui-ci est implémenté côte-à-côte avec le code html.\\
Grâce à ce code très simple, j'ai pu afficher ce que je voulais dans mon jelly en utilisant la notation jelly : \$\{maVariableJelly\}\\
\subsection{Construction d'une architecture en corrélation avec l'affichage souhaité}
Pour accéder aux différents jobs de Jenkins, il suffit de faire appel à l'une des méthodes de la classe mère : getItems(), retournant une liste de TopLevelItem. Toutes ces informations sont disponibles dans la javadoc du produit que j'ai longuement parcourue pour comprendre son fonctionnement. Mais malheureusement cet objet ne correspond pas vraiment à l'utilisation que je voulais en faire. J'ai donc créé une nouvelle classe : ProjectWrapper, comprenant cet objet ainsi que d'autres, plus spécifiques à mon plugin.\\
La méthode \gls{Java} que j'ai donc implémenté est la suivante :\\
\begin{lstlisting}
public List<ProjectWrapper> getSelectedJobs() {
List<ProjectWrapper> jobs = new ArrayList<ProjectWrapper>();
ProjectWrapper project;
for ( TopLevelItem item : super.getItems() ) {
if (item instanceof AbstractProject) {
project = new ProjectWrapper(this, (AbstractProject) item);
if (!project.getAbstractProject().isDisabled()) {
jobs.add(project);
}
}
}
return jobs;
}
\end{lstlisting}
Grâce à cette liste ainsi obtenue je pouvais avoir accès à la liste de mes jobs depuis mon interface graphique.\\
La plus grande difficulté que j'ai rencontré pour pouvoir afficher les jobs était de les afficher tels que je le voulais, autrement regroupés par préfixes qu'ils avaient en commun.\\
J'ai donc passé beaucoup de temps à construire une architecture qui me permttrait de réaliser cela, et je suis donc arrivé à créer un certain nombre de classes me permettant ceci.\\
Je développe en \gls{Java}, et pour respecter au mieux la logique de la programmation orientée objet, j'ai fais en sorte que mes objets \gls{Java} représentent vraiment les différents éléments de mon inerface graphique.\\
L'objet central de la logique que j'ai implémenté est le dashboard, celui-ci contenant la liste des différentes vues qui le compose, je l'ai nommé Dashboard!\\ Ensuite, chacune des vues intégrée à mon dashboard sont caractérisées par un préfixe (point commun à tous les projets qu'elle contient), un état dominant (état qui fera que la vue s'affiche de telle ou telle couleur) et d'une liste de projets. J'ai nommé cet objet ViewEntry.\\
Et pou finir, chacun des projets contenus dans une vue est caractérisé par un préfixe et un résultat personnalisé (personnalisé car un projet ne peut avoir qu'un seul état mais j'ai trois sources différentes pouvant influencer cet état : Jenkins, le plugin Claim ou un état choisi par l'utilisateur). Je l'ai nommé ProjectWrapper.\\
Chacun de ces objets possède un ensemble de comportement qui leur est propre. Par exemple, dans le cas du Dashboard, trier une liste de projets en une liste de vues (où tous les projets d'un vue on le même préfixe). Dans le cas de la ViewEntry, pouvoir ajouter un projet a sa liste de projets. Et dans le cas du ProjectWrapper, pouvoir fournir son préfixe s'il en a un, ou son statut.\\
Le diagramme de classe représentant cette architecture que j'ai ainsi construite est illustré page \pageref{figure:myDash}, et j'ai représenté l'algorithme me permettant d'obtenir mon Dashboard à partir d'une liste de ProjectWrapper page \pageref{figure:dashboardGenesis}
\begin{figure}[H]
\centering
\includegraphics[width=\textheight,angle=90]{images/myDash.jpg}
\caption{Diagramme de classe du plugin réalisé}
\label{figure:myDash}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=\textheight,angle=90]{images/dashboardGenesis.jpg}
\caption{Algorithme de création du Dashboard}
\label{figure:dashboardGenesis}
\end{figure}
\subsection{Affichage des jobs dans l'interface graphique}
Les objets \gls{Java} représentatifs de mes vues étant implémentés, l'objectif était maintenant de pouvoir les afficher correctement. Il me fallait donc dimensionner mes vues en fonction, d'une part du nombre de vues, et d'autre part, de la taille de l'écran.\\
J'ai d'abord voulu essayer de dimensionner les vues directement à l'affichage, dans l'interface graphique. Cela fonctionnait très bien, puisqu'à partir du Dashboard je pouvais récupérer les nombre de vues générées et ainsi les dimensionner en fonctions de la taille de l'écran. L'inconvénient de cette méthode était que la taille de l'écran n'étant pas accessible depuis le jelly j'étais obligé d'attribuer moi-même la valeur de la taille de l'écran. Cela ne m'a pas posé de problème au début mais lorsque j'ai essayé le plugin sur d'autre écrans, plus petits ou plus grands, le dimensionnement ne pouvait plus fonctionné.\\
J'ai donc opté pour la solution javascript. Je ne connaissais que très peu ce langage avant cet épisode et j'ai dû passer un peu de temps à l'apprendre. Ce qui a été plutôt rapide car je ne me contentais que de mettre en forme mes éléments html en modifiant mes feuilles de styles.\\
La solution la plus simple pour déterminer la largeur et la hauteur d'une vue a été, d'abord, de considérer que celles-ci seraient toutes de la même taille, et ensuite de baser ce calcul sur les dimensions du dashboard (celui-ci étant configuré de manière à occuper 100\% de l'espace disponible).\\
Concrètement, mon algorithme de dimensionnement est le suivant :
\begin{itemize}
\item Je calcule le carré minimum pouvant acceuillir toutes mes vues (4 vues impliquent un carré de 2, 6 vues impliquent un carré de 3, ...)
\item J'en déduis mon nombre de lignes en divisant le total des vues par le carré trouvé ( 6 \textbackslash 3 = 2 implique 2 lignes)
\item Si le résultat de la division n'est pas entier je rajoute une ligne (pour 7 vues j'aurais 2 lignes de 3 vues et 1 autre de 1)
\item De ces valeurs j'en déduis les dimensions de mes vues
\end{itemize}
J'ai appliqué quelques coefficients tenant compte du fait que les marges entre les vues sont constantes.\\
Le code javascript ainsi développé est ci-dessous :
\begin{lstlisting}
%breadcrumbarheight = $('div#breadcrumbBar').css("height").split("px")[0];
%h=h-breadcrumbarheight-15;
%var countOfViews = document.getElementById("hiddenCountOfViews").value;
%var captionSize = document.getElementById("hiddenCaptionSize");
%
%if(captionSize==null){
%captionSize=0;
%}else{
%captionSize=captionSize.value;
%}
%xdash = 0;
%while (countOfViews > xdash * xdash) {
%xdash++;
%}
%var countOfRows = Math.floor(countOfViews / xdash);
%
%if((countOfViews % xdash)!=0){
%countOfRows = countOfRows +1;
%}
%var viewheight = ((h - captionSize) / countOfRows) - 4*countOfRows;
%var viewwidth = (w / xdash) - 5*xdash;
\end{lstlisting}
Ce code fonctionnait très bien et j'ai donc voulu essayer mon plugin dans un contexte d'utilisation réelle, c'est-à-dire en intégrant mon plugin à Jenkins en utilisant le fichier d'installation .hpi.\\
J'ai eu la surprise de constater que, malgré que le dimensionnement se passait bien, tout le contenu de mon dashboard était décalé vers la droite d'une certaine distance qui restait la même quelle que soit la dimension de l'écran que j'utilisais.\\
J'ai passé beaucoup de temps à chercher ce qu'il se passait, sans comprendre d'où cela pouvait venir. J'ai cherché dans le plugin Radiator s'il prenait en compte autre chose que j'avais ignoré, mais sans résultat. \\
Je n'ai pas investigué longtemps dans le code car je ne pouvais rien trouver de cette manière. J'ai donc lancé les deux versions de Jenkins que j'avais, l'une en exécutant le plugin depuis Jenkins (où tout se comportait comme prévu) et l'autre (où le problème avait lieu).\\
De ces deux versions différentes j'ai analysé les deux codes sources des pages et ai écrit un petit programme java me permettant de faire ressortir les différences. Après un certain temps d'analyse j'ai remarqué qu'il y avait une différence entre les deux versions. L'un des éléments html, commun aux deux versions, ne possédait pas les mêmes classes. Je suis donc allé dans le code de Jenkins pour voir a quoi correspondait ce code, il s'agissait en fait d'une portion de l'écran (précisément le \textquote{side-panel}) qui était réservé au menu de Jenkins, et si le plugin Radiator ne rencontrait pas ce problème c'est que celui-ci avait été développé sur une version antérieure dans laquelle le positionnement ne se faisait pas de la même manière\footnote{voir \url{https://issues.jenkins-ci.org/browse/JENKINS-29659}}.\\
\'{E}tant au courant de la raison exacte du problème que j'ai rencontré j'ai pu le corriger en quelques lignes de JQuery ci-dessous :\\
\begin{lstlisting}
$("side-panel").removeClass("col-sm-9");
$("side-panel").removeClass("col-md-7");
$("side-panel").removeClass("col-lg-6");
$("side-panel").removeClass("col-xlg-4");
\end{lstlisting}
J'ai de nouveau testé mon plugin tel qu'il le serait réellement, tout fonctionnait comme je le désirais.\\
Ce problème a perduré longtemps parce que, ne sachant pas comment le résoudre, je l'ai laissé de côté en attendant d'avoir une meilleure idée. Avec le temps, accumulant de l'expérience tant avec les outils que j'utilisais qu'avec les langages que j'utilisais, j'ai eu cette idée qui m'a permis de résoudre ce problème en moins de deux heures.\\
%claim? priorité des status?
\subsection{Personnalisation des statuts}
J'avais donc à cette étape là un plugin me permettant d'afficher tous les jobs regroupés par préfixes dans des vues de la couleur représentative du statut jugé prioritaire par l'utilisateur. \`{A} ce niveau d'avancement de mon projet, le plugin possède déjà toutes les fonctionnalités de l'ancien plugin Radiator. \`{A} la seule différence que mon plugin permet de configurer l'ordre des priorités.\\
J'en arrivais maintenant à la fonctionnalité principale de mon plugin, raison d'être de mon projet : pouvoir configurer ses propres statuts se basant sur des fichiers xml.\\
La première question était de savoir comment récupérer ces fichiers xml.\\
La deuxième question, comment en extraire les résultats.\\
La troisième question, comment faire correspondre un résultat à un statut.\\
Lors de l'exécution des tests tous les fichiers générés sont enregistrés dans un répertoire d'archive (y compris les fichiers des résultats JUnit) je devais donc savoir comment y accéder. Pour répondre à cette question j'ai simplement récupérer toutes les informations disponibles dans un projet Jenkins jusqu'à tomber sur le répertoire du projet, duquel je suis parti pour me trouver dans le répertoire \textquote{archive}, le code me permettant d'avoir un objet File représentatif de ce dossier est le suivant :\\
\begin{lstlisting}
File files = new File(abstractProject.getBuildDir().getAbsolutePath() + "\\" + run.getId() + "\\archive");
\end{lstlisting}
Je peux maintenant tester l'existence d'un fichier (dont le nom est renseigné par l'utilisateur). Je devais pouvoir extraire une information de fichier, la méthode la plus simple, en considérant que j'ai affaire à un fichier xml, est d'utiliser un XPath pour obtenir mon information.\\
Je n'avais jamais utilisé cette technologie, bien que j'en connaissais son existence. Après quelques expérimentations j'ai obtenu un code fonctionnant bien me permettant, pour l'instant, de récupérer la valeur d'un attribut, que je pouvais retourner.\\
La vraie difficulté de cette partie à été d'implémenter une table dont les éléments sont \textquote{drag'n'droppable}. J'ai essayé un certain nombre de technologies, certaines correspondant tout à fait et étaient très faciles à utiliser mais dont le simple import de la libraire rendait le plugin inutilisable.\\
J'ai donc choisi de ne pas utiliser de librairie pour implémenter mon \textquote{drag'n'drop} et ai tout fait moi-même. Le \textquote{drag'n'drop}, uniquement des lignes d'un tableau étant plutôt facile à implémenter, j'ai pris le temps de le faire pour en retirer un résultat très satisfaisant.\\
Une fois la table implémentée il fallait, d'une part, pouvoir ajouter et supprimer des lignes, et d'autre part, que la modification de la table des statuts ait une influence sur la table des statuts personnalisés. Ceci à été assez difficile car l'ajout d'une ligne dans la table est exécuté par un code javascript contenant le code à ajouter. Ce qui nécessitait de modifier le code à deux endroits différents à la moindre modification de la table. Ensuite, les éléments à ajouter dans la ligne à ajouter, comme son identifiant, sont difficilement récupérables du simple fait que la génération ne se passe pas au même moment. Quand une table est générée, le jelly s'occupe d'incrémenter un variable pour identifier les lignes, mais quand je veux ajouter une ligne, non seulement, cette variable n'existe plus, mais aussi, je me trouve alors dans un code javascript.\\
J'ai donc passé beaucoup de temps à mettre en relation tous ces éléments, de manière à ce que l'interface graphique que l'utilisateur a sous les yeux soit complètement dynamique.
\section{Les échos de mon projet}
Lorsque je suis arrivé à un résultat satisfaisant il devenait nécessaire de présenter mon travail aux autres membres de mon équipe. J'ai donc préparer un PowerPoint pour étayer mes propos.\\
Ma première présentation, devant l'équipe ST Automation, s'est déroulée le jeudi 13 août 2015.\\
Mon auditoire n'a pas vraiment compris les détails de ce que je disais car je suis allé trop vite au début de la présentation et je n'ai pas pris le temps de clairement définir le domaine d'utilisation de mon plugin. De plus, une majorité des personnes présentes n'utilisait pas le vocabulaire que j'utilisais. L'autre point important, favorisant une certaine incompréhension de mon auditoire, était que je n'avais pas détaillé le contexte actuel, c'est-à-dire d'une part, l'utilisation du plugin Radiator, et d'autre part, la mécanique que j'ai mise en place précédemment pour obtenir un statut JCWB me permettant de le réutiliser. Pour terminer cette présentation, je n'ai pas fait de simulation de mon produit pour montrer à quoi il ressemble, cela aurait permis à mon auditoire de visualiser mon travail.\\
J'ai fait un seconde présentation, devant l'équipe SDK cette fois-ci. J'avais pris le temps de faire de nouveau slides me permettant de m'attarder un peu plus sur le contexte antérieur à mon projet et à la problématique, rencontrée. J'ai aussi fait la démonstration du plugin précédent et de mon plugin pour marquer les différences. Mon auditoire à beaucoup mieux compris le contexte de mon plugin. Le point que je devais encore améliorer était de bien séparer les différentes parties : avant, quel problème; aujourd'hui, quelle solution; dans le futur, toutes les fonctionnalités désirées.\\
Une autre présentation est prévue mais celle-ci n'est pas encore planifier à l'heure où j'écris ce rapport.\\
Je ferai beaucoup plus attention à présenter le contexte et je présenterai la problématique avec beaucoup plus soin de manière à ce que mon auditoire puisse comprendre tout le contexte dans lequel s'inscrit l'utilisation de mon plugin, et ainsi, son intérêt.\\
| syncrase/reportContrat | missions/JenkinsPlugin.tex | TeX | mit | 36,694 | [
30522,
1032,
3127,
1063,
13354,
2378,
11098,
1065,
1032,
2930,
1063,
6123,
2063,
3988,
1065,
11098,
9765,
4895,
7961,
9257,
1040,
1005,
8346,
3613,
1010,
6335,
9765,
21183,
24411,
2063,
1037,
20066,
18033,
3393,
6123,
2063,
4078,
5852,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php /* Smarty version 2.6.11, created on 2012-05-02 15:43:38
compiled from include/SugarFields/Fields/Phone/DetailView.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'sugarvar', 'include/SugarFields/Fields/Phone/DetailView.tpl', 38, false),array('function', 'sugarvar_connector', 'include/SugarFields/Fields/Phone/DetailView.tpl', 44, false),)), $this); ?>
{*
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
{if !empty(<?php echo smarty_function_sugarvar(array('key' => 'value','string' => true), $this);?>
)}
{assign var="phone_value" value=<?php echo smarty_function_sugarvar(array('key' => 'value','string' => true), $this);?>
}
{sugar_phone value=$phone_value usa_format="<?php if (! empty ( $this->_tpl_vars['vardef']['validate_usa_format'] )): ?>1<?php else: ?>0<?php endif; ?>"}
<?php if (! empty ( $this->_tpl_vars['displayParams']['enableConnectors'] )): echo smarty_function_sugarvar_connector(array('view' => 'DetailView'), $this);?>
<?php endif; ?>
{/if} | jmertic/sugarplatformdemo | cache/smarty/templates_c/%%FA^FA9^FA9EA62F%%DetailView.tpl.php | PHP | agpl-3.0 | 3,047 | [
30522,
1026,
1029,
25718,
30524,
1024,
4724,
1024,
4229,
9227,
2013,
2421,
1013,
5699,
15155,
1013,
4249,
1013,
3042,
1013,
6987,
8584,
1012,
1056,
24759,
1008,
1013,
1029,
1028,
1026,
1029,
25718,
5478,
1035,
2320,
1006,
6047,
2100,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Skeleton subclass for representing a row from the 'data2010' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.fbapp
*/
class Data2010 extends BaseData2010
{
}
| royrusso/fishbase | classes/fbapp/Data2010.php | PHP | apache-2.0 | 370 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
13526,
4942,
26266,
2005,
5052,
1037,
5216,
2013,
1996,
1005,
2951,
11387,
10790,
1005,
2795,
1012,
1008,
1008,
1008,
1008,
2017,
2323,
5587,
3176,
4725,
2000,
2023,
2465,
2000,
3113,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'use strict';
var path = require('path');
exports.name = 'cssmin';
//
// Output a config for the furnished block
// The context variable is used both to take the files to be treated
// (inFiles) and to output the one(s) created (outFiles).
// It aslo conveys whether or not the current process is the last of the pipe
//
exports.createConfig = function(context, block) {
var cfg = {files: []};
// FIXME: check context has all the needed info
var outfile = path.join(context.outDir, block.dest);
// Depending whether or not we're the last of the step we're not going to output the same thing
var files = {};
files.dest = outfile;
files.src = [];
context.inFiles.forEach(function(f) { files.src.push(path.join(context.inDir, f));} );
cfg.files.push(files);
context.outFiles = [block.dest];
return cfg;
};
| frangucc/gamify | www/sandbox/pals/node_modules/grunt-usemin/lib/config/cssmin.js | JavaScript | mit | 828 | [
30522,
1005,
2224,
9384,
1005,
1025,
13075,
4130,
1027,
5478,
1006,
1005,
4130,
1005,
1007,
1025,
14338,
1012,
2171,
1027,
1005,
20116,
6491,
2378,
1005,
1025,
1013,
1013,
1013,
1013,
6434,
1037,
9530,
8873,
2290,
2005,
1996,
19851,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you 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 org.elasticsearch.cluster.routing.allocation;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.routing.IndexRoutingTable;
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
import org.elasticsearch.cluster.routing.RoutingTable;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.routing.ShardRoutingState;
import org.elasticsearch.cluster.routing.TestShardRouting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.cluster.ESAllocationTestCase;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
/**
* A base testcase that allows to run tests based on the output of the CAT API
* The input is a line based cat/shards output like:
* kibana-int 0 p STARTED 2 24.8kb 10.202.245.2 r5-9-35
*
* the test builds up a clusterstate from the cat input and optionally runs a full balance on it.
* This can be used to debug cluster allocation decisions.
*/
public abstract class CatAllocationTestCase extends ESAllocationTestCase {
protected abstract Path getCatPath() throws IOException;
public void testRun() throws IOException {
Set<String> nodes = new HashSet<>();
Map<String, Idx> indices = new HashMap<>();
try (BufferedReader reader = Files.newBufferedReader(getCatPath(), StandardCharsets.UTF_8)) {
String line = null;
// regexp FTW
Pattern pattern = Pattern.compile("^(.+)\\s+(\\d)\\s+([rp])\\s+(STARTED|RELOCATING|INITIALIZING|UNASSIGNED)" +
"\\s+\\d+\\s+[0-9.a-z]+\\s+(\\d+\\.\\d+\\.\\d+\\.\\d+).*$");
while((line = reader.readLine()) != null) {
final Matcher matcher;
if ((matcher = pattern.matcher(line)).matches()) {
final String index = matcher.group(1);
Idx idx = indices.get(index);
if (idx == null) {
idx = new Idx(index);
indices.put(index, idx);
}
final int shard = Integer.parseInt(matcher.group(2));
final boolean primary = matcher.group(3).equals("p");
ShardRoutingState state = ShardRoutingState.valueOf(matcher.group(4));
String ip = matcher.group(5);
nodes.add(ip);
ShardRouting routing = TestShardRouting.newShardRouting(index, shard, ip, null, primary, state);
idx.add(routing);
logger.debug("Add routing {}", routing);
} else {
fail("can't read line: " + line);
}
}
}
logger.info("Building initial routing table");
MetaData.Builder builder = MetaData.builder();
RoutingTable.Builder routingTableBuilder = RoutingTable.builder();
for(Idx idx : indices.values()) {
IndexMetaData.Builder idxMetaBuilder = IndexMetaData.builder(idx.name).settings(settings(Version.CURRENT))
.numberOfShards(idx.numShards()).numberOfReplicas(idx.numReplicas());
for (ShardRouting shardRouting : idx.routing) {
if (shardRouting.active()) {
Set<String> allocationIds = idxMetaBuilder.getInSyncAllocationIds(shardRouting.id());
if (allocationIds == null) {
allocationIds = new HashSet<>();
} else {
allocationIds = new HashSet<>(allocationIds);
}
allocationIds.add(shardRouting.allocationId().getId());
idxMetaBuilder.putInSyncAllocationIds(shardRouting.id(), allocationIds);
}
}
IndexMetaData idxMeta = idxMetaBuilder.build();
builder.put(idxMeta, false);
IndexRoutingTable.Builder tableBuilder = new IndexRoutingTable.Builder(idxMeta.getIndex()).initializeAsRecovery(idxMeta);
Map<Integer, IndexShardRoutingTable> shardIdToRouting = new HashMap<>();
for (ShardRouting r : idx.routing) {
IndexShardRoutingTable refData = new IndexShardRoutingTable.Builder(r.shardId()).addShard(r).build();
if (shardIdToRouting.containsKey(r.getId())) {
refData = new IndexShardRoutingTable.Builder(shardIdToRouting.get(r.getId())).addShard(r).build();
}
shardIdToRouting.put(r.getId(), refData);
}
for (IndexShardRoutingTable t: shardIdToRouting.values()) {
tableBuilder.addIndexShard(t);
}
IndexRoutingTable table = tableBuilder.build();
routingTableBuilder.add(table);
}
MetaData metaData = builder.build();
RoutingTable routingTable = routingTableBuilder.build();
DiscoveryNodes.Builder builderDiscoNodes = DiscoveryNodes.builder();
for (String node : nodes) {
builderDiscoNodes.add(newNode(node));
}
ClusterState clusterState = ClusterState.builder(org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
.getDefault(Settings.EMPTY)).metaData(metaData).routingTable(routingTable).nodes(builderDiscoNodes.build()).build();
if (balanceFirst()) {
clusterState = rebalance(clusterState);
}
clusterState = allocateNew(clusterState);
}
protected abstract ClusterState allocateNew(ClusterState clusterState);
protected boolean balanceFirst() {
return true;
}
private ClusterState rebalance(ClusterState clusterState) {
RoutingTable routingTable;AllocationService strategy = createAllocationService(Settings.builder()
.build());
RoutingAllocation.Result routingResult = strategy.reroute(clusterState, "reroute");
clusterState = ClusterState.builder(clusterState).routingResult(routingResult).build();
int numRelocations = 0;
while (true) {
List<ShardRouting> initializing = clusterState.routingTable().shardsWithState(INITIALIZING);
if (initializing.isEmpty()) {
break;
}
logger.debug("Initializing shards: {}", initializing);
numRelocations += initializing.size();
routingResult = strategy.applyStartedShards(clusterState, initializing);
clusterState = ClusterState.builder(clusterState).routingResult(routingResult).build();
}
logger.debug("--> num relocations to get balance: {}", numRelocations);
return clusterState;
}
public class Idx {
final String name;
final List<ShardRouting> routing = new ArrayList<>();
public Idx(String name) {
this.name = name;
}
public void add(ShardRouting r) {
routing.add(r);
}
public int numReplicas() {
int count = 0;
for (ShardRouting msr : routing) {
if (msr.primary() == false && msr.id()==0) {
count++;
}
}
return count;
}
public int numShards() {
int max = 0;
for (ShardRouting msr : routing) {
if (msr.primary()) {
max = Math.max(msr.getId()+1, max);
}
}
return max;
}
}
}
| strahanjen/strahanjen.github.io | elasticsearch-master/core/src/test/java/org/elasticsearch/cluster/routing/allocation/CatAllocationTestCase.java | Java | bsd-3-clause | 8,869 | [
30522,
1013,
1008,
1008,
7000,
2000,
21274,
17310,
11140,
2104,
2028,
2030,
2062,
12130,
1008,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
1008,
2023,
2147,
2005,
3176,
2592,
4953,
9385,
1008,
6095,
1012,
21274,
17310,
11140,
159... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Blog based on symfony
### Requirement
- php
## Installation
```bash
$ git clone git@github.com:athlonUA/symfony-simple-blog.git
```
## Running
```bash
$ composer install
$ php app/console do:dat:cr
$ php app/console doctrine:schema:create
$ php app/console doctrine:fixtures:load
$ php app/console ass:in --symlink
$ php app/console ass:du
$ php app/console server:run
```
Go to the http://127.0.0.1:8000/ to run surf
| athlonUA/Symfony_blog_test | README.md | Markdown | mit | 427 | [
30522,
1001,
9927,
2241,
2006,
25353,
2213,
14876,
4890,
1001,
1001,
1001,
9095,
1011,
25718,
1001,
1001,
8272,
1036,
1036,
1036,
24234,
1002,
21025,
2102,
17598,
21025,
2102,
1030,
21025,
2705,
12083,
1012,
4012,
1024,
2012,
7317,
2239,
66... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* ff.h - a part of driver for RME Fireface series
*
* Copyright (c) 2015-2017 Takashi Sakamoto
*
* Licensed under the terms of the GNU General Public License, version 2.
*/
#ifndef SOUND_FIREFACE_H_INCLUDED
#define SOUND_FIREFACE_H_INCLUDED
#include <linux/device.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/sched/signal.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/rawmidi.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/hwdep.h>
#include <sound/firewire.h>
#include "../lib.h"
#include "../amdtp-stream.h"
#include "../iso-resources.h"
#define SND_FF_MAXIMIM_MIDI_QUADS 9
#define SND_FF_IN_MIDI_PORTS 2
#define SND_FF_OUT_MIDI_PORTS 2
#define SND_FF_REG_SYNC_STATUS 0x0000801c0000ull
/* For block write request. */
#define SND_FF_REG_FETCH_PCM_FRAMES 0x0000801c0000ull
#define SND_FF_REG_CLOCK_CONFIG 0x0000801c0004ull
enum snd_ff_stream_mode {
SND_FF_STREAM_MODE_LOW = 0,
SND_FF_STREAM_MODE_MID,
SND_FF_STREAM_MODE_HIGH,
SND_FF_STREAM_MODE_COUNT,
};
struct snd_ff_protocol;
struct snd_ff_spec {
const char *const name;
const unsigned int pcm_capture_channels[SND_FF_STREAM_MODE_COUNT];
const unsigned int pcm_playback_channels[SND_FF_STREAM_MODE_COUNT];
unsigned int midi_in_ports;
unsigned int midi_out_ports;
const struct snd_ff_protocol *protocol;
u64 midi_high_addr;
};
struct snd_ff {
struct snd_card *card;
struct fw_unit *unit;
struct mutex mutex;
spinlock_t lock;
bool registered;
struct delayed_work dwork;
const struct snd_ff_spec *spec;
/* To handle MIDI tx. */
struct snd_rawmidi_substream *tx_midi_substreams[SND_FF_IN_MIDI_PORTS];
struct fw_address_handler async_handler;
/* TO handle MIDI rx. */
struct snd_rawmidi_substream *rx_midi_substreams[SND_FF_OUT_MIDI_PORTS];
u8 running_status[SND_FF_OUT_MIDI_PORTS];
__le32 msg_buf[SND_FF_OUT_MIDI_PORTS][SND_FF_MAXIMIM_MIDI_QUADS];
struct work_struct rx_midi_work[SND_FF_OUT_MIDI_PORTS];
struct fw_transaction transactions[SND_FF_OUT_MIDI_PORTS];
ktime_t next_ktime[SND_FF_OUT_MIDI_PORTS];
bool rx_midi_error[SND_FF_OUT_MIDI_PORTS];
unsigned int rx_bytes[SND_FF_OUT_MIDI_PORTS];
unsigned int substreams_counter;
struct amdtp_stream tx_stream;
struct amdtp_stream rx_stream;
struct fw_iso_resources tx_resources;
struct fw_iso_resources rx_resources;
int dev_lock_count;
bool dev_lock_changed;
wait_queue_head_t hwdep_wait;
};
enum snd_ff_clock_src {
SND_FF_CLOCK_SRC_INTERNAL,
SND_FF_CLOCK_SRC_SPDIF,
SND_FF_CLOCK_SRC_ADAT1,
SND_FF_CLOCK_SRC_ADAT2,
SND_FF_CLOCK_SRC_WORD,
SND_FF_CLOCK_SRC_LTC,
/* TODO: perhaps TCO exists. */
};
struct snd_ff_protocol {
void (*handle_midi_msg)(struct snd_ff *ff, __le32 *buf, size_t length);
int (*begin_session)(struct snd_ff *ff, unsigned int rate);
void (*finish_session)(struct snd_ff *ff);
};
extern const struct snd_ff_protocol snd_ff_protocol_ff800;
extern const struct snd_ff_protocol snd_ff_protocol_ff400;
int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate,
enum snd_ff_clock_src *src);
int snd_ff_transaction_register(struct snd_ff *ff);
int snd_ff_transaction_reregister(struct snd_ff *ff);
void snd_ff_transaction_unregister(struct snd_ff *ff);
int amdtp_ff_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels);
int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
struct snd_pcm_runtime *runtime);
int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir);
int snd_ff_stream_get_multiplier_mode(enum cip_sfc sfc,
enum snd_ff_stream_mode *mode);
int snd_ff_stream_init_duplex(struct snd_ff *ff);
void snd_ff_stream_destroy_duplex(struct snd_ff *ff);
int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate);
void snd_ff_stream_stop_duplex(struct snd_ff *ff);
void snd_ff_stream_update_duplex(struct snd_ff *ff);
void snd_ff_stream_lock_changed(struct snd_ff *ff);
int snd_ff_stream_lock_try(struct snd_ff *ff);
void snd_ff_stream_lock_release(struct snd_ff *ff);
void snd_ff_proc_init(struct snd_ff *ff);
int snd_ff_create_midi_devices(struct snd_ff *ff);
int snd_ff_create_pcm_devices(struct snd_ff *ff);
int snd_ff_create_hwdep_devices(struct snd_ff *ff);
#endif
| qzhuyan/linux | sound/firewire/fireface/ff.h | C | gpl-2.0 | 4,433 | [
30522,
1013,
1008,
1008,
21461,
1012,
1044,
1011,
1037,
2112,
1997,
4062,
2005,
28549,
2063,
2543,
12172,
2186,
1008,
1008,
9385,
1006,
1039,
1007,
2325,
1011,
2418,
27006,
12914,
7842,
27052,
11439,
1008,
1008,
7000,
2104,
1996,
3408,
1997... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf-8 -*-
require 'spec_helper'
describe RailwayCompany do
describe :import do
let(:file_path) do
tempfile = Tempfile.new('railway_companies.csv')
tempfile << <<EOS
company_cd,rr_cd,company_name,company_name_k,company_name_h,company_name_r,company_url,company_type,e_status,e_sort
1,11,JR北海道,ジェイアールホッカイドウ,北海道旅客鉄道株式会社,JR北海道,http://www.jrhokkaido.co.jp/,1,0,1
2,11,JR東日本,ジェイアールヒガシニホン,東日本旅客鉄道株式会社,JR東日本,http://www.jreast.co.jp/,1,0,2
3,11,JR東海,ジェイアールトウカイ,東海旅客鉄道株式会社,JR東海,http://jr-central.co.jp/,1,0,3
4,11,JR西日本,ジェイアールニシニホン,西日本旅客鉄道株式会社,JR西日本,http://www.westjr.co.jp/,1,1,4
5,11,JR四国,ジェイアールシコク,四国旅客鉄道株式会社,JR四国,http://www.jr-shikoku.co.jp/,1,2,5
6,11,JR九州,ジェイアールキュウシュウ,九州旅客鉄道株式会社,JR九州,http://www.jrkyushu.co.jp/,1,2,6
EOS
tempfile.close
return tempfile.path
end
before do
RailwayCompany.import(file_path)
end
describe :imported_count do
subject { RailwayCompany.pluck(:id) }
it { should match_array [1, 2, 3] }
end
describe :first_company do
subject { RailwayCompany.find(1) }
its(:name) { should eq 'JR北海道' }
its(:railway_id) { should eq 11 }
its(:kana_name) { should eq 'ジェイアールホッカイドウ' }
its(:official_name) { should eq '北海道旅客鉄道株式会社' }
its(:abbreviated_name) { should eq 'JR北海道' }
its(:url) { should eq 'http://www.jrhokkaido.co.jp/' }
its(:company_type) { should eq 1 }
its(:sort) { should eq 1 }
end
end
end
| aonashi/jpstation | spec/models/railway_company_spec.rb | Ruby | mit | 1,833 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
5478,
1005,
28699,
1035,
2393,
2121,
1005,
6235,
2737,
9006,
9739,
2100,
2079,
6235,
1024,
12324,
2079,
2292,
1006,
1024,
5371,
1035,
4130,
1007,
2079,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- coding: utf-8 -*-
"""
This module put my utility functions
"""
__author__ = "Jiang Yu-Kuan <yukuan.jiang@gmail.com>"
__date__ = "2016/02/08 (initial version) ~ 2019/04/17 (last revision)"
import re
import os
import sys
#------------------------------------------------------------------------------
# File
#------------------------------------------------------------------------------
def save_utf8_file(fn, lines):
"""Save string lines into an UTF8 text files.
"""
with open(fn, "w") as out_file:
out_file.write("\n".join(lines).encode("utf-8"))
def main_basename(path):
r"""Return a main name of a basename of a given file path.
Example
-------
>>> main_basename('c:\code\langconv\MsgID.h')
'MsgID.h'
"""
base = os.path.basename(path)
base_main, _base_ext = os.path.splitext(base)
return base_main
#------------------------------------------------------------------------------
# Math
#------------------------------------------------------------------------------
def is_numeric(str):
try:
_offset = int(eval(str))
except:
return False
return True
#------------------------------------------------------------------------------
# String
#------------------------------------------------------------------------------
def replace_chars(text, replaced_pairs='', deleted_chars=''):
"""Return a char replaced text.
Arguments
---------
text -- the text
replaced_pairs -- the replaced chars
Example
-------
>>> replaced = [('a','b'), ('c','d')]
>>> removed = 'e'
>>> replace_chars('abcde', replaced, removed)
'bbdd'
"""
for old, new in replaced_pairs:
text = text.replace(old, new)
for ch in deleted_chars:
text = text.replace(ch, '')
return text
def camel_case(string):
"""Return camel case string from a space-separated string.
Example
-------
>>> camel_case('good job')
'GoodJob'
"""
return ''.join(w.capitalize() for w in string.split())
def replace_punctuations(text):
"""Replace punctuation characters with abbreviations for a string.
"""
punctuations = [
('?', 'Q'), # Q: question mark
('.', 'P'), # P: period; full stop
('!', 'E'), # E: exclamation mark
("'", 'SQ'), # SQ: single quotation mark; single quote
('"', 'DQ'), # DQ: double quotation mark; double quotes
('(', 'LP'), # LP: left parenthese
(')', 'RP'), # RP: right parenthese
(':', 'Cn'), # Cn: colon
(',', 'Ca'), # Ca: comma
(';', 'S'), # S: semicolon
]
deleted = '+-*/^=%$#@|\\<>{}[]'
return replace_chars(text, punctuations, deleted)
def remain_alnum(text):
"""Remain digits and English letters of a string.
"""
return ''.join(c for c in text if c.isalnum()
and ord(' ') <= ord(c) <= ord('z'))
#------------------------------------------------------------------------------
# For code generation
#------------------------------------------------------------------------------
def c_identifier(text):
"""Convert input text into an legal identifier in C.
Example
-------
>>> c_identifier("Hello World")
'HelloWorld'
>>> c_identifier("Anti-Shake")
'Antishake'
"""
if ' ' in text:
text = camel_case(text)
text = re.sub(r'\+\d+', lambda x: x.group().replace('+', 'P'), text)
text = re.sub(r'\-\d+', lambda x: x.group().replace('-', 'N'), text)
text = replace_punctuations(text)
return remain_alnum(text)
def wrap_header_guard(lines, h_fn):
"""Wrap a C header guard for a given line list.
"""
def underscore(txt):
"""Return an under_scores text from a CamelCase text.
This function will leave a CamelCase text unchanged.
"""
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', txt)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
h_fn_sig = '%s_H_' % underscore(main_basename(h_fn)).upper()
begin = ['#ifndef %s' % h_fn_sig]
begin += ['#define %s' % h_fn_sig, '', '']
end = ['', '', '#endif // %s' % h_fn_sig, '']
return begin + lines + end
def prefix_info(lines, software, version, author, comment_mark='//'):
"""Prefix information to the given lines with given comment-mark.
"""
prefix = ['%s Generated by the %s v%s' % (comment_mark,
software, version)]
prefix += ['%s !author: %s' % (comment_mark, author)]
prefix += ['%s !trail: %s %s' % (comment_mark,
os.path.basename(sys.argv[0]), ' '.join(sys.argv[1:]))]
return prefix + lines
| YorkJong/pyResourceLink | reslnk/myutil.py | Python | lgpl-3.0 | 4,850 | [
30522,
1001,
1011,
1008,
1011,
16861,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1000,
1000,
1000,
2023,
11336,
2404,
2026,
9710,
4972,
1000,
1000,
1000,
1035,
1035,
3166,
1035,
1035,
1027,
1000,
20613,
9805,
1011,
13970,
2319,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/** settings.js */
| majestrate/nntpchan | contrib/frontends/django/nntpchan/nntpchan/frontend/static/settings.js | JavaScript | mit | 19 | [
30522,
1013,
1008,
1008,
10906,
1012,
1046,
2015,
1008,
1013,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Copyright 2015 Dietrich Epp.
This file is part of Dash and the Jetpack Space Pirates. The Dash
and the Jetpack Space Pirates source code is distributed under the
terms of the MIT license. See LICENSE.txt for details. */
'use strict';
var glm = require('gl-matrix');
var vec2 = glm.vec2;
var color = require('./color');
var param = require('./param');
var physics = require('./physics');
function destroy(body) {
if (body.world) {
body.world.removeBody(body);
}
}
var Types = {};
/*
* Register entity types.
*
* category: The category name, or null.
* types: Mapping from type names to types
*/
function registerTypes(types, category) {
var prefix = category ? category + '.' : '';
_.forOwn(types, function(value, key) {
var inh = value.inherit, i;
if (inh) {
for (i = 0; i < inh.length; i++) {
_.defaults(value, inh[i]);
}
delete value.inherit;
}
var tname = prefix + key;
if (Types.hasOwnProperty(tname)) {
console.error('Duplicate type registered: ' + tname);
return;
}
Types[tname] = value;
});
}
function getType(type) {
return Types[type];
}
module.exports = {
destroy: destroy,
registerTypes: registerTypes,
getType: getType,
};
| depp/jetpack | src/entity.js | JavaScript | mit | 1,206 | [
30522,
1013,
1008,
9385,
2325,
22567,
4958,
2361,
1012,
2023,
5371,
2003,
2112,
1997,
11454,
1998,
1996,
6892,
23947,
2686,
8350,
1012,
1996,
11454,
1998,
1996,
6892,
23947,
2686,
8350,
3120,
3642,
2003,
5500,
2104,
1996,
3408,
1997,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::cell::DOMRefCell;
use dom::bindings::callback::ExceptionHandling;
use dom::bindings::codegen::Bindings::EventHandlerBinding::{OnErrorEventHandlerNonNull, EventHandlerNonNull};
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::FunctionBinding::Function;
use dom::bindings::codegen::Bindings::WindowBinding::{self, WindowMethods, FrameRequestCallback};
use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, EventTargetCast, WindowDerived};
use dom::bindings::global::global_object_for_js_object;
use dom::bindings::error::{report_pending_exception, Fallible};
use dom::bindings::error::Error::InvalidCharacter;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, Root, MutNullableHeap};
use dom::bindings::js::RootedReference;
use dom::bindings::num::Finite;
use dom::bindings::utils::{GlobalStaticData, Reflectable, WindowProxyHandler};
use dom::browsercontext::BrowsingContext;
use dom::console::Console;
use dom::crypto::Crypto;
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
use dom::document::{Document, DocumentHelpers};
use dom::element::Element;
use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId};
use dom::htmlelement::HTMLElement;
use dom::location::Location;
use dom::navigator::Navigator;
use dom::node::{window_from_node, TrustedNodeAddress, NodeHelpers, from_untrusted_node_address};
use dom::performance::Performance;
use dom::screen::Screen;
use dom::storage::Storage;
use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg};
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow};
use page::Page;
use script_task::{TimerSource, ScriptChan, ScriptPort, NonWorkerScriptChan};
use script_task::ScriptMsg;
use script_traits::ScriptControlChan;
use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
use webdriver_handlers::jsval_to_webdriver;
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType};
use devtools_traits::{TracingMetadata};
use msg::compositor_msg::ScriptListener;
use msg::constellation_msg::{LoadData, PipelineId, SubpageId, ConstellationChan, WindowSizeData, WorkerId};
use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult};
use net_traits::ResourceTask;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
use net_traits::storage_task::{StorageTask, StorageType};
use profile_traits::mem;
use string_cache::Atom;
use util::geometry::{self, Au, MAX_RECT};
use util::{breakpoint, opts};
use util::str::{DOMString,HTML_SPACE_CHARACTERS};
use euclid::{Point2D, Rect, Size2D};
use ipc_channel::ipc::IpcSender;
use js::jsapi::{Evaluate2, MutableHandleValue};
use js::jsapi::{JSContext, HandleValue};
use js::jsapi::{JS_GC, JS_GetRuntime, JSAutoCompartment, JSAutoRequest};
use js::rust::Runtime;
use js::rust::CompileOptionsWrapper;
use selectors::parser::PseudoElement;
use url::Url;
use libc;
use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD};
use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::cell::{Cell, Ref, RefMut, RefCell};
use std::collections::HashSet;
use std::default::Default;
use std::ffi::CString;
use std::io::{stdout, stderr, Write};
use std::mem as std_mem;
use std::rc::Rc;
use std::sync::Arc;
use std::sync::mpsc::TryRecvError::{Empty, Disconnected};
use std::sync::mpsc::{channel, Receiver};
use time;
/// Current state of the window object
#[derive(JSTraceable, Copy, Clone, Debug, PartialEq, HeapSizeOf)]
enum WindowState {
Alive,
Zombie, // Pipeline is closed, but the window hasn't been GCed yet.
}
/// Extra information concerning the reason for reflowing.
#[derive(Debug)]
pub enum ReflowReason {
CachedPageNeededReflow,
RefreshTick,
FirstLoad,
KeyEvent,
MouseEvent,
Query,
Timer,
Viewport,
WindowResize,
DOMContentLoaded,
DocumentLoaded,
ImageLoaded,
RequestAnimationFrame,
}
#[dom_struct]
#[derive(HeapSizeOf)]
pub struct Window {
eventtarget: EventTarget,
#[ignore_heap_size_of = "trait objects are hard"]
script_chan: Box<ScriptChan+Send>,
#[ignore_heap_size_of = "channels are hard"]
control_chan: ScriptControlChan,
console: MutNullableHeap<JS<Console>>,
crypto: MutNullableHeap<JS<Crypto>>,
navigator: MutNullableHeap<JS<Navigator>>,
#[ignore_heap_size_of = "channels are hard"]
image_cache_task: ImageCacheTask,
#[ignore_heap_size_of = "channels are hard"]
image_cache_chan: ImageCacheChan,
#[ignore_heap_size_of = "TODO(#6911) newtypes containing unmeasurable types are hard"]
compositor: DOMRefCell<ScriptListener>,
browsing_context: DOMRefCell<Option<BrowsingContext>>,
page: Rc<Page>,
performance: MutNullableHeap<JS<Performance>>,
navigation_start: u64,
navigation_start_precise: f64,
screen: MutNullableHeap<JS<Screen>>,
session_storage: MutNullableHeap<JS<Storage>>,
local_storage: MutNullableHeap<JS<Storage>>,
timers: TimerManager,
next_worker_id: Cell<WorkerId>,
/// For sending messages to the memory profiler.
#[ignore_heap_size_of = "channels are hard"]
mem_profiler_chan: mem::ProfilerChan,
/// For providing instructions to an optional devtools server.
#[ignore_heap_size_of = "channels are hard"]
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
/// For sending timeline markers. Will be ignored if
/// no devtools server
#[ignore_heap_size_of = "TODO(#6909) need to measure HashSet"]
devtools_markers: RefCell<HashSet<TimelineMarkerType>>,
#[ignore_heap_size_of = "channels are hard"]
devtools_marker_sender: RefCell<Option<IpcSender<TimelineMarker>>>,
/// A flag to indicate whether the developer tools have requested live updates of
/// page changes.
devtools_wants_updates: Cell<bool>,
next_subpage_id: Cell<SubpageId>,
/// Pending resize event, if any.
resize_event: Cell<Option<WindowSizeData>>,
/// Pipeline id associated with this page.
id: PipelineId,
/// Subpage id associated with this page, if any.
parent_info: Option<(PipelineId, SubpageId)>,
/// Unique id for last reflow request; used for confirming completion reply.
last_reflow_id: Cell<u32>,
/// Global static data related to the DOM.
dom_static: GlobalStaticData,
/// The JavaScript runtime.
#[ignore_heap_size_of = "Rc<T> is hard"]
js_runtime: DOMRefCell<Option<Rc<Runtime>>>,
/// A handle for communicating messages to the layout task.
#[ignore_heap_size_of = "channels are hard"]
layout_chan: LayoutChan,
/// A handle to perform RPC calls into the layout, quickly.
#[ignore_heap_size_of = "trait objects are hard"]
layout_rpc: Box<LayoutRPC+'static>,
/// The port that we will use to join layout. If this is `None`, then layout is not running.
#[ignore_heap_size_of = "channels are hard"]
layout_join_port: DOMRefCell<Option<Receiver<()>>>,
/// The current size of the window, in pixels.
window_size: Cell<Option<WindowSizeData>>,
/// Associated resource task for use by DOM objects like XMLHttpRequest
#[ignore_heap_size_of = "channels are hard"]
resource_task: Arc<ResourceTask>,
/// A handle for communicating messages to the storage task.
#[ignore_heap_size_of = "channels are hard"]
storage_task: StorageTask,
/// A handle for communicating messages to the constellation task.
#[ignore_heap_size_of = "channels are hard"]
constellation_chan: ConstellationChan,
/// Pending scroll to fragment event, if any
fragment_name: DOMRefCell<Option<String>>,
/// An enlarged rectangle around the page contents visible in the viewport, used
/// to prevent creating display list items for content that is far away from the viewport.
page_clip_rect: Cell<Rect<Au>>,
/// A counter of the number of pending reflows for this window.
pending_reflow_count: Cell<u32>,
/// A channel for communicating results of async scripts back to the webdriver server
#[ignore_heap_size_of = "channels are hard"]
webdriver_script_chan: RefCell<Option<IpcSender<WebDriverJSResult>>>,
/// The current state of the window object
current_state: Cell<WindowState>,
}
impl Window {
#[allow(unsafe_code)]
pub fn clear_js_runtime_for_script_deallocation(&self) {
unsafe {
*self.js_runtime.borrow_for_script_deallocation() = None;
*self.browsing_context.borrow_for_script_deallocation() = None;
self.current_state.set(WindowState::Zombie);
}
}
pub fn get_cx(&self) -> *mut JSContext {
self.js_runtime.borrow().as_ref().unwrap().cx()
}
pub fn script_chan(&self) -> Box<ScriptChan+Send> {
self.script_chan.clone()
}
pub fn image_cache_chan(&self) -> ImageCacheChan {
self.image_cache_chan.clone()
}
pub fn get_next_worker_id(&self) -> WorkerId {
let worker_id = self.next_worker_id.get();
let WorkerId(id_num) = worker_id;
self.next_worker_id.set(WorkerId(id_num + 1));
worker_id
}
pub fn pipeline(&self) -> PipelineId {
self.id
}
pub fn subpage(&self) -> Option<SubpageId> {
self.parent_info.map(|p| p.1)
}
pub fn parent_info(&self) -> Option<(PipelineId, SubpageId)> {
self.parent_info
}
pub fn new_script_pair(&self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>) {
let (tx, rx) = channel();
(box NonWorkerScriptChan(tx), box rx)
}
pub fn control_chan<'a>(&'a self) -> &'a ScriptControlChan {
&self.control_chan
}
pub fn image_cache_task<'a>(&'a self) -> &'a ImageCacheTask {
&self.image_cache_task
}
pub fn compositor<'a>(&'a self) -> RefMut<'a, ScriptListener> {
self.compositor.borrow_mut()
}
pub fn browsing_context<'a>(&'a self) -> Ref<'a, Option<BrowsingContext>> {
self.browsing_context.borrow()
}
pub fn page<'a>(&'a self) -> &'a Page {
&*self.page
}
pub fn storage_task(&self) -> StorageTask {
self.storage_task.clone()
}
}
// https://www.whatwg.org/html/#atob
pub fn base64_btoa(input: DOMString) -> Fallible<DOMString> {
// "The btoa() method must throw an InvalidCharacterError exception if
// the method's first argument contains any character whose code point
// is greater than U+00FF."
if input.chars().any(|c: char| c > '\u{FF}') {
Err(InvalidCharacter)
} else {
// "Otherwise, the user agent must convert that argument to a
// sequence of octets whose nth octet is the eight-bit
// representation of the code point of the nth character of
// the argument,"
let octets = input.chars().map(|c: char| c as u8).collect::<Vec<u8>>();
// "and then must apply the base64 algorithm to that sequence of
// octets, and return the result. [RFC4648]"
Ok(octets.to_base64(STANDARD))
}
}
// https://www.whatwg.org/html/#atob
pub fn base64_atob(input: DOMString) -> Fallible<DOMString> {
// "Remove all space characters from input."
// serialize::base64::from_base64 ignores \r and \n,
// but it treats the other space characters as
// invalid input.
fn is_html_space(c: char) -> bool {
HTML_SPACE_CHARACTERS.iter().any(|&m| m == c)
}
let without_spaces = input.chars()
.filter(|&c| ! is_html_space(c))
.collect::<String>();
let mut input = &*without_spaces;
// "If the length of input divides by 4 leaving no remainder, then:
// if input ends with one or two U+003D EQUALS SIGN (=) characters,
// remove them from input."
if input.len() % 4 == 0 {
if input.ends_with("==") {
input = &input[..input.len() - 2]
} else if input.ends_with("=") {
input = &input[..input.len() - 1]
}
}
// "If the length of input divides by 4 leaving a remainder of 1,
// throw an InvalidCharacterError exception and abort these steps."
if input.len() % 4 == 1 {
return Err(InvalidCharacter)
}
// "If input contains a character that is not in the following list of
// characters and character ranges, throw an InvalidCharacterError
// exception and abort these steps:
//
// U+002B PLUS SIGN (+)
// U+002F SOLIDUS (/)
// Alphanumeric ASCII characters"
if input.chars().any(|c| c != '+' && c != '/' && !c.is_alphanumeric()) {
return Err(InvalidCharacter)
}
match input.from_base64() {
Ok(data) => Ok(data.iter().map(|&b| b as char).collect::<String>()),
Err(..) => Err(InvalidCharacter)
}
}
impl<'a> WindowMethods for &'a Window {
// https://html.spec.whatwg.org/#dom-alert
fn Alert(self, s: DOMString) {
// Right now, just print to the console
// Ensure that stderr doesn't trample through the alert() we use to
// communicate test results.
let stderr = stderr();
let mut stderr = stderr.lock();
let stdout = stdout();
let mut stdout = stdout.lock();
writeln!(&mut stdout, "ALERT: {}", s).unwrap();
stdout.flush().unwrap();
stderr.flush().unwrap();
}
// https://html.spec.whatwg.org/multipage/#dom-window-close
fn Close(self) {
self.script_chan.send(ScriptMsg::ExitWindow(self.id.clone())).unwrap();
}
// https://html.spec.whatwg.org/multipage/#dom-document-0
fn Document(self) -> Root<Document> {
self.browsing_context().as_ref().unwrap().active_document()
}
// https://html.spec.whatwg.org/#dom-location
fn Location(self) -> Root<Location> {
self.Document().r().Location()
}
// https://html.spec.whatwg.org/#dom-sessionstorage
fn SessionStorage(self) -> Root<Storage> {
self.session_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Session))
}
// https://html.spec.whatwg.org/#dom-localstorage
fn LocalStorage(self) -> Root<Storage> {
self.local_storage.or_init(|| Storage::new(&GlobalRef::Window(self), StorageType::Local))
}
// https://developer.mozilla.org/en-US/docs/Web/API/Console
fn Console(self) -> Root<Console> {
self.console.or_init(|| Console::new(GlobalRef::Window(self)))
}
// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#dfn-GlobalCrypto
fn Crypto(self) -> Root<Crypto> {
self.crypto.or_init(|| Crypto::new(GlobalRef::Window(self)))
}
// https://html.spec.whatwg.org/#dom-frameelement
fn GetFrameElement(self) -> Option<Root<Element>> {
self.browsing_context().as_ref().unwrap().frame_element()
}
// https://html.spec.whatwg.org/#dom-navigator
fn Navigator(self) -> Root<Navigator> {
self.navigator.or_init(|| Navigator::new(self))
}
// https://html.spec.whatwg.org/#dom-windowtimers-settimeout
fn SetTimeout(self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
timeout,
IsInterval::NonInterval,
TimerSource::FromWindow(self.id.clone()),
self.script_chan.clone())
}
// https://html.spec.whatwg.org/#dom-windowtimers-settimeout
fn SetTimeout_(self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
timeout,
IsInterval::NonInterval,
TimerSource::FromWindow(self.id.clone()),
self.script_chan.clone())
}
// https://html.spec.whatwg.org/#dom-windowtimers-cleartimeout
fn ClearTimeout(self, handle: i32) {
self.timers.clear_timeout_or_interval(handle);
}
// https://html.spec.whatwg.org/#dom-windowtimers-setinterval
fn SetInterval(self, _cx: *mut JSContext, callback: Rc<Function>, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::FunctionTimerCallback(callback),
args,
timeout,
IsInterval::Interval,
TimerSource::FromWindow(self.id.clone()),
self.script_chan.clone())
}
// https://html.spec.whatwg.org/#dom-windowtimers-setinterval
fn SetInterval_(self, _cx: *mut JSContext, callback: DOMString, timeout: i32, args: Vec<HandleValue>) -> i32 {
self.timers.set_timeout_or_interval(TimerCallback::StringTimerCallback(callback),
args,
timeout,
IsInterval::Interval,
TimerSource::FromWindow(self.id.clone()),
self.script_chan.clone())
}
// https://html.spec.whatwg.org/#dom-windowtimers-clearinterval
fn ClearInterval(self, handle: i32) {
self.ClearTimeout(handle);
}
// https://html.spec.whatwg.org/multipage/#dom-window
fn Window(self) -> Root<Window> {
Root::from_ref(self)
}
// https://html.spec.whatwg.org/multipage/#dom-self
fn Self_(self) -> Root<Window> {
self.Window()
}
// https://www.whatwg.org/html/#dom-frames
fn Frames(self) -> Root<Window> {
self.Window()
}
// https://html.spec.whatwg.org/multipage/#dom-parent
fn Parent(self) -> Root<Window> {
self.parent().unwrap_or(self.Window())
}
// https://html.spec.whatwg.org/multipage/#dom-top
fn Top(self) -> Root<Window> {
let mut window = self.Window();
while let Some(parent) = window.parent() {
window = parent;
}
window
}
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/
// NavigationTiming/Overview.html#sec-window.performance-attribute
fn Performance(self) -> Root<Performance> {
self.performance.or_init(|| {
Performance::new(self, self.navigation_start,
self.navigation_start_precise)
})
}
global_event_handlers!();
event_handler!(unload, GetOnunload, SetOnunload);
error_event_handler!(error, GetOnerror, SetOnerror);
// https://developer.mozilla.org/en-US/docs/Web/API/Window/screen
fn Screen(self) -> Root<Screen> {
self.screen.or_init(|| Screen::new(self))
}
// https://html.spec.whatwg.org/multipage/#dom-windowbase64-btoa
fn Btoa(self, btoa: DOMString) -> Fallible<DOMString> {
base64_btoa(btoa)
}
// https://html.spec.whatwg.org/multipage/#dom-windowbase64-atob
fn Atob(self, atob: DOMString) -> Fallible<DOMString> {
base64_atob(atob)
}
/// https://html.spec.whatwg.org/multipage/#dom-window-requestanimationframe
fn RequestAnimationFrame(self, callback: Rc<FrameRequestCallback>) -> i32 {
let doc = self.Document();
let callback = move |now: f64| {
// TODO: @jdm The spec says that any exceptions should be suppressed;
callback.Call__(Finite::wrap(now), ExceptionHandling::Report).unwrap();
};
doc.r().request_animation_frame(Box::new(callback))
}
/// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe
fn CancelAnimationFrame(self, ident: i32) {
let doc = self.Document();
doc.r().cancel_animation_frame(ident);
}
// check-tidy: no specs after this line
fn Debug(self, message: DOMString) {
debug!("{}", message);
}
#[allow(unsafe_code)]
fn Gc(self) {
unsafe {
JS_GC(JS_GetRuntime(self.get_cx()));
}
}
fn Trap(self) {
breakpoint();
}
fn WebdriverCallback(self, cx: *mut JSContext, val: HandleValue) {
let rv = jsval_to_webdriver(cx, val);
let opt_chan = self.webdriver_script_chan.borrow_mut().take();
if let Some(chan) = opt_chan {
chan.send(rv).unwrap();
}
}
fn WebdriverTimeout(self) {
let opt_chan = self.webdriver_script_chan.borrow_mut().take();
if let Some(chan) = opt_chan {
chan.send(Err(WebDriverJSError::Timeout)).unwrap();
}
}
// https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle
fn GetComputedStyle(self,
element: &HTMLElement,
pseudo: Option<DOMString>) -> Root<CSSStyleDeclaration> {
// Steps 1-4.
let pseudo = match pseudo.map(|s| s.to_ascii_lowercase()) {
Some(ref pseudo) if pseudo == ":before" || pseudo == "::before" =>
Some(PseudoElement::Before),
Some(ref pseudo) if pseudo == ":after" || pseudo == "::after" =>
Some(PseudoElement::After),
_ => None
};
// Step 5.
CSSStyleDeclaration::new(self, element, pseudo, CSSModificationAccess::Readonly)
}
}
pub trait WindowHelpers {
fn clear_js_runtime(self);
fn init_browsing_context(self, doc: &Document, frame_element: Option<&Element>);
fn load_url(self, url: Url);
fn handle_fire_timer(self, timer_id: TimerId);
fn force_reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason);
fn reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason);
fn join_layout(self);
fn layout(&self) -> &LayoutRPC;
fn content_box_query(self, content_box_request: TrustedNodeAddress) -> Rect<Au>;
fn content_boxes_query(self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>>;
fn client_rect_query(self, node_geometry_request: TrustedNodeAddress) -> Rect<i32>;
fn resolved_style_query(self, element: TrustedNodeAddress,
pseudo: Option<PseudoElement>, property: &Atom) -> Option<String>;
fn offset_parent_query(self, node: TrustedNodeAddress) -> (Option<Root<Element>>, Rect<Au>);
fn handle_reflow_complete_msg(self, reflow_id: u32);
fn set_fragment_name(self, fragment: Option<String>);
fn steal_fragment_name(self) -> Option<String>;
fn set_window_size(self, size: WindowSizeData);
fn window_size(self) -> Option<WindowSizeData>;
fn get_url(self) -> Url;
fn resource_task(self) -> ResourceTask;
fn mem_profiler_chan(self) -> mem::ProfilerChan;
fn devtools_chan(self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>>;
fn layout_chan(self) -> LayoutChan;
fn constellation_chan(self) -> ConstellationChan;
fn windowproxy_handler(self) -> WindowProxyHandler;
fn get_next_subpage_id(self) -> SubpageId;
fn layout_is_idle(self) -> bool;
fn get_pending_reflow_count(self) -> u32;
fn add_pending_reflow(self);
fn set_resize_event(self, event: WindowSizeData);
fn steal_resize_event(self) -> Option<WindowSizeData>;
fn set_page_clip_rect_with_new_viewport(self, viewport: Rect<f32>) -> bool;
fn set_devtools_wants_updates(self, value: bool);
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Root<Window>>;
fn thaw(self);
fn freeze(self);
fn need_emit_timeline_marker(self, timeline_type: TimelineMarkerType) -> bool;
fn emit_timeline_marker(self, marker: TimelineMarker);
fn set_devtools_timeline_marker(self,
marker: TimelineMarkerType,
reply: IpcSender<TimelineMarker>);
fn drop_devtools_timeline_markers(self);
fn set_webdriver_script_chan(self, chan: Option<IpcSender<WebDriverJSResult>>);
fn is_alive(self) -> bool;
fn parent(self) -> Option<Root<Window>>;
}
pub trait ScriptHelpers {
fn evaluate_js_on_global_with_result(self, code: &str,
rval: MutableHandleValue);
fn evaluate_script_on_global_with_result(self, code: &str, filename: &str,
rval: MutableHandleValue);
}
impl<'a, T: Reflectable> ScriptHelpers for &'a T {
fn evaluate_js_on_global_with_result(self, code: &str,
rval: MutableHandleValue) {
self.evaluate_script_on_global_with_result(code, "", rval)
}
#[allow(unsafe_code)]
fn evaluate_script_on_global_with_result(self, code: &str, filename: &str,
rval: MutableHandleValue) {
let this = self.reflector().get_jsobject();
let global = global_object_for_js_object(this.get());
let cx = global.r().get_cx();
let _ar = JSAutoRequest::new(cx);
let globalhandle = global.r().reflector().get_jsobject();
let code: Vec<u16> = code.utf16_units().collect();
let filename = CString::new(filename).unwrap();
let _ac = JSAutoCompartment::new(cx, globalhandle.get());
let options = CompileOptionsWrapper::new(cx, filename.as_ptr(), 0);
unsafe {
if Evaluate2(cx, options.ptr, code.as_ptr() as *const i16,
code.len() as libc::size_t,
rval) == 0 {
debug!("error evaluating JS string");
report_pending_exception(cx, globalhandle.get());
}
}
}
}
impl<'a> WindowHelpers for &'a Window {
fn clear_js_runtime(self) {
let document = self.Document();
NodeCast::from_ref(document.r()).teardown();
// The above code may not catch all DOM objects
// (e.g. DOM objects removed from the tree that haven't
// been collected yet). Forcing a GC here means that
// those DOM objects will be able to call dispose()
// to free their layout data before the layout task
// exits. Without this, those remaining objects try to
// send a message to free their layout data to the
// layout task when the script task is dropped,
// which causes a panic!
self.Gc();
self.current_state.set(WindowState::Zombie);
*self.js_runtime.borrow_mut() = None;
*self.browsing_context.borrow_mut() = None;
}
/// Reflows the page unconditionally. This method will wait for the layout thread to complete
/// (but see the `TODO` below). If there is no window size yet, the page is presumed invisible
/// and no reflow is performed.
///
/// TODO(pcwalton): Only wait for style recalc, since we have off-main-thread layout.
fn force_reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason) {
let document = self.Document();
let root = document.r().GetDocumentElement();
let root = match root.r() {
Some(root) => root,
None => return,
};
let root = NodeCast::from_ref(root);
let window_size = match self.window_size.get() {
Some(window_size) => window_size,
None => return,
};
debug!("script: performing reflow for goal {:?} reason {:?}", goal, reason);
if self.need_emit_timeline_marker(TimelineMarkerType::Reflow) {
let marker = TimelineMarker::new("Reflow".to_owned(), TracingMetadata::IntervalStart);
self.emit_timeline_marker(marker);
}
// Layout will let us know when it's done.
let (join_chan, join_port) = channel();
{
let mut layout_join_port = self.layout_join_port.borrow_mut();
*layout_join_port = Some(join_port);
}
let last_reflow_id = &self.last_reflow_id;
last_reflow_id.set(last_reflow_id.get() + 1);
// On debug mode, print the reflow event information.
if opts::get().relayout_event {
debug_reflow_events(&goal, &query_type, &reason);
}
// Send new document and relevant styles to layout.
let reflow = box ScriptReflow {
reflow_info: Reflow {
goal: goal,
page_clip_rect: self.page_clip_rect.get(),
},
document_root: root.to_trusted_node_address(),
window_size: window_size,
script_chan: self.control_chan.clone(),
script_join_chan: join_chan,
id: last_reflow_id.get(),
query_type: query_type,
};
let LayoutChan(ref chan) = self.layout_chan;
chan.send(Msg::Reflow(reflow)).unwrap();
debug!("script: layout forked");
self.join_layout();
self.pending_reflow_count.set(0);
if self.need_emit_timeline_marker(TimelineMarkerType::Reflow) {
let marker = TimelineMarker::new("Reflow".to_owned(), TracingMetadata::IntervalEnd);
self.emit_timeline_marker(marker);
}
}
/// Reflows the page if it's possible to do so and the page is dirty. This method will wait
/// for the layout thread to complete (but see the `TODO` below). If there is no window size
/// yet, the page is presumed invisible and no reflow is performed.
///
/// TODO(pcwalton): Only wait for style recalc, since we have off-main-thread layout.
fn reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason) {
let document = self.Document();
let root = document.r().GetDocumentElement();
let root = match root.r() {
Some(root) => root,
None => return,
};
let root = NodeCast::from_ref(root);
if query_type == ReflowQueryType::NoQuery && !root.get_has_dirty_descendants() {
debug!("root has no dirty descendants; avoiding reflow (reason {:?})", reason);
return
}
self.force_reflow(goal, query_type, reason)
}
// FIXME(cgaebel): join_layout is racey. What if the compositor triggers a
// reflow between the "join complete" message and returning from this
// function?
/// Sends a ping to layout and waits for the response. The response will arrive when the
/// layout task has finished any pending request messages.
fn join_layout(self) {
let mut layout_join_port = self.layout_join_port.borrow_mut();
if let Some(join_port) = std_mem::replace(&mut *layout_join_port, None) {
match join_port.try_recv() {
Err(Empty) => {
info!("script: waiting on layout");
join_port.recv().unwrap();
}
Ok(_) => {}
Err(Disconnected) => {
panic!("Layout task failed while script was waiting for a result.");
}
}
debug!("script: layout joined")
}
}
fn layout(&self) -> &LayoutRPC {
&*self.layout_rpc
}
fn content_box_query(self, content_box_request: TrustedNodeAddress) -> Rect<Au> {
self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::ContentBoxQuery(content_box_request),
ReflowReason::Query);
self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxResponse(rect) = self.layout_rpc.content_box();
rect
}
fn content_boxes_query(self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>> {
self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::ContentBoxesQuery(content_boxes_request),
ReflowReason::Query);
self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxesResponse(rects) = self.layout_rpc.content_boxes();
rects
}
fn client_rect_query(self, node_geometry_request: TrustedNodeAddress) -> Rect<i32> {
self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::NodeGeometryQuery(node_geometry_request),
ReflowReason::Query);
self.layout_rpc.node_geometry().client_rect
}
fn resolved_style_query(self,
element: TrustedNodeAddress,
pseudo: Option<PseudoElement>,
property: &Atom) -> Option<String> {
self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::ResolvedStyleQuery(element, pseudo, property.clone()),
ReflowReason::Query);
let ResolvedStyleResponse(resolved) = self.layout_rpc.resolved_style();
resolved
}
fn offset_parent_query(self, node: TrustedNodeAddress) -> (Option<Root<Element>>, Rect<Au>) {
self.reflow(ReflowGoal::ForScriptQuery,
ReflowQueryType::OffsetParentQuery(node),
ReflowReason::Query);
let response = self.layout_rpc.offset_parent();
let js_runtime = self.js_runtime.borrow();
let js_runtime = js_runtime.as_ref().unwrap();
let element = match response.node_address {
Some(parent_node_address) => {
let node = from_untrusted_node_address(js_runtime.rt(),
parent_node_address);
let element = ElementCast::to_ref(node.r());
element.map(Root::from_ref)
}
None => {
None
}
};
(element, response.rect)
}
fn handle_reflow_complete_msg(self, reflow_id: u32) {
let last_reflow_id = self.last_reflow_id.get();
if last_reflow_id == reflow_id {
*self.layout_join_port.borrow_mut() = None;
}
}
fn init_browsing_context(self, doc: &Document, frame_element: Option<&Element>) {
let mut browsing_context = self.browsing_context.borrow_mut();
*browsing_context = Some(BrowsingContext::new(doc, frame_element));
(*browsing_context).as_mut().unwrap().create_window_proxy();
}
/// Commence a new URL load which will either replace this window or scroll to a fragment.
fn load_url(self, url: Url) {
match url.fragment {
Some(fragment) => {
self.script_chan.send(ScriptMsg::TriggerFragment(self.id, fragment)).unwrap();
},
None => {
self.script_chan.send(ScriptMsg::Navigate(self.id, LoadData::new(url))).unwrap();
}
}
}
fn handle_fire_timer(self, timer_id: TimerId) {
self.timers.fire_timer(timer_id, self);
self.reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery, ReflowReason::Timer);
}
fn set_fragment_name(self, fragment: Option<String>) {
*self.fragment_name.borrow_mut() = fragment;
}
fn steal_fragment_name(self) -> Option<String> {
self.fragment_name.borrow_mut().take()
}
fn set_window_size(self, size: WindowSizeData) {
self.window_size.set(Some(size));
}
fn window_size(self) -> Option<WindowSizeData> {
self.window_size.get()
}
fn get_url(self) -> Url {
let doc = self.Document();
doc.r().url()
}
fn resource_task(self) -> ResourceTask {
(*self.resource_task).clone()
}
fn mem_profiler_chan(self) -> mem::ProfilerChan {
self.mem_profiler_chan.clone()
}
fn devtools_chan(self) -> Option<IpcSender<ScriptToDevtoolsControlMsg>> {
self.devtools_chan.clone()
}
fn layout_chan(self) -> LayoutChan {
self.layout_chan.clone()
}
fn constellation_chan(self) -> ConstellationChan {
self.constellation_chan.clone()
}
fn windowproxy_handler(self) -> WindowProxyHandler {
WindowProxyHandler(self.dom_static.windowproxy_handler.0)
}
fn get_next_subpage_id(self) -> SubpageId {
let subpage_id = self.next_subpage_id.get();
let SubpageId(id_num) = subpage_id;
self.next_subpage_id.set(SubpageId(id_num + 1));
subpage_id
}
fn layout_is_idle(self) -> bool {
self.layout_join_port.borrow().is_none()
}
fn get_pending_reflow_count(self) -> u32 {
self.pending_reflow_count.get()
}
fn add_pending_reflow(self) {
self.pending_reflow_count.set(self.pending_reflow_count.get() + 1);
}
fn set_resize_event(self, event: WindowSizeData) {
self.resize_event.set(Some(event));
}
fn steal_resize_event(self) -> Option<WindowSizeData> {
let event = self.resize_event.get();
self.resize_event.set(None);
event
}
fn set_page_clip_rect_with_new_viewport(self, viewport: Rect<f32>) -> bool {
// We use a clipping rectangle that is five times the size of the of the viewport,
// so that we don't collect display list items for areas too far outside the viewport,
// but also don't trigger reflows every time the viewport changes.
static VIEWPORT_EXPANSION: f32 = 2.0; // 2 lengths on each side plus original length is 5 total.
let proposed_clip_rect = geometry::f32_rect_to_au_rect(
viewport.inflate(viewport.size.width * VIEWPORT_EXPANSION,
viewport.size.height * VIEWPORT_EXPANSION));
let clip_rect = self.page_clip_rect.get();
if proposed_clip_rect == clip_rect {
return false;
}
let had_clip_rect = clip_rect != MAX_RECT;
if had_clip_rect && !should_move_clip_rect(clip_rect, viewport) {
return false;
}
self.page_clip_rect.set(proposed_clip_rect);
// If we didn't have a clip rect, the previous display doesn't need rebuilding
// because it was built for infinite clip (MAX_RECT).
had_clip_rect
}
fn set_devtools_wants_updates(self, value: bool) {
self.devtools_wants_updates.set(value);
}
// https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Root<Window>> {
None
}
fn thaw(self) {
self.timers.resume();
// Push the document title to the compositor since we are
// activating this document due to a navigation.
let document = self.Document();
document.r().title_changed();
}
fn freeze(self) {
self.timers.suspend();
}
fn need_emit_timeline_marker(self, timeline_type: TimelineMarkerType) -> bool {
let markers = self.devtools_markers.borrow();
markers.contains(&timeline_type)
}
fn emit_timeline_marker(self, marker: TimelineMarker) {
let sender = self.devtools_marker_sender.borrow();
let sender = sender.as_ref().expect("There is no marker sender");
sender.send(marker).unwrap();
}
fn set_devtools_timeline_marker(self,
marker: TimelineMarkerType,
reply: IpcSender<TimelineMarker>) {
*self.devtools_marker_sender.borrow_mut() = Some(reply);
self.devtools_markers.borrow_mut().insert(marker);
}
fn drop_devtools_timeline_markers(self) {
self.devtools_markers.borrow_mut().clear();
*self.devtools_marker_sender.borrow_mut() = None;
}
fn set_webdriver_script_chan(self, chan: Option<IpcSender<WebDriverJSResult>>) {
*self.webdriver_script_chan.borrow_mut() = chan;
}
fn is_alive(self) -> bool {
self.current_state.get() == WindowState::Alive
}
fn parent(self) -> Option<Root<Window>> {
let browsing_context = self.browsing_context();
let browsing_context = browsing_context.as_ref().unwrap();
browsing_context.frame_element().map(|frame_element| {
let window = window_from_node(frame_element.r());
// FIXME(https://github.com/rust-lang/rust/issues/23338)
let r = window.r();
let context = r.browsing_context();
context.as_ref().unwrap().active_window()
})
}
}
impl Window {
pub fn new(runtime: Rc<Runtime>,
page: Rc<Page>,
script_chan: Box<ScriptChan+Send>,
image_cache_chan: ImageCacheChan,
control_chan: ScriptControlChan,
compositor: ScriptListener,
image_cache_task: ImageCacheTask,
resource_task: Arc<ResourceTask>,
storage_task: StorageTask,
mem_profiler_chan: mem::ProfilerChan,
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
constellation_chan: ConstellationChan,
layout_chan: LayoutChan,
id: PipelineId,
parent_info: Option<(PipelineId, SubpageId)>,
window_size: Option<WindowSizeData>)
-> Root<Window> {
let layout_rpc: Box<LayoutRPC> = {
let (rpc_send, rpc_recv) = channel();
let LayoutChan(ref lchan) = layout_chan;
lchan.send(Msg::GetRPC(rpc_send)).unwrap();
rpc_recv.recv().unwrap()
};
let win = box Window {
eventtarget: EventTarget::new_inherited(EventTargetTypeId::Window),
script_chan: script_chan,
image_cache_chan: image_cache_chan,
control_chan: control_chan,
console: Default::default(),
crypto: Default::default(),
compositor: DOMRefCell::new(compositor),
page: page,
navigator: Default::default(),
image_cache_task: image_cache_task,
mem_profiler_chan: mem_profiler_chan,
devtools_chan: devtools_chan,
browsing_context: DOMRefCell::new(None),
performance: Default::default(),
navigation_start: time::get_time().sec as u64,
navigation_start_precise: time::precise_time_ns() as f64,
screen: Default::default(),
session_storage: Default::default(),
local_storage: Default::default(),
timers: TimerManager::new(),
next_worker_id: Cell::new(WorkerId(0)),
id: id,
parent_info: parent_info,
dom_static: GlobalStaticData::new(),
js_runtime: DOMRefCell::new(Some(runtime.clone())),
resource_task: resource_task,
storage_task: storage_task,
constellation_chan: constellation_chan,
page_clip_rect: Cell::new(MAX_RECT),
fragment_name: DOMRefCell::new(None),
last_reflow_id: Cell::new(0),
resize_event: Cell::new(None),
next_subpage_id: Cell::new(SubpageId(0)),
layout_chan: layout_chan,
layout_rpc: layout_rpc,
layout_join_port: DOMRefCell::new(None),
window_size: Cell::new(window_size),
pending_reflow_count: Cell::new(0),
current_state: Cell::new(WindowState::Alive),
devtools_marker_sender: RefCell::new(None),
devtools_markers: RefCell::new(HashSet::new()),
devtools_wants_updates: Cell::new(false),
webdriver_script_chan: RefCell::new(None),
};
WindowBinding::Wrap(runtime.cx(), win)
}
}
fn should_move_clip_rect(clip_rect: Rect<Au>, new_viewport: Rect<f32>) -> bool{
let clip_rect = Rect::new(Point2D::new(clip_rect.origin.x.to_f32_px(),
clip_rect.origin.y.to_f32_px()),
Size2D::new(clip_rect.size.width.to_f32_px(),
clip_rect.size.height.to_f32_px()));
// We only need to move the clip rect if the viewport is getting near the edge of
// our preexisting clip rect. We use half of the size of the viewport as a heuristic
// for "close."
static VIEWPORT_SCROLL_MARGIN_SIZE: f32 = 0.5;
let viewport_scroll_margin = new_viewport.size * VIEWPORT_SCROLL_MARGIN_SIZE;
(clip_rect.origin.x - new_viewport.origin.x).abs() <= viewport_scroll_margin.width ||
(clip_rect.max_x() - new_viewport.max_x()).abs() <= viewport_scroll_margin.width ||
(clip_rect.origin.y - new_viewport.origin.y).abs() <= viewport_scroll_margin.height ||
(clip_rect.max_y() - new_viewport.max_y()).abs() <= viewport_scroll_margin.height
}
fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason: &ReflowReason) {
let mut debug_msg = "****".to_owned();
debug_msg.push_str(match *goal {
ReflowGoal::ForDisplay => "\tForDisplay",
ReflowGoal::ForScriptQuery => "\tForScriptQuery",
});
debug_msg.push_str(match *query_type {
ReflowQueryType::NoQuery => "\tNoQuery",
ReflowQueryType::ContentBoxQuery(_n) => "\tContentBoxQuery",
ReflowQueryType::ContentBoxesQuery(_n) => "\tContentBoxesQuery",
ReflowQueryType::NodeGeometryQuery(_n) => "\tNodeGeometryQuery",
ReflowQueryType::ResolvedStyleQuery(_, _, _) => "\tResolvedStyleQuery",
ReflowQueryType::OffsetParentQuery(_n) => "\tOffsetParentQuery",
});
debug_msg.push_str(match *reason {
ReflowReason::CachedPageNeededReflow => "\tCachedPageNeededReflow",
ReflowReason::RefreshTick => "\tRefreshTick",
ReflowReason::FirstLoad => "\tFirstLoad",
ReflowReason::KeyEvent => "\tKeyEvent",
ReflowReason::MouseEvent => "\tMouseEvent",
ReflowReason::Query => "\tQuery",
ReflowReason::Timer => "\tTimer",
ReflowReason::Viewport => "\tViewport",
ReflowReason::WindowResize => "\tWindowResize",
ReflowReason::DOMContentLoaded => "\tDOMContentLoaded",
ReflowReason::DocumentLoaded => "\tDocumentLoaded",
ReflowReason::ImageLoaded => "\tImageLoaded",
ReflowReason::RequestAnimationFrame => "\tRequestAnimationFrame",
});
println!("{}", debug_msg);
}
impl WindowDerived for EventTarget {
fn is_window(&self) -> bool {
self.type_id() == &EventTargetTypeId::Window
}
}
| tempbottle/servo | components/script/dom/window.rs | Rust | mpl-2.0 | 46,783 | [
30522,
1013,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,
1996,
3408,
1997,
1996,
9587,
5831,
4571,
2270,
1008,
6105,
1010,
1058,
1012,
1016,
1012,
1014,
1012,
2065,
1037,
6100,
1997,
1996,
6131,
2140,
2001,
2025,
5500,
2007,
2023,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
** PTYWindow.h
**
** Copyright (c) 2002, 2003
**
** Author: Fabian, Ujwal S. Setlur
** Initial code by Kiichi Kusama
**
** Project: iTerm
**
** Description: NSWindow subclass. Implements smart window placement and blur.
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#import <Cocoa/Cocoa.h>
@protocol PTYWindowDelegateProtocol<NSObject,NSWindowDelegate >
- (BOOL)lionFullScreen;
- (void)windowWillShowInitial;
- (void)toggleTraditionalFullScreenMode;
@end
@interface PTYWindow : NSWindow
@property(nonatomic, readonly) int screenNumber;
@property(nonatomic, readonly, getter=isTogglingLionFullScreen) BOOL togglingLionFullScreen;
- (void)smartLayout;
- (void)setLayoutDone;
- (void)enableBlur:(double)radius;
- (void)disableBlur;
- (void)setRestoreState:(NSObject *)restoreState;
// Returns the approximate fraction of this window that is occluded by other windows in this app.
- (double)approximateFractionOccluded;
// See comments in iTermDelayedTitleSetter for why this is so.
- (void)delayedSetTitle:(NSString *)title;
@end
@interface PTYWindow (Private)
// Private NSWindow method, needed to avoid ghosting when using transparency.
- (BOOL)_setContentHasShadow:(BOOL)contentHasShadow;
@end
| choppsv1/iTerm2 | sources/PTYWindow.h | C | gpl-2.0 | 1,915 | [
30522,
1013,
1008,
1008,
1008,
13866,
2100,
11101,
5004,
1012,
1044,
1008,
1008,
1008,
1008,
9385,
1006,
1039,
1007,
2526,
1010,
2494,
1008,
1008,
1008,
1008,
3166,
1024,
21174,
1010,
1057,
3501,
13476,
1055,
1012,
2275,
7630,
2099,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
title: Svett
tag: svett
active: false
url: https://www.facebook.com/svettifi/
template: association.pug
---
Navnet Svett spiller på den populært utbredte stereotypen av informatikere. Mange ser på informatikere som svette «nerder». Vi velger å spille videre på dette med et glimt i øyet.
**Formål:** Foreningens formål å fremme studenters interesse for spesielle informatiske fagområder. Fokuset vil ligge på å dele dybdekunnskap om fagrelaterte emner i sosiale omgivelser.
**Aktiviteter:** Vi arrangerer foredrag, workshops og konkurranser. Ved å fokusere på dybdekunnskap håper vi å kunne åpne flere studenters øyne for mer spesialiserte deler av pensum. Vi vil forsøke å introdusere medstudenter til dypere og mer tekniske aspekter ved den informatiske verden mens vi har det gøy. | megoth/ifi-ordenen | contents/association/svett/index.md | Markdown | mit | 813 | [
30522,
1011,
1011,
1011,
2516,
1024,
17917,
6582,
6415,
1024,
17917,
6582,
3161,
1024,
6270,
24471,
2140,
1024,
16770,
1024,
1013,
1013,
7479,
1012,
9130,
1012,
4012,
1013,
17917,
18319,
8873,
1013,
23561,
1024,
2523,
1012,
16405,
2290,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2015 Layer. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.layer.atlas.messenger;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Locale;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.layer.atlas.Atlas;
import com.layer.atlas.Atlas.Participant;
import com.layer.atlas.Atlas.Tools;
import com.layer.atlas.AtlasMessageComposer;
import com.layer.atlas.AtlasMessagesList;
import com.layer.atlas.AtlasMessagesList.Cell;
import com.layer.atlas.AtlasMessagesList.ItemClickListener;
import com.layer.atlas.AtlasParticipantPicker;
import com.layer.atlas.AtlasTypingIndicator;
import com.layer.atlas.cells.ImageCell;
import com.layer.atlas.messenger.MessengerApp.keys;
import com.layer.sdk.LayerClient;
import com.layer.sdk.changes.LayerChangeEvent;
import com.layer.sdk.listeners.LayerChangeEventListener;
import com.layer.sdk.messaging.Conversation;
import com.layer.sdk.messaging.ConversationOptions;
import com.layer.sdk.messaging.Message;
import com.layer.sdk.messaging.MessagePart;
import com.layer.sdk.query.Predicate;
import com.layer.sdk.query.Query;
import com.layer.sdk.query.SortDescriptor;
/**
* @author Oleg Orlov
* @since 14 Apr 2015
*/
public class AtlasMessagesScreen extends Activity {
private static final String TAG = AtlasMessagesScreen.class.getSimpleName();
private static final boolean debug = false;
public static final String EXTRA_CONVERSATION_IS_NEW = "conversation.new";
public static final String EXTRA_CONVERSATION_URI = keys.CONVERSATION_URI;
public static final int REQUEST_CODE_SETTINGS = 101;
public static final int REQUEST_CODE_GALLERY = 111;
public static final int REQUEST_CODE_CAMERA = 112;
/** Switch it to <code>true</code> to see {@link #AtlasMessagesScreen()} Query support in action */
private static final boolean USE_QUERY = false;
private volatile Conversation conv;
private LocationManager locationManager;
private Location lastKnownLocation;
private Handler uiHandler;
private AtlasMessagesList messagesList;
private AtlasMessageComposer messageComposer;
private AtlasParticipantPicker participantsPicker;
private AtlasTypingIndicator typingIndicator;
private MessengerApp app;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.uiHandler = new Handler();
this.app = (MessengerApp) getApplication();
setContentView(R.layout.atlas_screen_messages);
boolean convIsNew = getIntent().getBooleanExtra(EXTRA_CONVERSATION_IS_NEW, false);
String convUri = getIntent().getStringExtra(EXTRA_CONVERSATION_URI);
if (convUri != null) {
Uri uri = Uri.parse(convUri);
conv = app.getLayerClient().getConversation(uri);
((NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE)).cancel(convUri.hashCode()); // Clear notifications for this Conversation
}
participantsPicker = (AtlasParticipantPicker) findViewById(R.id.atlas_screen_messages_participants_picker);
participantsPicker.init(new String[]{app.getLayerClient().getAuthenticatedUserId()}, app.getParticipantProvider());
if (convIsNew) {
participantsPicker.setVisibility(View.VISIBLE);
}
messageComposer = (AtlasMessageComposer) findViewById(R.id.atlas_screen_messages_message_composer);
messageComposer.init(app.getLayerClient(), conv);
messageComposer.setListener(new AtlasMessageComposer.Listener() {
public boolean beforeSend(Message message) {
boolean conversationReady = ensureConversationReady();
if (!conversationReady) return false;
// push
preparePushMetadata(message);
return true;
}
});
messageComposer.registerMenuItem("Photo", new OnClickListener() {
public void onClick(View v) {
if (!ensureConversationReady()) return;
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
String fileName = "cameraOutput" + System.currentTimeMillis() + ".jpg";
photoFile = new File(getExternalFilesDir(android.os.Environment.DIRECTORY_PICTURES), fileName);
final Uri outputUri = Uri.fromFile(photoFile);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputUri);
if (debug) Log.w(TAG, "onClick() requesting photo to file: " + fileName + ", uri: " + outputUri);
startActivityForResult(cameraIntent, REQUEST_CODE_CAMERA);
}
});
messageComposer.registerMenuItem("Image", new OnClickListener() {
public void onClick(View v) {
if (!ensureConversationReady()) return;
// in onCreate or any event where your want the user to select a file
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), REQUEST_CODE_GALLERY);
}
});
messageComposer.registerMenuItem("Location", new OnClickListener() {
public void onClick(View v) {
if (!ensureConversationReady()) return;
if (lastKnownLocation == null) {
Toast.makeText(v.getContext(), "Inserting Location: Location is unknown yet", Toast.LENGTH_SHORT).show();
return;
}
String locationString = "{\"lat\":" + lastKnownLocation.getLatitude() + ", \"lon\":" + lastKnownLocation.getLongitude() + "}";
MessagePart part = app.getLayerClient().newMessagePart(Atlas.MIME_TYPE_ATLAS_LOCATION, locationString.getBytes());
Message message = app.getLayerClient().newMessage(Arrays.asList(part));
preparePushMetadata(message);
conv.send(message);
if (debug) Log.w(TAG, "onSendLocation() loc: " + locationString);
}
});
messagesList = (AtlasMessagesList) findViewById(R.id.atlas_screen_messages_messages_list);
messagesList.init(app.getLayerClient(), app.getParticipantProvider());
if (USE_QUERY) {
Query<Message> query = Query.builder(Message.class)
.predicate(new Predicate(Message.Property.CONVERSATION, Predicate.Operator.EQUAL_TO, conv))
.sortDescriptor(new SortDescriptor(Message.Property.POSITION, SortDescriptor.Order.ASCENDING))
.build();
messagesList.setQuery(query);
} else {
messagesList.setConversation(conv);
}
messagesList.setItemClickListener(new ItemClickListener() {
public void onItemClick(Cell cell) {
if (Atlas.MIME_TYPE_ATLAS_LOCATION.equals(cell.messagePart.getMimeType())) {
String jsonLonLat = new String(cell.messagePart.getData());
JSONObject json;
try {
json = new JSONObject(jsonLonLat);
double lon = json.getDouble("lon");
double lat = json.getDouble("lat");
Intent openMapIntent = new Intent(Intent.ACTION_VIEW);
String uriString = String.format(Locale.ENGLISH, "geo:%f,%f?z=%d&q=%f,%f", lat, lon, 18, lat, lon);
final Uri geoUri = Uri.parse(uriString);
openMapIntent.setData(geoUri);
if (openMapIntent.resolveActivity(getPackageManager()) != null) {
startActivity(openMapIntent);
if (debug) Log.w(TAG, "onItemClick() starting Map: " + uriString);
} else {
if (debug) Log.w(TAG, "onItemClick() No Activity to start Map: " + geoUri);
}
} catch (JSONException ignored) {
}
} else if (cell instanceof ImageCell) {
Intent intent = new Intent(AtlasMessagesScreen.this.getApplicationContext(), AtlasImageViewScreen.class);
app.setParam(intent, cell);
startActivity(intent);
}
}
});
typingIndicator = (AtlasTypingIndicator)findViewById(R.id.atlas_screen_messages_typing_indicator);
typingIndicator.init(conv, new AtlasTypingIndicator.DefaultTypingIndicatorCallback(app.getParticipantProvider()));
// location manager for inserting locations:
this.locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
prepareActionBar();
}
private void updateValues() {
if (conv == null) {
Log.e(TAG, "updateValues() no conversation set");
return;
}
TextView titleText = (TextView) findViewById(R.id.atlas_actionbar_title_text);
titleText.setText(Atlas.getTitle(conv, app.getParticipantProvider(), app.getLayerClient().getAuthenticatedUserId()));
}
private boolean ensureConversationReady() {
if (conv != null) return true;
// create new one
String[] userIds = participantsPicker.getSelectedUserIds();
// no people, no conversation
if (userIds.length == 0) {
Toast.makeText(this, "Conversation cannot be created without participants", Toast.LENGTH_SHORT).show();
return false;
}
conv = app.getLayerClient().newConversation(new ConversationOptions().distinct(false), userIds);
participantsPicker.setVisibility(View.GONE);
messageComposer.setConversation(conv);
messagesList.setConversation(conv);
typingIndicator.setConversation(conv);
updateValues();
return true;
}
private void preparePushMetadata(Message message) {
Participant me = app.getParticipantProvider().getParticipant(app.getLayerClient().getAuthenticatedUserId());
String senderName = Atlas.getFullName(me);
String text = Atlas.Tools.toString(message);
if (!text.isEmpty()) {
if (senderName != null && !senderName.isEmpty()) {
message.getOptions().pushNotificationMessage(senderName + ": " + text);
} else {
message.getOptions().pushNotificationMessage(text);
}
}
}
/** used to take photos from camera */
private File photoFile = null;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (debug) Log.w(TAG, "onActivityResult() requestCode: " + requestCode
+ ", resultCode: " + resultCode
+ ", uri: " + (data == null ? "" : data.getData())
+ ", data: " + (data == null ? "" : MessengerApp.toString(data.getExtras())) );
if (resultCode != Activity.RESULT_OK) return;
final LayerClient layerClient = ((MessengerApp) getApplication()).getLayerClient();
switch (requestCode) {
case REQUEST_CODE_CAMERA :
if (photoFile == null) {
if (debug) Log.w(TAG, "onActivityResult() taking photo, but output is undefined... ");
return;
}
if (!photoFile.exists()) {
if (debug) Log.w(TAG, "onActivityResult() taking photo, but photo file doesn't exist: " + photoFile.getPath());
return;
}
if (photoFile.length() == 0) {
if (debug) Log.w(TAG, "onActivityResult() taking photo, but photo file is empty: " + photoFile.getPath());
return;
}
try {
// prepare original
final File originalFile = photoFile;
FileInputStream fisOriginal = new FileInputStream(originalFile) {
public void close() throws IOException {
super.close();
boolean deleted = originalFile.delete();
if (debug) Log.w(TAG, "close() original file is" + (!deleted ? " not" : "") + " removed: " + originalFile.getName());
photoFile = null;
}
};
final MessagePart originalPart = layerClient.newMessagePart(Atlas.MIME_TYPE_IMAGE_JPEG, fisOriginal, originalFile.length());
File tempDir = getCacheDir();
MessagePart[] previewAndSize = Atlas.buildPreviewAndSize(originalFile, layerClient, tempDir);
if (previewAndSize == null) {
Log.e(TAG, "onActivityResult() cannot build preview, cancel send...");
return;
}
Message msg = layerClient.newMessage(originalPart, previewAndSize[0], previewAndSize[1]);
if (debug) Log.w(TAG, "onActivityResult() sending photo... ");
preparePushMetadata(msg);
conv.send(msg);
} catch (Exception e) {
Log.e(TAG, "onActivityResult() cannot insert photo" + e);
}
break;
case REQUEST_CODE_GALLERY :
if (data == null) {
if (debug) Log.w(TAG, "onActivityResult() insert from gallery: no data... :( ");
return;
}
// first check media gallery
Uri selectedImageUri = data.getData();
// TODO: Mi4 requires READ_EXTERNAL_STORAGE permission for such operation
String selectedImagePath = getGalleryImagePath(selectedImageUri);
String resultFileName = selectedImagePath;
if (selectedImagePath != null) {
if (debug) Log.w(TAG, "onActivityResult() image from gallery selected: " + selectedImagePath);
} else if (selectedImageUri.getPath() != null) {
if (debug) Log.w(TAG, "onActivityResult() image from file picker appears... " + selectedImageUri.getPath());
resultFileName = selectedImageUri.getPath();
}
if (resultFileName != null) {
String mimeType = Atlas.MIME_TYPE_IMAGE_JPEG;
if (resultFileName.endsWith(".png")) mimeType = Atlas.MIME_TYPE_IMAGE_PNG;
if (resultFileName.endsWith(".gif")) mimeType = Atlas.MIME_TYPE_IMAGE_GIF;
// test file copy locally
try {
// create message and upload content
InputStream fis = null;
File fileToUpload = new File(resultFileName);
if (fileToUpload.exists()) {
fis = new FileInputStream(fileToUpload);
} else {
if (debug) Log.w(TAG, "onActivityResult() file to upload doesn't exist, path: " + resultFileName + ", trying ContentResolver");
fis = getContentResolver().openInputStream(data.getData());
if (fis == null) {
if (debug) Log.w(TAG, "onActivityResult() cannot open stream with ContentResolver, uri: " + data.getData());
}
}
String fileName = "galleryFile" + System.currentTimeMillis() + ".jpg";
final File originalFile = new File(getExternalFilesDir(android.os.Environment.DIRECTORY_PICTURES), fileName);
OutputStream fos = new FileOutputStream(originalFile);
int totalBytes = Tools.streamCopyAndClose(fis, fos);
if (debug) Log.w(TAG, "onActivityResult() copied " + totalBytes + " to file: " + originalFile.getName());
FileInputStream fisOriginal = new FileInputStream(originalFile) {
public void close() throws IOException {
super.close();
boolean deleted = originalFile.delete();
if (debug) Log.w(TAG, "close() original file is" + (!deleted ? " not" : "") + " removed: " + originalFile.getName());
}
};
final MessagePart originalPart = layerClient.newMessagePart(mimeType, fisOriginal, originalFile.length());
File tempDir = getCacheDir();
MessagePart[] previewAndSize = Atlas.buildPreviewAndSize(originalFile, layerClient, tempDir);
if (previewAndSize == null) {
Log.e(TAG, "onActivityResult() cannot build preview, cancel send...");
return;
}
Message msg = layerClient.newMessage(originalPart, previewAndSize[0], previewAndSize[1]);
if (debug) Log.w(TAG, "onActivityResult() uploaded " + originalFile.length() + " bytes");
preparePushMetadata(msg);
conv.send(msg);
} catch (Exception e) {
Log.e(TAG, "onActivityResult() cannot upload file: " + resultFileName, e);
return;
}
}
break;
default :
break;
}
}
/**
* pick file name from content provider with Gallery-flavor format
*/
public String getGalleryImagePath(Uri uri) {
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
if (cursor == null) {
return null; // uri could be not suitable for ContentProviders, i.e. points to file
}
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
@Override
protected void onResume() {
super.onResume();
updateValues();
messagesList.jumpToLastMessage();
// restore location tracking
int requestLocationTimeout = 1 * 1000; // every second
int distance = 100;
Location loc = null;
if (locationManager.getProvider(LocationManager.GPS_PROVIDER) != null) {
loc = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (debug) Log.w(TAG, "onResume() location from gps: " + loc);
}
if (loc == null && locationManager.getProvider(LocationManager.NETWORK_PROVIDER) != null) {
loc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (debug) Log.w(TAG, "onResume() location from network: " + loc);
}
if (loc != null && loc.getTime() < System.currentTimeMillis() + LOCATION_EXPIRATION_TIME) {
locationTracker.onLocationChanged(loc);
}
if (locationManager.getProvider(LocationManager.GPS_PROVIDER) != null) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, requestLocationTimeout, distance, locationTracker);
}
if (locationManager.getProvider(LocationManager.NETWORK_PROVIDER) != null) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, requestLocationTimeout, distance, locationTracker);
}
app.getLayerClient().registerEventListener(messagesList);
app.getLayerClient().registerTypingIndicator(typingIndicator.clear());
// when something changed
app.getLayerClient().registerEventListener(new LayerChangeEventListener.MainThread() {
public void onEventMainThread(LayerChangeEvent event) {
updateValues();
}
});
}
private static final int LOCATION_EXPIRATION_TIME = 60 * 1000; // 1 minute
LocationListener locationTracker = new LocationListener() {
@Override
public void onLocationChanged(final Location location) {
uiHandler.post(new Runnable() {
@Override
public void run() {
lastKnownLocation = location;
if (debug) Log.d(TAG, "onLocationChanged() location: " + location);
}
});
}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {}
};
@Override
protected void onPause() {
super.onPause();
locationManager.removeUpdates(locationTracker);
app.getLayerClient().unregisterEventListener(messagesList);
app.getLayerClient().unregisterTypingIndicator(typingIndicator.clear());
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (debug) Log.w(TAG, "onConfigurationChanged() newConfig: " + newConfig);
updateValues();
messagesList.jumpToLastMessage();
}
private void prepareActionBar() {
ImageView menuBtn = (ImageView) findViewById(R.id.atlas_actionbar_left_btn);
menuBtn.setImageResource(R.drawable.atlas_ctl_btn_back);
menuBtn.setVisibility(View.VISIBLE);
menuBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
finish();
}
});
((TextView)findViewById(R.id.atlas_actionbar_title_text)).setText("Messages");
((TextView)findViewById(R.id.atlas_actionbar_title_text)).setOnClickListener(new OnClickListener() {
public void onClick(View v) {
messagesList.requestRefreshValues(true, false);
}
});
ImageView settingsBtn = (ImageView) findViewById(R.id.atlas_actionbar_right_btn);
settingsBtn.setImageResource(R.drawable.atlas_ctl_btn_detail);
settingsBtn.setVisibility(View.VISIBLE);
settingsBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (conv == null) return;
AtlasConversationSettingsScreen.conv = conv;
Intent intent = new Intent(v.getContext(), AtlasConversationSettingsScreen.class);
startActivityForResult(intent, REQUEST_CODE_SETTINGS);
}
});
Tools.setStatusBarColor(getWindow(), getResources().getColor(R.color.atlas_background_blue_dark));
}
}
| senorcris/Atlas-Android | layer-atlas-messenger/src/main/java/com/layer/atlas/messenger/AtlasMessagesScreen.java | Java | apache-2.0 | 24,874 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2325,
6741,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef __ASMPARISC_ELF_H
#define __ASMPARISC_ELF_H
/*
* ELF register definitions..
*/
#include <asm/ptrace.h>
#define EM_PARISC 15
/* HPPA specific definitions. */
/* Legal values for e_flags field of Elf32_Ehdr. */
#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */
#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */
#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */
#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */
#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch
prediction. */
#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */
#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */
/* Defined values for `e_flags & EF_PARISC_ARCH' are: */
#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */
#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */
#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */
/* Additional section indices. */
#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared
symbols in ANSI C. */
#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */
/* Legal values for sh_type field of Elf32_Shdr. */
#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */
#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */
#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */
/* Legal values for sh_flags field of Elf32_Shdr. */
#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */
#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */
#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */
#define STT_HP_OPAQUE (STT_LOOS + 0x1)
#define STT_HP_STUB (STT_LOOS + 0x2)
/* HPPA relocs. */
#define R_PARISC_NONE 0 /* No reloc. */
#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */
#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */
#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */
#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */
#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */
#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */
#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */
#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */
#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
#define R_PARISC_FPTR64 64 /* 64 bits function address. */
#define R_PARISC_PLABEL32 65 /* 32 bits function address. */
#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */
#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */
#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */
#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */
#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */
#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */
#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */
#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */
#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */
#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */
#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */
#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */
#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */
#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */
#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */
#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */
#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */
#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */
#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */
#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */
#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */
#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */
#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */
#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */
#define R_PARISC_LORESERVE 128
#define R_PARISC_COPY 128 /* Copy relocation. */
#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */
#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */
#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */
#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */
#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */
#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */
#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */
#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */
#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */
#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */
#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */
#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */
#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */
#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/
#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */
#define R_PARISC_HIRESERVE 255
#define PA_PLABEL_FDESC 0x02 /* bit set if PLABEL points to
* a function descriptor, not
* an address */
/* The following are PA function descriptors
*
* addr: the absolute address of the function
* gp: either the data pointer (r27) for non-PIC code or the
* the PLT pointer (r19) for PIC code */
/* Format for the Elf32 Function descriptor */
typedef struct elf32_fdesc {
__u32 addr;
__u32 gp;
} Elf32_Fdesc;
/* Format for the Elf64 Function descriptor */
typedef struct elf64_fdesc {
__u64 dummy[2]; /* FIXME: nothing uses these, why waste
* the space */
__u64 addr;
__u64 gp;
} Elf64_Fdesc;
#ifdef __KERNEL__
#ifdef CONFIG_64BIT
#define Elf_Fdesc Elf64_Fdesc
#else
#define Elf_Fdesc Elf32_Fdesc
#endif /*CONFIG_64BIT*/
#endif /*__KERNEL__*/
/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
#define PT_HP_TLS (PT_LOOS + 0x0)
#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
#define PT_HP_PARALLEL (PT_LOOS + 0x10)
#define PT_HP_FASTBIND (PT_LOOS + 0x11)
#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
#define PT_HP_STACK (PT_LOOS + 0x14)
#define PT_PARISC_ARCHEXT 0x70000000
#define PT_PARISC_UNWIND 0x70000001
/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */
#define PF_PARISC_SBP 0x08000000
#define PF_HP_PAGE_SIZE 0x00100000
#define PF_HP_FAR_SHARED 0x00200000
#define PF_HP_NEAR_SHARED 0x00400000
#define PF_HP_CODE 0x01000000
#define PF_HP_MODIFY 0x02000000
#define PF_HP_LAZYSWAP 0x04000000
#define PF_HP_SBP 0x08000000
/*
* The following definitions are those for 32-bit ELF binaries on a 32-bit
* kernel and for 64-bit binaries on a 64-bit kernel. To run 32-bit binaries
* on a 64-bit kernel, arch/parisc/kernel/binfmt_elf32.c defines these
* macros appropriately and then #includes binfmt_elf.c, which then includes
* this file.
*/
#ifndef ELF_CLASS
/*
* This is used to ensure we don't load something for the wrong architecture.
*
* Note that this header file is used by default in fs/binfmt_elf.c. So
* the following macros are for the default case. However, for the 64
* bit kernel we also support 32 bit parisc binaries. To do that
* arch/parisc/kernel/binfmt_elf32.c defines its own set of these
* macros, and then it includes fs/binfmt_elf.c to provide an alternate
* elf binary handler for 32 bit binaries (on the 64 bit kernel).
*/
#ifdef CONFIG_64BIT
#define ELF_CLASS ELFCLASS64
#else
#define ELF_CLASS ELFCLASS32
#endif
typedef unsigned long elf_greg_t;
/*
* This yields a string that ld.so will use to load implementation
* specific libraries for optimization. This is more specific in
* intent than poking at uname or /proc/cpuinfo.
*/
#define ELF_PLATFORM ("PARISC\0")
#define SET_PERSONALITY(ex) \
current->personality = PER_LINUX; \
current->thread.map_base = DEFAULT_MAP_BASE; \
current->thread.task_size = DEFAULT_TASK_SIZE \
/*
* Fill in general registers in a core dump. This saves pretty
* much the same registers as hp-ux, although in a different order.
* Registers marked # below are not currently saved in pt_regs, so
* we use their current values here.
*
* gr0..gr31
* sr0..sr7
* iaoq0..iaoq1
* iasq0..iasq1
* cr11 (sar)
* cr19 (iir)
* cr20 (isr)
* cr21 (ior)
* # cr22 (ipsw)
* # cr0 (recovery counter)
* # cr24..cr31 (temporary registers)
* # cr8,9,12,13 (protection IDs)
* # cr10 (scr/ccr)
* # cr15 (ext int enable mask)
*
*/
#define ELF_CORE_COPY_REGS(dst, pt) \
memset(dst, 0, sizeof(dst)); /* don't leak any "random" bits */ \
memcpy(dst + 0, pt->gr, 32 * sizeof(elf_greg_t)); \
memcpy(dst + 32, pt->sr, 8 * sizeof(elf_greg_t)); \
memcpy(dst + 40, pt->iaoq, 2 * sizeof(elf_greg_t)); \
memcpy(dst + 42, pt->iasq, 2 * sizeof(elf_greg_t)); \
dst[44] = pt->sar; dst[45] = pt->iir; \
dst[46] = pt->isr; dst[47] = pt->ior; \
dst[48] = mfctl(22); dst[49] = mfctl(0); \
dst[50] = mfctl(24); dst[51] = mfctl(25); \
dst[52] = mfctl(26); dst[53] = mfctl(27); \
dst[54] = mfctl(28); dst[55] = mfctl(29); \
dst[56] = mfctl(30); dst[57] = mfctl(31); \
dst[58] = mfctl( 8); dst[59] = mfctl( 9); \
dst[60] = mfctl(12); dst[61] = mfctl(13); \
dst[62] = mfctl(10); dst[63] = mfctl(15);
#endif /* ! ELF_CLASS */
#define ELF_NGREG 80 /* We only need 64 at present, but leave space
for expansion. */
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
#define ELF_NFPREG 32
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
struct task_struct;
extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
struct pt_regs; /* forward declaration... */
#define elf_check_arch(x) ((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS)
/*
* These are used to set parameters in the core dumps.
*/
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_PARISC
#define ELF_OSABI ELFOSABI_LINUX
/* %r23 is set by ld.so to a pointer to a function which might be
registered using atexit. This provides a means for the dynamic
linker to call DT_FINI functions for shared libraries that have
been loaded before the code runs.
So that we can use the same startup file with static executables,
we start programs with a value of 0 to indicate that there is no
such function. */
#define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0
#define ELF_EXEC_PAGESIZE 4096
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk.
(2 * TASK_SIZE / 3) turns into something undefined when run through a
32 bit preprocessor and in some cases results in the kernel trying to map
ld.so to the kernel virtual base. Use a sane value instead. /Jes
*/
#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x01000000)
/* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. This could be done in user space,
but it's not easy, and we've already done it here. */
#define ELF_HWCAP 0
#endif
| talnoah/android_kernel_htc_dlx | virt/arch/parisc/include/asm/elf.h | C | gpl-2.0 | 14,247 | [
30522,
1001,
2065,
13629,
2546,
1035,
1035,
2004,
8737,
23061,
2278,
1035,
17163,
1035,
1044,
1001,
9375,
1035,
1035,
2004,
8737,
23061,
2278,
1035,
17163,
1035,
1044,
1013,
1008,
1008,
17163,
4236,
15182,
1012,
1012,
1008,
1013,
1001,
2421... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# infinite zoom plugin
"infinite zoom" is an jQuery-Plugin that creates a nice foto/image show as background on DOM-containers.
## Features
* applicable to any DOM-container
* adjustable zoom properties
* asynchronous image loading (just loads what's needed)
* rendering with the high-performance CSS3-transitions
## Requirements
* jQuery 1.3 or upwards
* a container which must have
* a 'overflow:hidden' css style
* a 'position' css style
* content with
* a 'position' css style
* a 'z-index' css style greater than 0
## Install
It`s very easy to install:
1. download or clone the current version
2. include the minified version into your code
## Usage
Will coming soon!
## License
See the "LICENSE" file in the root of the repo.
| jtkDvlp/jQuery.infiniteZoom | README.md | Markdown | mit | 759 | [
30522,
1001,
10709,
24095,
13354,
2378,
1000,
10709,
24095,
1000,
2003,
2019,
1046,
4226,
2854,
1011,
13354,
2378,
2008,
9005,
1037,
3835,
1042,
11439,
1013,
3746,
2265,
2004,
4281,
2006,
14383,
1011,
16143,
1012,
1001,
1001,
2838,
1008,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.DataTransfer (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.DataTransfer
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.Generated.DataTransfer
#else
#endif
| plow-technologies/ghcjs-dom | src/GHCJS/DOM/DataTransfer.hs | Haskell | mit | 349 | [
30522,
1063,
1011,
1001,
2653,
18133,
2361,
1001,
1011,
1065,
11336,
1043,
16257,
22578,
1012,
14383,
1012,
30524,
3677,
1035,
9808,
1007,
1004,
1004,
4225,
1006,
2224,
1035,
9262,
22483,
26989,
1007,
1007,
1064,
1064,
999,
4225,
1006,
2224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Example
The example can be found in the `example` folder and is quite simple in nature. It just shows common use cases for interacting with components validation state and displaying errors from the validation system in the view layer.
You can access the example as a demo **[HERE](https://rawgit.com/grofit/treacherous-vue/master/example/app.html)**
## Browsing the source
The source has tried to be as simple to follow as possible with the `app.html` and `app.js` being the entry point for the example, and ther being some components which each show some use cases.
There is a `compiled.js` which is the overall webpack output for everything and this can be ignored, but ultimately you can browse all the rest of the source and see how everything interacts and how rulesets are created and validation groups are hooked into.
### Basic component
The basic component is the bare minimum all in one component file (with a separate template) to just get your component up and running with validation, due to this it doesnt separate out data/rulesets/logic etc and should just bee seen as a whimsical simple example.
### Complex component
This one is a bit more realistic in the way that it separates out the ruleset into its own module, the data models into their own modules. This although being slightly more complicated is generally going to be more *real* in terms of the way you would consume this library in most use cases. | grofit/treacherous-vue | docs/example.md | Markdown | mit | 1,438 | [
30522,
1001,
2742,
1996,
2742,
2064,
2022,
2179,
1999,
1996,
1036,
2742,
1036,
19622,
1998,
2003,
3243,
3722,
1999,
3267,
1012,
2009,
2074,
3065,
2691,
2224,
3572,
2005,
21935,
2007,
6177,
27354,
2110,
1998,
14962,
10697,
2013,
1996,
27354,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
begin
require 'json'
rescue LoadError => e
require 'json/pure'
end
module Rack
# A Rack middleware for parsing POST/PUT body data when Content-Type is
# not one of the standard supported types, like <tt>application/json</tt>.
#
# TODO: Find a better name.
#
class PostBodyContentTypeParser
# Constants
#
CONTENT_TYPE = 'CONTENT_TYPE'.freeze
POST_BODY = 'rack.input'.freeze
FORM_INPUT = 'rack.request.form_input'.freeze
FORM_HASH = 'rack.request.form_hash'.freeze
# Supported Content-Types
#
APPLICATION_JSON = 'application/json'.freeze
def initialize(app)
@app = app
end
def call(env)
case env[CONTENT_TYPE]
when APPLICATION_JSON
env.update(FORM_HASH => JSON.parse(env[POST_BODY].read), FORM_INPUT => env[POST_BODY])
end
@app.call(env)
end
end
end
| reinh/rack-shootout | vendor/rack-contrib-0.9.1/lib/rack/contrib/post_body_content_type_parser.rb | Ruby | mit | 863 | [
30522,
4088,
5478,
1005,
1046,
3385,
1005,
5343,
7170,
2121,
29165,
1027,
1028,
1041,
5478,
1005,
1046,
3385,
1013,
5760,
1005,
2203,
11336,
14513,
1001,
1037,
14513,
2690,
8059,
2005,
11968,
7741,
2695,
1013,
2404,
2303,
2951,
2043,
4180,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* EXYNOS - MP CPU frequency scaling support for EXYNOS big.Little series
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#include <linux/cpufreq.h>
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/delay.h>
#include <linux/cpu.h>
#include <linux/pm_qos.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/cpumask.h>
#include <asm/smp_plat.h>
#include <asm/cputype.h>
#include <mach/cpufreq.h>
#include <mach/asv-exynos.h>
#include <mach/regs-pmu.h>
#include <mach/tmu.h>
#include <plat/cpu.h>
#define POWER_COEFF_15P 57 /* percore param */
#define POWER_COEFF_7P 11 /* percore param */
#ifdef CONFIG_SMP
struct lpj_info {
unsigned long ref;
unsigned int freq;
};
static struct lpj_info global_lpj_ref;
#endif
/* For switcher */
static unsigned int freq_min[CA_END] __read_mostly; /* Minimum (Big/Little) clock frequency */
static unsigned int freq_max[CA_END] __read_mostly; /* Maximum (Big/Little) clock frequency */
static struct exynos_dvfs_info *exynos_info[CA_END];
static struct exynos_dvfs_info exynos_info_CA7;
static struct exynos_dvfs_info exynos_info_CA15;
static struct regulator *arm_regulator;
static struct regulator *kfc_regulator;
static unsigned int volt_offset;
static struct cpufreq_freqs *freqs[CA_END];
static DEFINE_MUTEX(cpufreq_lock);
static DEFINE_MUTEX(cpufreq_scale_lock);
bool exynos_cpufreq_init_done;
static bool suspend_prepared = false;
static bool hmp_boosted = false;
static bool egl_hotplugged = false;
bool cluster_on[CA_END] = {true, };
/* Include CPU mask of each cluster */
cluster_type exynos_boot_cluster;
static cluster_type boot_cluster;
static struct cpumask cluster_cpus[CA_END];
DEFINE_PER_CPU(cluster_type, cpu_cur_cluster);
static struct pm_qos_constraints max_cpu_qos_const;
static struct pm_qos_constraints max_kfc_qos_const;
static struct pm_qos_request boot_min_cpu_qos;
static struct pm_qos_request boot_max_cpu_qos;
static struct pm_qos_request boot_min_kfc_qos;
static struct pm_qos_request boot_max_kfc_qos;
static struct pm_qos_request min_cpu_qos;
static struct pm_qos_request max_cpu_qos;
static struct pm_qos_request min_kfc_qos;
static struct pm_qos_request max_kfc_qos;
static struct pm_qos_request exynos_mif_qos_CA7;
static struct pm_qos_request exynos_mif_qos_CA15;
static struct pm_qos_request ipa_max_kfc_qos;
static struct pm_qos_request ipa_max_cpu_qos;
static struct workqueue_struct *cluster_monitor_wq;
static struct delayed_work monitor_cluster_on;
static bool CA7_cluster_on = false;
static bool CA15_cluster_on = false;
/*
* CPUFREQ init notifier
*/
static BLOCKING_NOTIFIER_HEAD(exynos_cpufreq_init_notifier_list);
int exynos_cpufreq_init_register_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&exynos_cpufreq_init_notifier_list, nb);
}
EXPORT_SYMBOL(exynos_cpufreq_init_register_notifier);
int exynos_cpufreq_init_unregister_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&exynos_cpufreq_init_notifier_list, nb);
}
EXPORT_SYMBOL(exynos_cpufreq_init_unregister_notifier);
static int exynos_cpufreq_init_notify_call_chain(unsigned long val)
{
int ret = blocking_notifier_call_chain(&exynos_cpufreq_init_notifier_list, val, NULL);
return notifier_to_errno(ret);
}
static unsigned int get_limit_voltage(unsigned int voltage)
{
BUG_ON(!voltage);
if (voltage > LIMIT_COLD_VOLTAGE)
return voltage;
if (voltage + volt_offset > LIMIT_COLD_VOLTAGE)
return LIMIT_COLD_VOLTAGE;
if (ENABLE_MIN_COLD && volt_offset
&& (voltage + volt_offset) < MIN_COLD_VOLTAGE)
return MIN_COLD_VOLTAGE;
return voltage + volt_offset;
}
static void init_cpumask_cluster_set(cluster_type cluster)
{
unsigned int i;
for_each_cpu(i, cpu_possible_mask) {
if (cluster == CA7) {
if (i >= NR_CA7) {
cpumask_set_cpu(i, &cluster_cpus[CA15]);
per_cpu(cpu_cur_cluster, i) = CA15;
} else {
cpumask_set_cpu(i, &cluster_cpus[CA7]);
per_cpu(cpu_cur_cluster, i) = CA7;
}
} else {
if (i >= NR_CA15) {
cpumask_set_cpu(i, &cluster_cpus[CA7]);
per_cpu(cpu_cur_cluster, i) = CA7;
} else {
cpumask_set_cpu(i, &cluster_cpus[CA15]);
per_cpu(cpu_cur_cluster, i) = CA15;
}
}
}
}
/*
* get_cur_cluster - return current cluster
*
* You may reference this fuction directly, but it cannot be
* standard of judging current cluster. If you make a decision
* of operation by this function, it occurs system hang.
*/
static cluster_type get_cur_cluster(unsigned int cpu)
{
return per_cpu(cpu_cur_cluster, cpu);
}
static void set_boot_freq(void)
{
int i;
for (i = 0; i < CA_END; i++) {
if (exynos_info[i] == NULL)
continue;
exynos_info[i]->boot_freq
= clk_get_rate(exynos_info[i]->cpu_clk) / 1000;
}
}
static void cluster_onoff_monitor(struct work_struct *work)
{
struct cpufreq_frequency_table *CA15_freq_table = exynos_info[CA15]->freq_table;
struct cpufreq_frequency_table *CA7_freq_table = exynos_info[CA7]->freq_table;
unsigned int CA15_old_index = 0, CA7_old_index = 0;
unsigned int freq;
int i;
if (exynos_info[CA15]->is_alive)
cluster_on[CA15] = exynos_info[CA15]->is_alive();
if (exynos_info[CA15]->bus_table && exynos_info[CA15]->is_alive) {
if (!exynos_info[CA15]->is_alive() && CA15_cluster_on) {
pm_qos_update_request(&exynos_mif_qos_CA15, 0);
CA15_cluster_on = false;
} else if (exynos_info[CA15]->is_alive() && !CA15_cluster_on) {
for (i = 0; (CA15_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
freq = CA15_freq_table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if (freqs[CA15]->old == freq) {
CA15_old_index = i;
break;
}
}
pm_qos_update_request(&exynos_mif_qos_CA15,
exynos_info[CA15]->bus_table[CA15_old_index]);
CA15_cluster_on = true;
}
}
if (exynos_info[CA7]->is_alive)
cluster_on[CA7] = exynos_info[CA7]->is_alive();
if (exynos_info[CA7]->bus_table && exynos_info[CA7]->is_alive) {
if (!exynos_info[CA7]->is_alive() && CA7_cluster_on) {
pm_qos_update_request(&exynos_mif_qos_CA7, 0);
CA7_cluster_on = false;
} else if (exynos_info[CA7]->is_alive() && !CA7_cluster_on) {
for (i = 0; (CA7_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
freq = CA7_freq_table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if (freqs[CA7]->old == freq) {
CA7_old_index = i;
break;
}
}
pm_qos_update_request(&exynos_mif_qos_CA7,
exynos_info[CA7]->bus_table[CA7_old_index]);
CA7_cluster_on = true;
}
}
queue_delayed_work_on(0, cluster_monitor_wq, &monitor_cluster_on, msecs_to_jiffies(100));
}
static unsigned int get_freq_volt(int cluster, unsigned int target_freq)
{
int index;
int i;
struct cpufreq_frequency_table *table = exynos_info[cluster]->freq_table;
for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if (target_freq == freq) {
index = i;
break;
}
}
if (table[i].frequency == CPUFREQ_TABLE_END) {
if (exynos_info[cluster]->boot_freq_idx != -1 &&
target_freq == exynos_info[cluster]->boot_freq)
index = exynos_info[cluster]->boot_freq_idx;
else
return -EINVAL;
}
return exynos_info[cluster]->volt_table[index];
}
static unsigned int get_boot_freq(unsigned int cluster)
{
if (exynos_info[cluster] == NULL)
return 0;
return exynos_info[cluster]->boot_freq;
}
static unsigned int get_boot_volt(int cluster)
{
unsigned int boot_freq = get_boot_freq(cluster);
return get_freq_volt(cluster, boot_freq);
}
int exynos_verify_speed(struct cpufreq_policy *policy)
{
unsigned int cur = get_cur_cluster(policy->cpu);
return cpufreq_frequency_table_verify(policy,
exynos_info[cur]->freq_table);
}
unsigned int exynos_getspeed_cluster(cluster_type cluster)
{
return clk_get_rate(exynos_info[cluster]->cpu_clk) / 1000;
}
unsigned int exynos_getspeed(unsigned int cpu)
{
unsigned int cur = get_cur_cluster(cpu);
return exynos_getspeed_cluster(cur);
}
static unsigned int exynos_get_safe_volt(unsigned int old_index,
unsigned int new_index,
unsigned int cur)
{
unsigned int safe_arm_volt = 0;
struct cpufreq_frequency_table *freq_table
= exynos_info[cur]->freq_table;
unsigned int *volt_table = exynos_info[cur]->volt_table;
/*
* ARM clock source will be changed APLL to MPLL temporary
* To support this level, need to control regulator for
* reguired voltage level
*/
if (exynos_info[cur]->need_apll_change != NULL) {
if (exynos_info[cur]->need_apll_change(old_index, new_index) &&
(freq_table[new_index].frequency < exynos_info[cur]->mpll_freq_khz) &&
(freq_table[old_index].frequency < exynos_info[cur]->mpll_freq_khz)) {
safe_arm_volt = volt_table[exynos_info[cur]->pll_safe_idx];
}
}
return safe_arm_volt;
}
/* Determine valid target frequency using freq_table */
int exynos5_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int target_freq,
unsigned int relation,
unsigned int *index)
{
unsigned int i;
if (!cpu_online(policy->cpu))
return -EINVAL;
for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if (target_freq == freq) {
*index = i;
break;
}
}
if (table[i].frequency == CPUFREQ_TABLE_END) {
unsigned int cur = get_cur_cluster(policy->cpu);
if (exynos_info[cur]->boot_freq_idx != -1 &&
target_freq == exynos_info[cur]->boot_freq)
*index = exynos_info[cur]->boot_freq_idx;
else
return -EINVAL;
}
return 0;
}
static int exynos_cpufreq_scale(unsigned int target_freq,
unsigned int curr_freq, unsigned int cpu)
{
unsigned int cur = get_cur_cluster(cpu);
struct cpufreq_frequency_table *freq_table = exynos_info[cur]->freq_table;
unsigned int *volt_table = exynos_info[cur]->volt_table;
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
struct regulator *regulator = exynos_info[cur]->regulator;
unsigned int new_index, old_index;
unsigned int volt, safe_volt = 0;
bool set_abb_first_than_volt = false;
int ret = 0;
if (!policy) {
ret = -EINVAL;
goto no_policy;
}
freqs[cur]->cpu = cpu;
freqs[cur]->new = target_freq;
if (exynos5_frequency_table_target(policy, freq_table,
curr_freq, CPUFREQ_RELATION_L, &old_index)) {
ret = -EINVAL;
goto out;
}
if (exynos5_frequency_table_target(policy, freq_table,
freqs[cur]->new, CPUFREQ_RELATION_L, &new_index)) {
ret = -EINVAL;
goto out;
}
if (old_index == new_index)
goto out;
/*
* ARM clock source will be changed APLL to MPLL temporary
* To support this level, need to control regulator for
* required voltage level
*/
safe_volt = exynos_get_safe_volt(old_index, new_index, cur);
if (safe_volt)
safe_volt = get_limit_voltage(safe_volt);
volt = get_limit_voltage(volt_table[new_index]);
/* Update policy current frequency */
cpufreq_notify_transition(policy, freqs[cur], CPUFREQ_PRECHANGE);
if (freqs[cur]->new > freqs[cur]->old) {
if (exynos_info[cur]->set_int_skew)
exynos_info[cur]->set_int_skew(new_index);
}
if (exynos_info[cur]->abb_table) {
if (cur == CA7)
set_abb_first_than_volt = is_set_abb_first(ID_KFC, curr_freq, target_freq);
else
set_abb_first_than_volt = is_set_abb_first(ID_ARM, curr_freq, target_freq);
}
/* When the new frequency is higher than current frequency */
if ((freqs[cur]->new > freqs[cur]->old) && !safe_volt){
/* Firstly, voltage up to increase frequency */
if (!set_abb_first_than_volt)
regulator_set_voltage(regulator, volt, volt);
if (exynos_info[cur]->abb_table) {
if (cur == CA7)
set_match_abb(ID_KFC, exynos_info[cur]->abb_table[new_index]);
else
set_match_abb(ID_ARM, exynos_info[cur]->abb_table[new_index]);
}
if (set_abb_first_than_volt)
regulator_set_voltage(regulator, volt, volt);
if (exynos_info[cur]->set_ema)
exynos_info[cur]->set_ema(volt);
}
if (safe_volt) {
if (!set_abb_first_than_volt)
regulator_set_voltage(regulator, safe_volt, safe_volt);
if (exynos_info[cur]->abb_table) {
if (cur == CA7)
set_match_abb(ID_KFC, exynos_info[cur]->abb_table[new_index]);
else
set_match_abb(ID_ARM, exynos_info[cur]->abb_table[new_index]);
}
if (set_abb_first_than_volt)
regulator_set_voltage(regulator, volt, volt);
if (exynos_info[cur]->set_ema)
exynos_info[cur]->set_ema(safe_volt);
}
if (old_index > new_index) {
if (cur == CA15) {
if (pm_qos_request_active(&exynos_mif_qos_CA15))
pm_qos_update_request(&exynos_mif_qos_CA15,
exynos_info[cur]->bus_table[new_index]);
} else {
if (pm_qos_request_active(&exynos_mif_qos_CA7))
pm_qos_update_request(&exynos_mif_qos_CA7,
exynos_info[cur]->bus_table[new_index]);
}
}
exynos_info[cur]->set_freq(old_index, new_index);
if (old_index < new_index) {
if (cur == CA15) {
if (pm_qos_request_active(&exynos_mif_qos_CA15))
pm_qos_update_request(&exynos_mif_qos_CA15,
exynos_info[cur]->bus_table[new_index]);
} else {
if (pm_qos_request_active(&exynos_mif_qos_CA7))
pm_qos_update_request(&exynos_mif_qos_CA7,
exynos_info[cur]->bus_table[new_index]);
}
}
#ifdef CONFIG_SMP
if (!global_lpj_ref.freq) {
global_lpj_ref.ref = loops_per_jiffy;
global_lpj_ref.freq = freqs[cur]->old;
}
loops_per_jiffy = cpufreq_scale(global_lpj_ref.ref,
global_lpj_ref.freq, freqs[cur]->new);
#endif
cpufreq_notify_transition(policy, freqs[cur], CPUFREQ_POSTCHANGE);
/* When the new frequency is lower than current frequency */
if ((freqs[cur]->new < freqs[cur]->old) ||
((freqs[cur]->new > freqs[cur]->old) && safe_volt)) {
/* down the voltage after frequency change */
if (exynos_info[cur]->set_ema)
exynos_info[cur]->set_ema(volt);
if (exynos_info[cur]->abb_table) {
if (cur == CA7)
set_abb_first_than_volt = is_set_abb_first(ID_KFC, freqs[cur]->old, freqs[cur]->new);
else
set_abb_first_than_volt = is_set_abb_first(ID_ARM, freqs[cur]->old, freqs[cur]->new);
}
if (!set_abb_first_than_volt)
regulator_set_voltage(regulator, volt, volt);
if (exynos_info[cur]->abb_table) {
if (cur == CA7)
set_match_abb(ID_KFC, exynos_info[cur]->abb_table[new_index]);
else
set_match_abb(ID_ARM, exynos_info[cur]->abb_table[new_index]);
}
if (set_abb_first_than_volt)
regulator_set_voltage(regulator, volt, volt);
}
if (freqs[cur]->new < freqs[cur]->old) {
if (exynos_info[cur]->set_int_skew)
exynos_info[cur]->set_int_skew(new_index);
}
out:
cpufreq_cpu_put(policy);
no_policy:
return ret;
}
static void __exynos_set_max_freq(struct pm_qos_request *pm_qos_request, int class, int max_freq)
{
if (pm_qos_request_active(pm_qos_request))
pm_qos_update_request(pm_qos_request, max_freq);
else
pm_qos_add_request(pm_qos_request, class, max_freq);
}
void exynos_set_max_freq(int max_freq, unsigned int cpu)
{
struct pm_qos_request *req;
int class;
if (get_cur_cluster(cpu) == CA7) {
req = &ipa_max_kfc_qos;
class = PM_QOS_KFC_FREQ_MAX;
} else {
req = &ipa_max_cpu_qos;
class = PM_QOS_CPU_FREQ_MAX;
}
__exynos_set_max_freq(req, class, max_freq);
}
struct cpu_power_info {
unsigned int load[4];
unsigned int freq;
cluster_type cluster;
unsigned int temp;
};
unsigned int get_power_value(struct cpu_power_info *power_info)
{
/* ps : power_static (mW)
* pd : power_dynamic (mW)
*/
u64 temp;
u64 pd_tot;
unsigned int ps, total_power;
unsigned int volt, maxfreq;
int i, coeff;
struct cpufreq_frequency_table *freq_table;
unsigned int *volt_table;
unsigned int freq = power_info->freq / 10000;
if (power_info->cluster == CA15) {
coeff = POWER_COEFF_15P;
freq_table = exynos_info[CA15]->freq_table;
volt_table = exynos_info[CA15]->volt_table;
maxfreq = exynos_info[CA15]->freq_table[exynos_info[CA15]->max_support_idx].frequency;
} else if (power_info->cluster == CA7) {
coeff = POWER_COEFF_7P;
freq_table = exynos_info[CA7]->freq_table;
volt_table = exynos_info[CA7]->volt_table;
maxfreq = exynos_info[CA7]->freq_table[exynos_info[CA7]->max_support_idx].frequency;
} else {
BUG_ON(1);
}
if (power_info->freq < freq_min[power_info->cluster]) {
pr_warn("%s: freq: %d for cluster: %d is less than min. freq: %d\n",
__func__, power_info->freq, power_info->cluster,
freq_min[power_info->cluster]);
power_info->freq = freq_min[power_info->cluster];
}
if (power_info->freq > maxfreq) {
pr_warn("%s: freq: %d for cluster: %d is greater than max. freq: %d\n",
__func__, power_info->freq, power_info->cluster,
maxfreq);
power_info->freq = maxfreq;
}
for (i = 0; (freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (power_info->freq == freq_table[i].frequency)
break;
}
volt = volt_table[i] / 10000;
/* TODO: pde_p is not linear to load, need to update equation */
pd_tot = 0;
temp = (u64)coeff * (u64)freq * (u64)volt * (u64)volt;
do_div(temp, 100000);
for (i = 0; i < 4; i++) {
if (power_info->load[i] > 100) {
pr_err("%s: Load should be a percent value\n", __func__);
BUG_ON(1);
}
pd_tot += temp * (power_info->load[i]+1);
}
total_power = (unsigned int)pd_tot / (unsigned int)100;
/* pse = alpha ~ volt ~ temp */
/* TODO: Update voltage, temperature variant PSE */
ps = 0;
total_power += ps;
return total_power;
}
unsigned int g_cpufreq;
unsigned int g_kfcfreq;
unsigned int g_clamp_cpufreqs[CA_END];
/* Set clock frequency */
static int exynos_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
cluster_type cur = get_cur_cluster(policy->cpu);
struct cpufreq_frequency_table *freq_table = exynos_info[cur]->freq_table;
unsigned int index;
int ret = 0;
#ifdef CONFIG_CPU_THERMAL_IPA_DEBUG
trace_printk("IPA:%s:%d Called by %x, with target_freq %d", __PRETTY_FUNCTION__, __LINE__,
(unsigned int) __builtin_return_address (0), target_freq);
#endif
mutex_lock(&cpufreq_lock);
if (exynos_info[cur]->blocked)
goto out;
if (target_freq == 0)
target_freq = policy->min;
/* if PLL bypass, frequency scale is skip */
if (exynos_getspeed(policy->cpu) <= 24000)
goto out;
/* verify old frequency */
if (freqs[cur]->old != exynos_getspeed(policy->cpu)) {
printk("oops, sombody change clock old clk:%d, cur clk:%d \n", freqs[cur]->old, exynos_getspeed(policy->cpu));
BUG_ON(freqs[cur]->old != exynos_getspeed(policy->cpu));
}
#if 0
if (cur == CA15) {
target_freq = max((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MIN), target_freq);
target_freq = min((unsigned int)pm_qos_request(PM_QOS_CPU_FREQ_MAX), target_freq);
target_freq = min(g_clamp_cpufreqs[CA15], target_freq); /* add IPA clamp */
} else {
target_freq = max((unsigned int)pm_qos_request(PM_QOS_KFC_FREQ_MIN), target_freq);
target_freq = min((unsigned int)pm_qos_request(PM_QOS_KFC_FREQ_MAX), target_freq);
target_freq = min(g_clamp_cpufreqs[CA7], target_freq); /* add IPA clamp */
}
#endif
#ifdef CONFIG_CPU_THERMAL_IPA_DEBUG
trace_printk("IPA:%s:%d will apply %d ", __PRETTY_FUNCTION__, __LINE__, target_freq);
#endif
if (cpufreq_frequency_table_target(policy, freq_table,
target_freq, relation, &index)) {
ret = -EINVAL;
goto out;
}
target_freq = freq_table[index].frequency;
pr_debug("%s[%d]: new_freq[%d], index[%d]\n",
__func__, cur, target_freq, index);
/* frequency and volt scaling */
ret = exynos_cpufreq_scale(target_freq, freqs[cur]->old, policy->cpu);
/* save current frequency */
freqs[cur]->old = target_freq;
out:
mutex_unlock(&cpufreq_lock);
if (cur == CA15)
g_cpufreq = target_freq;
else
g_kfcfreq = target_freq;
return ret;
}
void ipa_set_clamp(int cpu, unsigned int clamp_freq, unsigned int gov_target)
{
unsigned int freq = 0;
unsigned int new_freq = 0;
unsigned int cur = get_cur_cluster(cpu);
struct cpufreq_policy *policy;
g_clamp_cpufreqs[cur] = clamp_freq;
new_freq = min(clamp_freq, gov_target);
freq = exynos_getspeed(cpu);
if (freq <= clamp_freq)
return;
policy = cpufreq_cpu_get(cpu);
if (!policy)
return;
if (!policy->user_policy.governor) {
cpufreq_cpu_put(policy);
return;
}
#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_PERFORMANCE)
if ((strcmp(policy->governor->name, "userspace") == 0)
|| strcmp(policy->governor->name, "performance") == 0) {
cpufreq_cpu_put(policy);
return;
}
#endif
#ifdef CONFIG_CPU_THERMAL_IPA_DEBUG
trace_printk("IPA: %s:%d: set clamps for cpu %d to %d (curr was %d)",
__PRETTY_FUNCTION__, __LINE__, cpu, clamp_freq, freq);
#endif
__cpufreq_driver_target(policy, new_freq, CPUFREQ_RELATION_H);
cpufreq_cpu_put(policy);
}
#ifdef CONFIG_PM
static int exynos_cpufreq_suspend(struct cpufreq_policy *policy)
{
return 0;
}
static int exynos_cpufreq_resume(struct cpufreq_policy *policy)
{
freqs[CA7]->old = exynos_getspeed_cluster(CA7);
freqs[CA15]->old = exynos_getspeed_cluster(CA15);
return 0;
}
#endif
static int __cpuinit exynos_cpufreq_cpu_notifier(struct notifier_block *notifier,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
struct device *dev;
if (suspend_prepared)
return NOTIFY_OK;
dev = get_cpu_device(cpu);
if (dev) {
switch (action) {
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
mutex_lock(&cpufreq_lock);
exynos_info[CA7]->blocked = true;
exynos_info[CA15]->blocked = true;
mutex_unlock(&cpufreq_lock);
break;
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
case CPU_DEAD:
mutex_lock(&cpufreq_lock);
exynos_info[CA7]->blocked = false;
exynos_info[CA15]->blocked = false;
mutex_unlock(&cpufreq_lock);
break;
}
}
return NOTIFY_OK;
}
static struct notifier_block __refdata exynos_cpufreq_cpu_nb = {
.notifier_call = exynos_cpufreq_cpu_notifier,
};
/*
* exynos_cpufreq_pm_notifier - block CPUFREQ's activities in suspend-resume
* context
* @notifier
* @pm_event
* @v
*
* While cpufreq_disable == true, target() ignores every frequency but
* boot_freq. The boot_freq value is the initial frequency,
* which is set by the bootloader. In order to eliminate possible
* inconsistency in clock values, we save and restore frequencies during
* suspend and resume and block CPUFREQ activities. Note that the standard
* suspend/resume cannot be used as they are too deep (syscore_ops) for
* regulator actions.
*/
static int exynos_cpufreq_pm_notifier(struct notifier_block *notifier,
unsigned long pm_event, void *v)
{
struct cpufreq_frequency_table *CA15_freq_table = exynos_info[CA15]->freq_table;
struct cpufreq_frequency_table *CA7_freq_table = exynos_info[CA7]->freq_table;
unsigned int freqCA7, freqCA15;
unsigned int bootfreqCA7, bootfreqCA15;
unsigned int abb_freqCA7 = 0, abb_freqCA15 = 0;
bool set_abb_first_than_volt = false;
int volt, i;
switch (pm_event) {
case PM_SUSPEND_PREPARE:
mutex_lock(&cpufreq_lock);
exynos_info[CA7]->blocked = true;
exynos_info[CA15]->blocked = true;
mutex_unlock(&cpufreq_lock);
bootfreqCA7 = get_boot_freq(CA7);
bootfreqCA15 = get_boot_freq(CA15);
freqCA7 = freqs[CA7]->old;
freqCA15 = freqs[CA15]->old;
volt = max(get_boot_volt(CA7),
get_freq_volt(CA7, freqCA7));
BUG_ON(volt <= 0);
volt = get_limit_voltage(volt);
if (exynos_info[CA7]->abb_table)
set_abb_first_than_volt = is_set_abb_first(ID_KFC, freqCA7, bootfreqCA7);
if (!set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt))
goto err;
if (exynos_info[CA7]->abb_table) {
abb_freqCA7 = max(bootfreqCA7, freqCA7);
for (i = 0; (CA7_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (CA7_freq_table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
if (CA7_freq_table[i].frequency == abb_freqCA7) {
set_match_abb(ID_KFC, exynos_info[CA7]->abb_table[i]);
break;
}
}
}
if (!set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt))
goto err;
volt = max(get_boot_volt(CA15),
get_freq_volt(CA15, freqCA15));
if ( volt <= 0) {
printk("oops, strange voltage CA15 -> boot volt:%d, get_freq_volt:%d, freqCA15:%d \n",
get_boot_volt(CA15), get_freq_volt(CA15, freqCA15), freqCA15);
BUG_ON(volt <= 0);
}
volt = get_limit_voltage(volt);
set_abb_first_than_volt = false;
if (exynos_info[CA15]->abb_table)
set_abb_first_than_volt = is_set_abb_first(ID_ARM, freqCA15, bootfreqCA15);
if (!set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt))
goto err;
if (exynos_info[CA15]->abb_table) {
abb_freqCA15 = max(bootfreqCA15, freqCA15);
for (i = 0; (CA15_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (CA15_freq_table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
if (CA15_freq_table[i].frequency == abb_freqCA15) {
set_match_abb(ID_ARM, exynos_info[CA15]->abb_table[i]);
break;
}
}
}
if (set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt))
goto err;
suspend_prepared = true;
pr_debug("PM_SUSPEND_PREPARE for CPUFREQ\n");
break;
case PM_POST_SUSPEND:
pr_debug("PM_POST_SUSPEND for CPUFREQ\n");
mutex_lock(&cpufreq_lock);
exynos_info[CA7]->blocked = false;
exynos_info[CA15]->blocked = false;
mutex_unlock(&cpufreq_lock);
suspend_prepared = false;
break;
}
return NOTIFY_OK;
err:
pr_err("%s: failed to set voltage\n", __func__);
return NOTIFY_BAD;
}
static struct notifier_block exynos_cpufreq_nb = {
.notifier_call = exynos_cpufreq_pm_notifier,
};
#ifdef CONFIG_EXYNOS_THERMAL
static int exynos_cpufreq_tmu_notifier(struct notifier_block *notifier,
unsigned long event, void *v)
{
int volt;
int *on = v;
if (event != TMU_COLD)
return NOTIFY_OK;
mutex_lock(&cpufreq_lock);
if (*on) {
if (volt_offset)
goto out;
else
volt_offset = COLD_VOLT_OFFSET;
volt = get_limit_voltage(regulator_get_voltage(exynos_info[CA15]->regulator));
regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt);
if (exynos_info[CA15]->set_ema)
exynos_info[CA15]->set_ema(volt);
volt = get_limit_voltage(regulator_get_voltage(exynos_info[CA7]->regulator));
regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt);
if (exynos_info[CA7]->set_ema)
exynos_info[CA7]->set_ema(volt);
} else {
if (!volt_offset)
goto out;
else
volt_offset = 0;
volt = get_limit_voltage(regulator_get_voltage(exynos_info[CA15]->regulator)
- COLD_VOLT_OFFSET);
if (exynos_info[CA15]->set_ema)
exynos_info[CA15]->set_ema(volt);
regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt);
volt = get_limit_voltage(regulator_get_voltage(exynos_info[CA7]->regulator)
- COLD_VOLT_OFFSET);
regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt);
if (exynos_info[CA7]->set_ema)
exynos_info[CA7]->set_ema(volt);
}
out:
mutex_unlock(&cpufreq_lock);
return NOTIFY_OK;
}
static struct notifier_block exynos_tmu_nb = {
.notifier_call = exynos_cpufreq_tmu_notifier,
};
#endif
static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
unsigned int cur = get_cur_cluster(policy->cpu);
pr_debug("%s: cpu[%d]\n", __func__, policy->cpu);
policy->cur = policy->min = policy->max = exynos_getspeed(policy->cpu);
cpufreq_frequency_table_get_attr(exynos_info[cur]->freq_table, policy->cpu);
/* set the transition latency value */
policy->cpuinfo.transition_latency = 100000;
if (cpumask_test_cpu(policy->cpu, &cluster_cpus[CA15])) {
cpumask_copy(policy->cpus, &cluster_cpus[CA15]);
cpumask_copy(policy->related_cpus, &cluster_cpus[CA15]);
} else {
cpumask_copy(policy->cpus, &cluster_cpus[CA7]);
cpumask_copy(policy->related_cpus, &cluster_cpus[CA7]);
}
return cpufreq_frequency_table_cpuinfo(policy, exynos_info[cur]->freq_table);
}
static struct cpufreq_driver exynos_driver = {
.flags = CPUFREQ_STICKY,
.verify = exynos_verify_speed,
.target = exynos_target,
.get = exynos_getspeed,
.init = exynos_cpufreq_cpu_init,
.name = "exynos_cpufreq",
#ifdef CONFIG_PM
.suspend = exynos_cpufreq_suspend,
.resume = exynos_cpufreq_resume,
#endif
.have_governor_per_policy = true,
};
/************************** sysfs interface ************************/
static ssize_t show_cpufreq_table(struct kobject *kobj,
struct attribute *attr, char *buf)
{
int i;
ssize_t count = 0;
size_t tbl_sz = 0, pr_len;
struct cpufreq_frequency_table *freq_table_CA15 = exynos_info[CA15]->freq_table;
struct cpufreq_frequency_table *freq_table_CA7 = exynos_info[CA7]->freq_table;
for (i = 0; freq_table_CA15[i].frequency != CPUFREQ_TABLE_END; i++)
tbl_sz++;
for (i = 0; freq_table_CA7[i].frequency != CPUFREQ_TABLE_END; i++)
tbl_sz++;
if (tbl_sz == 0)
return -EINVAL;
pr_len = (size_t)((PAGE_SIZE - 2) / tbl_sz);
for (i = 0; freq_table_CA15[i].frequency != CPUFREQ_TABLE_END; i++) {
if (freq_table_CA15[i].frequency != CPUFREQ_ENTRY_INVALID)
count += snprintf(&buf[count], pr_len, "%d ",
freq_table_CA15[i].frequency);
}
for (i = 0; freq_table_CA7[i].frequency != CPUFREQ_TABLE_END; i++) {
if (freq_table_CA7[i].frequency != CPUFREQ_ENTRY_INVALID)
count += snprintf(&buf[count], pr_len, "%d ",
freq_table_CA7[i].frequency / 2);
}
count += snprintf(&buf[count - 1], 2, "\n");
return count - 1;
}
static ssize_t show_cpufreq_min_limit(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int cpu_qos_min = pm_qos_request(PM_QOS_CPU_FREQ_MIN);
unsigned int kfc_qos_min = pm_qos_request(PM_QOS_KFC_FREQ_MIN);
if (cpu_qos_min > 0 && get_hmp_boost()) {
if (cpu_qos_min > freq_max[CA15])
cpu_qos_min = freq_max[CA15];
else if (cpu_qos_min < freq_min[CA15])
cpu_qos_min = freq_min[CA15];
return snprintf(buf, 10, "%u\n", cpu_qos_min);
} else if (kfc_qos_min > 0) {
if (kfc_qos_min > freq_max[CA7])
kfc_qos_min = freq_max[CA7];
if (kfc_qos_min < freq_min[CA7])
kfc_qos_min = freq_min[CA7];
return snprintf(buf, 10, "%u\n", kfc_qos_min / 2);
} else if (kfc_qos_min == 0) {
kfc_qos_min = freq_min[CA7];
return snprintf(buf, 10, "%u\n", kfc_qos_min / 2);
}
return 0;
}
static ssize_t store_cpufreq_min_limit(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int cpu_input, kfc_input;
if (!sscanf(buf, "%d", &cpu_input))
return -EINVAL;
if (cpu_input >= (int)freq_min[CA15]) {
if (!hmp_boosted) {
if (set_hmp_boost(1) < 0)
pr_err("%s: failed HMP boost enable\n",
__func__);
else
hmp_boosted = true;
}
cpu_input = min(cpu_input, (int)freq_max[CA15]);
kfc_input = max_kfc_qos_const.default_value;
} else if (cpu_input < (int)freq_min[CA15]) {
if (hmp_boosted) {
if (set_hmp_boost(0) < 0)
pr_err("%s: failed HMP boost disable\n",
__func__);
else
hmp_boosted = false;
}
if (cpu_input < 0) {
cpu_input = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE;
kfc_input = PM_QOS_KFC_FREQ_MIN_DEFAULT_VALUE;
} else {
kfc_input = cpu_input * 2;
if (kfc_input > 0)
kfc_input = min(kfc_input, (int)freq_max[CA7]);
cpu_input = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE;
}
}
if (pm_qos_request_active(&min_cpu_qos))
pm_qos_update_request(&min_cpu_qos, cpu_input);
if (pm_qos_request_active(&min_kfc_qos))
pm_qos_update_request(&min_kfc_qos, kfc_input);
return count;
}
static ssize_t show_cpufreq_max_limit(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int cpu_qos_max = pm_qos_request(PM_QOS_CPU_FREQ_MAX);
unsigned int kfc_qos_max = pm_qos_request(PM_QOS_KFC_FREQ_MAX);
if (cpu_qos_max > 0) {
if (cpu_qos_max < freq_min[CA15])
cpu_qos_max = freq_min[CA15];
else if (cpu_qos_max > freq_max[CA15])
cpu_qos_max = freq_max[CA15];
return snprintf(buf, 10, "%u\n", cpu_qos_max);
} else if (kfc_qos_max > 0) {
if (kfc_qos_max < freq_min[CA7])
kfc_qos_max = freq_min[CA7];
if (kfc_qos_max > freq_max[CA7])
kfc_qos_max = freq_max[CA7];
return snprintf(buf, 10, "%u\n", kfc_qos_max / 2);
} else if (kfc_qos_max == 0) {
kfc_qos_max = freq_min[CA7];
return snprintf(buf, 10, "%u\n", kfc_qos_max / 2);
}
return 0;
}
static ssize_t store_cpufreq_max_limit(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int cpu_input, kfc_input;
if (!sscanf(buf, "%d", &cpu_input))
return -EINVAL;
if (cpu_input >= (int)freq_min[CA15]) {
if (egl_hotplugged) {
if (big_cores_hotplug(false))
pr_err("%s: failed big cores hotplug in\n",
__func__);
else
egl_hotplugged = false;
}
cpu_input = max(cpu_input, (int)freq_min[CA15]);
kfc_input = max_kfc_qos_const.default_value;
} else if (cpu_input < (int)freq_min[CA15]) {
if (cpu_input < 0) {
if (egl_hotplugged) {
if (big_cores_hotplug(false))
pr_err("%s: failed big cores hotplug in\n",
__func__);
else
egl_hotplugged = false;
}
cpu_input = max_cpu_qos_const.default_value;
kfc_input = max_kfc_qos_const.default_value;
} else {
kfc_input = cpu_input * 2;
if (kfc_input > 0)
kfc_input = max(kfc_input, (int)freq_min[CA7]);
cpu_input = PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE;
if (!egl_hotplugged) {
if (big_cores_hotplug(true))
pr_err("%s: failed big cores hotplug out\n",
__func__);
else
egl_hotplugged = true;
}
}
}
if (pm_qos_request_active(&max_cpu_qos))
pm_qos_update_request(&max_cpu_qos, cpu_input);
if (pm_qos_request_active(&max_kfc_qos))
pm_qos_update_request(&max_kfc_qos, kfc_input);
return count;
}
static ssize_t show_cpu_freq_table(struct kobject *kobj,
struct attribute *attr, char *buf)
{
int i, count = 0;
size_t tbl_sz = 0, pr_len;
struct cpufreq_frequency_table *freq_table = exynos_info[CA15]->freq_table;
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
tbl_sz++;
if (tbl_sz == 0)
return -EINVAL;
pr_len = (size_t)((PAGE_SIZE - 2) / tbl_sz);
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
if (freq_table[i].frequency != CPUFREQ_ENTRY_INVALID)
count += snprintf(&buf[count], pr_len, "%d ",
freq_table[i].frequency);
}
count += snprintf(&buf[count], 2, "\n");
return count;
}
static ssize_t show_cpu_min_freq(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int cpu_qos_min = pm_qos_request(PM_QOS_CPU_FREQ_MIN);
if (cpu_qos_min == 0)
cpu_qos_min = freq_min[CA15];
return snprintf(buf, PAGE_SIZE, "%u\n", cpu_qos_min);
}
static ssize_t show_cpu_max_freq(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int cpu_qos_max = pm_qos_request(PM_QOS_CPU_FREQ_MAX);
if (cpu_qos_max == 0)
cpu_qos_max = freq_min[CA15];
return snprintf(buf, PAGE_SIZE, "%u\n", cpu_qos_max);
}
static ssize_t store_cpu_min_freq(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int input;
if (!sscanf(buf, "%d", &input))
return -EINVAL;
if (input > 0)
input = min(input, (int)freq_max[CA15]);
if (pm_qos_request_active(&min_cpu_qos))
pm_qos_update_request(&min_cpu_qos, input);
return count;
}
static ssize_t store_cpu_max_freq(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int input;
if (!sscanf(buf, "%d", &input))
return -EINVAL;
if (input > 0)
input = max(input, (int)freq_min[CA15]);
if (pm_qos_request_active(&max_cpu_qos))
pm_qos_update_request(&max_cpu_qos, input);
return count;
}
static ssize_t show_kfc_freq_table(struct kobject *kobj,
struct attribute *attr, char *buf)
{
int i, count = 0;
size_t tbl_sz = 0, pr_len;
struct cpufreq_frequency_table *freq_table = exynos_info[CA7]->freq_table;
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
tbl_sz++;
if (tbl_sz == 0)
return -EINVAL;
pr_len = (size_t)((PAGE_SIZE - 2) / tbl_sz);
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
if (freq_table[i].frequency != CPUFREQ_ENTRY_INVALID)
count += snprintf(&buf[count], pr_len, "%d ",
freq_table[i].frequency);
}
count += snprintf(&buf[count], 2, "\n");
return count;
}
static ssize_t show_kfc_min_freq(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int kfc_qos_min = pm_qos_request(PM_QOS_KFC_FREQ_MIN);
if (kfc_qos_min == 0)
kfc_qos_min = freq_min[CA7];
return snprintf(buf, PAGE_SIZE, "%u\n", kfc_qos_min);
}
static ssize_t show_kfc_max_freq(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int kfc_qos_max = pm_qos_request(PM_QOS_KFC_FREQ_MAX);
if (kfc_qos_max == 0)
kfc_qos_max = freq_min[CA7];
return snprintf(buf, PAGE_SIZE, "%u\n", kfc_qos_max);
}
static ssize_t store_kfc_min_freq(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int input;
if (!sscanf(buf, "%d", &input))
return -EINVAL;
if (input > 0)
input = min(input, (int)freq_max[CA7]);
if (pm_qos_request_active(&min_kfc_qos))
pm_qos_update_request(&min_kfc_qos, input);
return count;
}
static ssize_t store_kfc_max_freq(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
int input;
if (!sscanf(buf, "%d", &input))
return -EINVAL;
if (input > 0)
input = max(input, (int)freq_min[CA7]);
if (pm_qos_request_active(&max_kfc_qos))
pm_qos_update_request(&max_kfc_qos, input);
return count;
}
define_one_global_ro(cpu_freq_table);
define_one_global_rw(cpu_min_freq);
define_one_global_rw(cpu_max_freq);
define_one_global_ro(kfc_freq_table);
define_one_global_rw(kfc_min_freq);
define_one_global_rw(kfc_max_freq);
static struct attribute *mp_attributes[] = {
&cpu_freq_table.attr,
&cpu_min_freq.attr,
&cpu_max_freq.attr,
&kfc_freq_table.attr,
&kfc_min_freq.attr,
&kfc_max_freq.attr,
NULL
};
static struct attribute_group mp_attr_group = {
.attrs = mp_attributes,
.name = "mp-cpufreq",
};
#ifdef CONFIG_PM
static struct global_attr cpufreq_table =
__ATTR(cpufreq_table, S_IRUGO, show_cpufreq_table, NULL);
static struct global_attr cpufreq_min_limit =
__ATTR(cpufreq_min_limit, S_IRUGO | S_IWUSR,
show_cpufreq_min_limit, store_cpufreq_min_limit);
static struct global_attr cpufreq_max_limit =
__ATTR(cpufreq_max_limit, S_IRUGO | S_IWUSR,
show_cpufreq_max_limit, store_cpufreq_max_limit);
#endif
/************************** sysfs end ************************/
static int exynos_cpufreq_reboot_notifier_call(struct notifier_block *this,
unsigned long code, void *_cmd)
{
struct cpufreq_frequency_table *CA15_freq_table = exynos_info[CA15]->freq_table;
struct cpufreq_frequency_table *CA7_freq_table = exynos_info[CA7]->freq_table;
unsigned int freqCA7, freqCA15;
unsigned int bootfreqCA7, bootfreqCA15;
unsigned int abb_freqCA7 = 0, abb_freqCA15 = 0;
bool set_abb_first_than_volt = false;
int volt, i;
mutex_lock(&cpufreq_lock);
exynos_info[CA7]->blocked = true;
exynos_info[CA15]->blocked = true;
mutex_unlock(&cpufreq_lock);
bootfreqCA7 = get_boot_freq(CA7);
bootfreqCA15 = get_boot_freq(CA15);
freqCA7 = freqs[CA7]->old;
freqCA15 = freqs[CA15]->old;
volt = max(get_boot_volt(CA7),
get_freq_volt(CA7, freqCA7));
volt = get_limit_voltage(volt);
if (exynos_info[CA7]->abb_table)
set_abb_first_than_volt = is_set_abb_first(ID_ARM, freqCA7, max(bootfreqCA7, freqCA7));
if (!set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt))
goto err;
if (exynos_info[CA7]->abb_table) {
abb_freqCA7 = max(bootfreqCA7, freqCA7);
for (i = 0; (CA7_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (CA7_freq_table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
if (CA7_freq_table[i].frequency == abb_freqCA7) {
set_match_abb(ID_KFC, exynos_info[CA7]->abb_table[i]);
break;
}
}
}
if (set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA7]->regulator, volt, volt))
goto err;
if (exynos_info[CA7]->set_ema)
exynos_info[CA7]->set_ema(volt);
volt = max(get_boot_volt(CA15),
get_freq_volt(CA15, freqCA15));
volt = get_limit_voltage(volt);
set_abb_first_than_volt = false;
if (exynos_info[CA15]->abb_table)
set_abb_first_than_volt = is_set_abb_first(ID_ARM, freqCA15, max(bootfreqCA15, freqCA15));
if (!set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt))
goto err;
if (exynos_info[CA15]->abb_table) {
abb_freqCA15 = max(bootfreqCA15, freqCA15);
for (i = 0; (CA15_freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (CA15_freq_table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
if (CA15_freq_table[i].frequency == abb_freqCA15) {
set_match_abb(ID_ARM, exynos_info[CA15]->abb_table[i]);
break;
}
}
}
if (set_abb_first_than_volt)
if (regulator_set_voltage(exynos_info[CA15]->regulator, volt, volt))
goto err;
if (exynos_info[CA15]->set_ema)
exynos_info[CA15]->set_ema(volt);
return NOTIFY_DONE;
err:
pr_err("%s: failed to set voltage\n", __func__);
return NOTIFY_BAD;
}
static struct notifier_block exynos_cpufreq_reboot_notifier = {
.notifier_call = exynos_cpufreq_reboot_notifier_call,
};
void (*disable_c3_idle)(bool disable);
static void exynos_qos_nop(void *info)
{
}
static int exynos_cpu_min_qos_handler(struct notifier_block *b, unsigned long val, void *v)
{
int ret;
unsigned long freq;
struct cpufreq_policy *policy;
int cpu = boot_cluster ? 0 : NR_CA7;
if (val)
event_hotplug_in();
freq = exynos_getspeed(cpu);
if (freq >= val)
goto good;
policy = cpufreq_cpu_get(cpu);
if (!policy)
goto bad;
if (!policy->user_policy.governor) {
cpufreq_cpu_put(policy);
goto bad;
}
#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_PERFORMANCE)
if ((strcmp(policy->governor->name, "userspace") == 0)
|| strcmp(policy->governor->name, "performance") == 0) {
cpufreq_cpu_put(policy);
goto good;
}
#endif
if (disable_c3_idle)
disable_c3_idle(true);
smp_call_function_single(cpu, exynos_qos_nop, NULL, 0);
ret = __cpufreq_driver_target(policy, val, CPUFREQ_RELATION_H);
if (disable_c3_idle)
disable_c3_idle(false);
cpufreq_cpu_put(policy);
if (ret < 0)
goto bad;
good:
return NOTIFY_OK;
bad:
return NOTIFY_BAD;
}
static struct notifier_block exynos_cpu_min_qos_notifier = {
.notifier_call = exynos_cpu_min_qos_handler,
};
static int exynos_cpu_max_qos_handler(struct notifier_block *b, unsigned long val, void *v)
{
int ret;
unsigned long freq;
struct cpufreq_policy *policy;
int cpu = boot_cluster ? 0 : NR_CA7;
freq = exynos_getspeed(cpu);
if (freq <= val)
goto good;
policy = cpufreq_cpu_get(cpu);
if (!policy)
goto bad;
if (!policy->user_policy.governor) {
cpufreq_cpu_put(policy);
goto bad;
}
#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_PERFORMANCE)
if ((strcmp(policy->governor->name, "userspace") == 0)
|| strcmp(policy->governor->name, "performance") == 0) {
cpufreq_cpu_put(policy);
goto good;
}
#endif
if (disable_c3_idle)
disable_c3_idle(true);
smp_call_function_single(cpu, exynos_qos_nop, NULL, 0);
ret = __cpufreq_driver_target(policy, val, CPUFREQ_RELATION_H);
if (disable_c3_idle)
disable_c3_idle(false);
cpufreq_cpu_put(policy);
if (ret < 0)
goto bad;
good:
return NOTIFY_OK;
bad:
return NOTIFY_BAD;
}
static struct notifier_block exynos_cpu_max_qos_notifier = {
.notifier_call = exynos_cpu_max_qos_handler,
};
static int exynos_kfc_min_qos_handler(struct notifier_block *b, unsigned long val, void *v)
{
int ret;
unsigned long freq;
struct cpufreq_policy *policy;
int cpu = boot_cluster ? NR_CA15 : 0;
unsigned int threshold_freq;
threshold_freq = 1000000; /* 1.0GHz */
if (val > threshold_freq)
event_hotplug_in();
freq = exynos_getspeed(cpu);
if (freq >= val)
goto good;
policy = cpufreq_cpu_get(cpu);
if (!policy)
goto bad;
if (!policy->user_policy.governor) {
cpufreq_cpu_put(policy);
goto bad;
}
#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_PERFORMANCE)
if ((strcmp(policy->governor->name, "userspace") == 0)
|| strcmp(policy->governor->name, "performance") == 0) {
cpufreq_cpu_put(policy);
goto good;
}
#endif
smp_call_function_single(cpu, exynos_qos_nop, NULL, 0);
ret = __cpufreq_driver_target(policy, val, CPUFREQ_RELATION_H);
cpufreq_cpu_put(policy);
if (ret < 0)
goto bad;
good:
return NOTIFY_OK;
bad:
return NOTIFY_BAD;
}
static struct notifier_block exynos_kfc_min_qos_notifier = {
.notifier_call = exynos_kfc_min_qos_handler,
};
static int exynos_kfc_max_qos_handler(struct notifier_block *b, unsigned long val, void *v)
{
int ret;
unsigned long freq;
struct cpufreq_policy *policy;
int cpu = boot_cluster ? NR_CA15 : 0;
freq = exynos_getspeed(cpu);
if (freq <= val)
goto good;
policy = cpufreq_cpu_get(cpu);
if (!policy)
goto bad;
if (!policy->user_policy.governor) {
cpufreq_cpu_put(policy);
goto bad;
}
#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_PERFORMANCE)
if ((strcmp(policy->governor->name, "userspace") == 0)
|| strcmp(policy->governor->name, "performance") == 0) {
cpufreq_cpu_put(policy);
goto good;
}
#endif
smp_call_function_single(cpu, exynos_qos_nop, NULL, 0);
ret = __cpufreq_driver_target(policy, val, CPUFREQ_RELATION_H);
cpufreq_cpu_put(policy);
if (ret < 0)
goto bad;
good:
return NOTIFY_OK;
bad:
return NOTIFY_BAD;
}
static struct notifier_block exynos_kfc_max_qos_notifier = {
.notifier_call = exynos_kfc_max_qos_handler,
};
static int __init exynos_cpufreq_init(void)
{
int i, ret = -EINVAL;
cluster_type cluster;
struct cpufreq_frequency_table *freq_table;
g_clamp_cpufreqs[CA15] = UINT_MAX;
g_clamp_cpufreqs[CA7] = UINT_MAX;
boot_cluster = 0;
exynos_info[CA7] = kzalloc(sizeof(struct exynos_dvfs_info), GFP_KERNEL);
if (!exynos_info[CA7]) {
ret = -ENOMEM;
goto err_alloc_info_CA7;
}
exynos_info[CA15] = kzalloc(sizeof(struct exynos_dvfs_info), GFP_KERNEL);
if (!exynos_info[CA15]) {
ret = -ENOMEM;
goto err_alloc_info_CA15;
}
freqs[CA7] = kzalloc(sizeof(struct cpufreq_freqs), GFP_KERNEL);
if (!freqs[CA7]) {
ret = -ENOMEM;
goto err_alloc_freqs_CA7;
}
freqs[CA15] = kzalloc(sizeof(struct cpufreq_freqs), GFP_KERNEL);
if (!freqs[CA15]) {
ret = -ENOMEM;
goto err_alloc_freqs_CA15;
}
/* Get to boot_cluster_num - 0 for CA7; 1 for CA15 */
boot_cluster = !MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1);
pr_debug("%s: boot_cluster is %s\n", __func__,
boot_cluster == CA7 ? "CA7" : "CA15");
exynos_boot_cluster = boot_cluster;
init_cpumask_cluster_set(boot_cluster);
ret = exynos5_cpufreq_CA7_init(&exynos_info_CA7);
if (ret)
goto err_init_cpufreq;
ret = exynos5_cpufreq_CA15_init(&exynos_info_CA15);
if (ret)
goto err_init_cpufreq;
arm_regulator = regulator_get(NULL, "vdd_eagle");
if (IS_ERR(arm_regulator)) {
pr_err("%s: failed to get resource vdd_eagle\n", __func__);
goto err_vdd_eagle;
}
kfc_regulator = regulator_get(NULL, "vdd_kfc");
if (IS_ERR(kfc_regulator)) {
pr_err("%s:failed to get resource vdd_kfc\n", __func__);
goto err_vdd_kfc;
}
memcpy(exynos_info[CA7], &exynos_info_CA7,
sizeof(struct exynos_dvfs_info));
exynos_info[CA7]->regulator = kfc_regulator;
memcpy(exynos_info[CA15], &exynos_info_CA15,
sizeof(struct exynos_dvfs_info));
exynos_info[CA15]->regulator = arm_regulator;
if (exynos_info[CA7]->set_freq == NULL) {
pr_err("%s: No set_freq function (ERR)\n", __func__);
goto err_set_freq;
}
freq_max[CA15] = exynos_info[CA15]->
freq_table[exynos_info[CA15]->max_support_idx].frequency;
freq_min[CA15] = exynos_info[CA15]->
freq_table[exynos_info[CA15]->min_support_idx].frequency;
freq_max[CA7] = exynos_info[CA7]->
freq_table[exynos_info[CA7]->max_support_idx].frequency;
freq_min[CA7] = exynos_info[CA7]->
freq_table[exynos_info[CA7]->min_support_idx].frequency;
set_boot_freq();
/* set initial old frequency */
freqs[CA7]->old = exynos_getspeed_cluster(CA7);
freqs[CA15]->old = exynos_getspeed_cluster(CA15);
/*
* boot freq index is needed if minimum supported frequency
* greater than boot freq
*/
for (cluster = 0; cluster < CA_END; cluster++) {
freq_table = exynos_info[cluster]->freq_table;
exynos_info[cluster]->boot_freq_idx = -1;
pr_debug("%s Core Max-Min frequency[%d - %d]KHz\n",
cluster ? "CA15" : "CA7", freq_max[cluster], freq_min[cluster]);
for (i = L0; (freq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (exynos_info[cluster]->boot_freq == freq_table[i].frequency) {
exynos_info[cluster]->boot_freq_idx = i;
pr_debug("boot frequency[%d] index %d\n",
exynos_info[cluster]->boot_freq, i);
}
if (freq_table[i].frequency > freq_max[cluster] ||
freq_table[i].frequency < freq_min[cluster])
freq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
}
}
register_hotcpu_notifier(&exynos_cpufreq_cpu_nb);
register_pm_notifier(&exynos_cpufreq_nb);
register_reboot_notifier(&exynos_cpufreq_reboot_notifier);
#ifdef CONFIG_EXYNOS_THERMAL
exynos_tmu_add_notifier(&exynos_tmu_nb);
#endif
/* setup default qos constraints */
max_cpu_qos_const.target_value = freq_max[CA15];
max_cpu_qos_const.default_value = freq_max[CA15];
pm_qos_update_constraints(PM_QOS_CPU_FREQ_MAX, &max_cpu_qos_const);
max_kfc_qos_const.target_value = freq_max[CA7];
max_kfc_qos_const.default_value = freq_max[CA7];
pm_qos_update_constraints(PM_QOS_KFC_FREQ_MAX, &max_kfc_qos_const);
pm_qos_add_notifier(PM_QOS_CPU_FREQ_MIN, &exynos_cpu_min_qos_notifier);
pm_qos_add_notifier(PM_QOS_CPU_FREQ_MAX, &exynos_cpu_max_qos_notifier);
pm_qos_add_notifier(PM_QOS_KFC_FREQ_MIN, &exynos_kfc_min_qos_notifier);
pm_qos_add_notifier(PM_QOS_KFC_FREQ_MAX, &exynos_kfc_max_qos_notifier);
if (cpufreq_register_driver(&exynos_driver)) {
pr_err("%s: failed to register cpufreq driver\n", __func__);
goto err_cpufreq;
}
ret = sysfs_create_group(cpufreq_global_kobject, &mp_attr_group);
if (ret) {
pr_err("%s: failed to create iks-cpufreq sysfs interface\n", __func__);
goto err_mp_attr;
}
#ifdef CONFIG_PM
ret = sysfs_create_file(power_kobj, &cpufreq_table.attr);
if (ret) {
pr_err("%s: failed to create cpufreq_table sysfs interface\n", __func__);
goto err_cpu_table;
}
ret = sysfs_create_file(power_kobj, &cpufreq_min_limit.attr);
if (ret) {
pr_err("%s: failed to create cpufreq_min_limit sysfs interface\n", __func__);
goto err_cpufreq_min_limit;
}
ret = sysfs_create_file(power_kobj, &cpufreq_max_limit.attr);
if (ret) {
pr_err("%s: failed to create cpufreq_max_limit sysfs interface\n", __func__);
goto err_cpufreq_max_limit;
}
#endif
pm_qos_add_request(&min_kfc_qos, PM_QOS_KFC_FREQ_MIN,
PM_QOS_KFC_FREQ_MIN_DEFAULT_VALUE);
pm_qos_add_request(&max_kfc_qos, PM_QOS_KFC_FREQ_MAX,
max_kfc_qos_const.default_value);
pm_qos_add_request(&min_cpu_qos, PM_QOS_CPU_FREQ_MIN,
PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE);
pm_qos_add_request(&max_cpu_qos, PM_QOS_CPU_FREQ_MAX,
max_cpu_qos_const.default_value);
if (exynos_info[CA7]->boot_cpu_min_qos) {
pm_qos_add_request(&boot_min_kfc_qos, PM_QOS_KFC_FREQ_MIN,
PM_QOS_KFC_FREQ_MIN_DEFAULT_VALUE);
pm_qos_update_request_timeout(&boot_min_kfc_qos,
exynos_info[CA7]->boot_cpu_min_qos, 40000 * 1000);
}
if (exynos_info[CA7]->boot_cpu_max_qos) {
pm_qos_add_request(&boot_max_kfc_qos, PM_QOS_KFC_FREQ_MAX,
max_kfc_qos_const.default_value);
pm_qos_update_request_timeout(&boot_max_kfc_qos,
exynos_info[CA7]->boot_cpu_max_qos, 40000 * 1000);
}
if (exynos_info[CA15]->boot_cpu_min_qos) {
pm_qos_add_request(&boot_min_cpu_qos, PM_QOS_CPU_FREQ_MIN,
max_cpu_qos_const.default_value);
pm_qos_update_request_timeout(&boot_min_cpu_qos,
exynos_info[CA15]->boot_cpu_min_qos, 40000 * 1000);
}
if (exynos_info[CA15]->boot_cpu_max_qos) {
pm_qos_add_request(&boot_max_cpu_qos, PM_QOS_CPU_FREQ_MAX,
PM_QOS_CPU_FREQ_MAX_DEFAULT_VALUE);
pm_qos_update_request_timeout(&boot_max_cpu_qos,
exynos_info[CA15]->boot_cpu_max_qos, 40000 * 1000);
}
if (exynos_info[CA7]->bus_table)
pm_qos_add_request(&exynos_mif_qos_CA7, PM_QOS_BUS_THROUGHPUT, 0);
if (exynos_info[CA15]->bus_table)
pm_qos_add_request(&exynos_mif_qos_CA15, PM_QOS_BUS_THROUGHPUT, 0);
if (exynos_info[CA7]->bus_table || exynos_info[CA15]->bus_table) {
INIT_DEFERRABLE_WORK(&monitor_cluster_on, cluster_onoff_monitor);
cluster_monitor_wq = create_workqueue("cluster_monitor");
if (!cluster_monitor_wq) {
pr_err("%s: failed to create cluster_monitor_wq\n", __func__);
goto err_workqueue;
}
queue_delayed_work_on(0, cluster_monitor_wq, &monitor_cluster_on,
msecs_to_jiffies(1000));
}
exynos_cpufreq_init_done = true;
exynos_cpufreq_init_notify_call_chain(CPUFREQ_INIT_COMPLETE);
return 0;
err_workqueue:
if (exynos_info[CA15]->bus_table)
pm_qos_remove_request(&exynos_mif_qos_CA15);
if (exynos_info[CA7]->bus_table)
pm_qos_remove_request(&exynos_mif_qos_CA7);
if (pm_qos_request_active(&boot_max_cpu_qos))
pm_qos_remove_request(&boot_max_cpu_qos);
if (pm_qos_request_active(&boot_min_cpu_qos))
pm_qos_remove_request(&boot_min_cpu_qos);
if (pm_qos_request_active(&boot_max_kfc_qos))
pm_qos_remove_request(&boot_max_kfc_qos);
if (pm_qos_request_active(&boot_min_kfc_qos))
pm_qos_remove_request(&boot_min_kfc_qos);
#ifdef CONFIG_PM
err_cpufreq_max_limit:
sysfs_remove_file(power_kobj, &cpufreq_min_limit.attr);
err_cpufreq_min_limit:
sysfs_remove_file(power_kobj, &cpufreq_table.attr);
err_cpu_table:
sysfs_remove_group(cpufreq_global_kobject, &mp_attr_group);
#endif
err_mp_attr:
cpufreq_unregister_driver(&exynos_driver);
err_cpufreq:
pm_qos_remove_notifier(PM_QOS_CPU_FREQ_MIN, &exynos_cpu_min_qos_notifier);
pm_qos_remove_notifier(PM_QOS_CPU_FREQ_MAX, &exynos_cpu_max_qos_notifier);
pm_qos_remove_notifier(PM_QOS_KFC_FREQ_MIN, &exynos_kfc_min_qos_notifier);
pm_qos_remove_notifier(PM_QOS_KFC_FREQ_MAX, &exynos_kfc_max_qos_notifier);
unregister_reboot_notifier(&exynos_cpufreq_reboot_notifier);
unregister_pm_notifier(&exynos_cpufreq_nb);
unregister_hotcpu_notifier(&exynos_cpufreq_cpu_nb);
err_set_freq:
regulator_put(kfc_regulator);
err_vdd_kfc:
regulator_put(arm_regulator);
err_vdd_eagle:
err_init_cpufreq:
kfree(freqs[CA15]);
err_alloc_freqs_CA15:
kfree(freqs[CA7]);
err_alloc_freqs_CA7:
kfree(exynos_info[CA15]);
err_alloc_info_CA15:
kfree(exynos_info[CA7]);
err_alloc_info_CA7:
pr_err("%s: failed initialization\n", __func__);
return ret;
}
late_initcall(exynos_cpufreq_init);
| cypresskr/linux | drivers/cpufreq/exynos-mp-cpufreq.c | C | gpl-2.0 | 55,344 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2286,
19102,
8139,
2522,
1012,
1010,
5183,
1012,
1008,
8299,
1024,
1013,
1013,
7479,
1012,
19102,
1012,
4012,
1008,
1008,
4654,
6038,
2891,
1011,
6131,
17368,
6075,
25169,
2490,
30524,
2923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html>
<head>
<link href="../css/bootstrap.css" rel="stylesheet">
<style>
.table {
font-size: 10pt;
}
.table td {
line-height: 16px;
}
</style>
</head>
<body>
<b>Keyboard shortcuts</b>
<table class='table'>
<tr><td colspan="2"><b>Browser Navigation</b><br>Mouse must be within browser window to navigate; click on track label if focus has been lost.</td></tr>
<tr>
<td>← | →</td>
<td>Move left | right (increase | decrease genomic coordinates)</td>
</tr>
<tr>
<td>ctrl ← | ctrl →</td>
<td>Next feature left | right above threshold in selected track<br>(doesn't work for all data sources)</td>
</tr>
<tr>
<td>Space bar</td>
<td>Toggle zoom to base pair coordinates and back</td>
</tr>
<tr><td colspan="2"><b>Track Navigation</b><br>Highlighted track label is selected track</td></tr>
<tr>
<td>↑ / w |<br>↓ / s</td>
<td>Select track above | below</td>
</tr>
<tr>
<td>shift ↑ | shift ↓</td>
<td>Expand | contract selected track</td>
</tr>
<tr>
<td>t | shift t</td>
<td>For tracks with ⊕ toogle expansion of selected | all tracks (genes ↔ transcripts)</td>
</tr>
<tr><td colspan="2"><b>Information</b></td></tr>
<tr>
<td>i</td>
<td>Toggle description of selected track</td>
</tr>
<tr>
<td>h</td>
<td>Toggle help panel</td>
</tr>
</table>
</body>
</html>
| mpi2/PhenotypeArchive | WebContent/resources/dalliance/help/index.html | HTML | apache-2.0 | 1,398 | [
30522,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
4957,
17850,
12879,
1027,
1000,
1012,
1012,
1013,
20116,
2015,
1013,
6879,
6494,
2361,
1012,
20116,
2015,
1000,
2128,
2140,
1027,
1000,
6782,
21030,
2102,
1000,
1028,
1026,
2806,
1028,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace DataSift\Tests\Stubs;
use DataSift_IStreamConsumerEventHandler;
class StubEventHandler implements DataSift_IStreamConsumerEventHandler
{
public function onConnect($consumer)
{
}
public function onInteraction($consumer, $interaction, $hash)
{
}
public function onDeleted($consumer, $interaction, $hash)
{
}
public function onStatus($consumer, $type, $info)
{
}
public function onWarning($consumer, $message)
{
}
public function onError($consumer, $message)
{
}
public function onDisconnect($consumer)
{
}
public function onStopped($consumer, $reason)
{
}
}
| datasift/datasift-php | tests/Stubs/StubEventHandler.php | PHP | mit | 678 | [
30522,
1026,
1029,
25718,
3415,
15327,
2951,
5332,
6199,
1032,
5852,
1032,
24646,
5910,
1025,
2224,
2951,
5332,
6199,
1035,
21541,
16416,
12458,
5644,
17897,
2890,
15338,
11774,
3917,
1025,
2465,
24646,
4783,
15338,
11774,
3917,
22164,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=b863d60b03fea8abc1e7)
* Config saved to config.json and https://gist.github.com/b863d60b03fea8abc1e7
*/
/*!
* 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;
-ms-text-size-adjust: 100%;
-webkit-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 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
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 {
border: 0;
padding: 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-appearance: textfield;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-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: #333333;
background-color: #ffffff;
}
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 {
padding: 4px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
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: #777777;
}
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 {
background-color: #fcf8e3;
padding: .2em;
}
.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: #777777;
}
.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 #eeeeee;
}
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;
list-style: none;
margin-left: -5px;
}
.list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 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;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #777777;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee;
}
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: #777777;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
text-align: right;
}
.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: #ffffff;
background-color: #333333;
border-radius: 3px;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
box-shadow: inset 0 -1px 0 rgba(0, 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;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
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 {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.row {
margin-left: -15px;
margin-right: -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-left: 15px;
padding-right: 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: #777777;
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 #dddddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.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 #dddddd;
}
.table .table {
background-color: #ffffff;
}
.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 #dddddd;
}
.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 #dddddd;
}
.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;
float: none;
display: table-column;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
float: none;
display: table-cell;
}
.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 {
overflow-x: auto;
min-height: 0.01%;
}
@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 #dddddd;
}
.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 {
padding: 0;
margin: 0;
border: 0;
min-width: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #333333;
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: #555555;
}
.form-control {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 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, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::-moz-placeholder {
color: #999999;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #999999;
}
.form-control::-webkit-input-placeholder {
color: #999999;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: #eeeeee;
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-left: -20px;
margin-top: 4px \9;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
position: relative;
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
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 {
padding-top: 7px;
padding-bottom: 7px;
margin-bottom: 0;
min-height: 34px;
}
.form-control-static.input-lg,
.form-control-static.input-sm {
padding-left: 0;
padding-right: 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, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-success .form-control:focus {
border-color: #2b542c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
}
.has-success .input-group-addon {
color: #3c763d;
border-color: #3c763d;
background-color: #dff0d8;
}
.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, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-warning .form-control:focus {
border-color: #66512c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
}
.has-warning .input-group-addon {
color: #8a6d3b;
border-color: #8a6d3b;
background-color: #fcf8e3;
}
.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, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
}
.has-error .input-group-addon {
color: #a94442;
border-color: #a94442;
background-color: #f2dede;
}
.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 {
margin-top: 0;
margin-bottom: 0;
padding-top: 7px;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 27px;
}
.form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
margin-bottom: 0;
padding-top: 7px;
}
}
.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;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.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: #333333;
text-decoration: none;
}
.btn:active,
.btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
a.btn.disabled,
fieldset[disabled] a.btn {
pointer-events: none;
}
.btn-default {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.btn-default:focus,
.btn-default.focus {
color: #333333;
background-color: #e6e6e6;
border-color: #8c8c8c;
}
.btn-default:hover {
color: #333333;
background-color: #e6e6e6;
border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333333;
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: #333333;
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: #ffffff;
border-color: #cccccc;
}
.btn-default .badge {
color: #ffffff;
background-color: #333333;
}
.btn-primary {
color: #ffffff;
background-color: #337ab7;
border-color: #2e6da4;
}
.btn-primary:focus,
.btn-primary.focus {
color: #ffffff;
background-color: #286090;
border-color: #122b40;
}
.btn-primary:hover {
color: #ffffff;
background-color: #286090;
border-color: #204d74;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #ffffff;
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: #ffffff;
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: #ffffff;
}
.btn-success {
color: #ffffff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn-success:focus,
.btn-success.focus {
color: #ffffff;
background-color: #449d44;
border-color: #255625;
}
.btn-success:hover {
color: #ffffff;
background-color: #449d44;
border-color: #398439;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #ffffff;
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: #ffffff;
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: #ffffff;
}
.btn-info {
color: #ffffff;
background-color: #5bc0de;
border-color: #46b8da;
}
.btn-info:focus,
.btn-info.focus {
color: #ffffff;
background-color: #31b0d5;
border-color: #1b6d85;
}
.btn-info:hover {
color: #ffffff;
background-color: #31b0d5;
border-color: #269abc;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #ffffff;
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: #ffffff;
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: #ffffff;
}
.btn-warning {
color: #ffffff;
background-color: #f0ad4e;
border-color: #eea236;
}
.btn-warning:focus,
.btn-warning.focus {
color: #ffffff;
background-color: #ec971f;
border-color: #985f0d;
}
.btn-warning:hover {
color: #ffffff;
background-color: #ec971f;
border-color: #d58512;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #ffffff;
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: #ffffff;
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: #ffffff;
}
.btn-danger {
color: #ffffff;
background-color: #d9534f;
border-color: #d43f3a;
}
.btn-danger:focus,
.btn-danger.focus {
color: #ffffff;
background-color: #c9302c;
border-color: #761c19;
}
.btn-danger:hover {
color: #ffffff;
background-color: #c9302c;
border-color: #ac2925;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #ffffff;
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: #ffffff;
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: #ffffff;
}
.btn-link {
color: #337ab7;
font-weight: normal;
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: #777777;
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 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.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-property: height, visibility;
-o-transition-property: height, visibility;
transition-property: height, visibility;
-webkit-transition-duration: 0.35s;
-o-transition-duration: 0.35s;
transition-duration: 0.35s;
-webkit-transition-timing-function: ease;
-o-transition-timing-function: ease;
transition-timing-function: ease;
}
.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;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.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: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #337ab7;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #777777;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
left: auto;
right: 0;
}
.dropdown-menu-left {
left: 0;
right: auto;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777777;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px dashed;
border-bottom: 4px solid \9;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 2px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
}
.navbar-right .dropdown-menu-left {
left: 0;
right: auto;
}
}
.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-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
border-bottom-left-radius: 0;
border-top-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-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 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-bottom-left-radius: 4px;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.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-right-radius: 0;
border-top-left-radius: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
float: none;
display: table-cell;
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-left: 0;
padding-right: 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: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
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-bottom-right-radius: 0;
border-top-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-bottom-left-radius: 0;
border-top-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 {
margin-bottom: 0;
padding-left: 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: #eeeeee;
}
.nav > li.disabled > a {
color: #777777;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #777777;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
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 #dddddd;
}
.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: #eeeeee #eeeeee #dddddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.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 #dddddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
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: #ffffff;
}
}
.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: #ffffff;
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 {
text-align: center;
margin-bottom: 5px;
}
.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 #dddddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
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: #ffffff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
border-top-right-radius: 0;
border-top-left-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 {
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.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-left: 0;
padding-right: 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;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
height: 50px;
}
.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;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
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 {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 8px;
margin-bottom: 8px;
}
@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;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
margin-bottom: 0;
border-top-right-radius: 4px;
border-top-left-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-left: 15px;
margin-right: 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: #777777;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #5e5e5e;
background-color: transparent;
}
.navbar-default .navbar-text {
color: #777777;
}
.navbar-default .navbar-nav > li > a {
color: #777777;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #dddddd;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #dddddd;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #888888;
}
.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 {
background-color: #e7e7e7;
color: #555555;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #777777;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
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: #555555;
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: #cccccc;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #777777;
}
.navbar-default .navbar-link:hover {
color: #333333;
}
.navbar-default .btn-link {
color: #777777;
}
.navbar-default .btn-link:hover,
.navbar-default .btn-link:focus {
color: #333333;
}
.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: #cccccc;
}
.navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
color: #9d9d9d;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ffffff;
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: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #333333;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #333333;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.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 {
background-color: #080808;
color: #ffffff;
}
@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: #ffffff;
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: #ffffff;
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: #444444;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #9d9d9d;
}
.navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.navbar-inverse .btn-link {
color: #9d9d9d;
}
.navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link:focus {
color: #ffffff;
}
.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: #444444;
}
.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 {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.breadcrumb > .active {
color: #777777;
}
.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;
line-height: 1.42857143;
text-decoration: none;
color: #337ab7;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-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: #eeeeee;
border-color: #dddddd;
}
.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: #ffffff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #777777;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.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-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
border-bottom-right-radius: 6px;
border-top-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-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.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: #777777;
background-color: #ffffff;
cursor: not-allowed;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a.label:hover,
a.label:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #777777;
}
.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;
color: #ffffff;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
text-align: center;
background-color: #777777;
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: #ffffff;
text-decoration: none;
cursor: pointer;
}
.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #ffffff;
}
.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: #eeeeee;
}
.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-left: 60px;
padding-right: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: border 0.2s ease-in-out;
-o-transition: border 0.2s ease-in-out;
transition: border 0.2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
margin-left: auto;
margin-right: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #337ab7;
}
.thumbnail .caption {
padding: 9px;
color: #333333;
}
.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 {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #2b542c;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #245269;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
}
.alert-warning hr {
border-top-color: #f7e1b5;
}
.alert-warning .alert-link {
color: #66512c;
}
.alert-danger {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
}
.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 {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #337ab7;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.progress-striped .progress-bar,
.progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.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, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.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, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.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, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.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, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media,
.media-body {
zoom: 1;
overflow: hidden;
}
.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 {
margin-bottom: 20px;
padding-left: 0;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.list-group-item:first-child {
border-top-right-radius: 4px;
border-top-left-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: #555555;
}
a.list-group-item .list-group-item-heading,
button.list-group-item .list-group-item-heading {
color: #333333;
}
a.list-group-item:hover,
button.list-group-item:hover,
a.list-group-item:focus,
button.list-group-item:focus {
text-decoration: none;
color: #555555;
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 {
background-color: #eeeeee;
color: #777777;
cursor: not-allowed;
}
.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: #777777;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
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: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
padding: 15px;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 3px;
border-top-left-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 #dddddd;
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-right-radius: 3px;
border-top-left-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-right-radius: 0;
border-top-left-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-left: 15px;
padding-right: 15px;
}
.panel > .table:first-child,
.panel > .table-responsive:first-child > .table:first-child {
border-top-right-radius: 3px;
border-top-left-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-left-radius: 3px;
border-bottom-right-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 #dddddd;
}
.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 {
border: 0;
margin-bottom: 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 #dddddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.panel-default {
border-color: #dddddd;
}
.panel-default > .panel-heading {
color: #333333;
background-color: #f5f5f5;
border-color: #dddddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #333333;
}
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-primary {
border-color: #337ab7;
}
.panel-primary > .panel-heading {
color: #ffffff;
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: #ffffff;
}
.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;
left: 0;
bottom: 0;
height: 100%;
width: 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, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 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: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.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: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
-webkit-background-clip: padding-box;
background-clip: padding-box;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.42857143px;
}
.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-left: 5px;
margin-bottom: 0;
}
.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, 0.5);
box-shadow: 0 5px 15px rgba(0, 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-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 12px;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
background-color: #000000;
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: #000000;
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
right: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.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-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
font-size: 14px;
background-color: #ffffff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
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 {
border-width: 10px;
content: "";
}
.popover.top > .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top > .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right > .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom > .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left > .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.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 0.6s ease-in-out;
-o-transition: -o-transform 0.6s ease-in-out;
transition: transform 0.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 {
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
left: 0;
}
.carousel-inner > .item.prev,
.carousel-inner > .item.active.left {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
left: 0;
}
.carousel-inner > .item.next.left,
.carousel-inner > .item.prev.right,
.carousel-inner > .item.active {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
left: 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;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-control.left {
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
outline: 0;
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right {
position: absolute;
top: 50%;
margin-top: -10px;
z-index: 5;
display: inline-block;
}
.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;
line-height: 1;
font-family: serif;
}
.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%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 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 {
left: 20%;
right: 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 {
content: " ";
display: table;
}
.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-left: auto;
margin-right: 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;
}
}
| hidu/api-man | resource/bootstrap/css/bootstrap.css | CSS | mit | 147,977 | [
30522,
1013,
1008,
999,
1008,
6879,
6494,
2361,
1058,
2509,
1012,
1017,
1012,
1019,
1006,
8299,
1024,
1013,
1013,
2131,
27927,
20528,
2361,
1012,
4012,
1007,
1008,
9385,
2249,
1011,
2325,
10474,
1010,
4297,
1012,
1008,
7000,
2104,
10210,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package main
import (
"net/http"
"os"
"path"
"strings"
"github.com/zenazn/goji/web"
)
func fileServeHandler(c web.C, w http.ResponseWriter, r *http.Request) {
fileName := c.URLParams["name"]
filePath := path.Join(Config.filesDir, fileName)
if !fileExistsAndNotExpired(fileName) {
notFoundHandler(c, w, r)
return
}
if !Config.allowHotlink {
referer := r.Header.Get("Referer")
if referer != "" && !strings.HasPrefix(referer, Config.siteURL) {
w.WriteHeader(403)
return
}
}
w.Header().Set("Content-Security-Policy", Config.fileContentSecurityPolicy)
http.ServeFile(w, r, filePath)
}
func staticHandler(c web.C, w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
if path[len(path)-1:] == "/" {
notFoundHandler(c, w, r)
return
} else {
if path == "/favicon.ico" {
path = "/static/images/favicon.gif"
}
filePath := strings.TrimPrefix(path, "/static/")
file, err := staticBox.Open(filePath)
if err != nil {
notFoundHandler(c, w, r)
return
}
w.Header().Set("Etag", timeStartedStr)
w.Header().Set("Cache-Control", "max-age=86400")
http.ServeContent(w, r, filePath, timeStarted, file)
return
}
}
func fileExistsAndNotExpired(filename string) bool {
filePath := path.Join(Config.filesDir, filename)
_, err := os.Stat(filePath)
if err != nil {
return false
}
if isFileExpired(filename) {
os.Remove(path.Join(Config.filesDir, filename))
os.Remove(path.Join(Config.metaDir, filename))
return false
}
return true
}
| matthazinski/linx-server | fileserve.go | GO | gpl-3.0 | 1,505 | [
30522,
7427,
2364,
12324,
1006,
1000,
5658,
1013,
8299,
1000,
1000,
9808,
1000,
1000,
4130,
1000,
1000,
7817,
1000,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
16729,
10936,
2078,
1013,
2175,
4478,
1013,
4773,
1000,
1007,
4569,
2278,
6764,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
return [
'@class' => 'Grav\\Common\\File\\CompiledYamlFile',
'filename' => 'C:/xampp/htdocs/castledevcms/user/plugins/admin/languages/ar.yaml',
'modified' => 1493044482,
'data' => [
'PLUGIN_ADMIN' => [
'ADMIN_BETA_MSG' => 'هذا إصدار بيتا! استخدم هذا في الإنتاج على مسؤوليتك الخاصة...',
'ADMIN_REPORT_ISSUE' => 'وجدت مشكلة؟ الرجاء الإبلاغ عن GitHub.',
'EMAIL_FOOTER' => '<a href="http://getgrav.org">Powered by Grav</a> - The Modern Flat File CMS',
'LOGIN_BTN' => 'تسجل الدخول',
'LOGIN_BTN_FORGOT' => 'نسيت',
'LOGIN_BTN_RESET' => 'إعادة تعيين كلمة المرور',
'LOGIN_BTN_SEND_INSTRUCTIONS' => 'إرسال إرشادات إعادة تعيين',
'LOGIN_BTN_CLEAR' => 'مسح النموذج',
'LOGIN_BTN_CREATE_USER' => 'أنشاء مستخدم جديد',
'LOGIN_LOGGED_IN' => 'لقد تم تسجيل بنجاح',
'LOGIN_FAILED' => 'فشل تسجيل الخول',
'LOGGED_OUT' => 'لقد قمت بتسجيل الخروج',
'RESET_NEW_PASSWORD' => 'إدخال كلمة سر جديدة رجاءً …',
'RESET_LINK_EXPIRED' => 'انتهت مدة صلاحية إعادة الارتباط، الرجاء المحاولة مرة أخرى',
'RESET_PASSWORD_RESET' => 'لقد تم إعادة تعيين كلمة المرور',
'RESET_INVALID_LINK' => 'اللينك خاطئ ، الرجاء المحاولة مرة أخرى',
'FORGOT_INSTRUCTIONS_SENT_VIA_EMAIL' => 'تم إرسال إرشادات إعادة تعيين كلمة المرور الخاصة بك عبر البريد الإلكتروني إلى %s',
'FORGOT_FAILED_TO_EMAIL' => 'فشل في تعليمات البريد الإلكتروني، الرجاء المحاولة مرة أخرى لاحقاً',
'FORGOT_CANNOT_RESET_EMAIL_NO_EMAIL' => 'لا يمكن إعادة تعيين كلمة المرور ل %s، لم يتم تعيين عنوان البريد الإلكتروني',
'FORGOT_USERNAME_DOES_NOT_EXIST' => 'لا يوجد المستخدم مع اسم المستخدم <b>%s</b>',
'FORGOT_EMAIL_NOT_CONFIGURED' => 'لا يمكن إعادة تعيين كلمة المرور. لم يتم تكوين هذا الموقع لإرسال رسائل البريد الإلكتروني',
'FORGOT_EMAIL_SUBJECT' => 'طلب إعادة تعيين كلمة المرور %s',
'MANAGE_PAGES' => 'إدارة الصفحات',
'PAGES' => 'الصفحات',
'PLUGINS' => 'البرامج الإضافية',
'PLUGIN' => 'البرنامج الإضافي',
'THEMES' => 'المواضيع',
'LOGOUT' => 'تسجيل الخروج',
'BACK' => 'الرجوع',
'ADD_PAGE' => 'إضافة صفحة',
'ADD_MODULAR' => 'إضافة وحدة',
'MOVE' => 'انقل',
'DELETE' => 'حذف',
'SAVE' => 'حفظ',
'NORMAL' => 'عادي',
'EXPERT' => 'خبير',
'EXPAND_ALL' => 'عرض الكل',
'COLLAPSE_ALL' => 'طي الكل',
'ERROR' => 'خطأ',
'CLOSE' => 'أغلق',
'CANCEL' => 'إلغاء',
'CONTINUE' => 'المتابعة',
'MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE' => 'التأكيد مطلوب',
'MODAL_CHANGED_DETECTED_TITLE' => 'تم الكشف عن التغييرات',
'MODAL_CHANGED_DETECTED_DESC' => 'وقد تغييرات غير محفوظة. هل أنت متأكد من أنك تريد ترك دون الحفظ؟',
'MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_TITLE' => 'التأكيد مطلوب',
'MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_DESC' => 'هل أنت متأكد من حذف هذا الملف؟ لا يمكن التراجع عن هذا الإجراء.',
'ADD_FILTERS' => 'إضافة عامل تصفية',
'SEARCH_PAGES' => 'صفحات البحث',
'VERSION' => 'النسخة',
'WAS_MADE_WITH' => 'تم عمله مع',
'BY' => 'بواسطة',
'UPDATE_THEME' => 'تحديث الموضوع',
'UPDATE_PLUGIN' => 'تحديث البرنامج الإضافي',
'AUTHOR' => 'المؤلّف',
'HOMEPAGE' => 'الصفحة الرئيسية',
'DEMO' => 'عرض تجريبي',
'BUG_TRACKER' => 'متتبع الأخطاء',
'KEYWORDS' => 'الكلمات الرئيسية',
'LICENSE' => 'الرخصة',
'DESCRIPTION' => 'الوصف',
'README' => 'الملف التمهيدي',
'REMOVE_THEME' => 'إزالة الموضوع',
'INSTALL_THEME' => 'تثبيت الموضوع',
'THEME' => 'الموضوع',
'BACK_TO_THEMES' => 'العودة إلى المواضيع',
'BACK_TO_PLUGINS' => 'العودة إلى البرامج الإضافية',
'CHECK_FOR_UPDATES' => 'التحقق من وجود تحديثات',
'ADD' => 'أَضِف',
'CLEAR_CACHE' => 'مسح ذاكرة التخزين المؤقتة',
'CLEAR_CACHE_IMAGES_ONLY' => 'الصور فقط',
'DASHBOARD' => 'لوحة المعلومات',
'UPDATES_AVAILABLE' => 'تحديثات متوفّرة',
'DAYS' => 'أيام',
'UPDATE' => 'تحديث',
'STATISTICS' => 'إحصائيات',
'TODAY' => 'اليوم',
'WEEK' => 'اسبوع',
'MONTH' => 'شهر',
'MAINTENANCE' => 'الصيانه',
'MON' => 'الإثنين',
'TUE' => 'الثلاثاء',
'WED' => 'الإربعاء',
'THU' => 'الخميس',
'FRI' => 'الجمعة',
'SAT' => 'السبت',
'SUN' => 'الأحد',
'COPY' => 'نسخ',
'EDIT' => 'تحرير',
'CREATE' => 'انشاء'
]
]
];
| defremont/castledevcms | cache/compiled/files/e416da176901ece1baa86d315116523e.yaml.php | PHP | mit | 6,258 | [
30522,
1026,
1029,
25718,
2709,
1031,
1005,
1030,
2465,
1005,
1027,
1028,
1005,
24665,
11431,
1032,
1032,
2691,
1032,
1032,
5371,
1032,
1032,
9227,
14852,
10270,
9463,
1005,
1010,
1005,
5371,
18442,
1005,
1027,
1028,
1005,
1039,
1024,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
YUI.add('enc-utf16-test', function (Y) {
var C = CryptoJS;
Y.CryptoJSTestSuite.add(new Y.Test.Case({
name: 'Utf16',
testStringify1: function () {
Y.Assert.areEqual('z', C.enc.Utf16.stringify(C.lib.WordArray.create([0x007a0000], 2)));
},
testStringify2: function () {
Y.Assert.areEqual('水', C.enc.Utf16.stringify(C.lib.WordArray.create([0x6c340000], 2)));
},
testStringify3: function () {
Y.Assert.areEqual('𐀀', C.enc.Utf16.stringify(C.lib.WordArray.create([0xd800dc00], 4)));
},
testStringify4: function () {
Y.Assert.areEqual('𝄞', C.enc.Utf16.stringify(C.lib.WordArray.create([0xd834dd1e], 4)));
},
testStringify5: function () {
Y.Assert.areEqual('', C.enc.Utf16.stringify(C.lib.WordArray.create([0xdbffdffd], 4)));
},
testStringifyLE: function () {
Y.Assert.areEqual('', C.enc.Utf16LE.stringify(C.lib.WordArray.create([0xffdbfddf], 4)));
},
testStringifyLEInputIntegrity: function () {
var wordArray = C.lib.WordArray.create([0xffdbfddf], 4);
Y.Assert.areEqual('', C.enc.Utf16LE.stringify(wordArray));
Y.Assert.areEqual('', C.enc.Utf16LE.stringify(wordArray));
},
testParse1: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0x007a0000], 2).toString(), C.enc.Utf16.parse('z').toString());
},
testParse2: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0x6c340000], 2).toString(), C.enc.Utf16.parse('水').toString());
},
testParse3: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0xd800dc00], 4).toString(), C.enc.Utf16.parse('𐀀').toString());
},
testParse4: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0xd834dd1e], 4).toString(), C.enc.Utf16.parse('𝄞').toString());
},
testParse5: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0xdbffdffd], 4).toString(), C.enc.Utf16.parse('').toString());
},
testParseLE: function () {
Y.Assert.areEqual(C.lib.WordArray.create([0xffdbfddf], 4).toString(), C.enc.Utf16LE.parse('').toString());
}
}));
}, '$Rev$');
| pirafrank/crypto-js | branches/4.x/test/tests/enc-utf16-test.js | JavaScript | bsd-3-clause | 2,419 | [
30522,
9805,
2072,
1012,
5587,
1006,
1005,
4372,
2278,
1011,
21183,
2546,
16048,
1011,
3231,
1005,
1010,
3853,
1006,
1061,
1007,
1063,
13075,
1039,
1027,
19888,
29147,
2015,
1025,
1061,
1012,
19888,
29147,
13473,
12837,
14663,
2063,
1012,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Ext.ux.grid.GridFilters v0.2.7
**/
Ext.namespace("Ext.ux.grid");
Ext.ux.grid.GridFilters = function(config){
this.filters = new Ext.util.MixedCollection();
this.filters.getKey = function(o){return o ? o.dataIndex : null};
for(var i=0, len=config.filters.length; i<len; i++)
this.addFilter(config.filters[i]);
this.deferredUpdate = new Ext.util.DelayedTask(this.reload, this);
delete config.filters;
Ext.apply(this, config);
};
Ext.extend(Ext.ux.grid.GridFilters, Ext.util.Observable, {
/**
* @cfg {Integer} updateBuffer
* Number of milisecond to defer store updates since the last filter change.
*/
updateBuffer: 500,
/**
* @cfg {String} paramPrefix
* The url parameter prefix for the filters.
*/
paramPrefix: 'filter',
/**
* @cfg {String} fitlerCls
* The css class to be applied to column headers that active filters. Defaults to 'ux-filterd-column'
*/
filterCls: 'ux-filtered-column',
/**
* @cfg {Boolean} local
* True to use Ext.data.Store filter functions instead of server side filtering.
*/
local: false,
/**
* @cfg {Boolean} autoReload
* True to automagicly reload the datasource when a filter change happens.
*/
autoReload: true,
/**
* @cfg {String} stateId
* Name of the Ext.data.Store value to be used to store state information.
*/
stateId: undefined,
/**
* @cfg {Boolean} showMenu
* True to show the filter menus
*/
showMenu: true,
menuFilterText: 'Filters',
init: function(grid){
if(grid instanceof Ext.grid.GridPanel){
this.grid = grid;
this.store = this.grid.getStore();
if(this.local){
this.store.on('load', function(store){
store.filterBy(this.getRecordFilter());
}, this);
} else {
this.store.on('beforeload', this.onBeforeLoad, this);
}
this.grid.filters = this;
this.grid.addEvents({"filterupdate": true});
grid.on("render", this.onRender, this);
grid.on("beforestaterestore", this.applyState, this);
grid.on("beforestatesave", this.saveState, this);
} else if(grid instanceof Ext.PagingToolbar){
this.toolbar = grid;
}
},
/** private **/
applyState: function(grid, state){
this.suspendStateStore = true;
this.clearFilters();
if(state.filters)
for(var key in state.filters){
var filter = this.filters.get(key);
if(filter){
filter.setValue(state.filters[key]);
filter.setActive(true);
}
}
this.deferredUpdate.cancel();
if(this.local)
this.reload();
this.suspendStateStore = false;
},
/** private **/
saveState: function(grid, state){
var filters = {};
this.filters.each(function(filter){
if(filter.active)
filters[filter.dataIndex] = filter.getValue();
});
return state.filters = filters;
},
/** private **/
onRender: function(){
var hmenu;
if(this.showMenu){
hmenu = this.grid.getView().hmenu;
this.sep = hmenu.addSeparator();
this.menu = hmenu.add(new Ext.menu.CheckItem({
text: this.menuFilterText,
menu: new Ext.menu.Menu()
}));
this.menu.on('checkchange', this.onCheckChange, this);
this.menu.on('beforecheckchange', this.onBeforeCheck, this);
hmenu.on('beforeshow', this.onMenu, this);
}
this.grid.getView().on("refresh", this.onRefresh, this);
this.updateColumnHeadings(this.grid.getView());
},
/** private **/
onMenu: function(filterMenu){
var filter = this.getMenuFilter();
if(filter){
this.menu.menu = filter.menu;
this.menu.setChecked(filter.active, false);
}
this.menu.setVisible(filter !== undefined);
this.sep.setVisible(filter !== undefined);
},
/** private **/
onCheckChange: function(item, value){
this.getMenuFilter().setActive(value);
},
/** private **/
onBeforeCheck: function(check, value){
return !value || this.getMenuFilter().isActivatable();
},
/** private **/
onStateChange: function(event, filter){
if(event == "serialize") return;
if(filter == this.getMenuFilter())
this.menu.setChecked(filter.active, false);
if(this.autoReload || this.local)
this.deferredUpdate.delay(this.updateBuffer);
var view = this.grid.getView();
this.updateColumnHeadings(view);
this.grid.saveState();
this.grid.fireEvent('filterupdate', this, filter);
},
/** private **/
onBeforeLoad: function(store, options){
options.params = options.params || {};
this.cleanParams(options.params);
var params = this.buildQuery(this.getFilterData());
Ext.apply(options.params, params);
},
/** private **/
onRefresh: function(view){
this.updateColumnHeadings(view);
},
/** private **/
getMenuFilter: function(){
var view = this.grid.getView();
if(!view || view.hdCtxIndex === undefined)
return null;
return this.filters.get(
view.cm.config[view.hdCtxIndex].dataIndex);
},
/** private **/
updateColumnHeadings: function(view){
if(!view || !view.mainHd) return;
var hds = view.mainHd.select('td').removeClass(this.filterCls);
for(var i=0, len=view.cm.config.length; i<len; i++){
var filter = this.getFilter(view.cm.config[i].dataIndex);
if(filter && filter.active)
hds.item(i).addClass(this.filterCls);
}
},
/** private **/
reload: function(){
if(this.local){
this.grid.store.clearFilter(true);
this.grid.store.filterBy(this.getRecordFilter());
} else {
this.deferredUpdate.cancel();
var store = this.grid.store;
if(this.toolbar){
var start = this.toolbar.paramNames.start;
if(store.lastOptions && store.lastOptions.params && store.lastOptions.params[start])
store.lastOptions.params[start] = 0;
}
store.reload();
}
},
/**
* Method factory that generates a record validator for the filters active at the time
* of invokation.
*
* @private
*/
getRecordFilter: function(){
var f = [];
this.filters.each(function(filter){
if(filter.active) f.push(filter);
});
var len = f.length;
return function(record){
for(var i=0; i<len; i++)
if(!f[i].validateRecord(record))
return false;
return true;
};
},
/**
* Adds a filter to the collection.
*
* @param {Object/Ext.ux.grid.filter.Filter} config A filter configuration or a filter object.
*
* @return {Ext.ux.grid.filter.Filter} The existing or newly created filter object.
*/
addFilter: function(config){
var filter = config.menu ? config :
new (this.getFilterClass(config.type))(config);
this.filters.add(filter);
Ext.util.Observable.capture(filter, this.onStateChange, this);
return filter;
},
/**
* Returns a filter for the given dataIndex, if on exists.
*
* @param {String} dataIndex The dataIndex of the desired filter object.
*
* @return {Ext.ux.grid.filter.Filter}
*/
getFilter: function(dataIndex){
return this.filters.get(dataIndex);
},
/**
* Turns all filters off. This does not clear the configuration information.
*/
clearFilters: function(){
this.filters.each(function(filter){
filter.setActive(false);
});
},
/** private **/
getFilterData: function(){
var filters = [],
fields = this.grid.getStore().fields;
this.filters.each(function(f){
if(f.active){
var d = [].concat(f.serialize());
for(var i=0, len=d.length; i<len; i++)
filters.push({
field: f.dataIndex,
data: d[i]
});
}
});
return filters;
},
/**
* Function to take structured filter data and 'flatten' it into query parameteres. The default function
* will produce a query string of the form:
* filters[0][field]=dataIndex&filters[0][data][param1]=param&filters[0][data][param2]=param...
*
* @param {Array} filters A collection of objects representing active filters and their configuration.
* Each element will take the form of {field: dataIndex, data: filterConf}. dataIndex is not assured
* to be unique as any one filter may be a composite of more basic filters for the same dataIndex.
*
* @return {Object} Query keys and values
*/
buildQuery: function(filters){
var p = {};
for(var i=0, len=filters.length; i<len; i++){
var f = filters[i];
var root = [this.paramPrefix, '[', i, ']'].join('');
p[root + '[field]'] = f.field;
var dataPrefix = root + '[data]';
for(var key in f.data)
p[[dataPrefix, '[', key, ']'].join('')] = f.data[key];
}
return p;
},
/**
* Removes filter related query parameters from the provided object.
*
* @param {Object} p Query parameters that may contain filter related fields.
*/
cleanParams: function(p){
var regex = new RegExp("^" + this.paramPrefix + "\[[0-9]+\]");
for(var key in p)
if(regex.test(key))
delete p[key];
},
/**
* Function for locating filter classes, overwrite this with your favorite
* loader to provide dynamic filter loading.
*
* @param {String} type The type of filter to load.
*
* @return {Class}
*/
getFilterClass: function(type){
return Ext.ux.grid.filter[type.substr(0, 1).toUpperCase() + type.substr(1) + 'Filter'];
}
}); | bundocba/unitedworld | components/com_ose_cpu/extjs/grid/GridFilters.js | JavaScript | gpl-2.0 | 9,021 | [
30522,
1013,
1008,
1008,
1008,
4654,
2102,
1012,
1057,
2595,
1012,
8370,
1012,
8370,
8873,
21928,
2015,
1058,
2692,
1012,
1016,
1012,
1021,
1008,
1008,
1013,
4654,
2102,
1012,
3415,
15327,
1006,
1000,
4654,
2102,
1012,
1057,
2595,
1012,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class Vocabulist < Cask
url 'http://vocabulistapp.com/downloads/Vocabulist-2.2.dmg'
homepage 'http://vocabulistapp.com/'
version '2.2'
sha256 '414e77ea72c9caead1b5d7e389ed2541408350cd0a87d1e7e40c0d807ec577be'
link 'Vocabulist.app'
end
| rzyns/homebrew-cask | Casks/vocabulist.rb | Ruby | bsd-2-clause | 245 | [
30522,
2465,
29536,
3540,
8569,
9863,
1026,
25222,
2243,
24471,
2140,
1005,
8299,
1024,
1013,
1013,
29536,
3540,
8569,
9863,
29098,
1012,
4012,
1013,
22956,
1013,
29536,
3540,
8569,
9863,
1011,
1016,
1012,
1016,
1012,
1040,
24798,
1005,
218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Kmom3: Grunderna i jQuery
-------------------------
###Reflektera över svårigheter, problem, lösningar, erfarenheter, lärdomar, resultatet, etc.
Den här uppgiften har flutit på ganska bra, även om den har tagit lång tid. Det som jag fortfarande har lite problem med är css, tycker det är svårt att se hur egenskaper påverkar varandra. Ex. har man 'position: static'
så bortses från 'top' och 'left' värden (vilket kanske är självklart, men man önskar att man hade fått någon varning när man har 'död' css-kod).
Sen så skulle man önska sig lite mer 'best practices' för jQuery, HTML, LESS ... Det finns så många olika sätt att göra saker på, men vilka lösningar har visat sig hålla i längden ex. enkel att utöka, snabb, ...? Författarna till jQuery-boken tycker att det är upp till varje utvecklares personliga smak (men det kan ju samtidigt göra koden ganska svår att läsa för andra).
###Vad tycker du om jQuery, hur känns det?
Jag tycker att jQuery är lätt och roligt att arbeta med. Största fördelen, tycker jag, är att man slipper göra några större tester i olika browsers, man kan vara ganska säker på att det kommer att fungera i alla.
Men kanske ändå inte till 100%. Jag märkte att $(...).width() fungerade lite olika i Chrome jämfört med IE och Firefox. Då jag angav en bredd i em i ett nytt element, så gav .width() i Chrome ett värde i em och i IE och Firefox fick jag ett px-värde. Om jag la in det nya elementet i DOM:n och sedan tog .width() så fick jag ett px-värde även i Chrome.
Vad jag tycker är bra med jQuery är också att de har hållit det överskådligt och inte låtit det växa iväg till något som det tar veckor att få överblick över. Använder man jQuery mycket så tappar man kanske kunskapen om hur man arbetar direkt mot DOM-apiet, men vet inte om det är någon stor förlust.
###Vilka är dina erfarenheter av jQuery inför detta kursmoment?
Jag har jobbat en del med jQuery, lite med jQueryUI och en del med jQueryMobile (som i alla fall för ett år sedan kändes långt ifrån att fungera lika bra som jQuery).
###Berätta om din plugin
Det är egentligen en 'lightbox' fast för text och den kallas för ezyRead. Problemet som den är tänkt att lösa är att det kan vara svårt att läsa texter på nätet, ofta är raderna långa och det kan vara ganska störande element runt omkring texten. Funktionaliteten i min plugin kan man "hänga på" textelement. Man får då en liten knapp som, när man klickar på den, visar texten i ett mer läsvänligt format. | Kajja/QAsite | app/content/kmom3.md | Markdown | mit | 2,575 | [
30522,
2463,
5358,
2509,
30524,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1001,
1001,
1001,
25416,
2571,
25509,
6906,
2058,
17917,
8486,
5603,
15141,
1010,
3291,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// TimerChangedEventArgs.cs
// <copyright file="TimerChangedEventArgs.cs"> This code is protected under the MIT License. </copyright>
namespace Tron.EventArgs
{
/// <summary>
/// The event arguments for when the timer changes.
/// </summary>
public class TimerChangedEventArgs : System.EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="TimerChangedEventArgs" /> class.
/// </summary>
/// <param name="timeLeft"> How much time is left on the timer. </param>
public TimerChangedEventArgs(int timeLeft)
{
this.TimeLeft = timeLeft;
}
/// <summary>
/// Gets or sets how much time is left on the timer.
/// </summary>
public int TimeLeft { get; set; }
}
}
| wrightg42/tron | Tron/Tron/EventArgs/TimerChangedEventArgs.cs | C# | mit | 803 | [
30522,
1013,
1013,
25309,
22305,
14728,
15338,
2906,
5620,
1012,
20116,
1013,
1013,
1026,
9385,
5371,
1027,
1000,
25309,
22305,
14728,
15338,
2906,
5620,
1012,
20116,
1000,
1028,
2023,
3642,
2003,
5123,
2104,
1996,
10210,
6105,
1012,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Sclerospora sorghi W. Weston & Uppal, 1932 SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Phytopathology 22: 582 (1932)
#### Original name
Sclerospora sorghi W. Weston & Uppal, 1932
### Remarks
null | mdoering/backbone | life/Chromista/Oomycota/Oomycetes/Peronosporales/Peronosporaceae/Peronosclerospora/Peronosclerospora sorghi/ Syn. Sclerospora sorghi/README.md | Markdown | apache-2.0 | 262 | [
30522,
1001,
8040,
3917,
2891,
17822,
2050,
2061,
27172,
2072,
1059,
1012,
12755,
1004,
2039,
12952,
1010,
4673,
2427,
1001,
1001,
1001,
1001,
3570,
10675,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,
2254,
2249,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# res_partner
# Copyright (c) 2013 Codeback Software S.L. (http://codeback.es)
# @author: Miguel García <miguel@codeback.es>
# @author: Javier Fuentes <javier@codeback.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from datetime import datetime, timedelta
from openerp.tools.translate import _
class res_company(osv.osv):
"""añadimos los nuevos campos"""
_name = "res.company"
_inherit = "res.company"
_columns = {
'web_discount': fields.float('Descuento web (%)'),
}
| codeback/openerp-cbk_company_web_discount | res_company.py | Python | agpl-3.0 | 1,385 | [
30522,
1001,
1011,
1008,
1011,
17181,
1024,
21183,
2546,
1011,
1022,
1011,
1008,
1011,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
30524,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<html>
<head>
<title>User agent detail - Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Texet</td><td>TM-7025</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a>
<!-- Modal Structure -->
<div id="modal-test" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Testsuite result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
[family] => TM-7025
[brand] => Texet
[model] => TM-7025
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td><td>Chrome 18.0</td><td>WebKit </td><td>Android 4.0</td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.019</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a>
<!-- Modal Structure -->
<div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.4\.0.*\) applewebkit\/.* \(khtml, like gecko\) chrome\/18\..*safari\/.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?4.0*) applewebkit/* (khtml, like gecko) chrome/18.*safari/*
[parent] => Chrome 18.0 for Android
[comment] => Chrome 18.0
[browser] => Chrome
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 18.0
[majorver] => 18
[minorver] => 0
[platform] => Android
[platform_version] => 4.0
[platform_description] => Android OS
[platform_bits] => 32
[platform_maker] => Google Inc
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[cssversion] => 3
[aolversion] => 0
[device_name] => general Mobile Phone
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => general Mobile Phone
[device_brand_name] => unknown
[renderingengine_name] => WebKit
[renderingengine_version] => unknown
[renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3.
[renderingengine_maker] => Apple Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Chrome 18.0.1025.166</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a>
<!-- Modal Structure -->
<div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Android
[browser] => Chrome
[version] => 18.0.1025.166
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>Chrome 18.0.1025.166</td><td><i class="material-icons">close</i></td><td>Android 4.0.3</td><td style="border-left: 1px solid #555"></td><td></td><td>desktop-browser</td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.26003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a>
<!-- Modal Structure -->
<div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 0
[is_mobile] =>
[type] => desktop-browser
[mobile_brand] =>
[mobile_model] =>
[version] => 18.0.1025.166
[is_android] =>
[browser_name] => Chrome
[operating_system_family] => Android
[operating_system_version] => 4.0.3
[is_ios] =>
[producer] => Google Inc.
[operating_system] => Android 4.0.x Ice Cream Sandwich
[mobile_screen_width] => 0
[mobile_browser] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td>Chrome 18.0</td><td>WebKit </td><td>Android 4.0</td><td style="border-left: 1px solid #555"></td><td></td><td>tablet</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.007</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a>
<!-- Modal Structure -->
<div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Chrome
[short_name] => CH
[version] => 18.0
[engine] => WebKit
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 4.0
[platform] =>
)
[device] => Array
(
[brand] =>
[brandName] =>
[model] =>
[device] => 2
[deviceName] => tablet
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[isTablet] => 1
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Chrome 18.0.1025.166</td><td><i class="material-icons">close</i></td><td>Android 4.0.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
)
[name:Sinergi\BrowserDetector\Browser:private] => Chrome
[version:Sinergi\BrowserDetector\Browser:private] => 18.0.1025.166
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Android
[version:Sinergi\BrowserDetector\Os:private] => 4.0.3
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => unknown
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Chrome 18.0.1025</td><td><i class="material-icons">close</i></td><td>Android 4.0.3</td><td style="border-left: 1px solid #555">Texet</td><td>TM-7025</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a>
<!-- Modal Structure -->
<div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 18
[minor] => 0
[patch] => 1025
[family] => Chrome
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 4
[minor] => 0
[patch] => 3
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Texet
[model] => TM-7025
[family] => TM-7025
)
[originalUserAgent] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 4.0.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.05401</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a>
<!-- Modal Structure -->
<div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Android Webkit Browser
[agent_version] => --
[os_type] => Android
[os_name] => Android
[os_versionName] =>
[os_versionNumber] => 4.0.3
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>Chrome 18.0.1025.166</td><td>WebKit 535.19</td><td>Android 4.0.3</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.40904</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a>
<!-- Modal Structure -->
<div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => Android
[simple_sub_description_string] =>
[simple_browser_string] => Chrome 18 on Android (Ice Cream Sandwich)
[browser_version] => 18
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => IML74K
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => chrome
[operating_system_version] => Ice Cream Sandwich
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 535.19
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Ice Cream Sandwich)
[operating_system_version_full] => 4.0.3
[operating_platform_code] =>
[browser_name] => Chrome
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; Android 4.0.3; TM-7025 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19
[browser_version_full] => 18.0.1025.166
[browser] => Chrome 18
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td>Chrome 18</td><td>Webkit 535.19</td><td>Android 4.0.3</td><td style="border-left: 1px solid #555">teXet</td><td>TM-7025</td><td>tablet</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.045</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a>
<!-- Modal Structure -->
<div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Chrome
[version] => 18
[type] => browser
)
[engine] => Array
(
[name] => Webkit
[version] => 535.19
)
[os] => Array
(
[name] => Android
[version] => 4.0.3
)
[device] => Array
(
[type] => tablet
[manufacturer] => teXet
[model] => TM-7025
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Chrome 18.0.1025.166</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3f285ff5-314b-4db4-9948-54572e92e7b6">Detail</a>
<!-- Modal Structure -->
<div id="modal-3f285ff5-314b-4db4-9948-54572e92e7b6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Chrome
[vendor] => Google
[version] => 18.0.1025.166
[category] => smartphone
[os] => Android
[os_version] => 4.0.3
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Chrome Mobile 18</td><td><i class="material-icons">close</i></td><td>Android 4.0</td><td style="border-left: 1px solid #555">Texet</td><td>TM-7025</td><td>Tablet</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.05601</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a>
<!-- Modal Structure -->
<div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => true
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => Android
[advertised_device_os_version] => 4.0
[advertised_browser] => Chrome Mobile
[advertised_browser_version] => 18
[complete_device_name] => Texet TM-7025
[form_factor] => Tablet
[is_phone] => false
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Texet
[model_name] => TM-7025
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Android
[mobile_browser] => Android Webkit
[mobile_browser_version] =>
[device_os_version] => 4.0
[pointing_method] => touchscreen
[release_date] => 2012_february
[marketing_name] =>
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => false
[is_tablet] => true
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => true
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => true
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => iso-8859-1
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => text/html
[xhtml_table_support] => true
[xhtml_send_sms_string] => sms:
[xhtml_send_mms_string] => mms:
[xhtml_file_upload] => supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => full
[xhtml_avoid_accesskeys] => true
[xhtml_can_embed_video] => none
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => w3c_api
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => false
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 800
[resolution_height] => 480
[columns] => 60
[max_image_width] => 320
[max_image_height] => 480
[rows] => 40
[physical_screen_width] => 153
[physical_screen_height] => 92
[dual_orientation] => true
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => true
[transparent_png_index] => true
[svgt_1_1] => true
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => true
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 3600
[wifi] => true
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 2000000
[max_url_length_in_requests] => 256
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => true
[inline_support] => false
[oma_support] => true
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 10
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 2
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => 3.0
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => lc
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => apple_live_streaming
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => true
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => true
[mp3] => true
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => true
[css_supports_width_as_percentage] => true
[css_border_image] => webkit
[css_rounded_corners] => webkit
[css_gradient] => none
[css_spriting] => true
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => 10
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => 0
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => 3.0
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => false
[playback_mp4] => true
[playback_mov] => false
[playback_acodec_amr] => nb
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => true
[html_preferred_dtd] => html4
[viewport_supported] => true
[viewport_width] => device_width_token
[viewport_userscalable] => no
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => A
[is_sencha_touch_ok] => false
[controlcap_is_smartphone] => default
[controlcap_is_ios] => default
[controlcap_is_android] => default
[controlcap_is_robot] => default
[controlcap_is_app] => default
[controlcap_advertised_device_os] => default
[controlcap_advertised_device_os_version] => default
[controlcap_advertised_browser] => default
[controlcap_advertised_browser_version] => default
[controlcap_is_windows_phone] => default
[controlcap_is_full_desktop] => default
[controlcap_is_largescreen] => default
[controlcap_is_mobile] => default
[controlcap_is_touchscreen] => default
[controlcap_is_wml_preferred] => default
[controlcap_is_xhtmlmp_preferred] => default
[controlcap_is_html_preferred] => default
[controlcap_form_factor] => default
[controlcap_complete_device_name] => default
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-02-13 13:25:25</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | ThaDafinser/UserAgentParserComparison | v4/user-agent-detail/08/1c/081c05e7-7932-41a5-9629-06fd2aeeba5c.html | HTML | mit | 46,287 | [
30522,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
5310,
4005,
6987,
1011,
9587,
5831,
4571,
1013,
1019,
1012,
1014,
1006,
11603,
1025,
11924,
1018,
1012,
1014,
1012,
1017,
1025,
1056,
2213,
1011,
3963,
17788,
3857,
1013,
10047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
export = function tsd(gulp, plugins) {
return plugins.shell.task([
'tsd reinstall --clean',
'tsd link',
'tsd rebundle'
]);
};
| ravi-mone/angular2-lab | tools/tasks/tsd.ts | TypeScript | mit | 142 | [
30522,
9167,
1027,
3853,
24529,
2094,
1006,
26546,
1010,
13354,
7076,
1007,
1063,
2709,
13354,
7076,
1012,
5806,
1012,
4708,
1006,
1031,
1005,
24529,
2094,
19222,
9080,
2140,
1011,
1011,
4550,
1005,
1010,
1005,
24529,
2094,
4957,
1005,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Api\Test\Unit\Code\Generator;
use Magento\Framework\Api\ExtensibleDataInterface;
/**
* Interface for ExtensibleSample
*/
interface ExtensibleSampleInterface extends ExtensibleDataInterface
{
/**
* @return array
*/
public function getItems();
/**
* @return string
*/
public function getName();
/**
* @return int
*/
public function getCount();
/**
* @return int
*/
public function getCreatedAt();
}
| kunj1988/Magento2 | lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensibleSampleInterface.php | PHP | gpl-2.0 | 610 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
9385,
1075,
17454,
13663,
1010,
4297,
1012,
2035,
2916,
9235,
1012,
1008,
2156,
24731,
1012,
19067,
2102,
2005,
6105,
4751,
1012,
1008,
1013,
3415,
15327,
17454,
13663,
1032,
7705,
1032,
179... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2015 Light Code Labs, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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 caddytls
import (
"crypto/tls"
"fmt"
"log"
"net"
"strings"
"github.com/caddyserver/caddy/telemetry"
"github.com/mholt/certmagic"
)
// configGroup is a type that keys configs by their hostname
// (hostnames can have wildcard characters; use the getConfig
// method to get a config by matching its hostname).
type configGroup map[string]*Config
// getConfig gets the config by the first key match for hello.
// In other words, "sub.foo.bar" will get the config for "*.foo.bar"
// if that is the closest match. If no match is found, the first
// (random) config will be loaded, which will defer any TLS alerts
// to the certificate validation (this may or may not be ideal;
// let's talk about it if this becomes problematic).
//
// This function follows nearly the same logic to lookup
// a hostname as the getCertificate function uses.
func (cg configGroup) getConfig(hello *tls.ClientHelloInfo) *Config {
name := certmagic.NormalizedName(hello.ServerName)
if name == "" {
name = certmagic.NormalizedName(certmagic.Default.DefaultServerName)
}
// if SNI is empty, prefer matching IP address (it is
// more specific than a "catch-all" configuration)
if name == "" && hello.Conn != nil {
addr := hello.Conn.LocalAddr().String()
ip, _, err := net.SplitHostPort(addr)
if err == nil {
addr = ip
}
if config, ok := cg[addr]; ok {
return config
}
}
// otherwise, try an exact match
if config, ok := cg[name]; ok {
return config
}
// then try replacing labels in the name with
// wildcards until we get a match
labels := strings.Split(name, ".")
for i := range labels {
labels[i] = "*"
candidate := strings.Join(labels, ".")
if config, ok := cg[candidate]; ok {
return config
}
}
// try a config that matches all names - this
// is needed to match configs defined without
// a specific host, like ":443", when SNI is
// a non-empty value
if config, ok := cg[""]; ok {
return config
}
// failover with a random config: this is necessary
// because we might be needing to solve a TLS-ALPN
// ACME challenge for a name that we don't have a
// TLS configuration for; any config will do for
// this purpose
for _, config := range cg {
// important! disable on-demand TLS so we don't
// try to get certificates for unrecognized names;
// this requires a careful pointer dance... first
// make shallow copies of the structs
if config.Manager != nil && config.Manager.OnDemand != nil {
cfgCopy := *config
mgrCopy := *config.Manager
tlsCfgCopy := config.tlsConfig.Clone()
// then turn off on-demand TLS
mgrCopy.OnDemand = nil
// then change the copies; make sure the
// GetCertificate callback is updated so
// it points to our modified config
cfgCopy.Manager = &mgrCopy
tlsCfgCopy.GetCertificate = mgrCopy.GetCertificate
cfgCopy.tlsConfig = tlsCfgCopy
// finally, return the reconstructed config
return &cfgCopy
}
// if on-demand TLS was not enabled, we should
// be able to use this config directly
return config
}
log.Printf("[ERROR] No TLS configuration available for ClientHello with ServerName: %s", hello.ServerName)
return nil
}
// GetConfigForClient gets a TLS configuration satisfying clientHello.
// In getting the configuration, it abides the rules and settings
// defined in the Config that matches clientHello.ServerName. If no
// tls.Config is set on the matching Config, a nil value is returned.
//
// This method is safe for use as a tls.Config.GetConfigForClient callback.
func (cg configGroup) GetConfigForClient(clientHello *tls.ClientHelloInfo) (*tls.Config, error) {
config := cg.getConfig(clientHello)
if config != nil {
return config.tlsConfig, nil
}
return nil, nil
}
// ClientHelloInfo is our own version of the standard lib's
// tls.ClientHelloInfo. As of May 2018, any fields populated
// by the Go standard library are not guaranteed to have their
// values in the original order as on the wire.
type ClientHelloInfo struct {
Version uint16 `json:"version,omitempty"`
CipherSuites []uint16 `json:"cipher_suites,omitempty"`
Extensions []uint16 `json:"extensions,omitempty"`
CompressionMethods []byte `json:"compression,omitempty"`
Curves []tls.CurveID `json:"curves,omitempty"`
Points []uint8 `json:"points,omitempty"`
// Whether a couple of fields are unknown; if not, the key will encode
// differently to reflect that, as opposed to being known empty values.
// (some fields may be unknown depending on what package is being used;
// i.e. the Go standard lib doesn't expose some things)
// (very important to NOT encode these to JSON)
ExtensionsUnknown bool `json:"-"`
CompressionMethodsUnknown bool `json:"-"`
}
// Key returns a standardized string form of the data in info,
// useful for identifying duplicates.
func (info ClientHelloInfo) Key() string {
extensions, compressionMethods := "?", "?"
if !info.ExtensionsUnknown {
extensions = fmt.Sprintf("%x", info.Extensions)
}
if !info.CompressionMethodsUnknown {
compressionMethods = fmt.Sprintf("%x", info.CompressionMethods)
}
return telemetry.FastHash([]byte(fmt.Sprintf("%x-%x-%s-%s-%x-%x",
info.Version, info.CipherSuites, extensions,
compressionMethods, info.Curves, info.Points)))
}
// ClientHelloTelemetry determines whether to report
// TLS ClientHellos to telemetry. Disable if doing
// it from a different package.
var ClientHelloTelemetry = true
| mholt/caddy | caddytls/handshake.go | GO | apache-2.0 | 6,098 | [
30522,
1013,
1013,
9385,
2325,
2422,
3642,
13625,
1010,
11775,
1013,
1013,
1013,
1013,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1013,
1013,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_XHPAST_PARSER_YACC_HPP_INCLUDED
# define YY_XHPAST_PARSER_YACC_HPP_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int xhpastdebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
T_INCLUDE = 258,
T_INCLUDE_ONCE = 259,
T_EVAL = 260,
T_REQUIRE = 261,
T_REQUIRE_ONCE = 262,
T_LOGICAL_OR = 263,
T_LOGICAL_XOR = 264,
T_LOGICAL_AND = 265,
T_PRINT = 266,
T_PLUS_EQUAL = 267,
T_MINUS_EQUAL = 268,
T_MUL_EQUAL = 269,
T_DIV_EQUAL = 270,
T_CONCAT_EQUAL = 271,
T_MOD_EQUAL = 272,
T_AND_EQUAL = 273,
T_OR_EQUAL = 274,
T_XOR_EQUAL = 275,
T_SL_EQUAL = 276,
T_SR_EQUAL = 277,
T_COALESCE = 278,
T_BOOLEAN_OR = 279,
T_BOOLEAN_AND = 280,
T_IS_EQUAL = 281,
T_IS_NOT_EQUAL = 282,
T_IS_IDENTICAL = 283,
T_IS_NOT_IDENTICAL = 284,
T_SPACESHIP = 285,
T_IS_SMALLER_OR_EQUAL = 286,
T_IS_GREATER_OR_EQUAL = 287,
T_SL = 288,
T_SR = 289,
T_INSTANCEOF = 290,
T_INC = 291,
T_DEC = 292,
T_INT_CAST = 293,
T_DOUBLE_CAST = 294,
T_STRING_CAST = 295,
T_UNICODE_CAST = 296,
T_BINARY_CAST = 297,
T_ARRAY_CAST = 298,
T_OBJECT_CAST = 299,
T_BOOL_CAST = 300,
T_UNSET_CAST = 301,
T_NEW = 302,
T_CLONE = 303,
T_EXIT = 304,
T_IF = 305,
T_ELSEIF = 306,
T_ELSE = 307,
T_ENDIF = 308,
T_LNUMBER = 309,
T_DNUMBER = 310,
T_STRING = 311,
T_STRING_VARNAME = 312,
T_VARIABLE = 313,
T_NUM_STRING = 314,
T_INLINE_HTML = 315,
T_CHARACTER = 316,
T_BAD_CHARACTER = 317,
T_ENCAPSED_AND_WHITESPACE = 318,
T_CONSTANT_ENCAPSED_STRING = 319,
T_BACKTICKS_EXPR = 320,
T_ECHO = 321,
T_DO = 322,
T_WHILE = 323,
T_ENDWHILE = 324,
T_FOR = 325,
T_ENDFOR = 326,
T_FOREACH = 327,
T_ENDFOREACH = 328,
T_DECLARE = 329,
T_ENDDECLARE = 330,
T_AS = 331,
T_SWITCH = 332,
T_ENDSWITCH = 333,
T_CASE = 334,
T_DEFAULT = 335,
T_BREAK = 336,
T_CONTINUE = 337,
T_GOTO = 338,
T_FUNCTION = 339,
T_CONST = 340,
T_RETURN = 341,
T_TRY = 342,
T_CATCH = 343,
T_THROW = 344,
T_USE = 345,
T_GLOBAL = 346,
T_STATIC = 347,
T_ABSTRACT = 348,
T_FINAL = 349,
T_PRIVATE = 350,
T_PROTECTED = 351,
T_PUBLIC = 352,
T_VAR = 353,
T_UNSET = 354,
T_ISSET = 355,
T_EMPTY = 356,
T_HALT_COMPILER = 357,
T_CLASS = 358,
T_INTERFACE = 359,
T_EXTENDS = 360,
T_IMPLEMENTS = 361,
T_OBJECT_OPERATOR = 362,
T_DOUBLE_ARROW = 363,
T_LIST = 364,
T_ARRAY = 365,
T_CLASS_C = 366,
T_METHOD_C = 367,
T_FUNC_C = 368,
T_LINE = 369,
T_FILE = 370,
T_COMMENT = 371,
T_DOC_COMMENT = 372,
T_OPEN_TAG = 373,
T_OPEN_TAG_WITH_ECHO = 374,
T_OPEN_TAG_FAKE = 375,
T_CLOSE_TAG = 376,
T_WHITESPACE = 377,
T_START_HEREDOC = 378,
T_END_HEREDOC = 379,
T_HEREDOC = 380,
T_DOLLAR_OPEN_CURLY_BRACES = 381,
T_CURLY_OPEN = 382,
T_PAAMAYIM_NEKUDOTAYIM = 383,
T_BINARY_DOUBLE = 384,
T_BINARY_HEREDOC = 385,
T_NAMESPACE = 386,
T_NS_C = 387,
T_DIR = 388,
T_NS_SEPARATOR = 389,
T_INSTEADOF = 390,
T_CALLABLE = 391,
T_TRAIT = 392,
T_TRAIT_C = 393,
T_YIELD = 394,
T_FINALLY = 395,
T_ELLIPSIS = 396
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
int xhpastparse (void* yyscanner, xhpast::Node** root);
#endif /* !YY_XHPAST_PARSER_YACC_HPP_INCLUDED */
/* @generated */
| r4nt/libphutil | support/xhpast/parser.yacc.hpp | C++ | apache-2.0 | 5,213 | [
30522,
1013,
1008,
1037,
22285,
11968,
8043,
1010,
2081,
2011,
27004,
22285,
1017,
1012,
1014,
1012,
1018,
1012,
1008,
1013,
1013,
1008,
30524,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
(function ($) {
/**
* Move a block in the blocks table from one region to another via select list.
*
* This behavior is dependent on the tableDrag behavior, since it uses the
* objects initialized in that behavior to update the row.
*/
Drupal.behaviors.taskbarUIDrag = {
attach: function (context, settings) {
// tableDrag is required and we should be on the Taskbar UI admin page.
if (typeof Drupal.tableDrag == 'undefined' || typeof Drupal.tableDrag.items == 'undefined') {
return;
}
var table = $('table#items');
var tableDrag = Drupal.tableDrag.items; // Get the items tableDrag object.
// Add a handler for when a row is swapped, update empty regions.
tableDrag.row.prototype.onSwap = function(swappedRow) {
checkEmptyRegions(table, this);
};
// A custom message for the blocks page specifically.
Drupal.theme.tableDragChangedWarning = function () {
return '<div class="messages warning">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t("The changes to these items will not be saved until the <em>Save items</em> button is clicked.") + '</div>';
};
// Add a handler so when a row is dropped, update fields dropped into new regions.
tableDrag.onDrop = function() {
dragObject = this;
var regionRow = $(dragObject.rowObject.element).prevAll('tr.region-message').get(0);
var regionName = regionRow.className.replace(/([^ ]+[ ]+)*region-([^ ]+)-message([ ]+[^ ]+)*/, '$2');
var regionField = $('select.item-region-select', dragObject.rowObject.element);
if ($('option[value=' + regionName + ']', regionField).length == 0) {
alert(Drupal.t('The item cannot be placed in this region.'));
// Simulate that there was a selected element change, so the row is put
// back to from where the user tried to drag it.
regionField.change();
}
else if ($(dragObject.rowObject.element).prev('tr').is('.region-message')) {
var weightField = $('select.item-weight', dragObject.rowObject.element);
var oldRegionName = weightField[0].className.replace(/([^ ]+[ ]+)*item-weight-([^ ]+)([ ]+[^ ]+)*/, '$2');
if (!regionField.is('.item-region-'+ regionName)) {
regionField.removeClass('item-region-' + oldRegionName).addClass('item-region-' + regionName);
weightField.removeClass('item-weight-' + oldRegionName).addClass('item-weight-' + regionName);
regionField.val(regionName);
}
}
};
// Add the behavior to each region select list.
$('select.item-region-select', context).once('item-region-select', function() {
$(this).change(function(event) {
// Make our new row and select field.
var row = $(this).parents('tr:first');
var select = $(this);
tableDrag.rowObject = new tableDrag.row(row);
// Find the correct region and insert the row as the first in the region.
$('tr.region-message', table).each(function() {
if ($(this).is('.region-' + select[0].value + '-message')) {
// Add the new row and remove the old one.
$(this).after(row);
// Manually update weights and restripe.
tableDrag.updateFields(row.get(0));
tableDrag.rowObject.changed = true;
if (tableDrag.oldRowElement) {
$(tableDrag.oldRowElement).removeClass('drag-previous');
}
tableDrag.oldRowElement = row.get(0);
tableDrag.restripeTable();
tableDrag.rowObject.markChanged();
tableDrag.oldRowElement = row;
$(row).addClass('drag-previous');
}
});
// Modify empty regions with added or removed fields.
checkEmptyRegions(table, row);
// Remove focus from selectbox.
select.get(0).blur();
});
$(this).addClass('itemregionselect-processed');
});
var checkEmptyRegions = function(table, rowObject) {
$('tr.region-message', table).each(function() {
// If the dragged row is in this region, but above the message row, swap it down one space.
if ($(this).prev('tr').get(0) == rowObject.element) {
// Prevent a recursion problem when using the keyboard to move rows up.
if ((rowObject.method != 'keyboard' || rowObject.direction == 'down')) {
rowObject.swap('after', this);
}
}
// This region has become empty
if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').size() == 0) {
$(this).removeClass('region-populated').addClass('region-empty');
}
// This region has become populated.
else if ($(this).is('.region-empty')) {
$(this).removeClass('region-empty').addClass('region-populated');
}
});
};
}
};
})(jQuery);
| chandra20/ch | sites/all/modules/taskbar/modules/taskbar_ui/taskbar_ui.js | JavaScript | gpl-2.0 | 4,863 | [
30522,
1006,
3853,
1006,
1002,
1007,
1063,
1013,
1008,
1008,
1008,
2693,
1037,
3796,
1999,
1996,
5991,
2795,
2013,
2028,
2555,
2000,
2178,
3081,
7276,
2862,
1012,
1008,
1008,
2023,
5248,
2003,
7790,
2006,
1996,
2795,
7265,
2290,
5248,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Myoxanthus affinoides Luer SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Myoxanthus/Myoxanthus ceratothallis/ Syn. Myoxanthus affinoides/README.md | Markdown | apache-2.0 | 183 | [
30522,
1001,
2026,
11636,
4630,
9825,
21358,
16294,
25064,
11320,
2121,
2427,
1001,
1001,
1001,
1001,
3570,
10675,
1001,
1001,
1001,
1001,
2429,
2000,
1996,
10161,
1997,
2166,
1010,
3822,
2254,
2249,
1001,
1001,
1001,
1001,
2405,
1999,
1970... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* This file is part of the "clip" project
* Copyright (c) 2018 Paul Asmuth
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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.
*/
#include "draw.h"
#include "context.h"
#include <graphics/text.h>
#include <graphics/text_shaper.h>
#include "graphics/text_layout.h"
#include "graphics/text_support.h"
#include "draw/text.h"
namespace clip {
void draw_shape(Context* ctx, DrawCommand shape) {
auto layer = layer_get(ctx);
if (shape.fill_style.color) {
if (shape.fill_style.hatch) {
shape.style.fill_hatch.push_back({
.color = *shape.fill_style.color,
.angle_deg = shape.fill_style.hatch_angle_deg,
.offset = Number(shape.fill_style.hatch_offset),
.stride = Number(shape.fill_style.hatch_stride),
.width = Number(shape.fill_style.hatch_width),
});
} else {
shape.style.fill_solid.emplace_back(*shape.fill_style.color);
}
shape.fill_style = {};
}
if (shape.stroke_style.line_width.value) {
switch (shape.stroke_style.dash_type) {
case StrokeStyle::SOLID:
shape.style.stroke_solid.push_back({
.color = shape.stroke_style.color,
.width = shape.stroke_style.line_width
});
break;
case StrokeStyle::DASH:
std::vector<Number> pattern(shape.stroke_style.dash_pattern.size());
std::transform(
shape.stroke_style.dash_pattern.begin(),
shape.stroke_style.dash_pattern.end(),
pattern.begin(),
[] (auto v) { return Number(v); });
shape.style.stroke_dash.push_back({
.color = shape.stroke_style.color,
.width = shape.stroke_style.line_width,
.pattern = pattern,
.offset = Number(shape.stroke_style.dash_offset),
});
break;
}
shape.stroke_style = {};
}
layer_get(ctx)->drawlist.emplace_back(std::move(shape));
}
void draw_path(
Context* ctx,
const Path& path,
StrokeStyle stroke_style,
FillStyle fill_style) {
DrawCommand shape;
shape.path = path;
shape.stroke_style = stroke_style;
shape.fill_style = fill_style;
draw_shape(ctx, shape);
}
void draw_polygon(
Context* ctx,
const Poly2& poly,
StrokeStyle stroke_style,
FillStyle fill_style) {
DrawCommand shape;
shape.path = path_from_poly2(poly);
shape.stroke_style = stroke_style;
shape.fill_style = fill_style;
draw_shape(ctx, shape);
}
void draw_line(
Context* ctx,
vec2 from,
vec2 to,
StrokeStyle stroke_style) {
DrawCommand shape;
shape.path.moveTo(from.x, from.y);
shape.path.lineTo(to.x, to.y);
shape.stroke_style = stroke_style;
draw_shape(ctx, shape);
}
ReturnCode draw_text(
Context* ctx,
const std::string& text,
const Point& position,
HAlign align_x,
VAlign align_y,
double rotate,
TextStyle text_style) {
draw::text_op op;
op.text = text;
op.placement.position = position;
op.placement.align_x = align_x;
op.placement.align_y = align_y;
op.text_style = text_style;
op.draw_style.fill_solid.push_back(draw_style::fill_solid(text_style.color));
if (rotate) {
op.transform = mul(
translate2({position.x, position.y}),
mul(
rotate2(rotate),
translate2({-position.x, -position.y})));
}
return draw::text(ctx, op);
}
ReturnCode draw_text(
Context* ctx,
const std::string& text,
const Point& position,
HAlign align_x,
VAlign align_y,
TextStyle text_style) {
return draw_text(
ctx,
text,
position,
align_x,
align_y,
0,
text_style);
}
} // namespace clip
| paulasmuth/fnordmetric | src/graphics/draw_cmd.cc | C++ | gpl-3.0 | 4,047 | [
30522,
1013,
1008,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
1996,
1000,
12528,
1000,
2622,
1008,
9385,
1006,
1039,
1007,
2760,
2703,
2004,
28120,
2232,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package ai.grakn.engine;
import ai.grakn.engine.util.SimpleURI;
import ai.grakn.test.GraknTestSetup;
import java.io.IOException;
import java.net.ServerSocket;
/**
* <p>
* This class instantiates an engine server-side component once, statically until the JVM exists.
* Any state cleanup needs to be done by tests themselves - more code, more work, but more performant
* test suite. So all unit tests will share the same components and will be written with that in mind.
* </p>
*
* @author borislav
*
*/
public class EngineTestHelper {
private static volatile GraknEngineConfig config = null;
public static int findAvailablePort() {
try (ServerSocket socket = new ServerSocket(0)) {
return socket.getLocalPort();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* Create (once only, statically) the GraknEngineConfig as per configuration file and return it.
*/
public static synchronized GraknEngineConfig config() {
if (config != null) {
return config;
}
config = GraknEngineConfig.create();
config.setConfigProperty(GraknEngineConfig.SERVER_PORT_NUMBER, String.valueOf(findAvailablePort()));
return config;
}
private static volatile GraknEngineServer server = null;
/**
* <p>
* Creates and initializes all components for running a self-contained, embedded engine server.
* </p>
* <p>
* Make sure it's invoked before any test that needs to access engine components. It's an
* idempotent operation - it can be invoked many times without repercussions.
* </p>
*/
public static synchronized void engine() {
if (server != null) {
return;
}
GraknTestSetup.startRedisIfNeeded(new SimpleURI(config().getProperty(GraknEngineConfig.REDIS_HOST)).getPort());
server = GraknEngineServer.create(config());
server.start();
}
/**
* Similarly to {@link EngineTestHelper#engine()} it creates a test engine with the ability to write {@link ai.grakn.GraknTx} to a
* persistent backend if needed
*/
public static synchronized void engineWithKBs() {
GraknTestSetup.startCassandraIfNeeded();
engine();
}
/**
* Shutdown the engine server.
*/
public static synchronized void noEngine() {
if (server == null) {
return;
}
try {
server.close();
}
finally {
server = null;
}
}
}
| pluraliseseverythings/grakn | grakn-engine/src/test/java/ai/grakn/engine/EngineTestHelper.java | Java | gpl-3.0 | 2,621 | [
30522,
7427,
9932,
1012,
24665,
4817,
2078,
1012,
3194,
1025,
12324,
9932,
1012,
24665,
4817,
2078,
1012,
3194,
1012,
21183,
4014,
1012,
3722,
9496,
1025,
12324,
9932,
1012,
24665,
4817,
2078,
1012,
3231,
1012,
24665,
4817,
17340,
3215,
338... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Bpost\BpostApiClient;
use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidLengthException;
use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException;
/**
* bPost Form handler class
*
* @author Tijs Verkoyen <php-bpost@verkoyen.eu>
*/
class FormHandler
{
/**
* bPost instance
*
* @var Bpost
*/
private $bpost;
/**
* The parameters
*
* @var array
*/
private $parameters = array();
/**
* Create bPostFormHandler instance
*
* @param string $accountId
* @param string $passPhrase
* @param string $apiUrl
*/
public function __construct($accountId, $passPhrase, $apiUrl = Bpost::API_URL)
{
$this->bpost = new Bpost($accountId, $passPhrase, $apiUrl);
}
/**
* Calculate the hash
*
* @return string
*/
private function getChecksum()
{
$keysToHash = array(
'accountId',
'action',
'costCenter',
'customerCountry',
'deliveryMethodOverrides',
'extraSecure',
'orderReference',
'orderWeight',
);
$base = 'accountId=' . $this->bpost->getAccountId() . '&';
foreach ($keysToHash as $key) {
if (isset($this->parameters[$key])) {
if (! is_array($this->parameters[$key])) {
$base .= $key.'='.$this->parameters[$key].'&';
} else {
foreach ($this->parameters[$key] as $entry) {
$base .= $key.'='.$entry.'&';
}
}
}
}
// add passphrase
$base .= $this->bpost->getPassPhrase();
// return the hash
return hash('sha256', $base);
}
/**
* Get the parameters
*
* @param bool $form
* @param bool $includeChecksum
* @return array
*/
public function getParameters($form = false, $includeChecksum = true)
{
$return = $this->parameters;
if ($form && isset($return['orderLine'])) {
foreach ($return['orderLine'] as $key => $value) {
$return['orderLine[' . $key . ']'] = $value;
}
unset($return['orderLine']);
}
if ($includeChecksum) {
$return['accountId'] = $this->bpost->getAccountId();
$return['checksum'] = $this->getChecksum();
}
return $return;
}
/**
* Set a parameter
*
* @param string $key
* @param mixed $value
* @throws BpostInvalidValueException
* @throws BpostInvalidLengthException
*/
public function setParameter($key, $value)
{
switch ((string) $key) {
// limited values
case 'action':
case 'lang':
$allowedValues['action'] = array('START', 'CONFIRM');
$allowedValues['lang'] = array('NL', 'FR', 'EN', 'DE', 'Default');
if (!in_array($value, $allowedValues[$key])) {
throw new BpostInvalidValueException($key, $value, $allowedValues[$key]);
}
$this->parameters[$key] = $value;
break;
// maximum 2 chars
case 'customerCountry':
if (mb_strlen($value) > 2) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 2);
}
$this->parameters[$key] = (string) $value;
break;
// maximum 8 chars
case 'customerStreetNumber':
case 'customerBox':
if (mb_strlen($value) > 8) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 8);
}
$this->parameters[$key] = (string) $value;
break;
// maximum 20 chars
case 'customerPhoneNumber':
if (mb_strlen($value) > 20) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 20);
}
$this->parameters[$key] = (string) $value;
break;
// maximum 32 chars
case 'customerPostalCode':
if (mb_strlen($value) > 32) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 32);
}
$this->parameters[$key] = (string) $value;
break;
// maximum 40 chars
case 'customerFirstName':
case 'customerLastName':
case 'customerCompany':
case 'customerStreet':
case 'customerCity':
if (mb_strlen($value) > 40) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 40);
}
$this->parameters[$key] = (string) $value;
break;
// maximum 50 chars
case 'orderReference':
case 'costCenter':
case 'customerEmail':
if (mb_strlen($value) > 50) {
throw new BpostInvalidLengthException($key, mb_strlen($value), 50);
}
$this->parameters[$key] = (string) $value;
break;
// integers
case 'orderTotalPrice':
case 'orderWeight':
$this->parameters[$key] = (int) $value;
break;
// array
case 'orderLine':
if (!isset($this->parameters[$key])) {
$this->parameters[$key] = array();
}
$this->parameters[$key][] = $value;
break;
// unknown
case 'deliveryMethodOverrides':
case 'extra':
case 'extraSecure':
case 'confirmUrl':
case 'cancelUrl':
case 'errorUrl':
default:
if (is_array($value)) {
sort($value);
}
$this->parameters[$key] = $value;
}
}
}
| tijsverkoyen/bpost | src/FormHandler.php | PHP | bsd-3-clause | 6,173 | [
30522,
1026,
1029,
25718,
3415,
15327,
17531,
14122,
1032,
17531,
28696,
24330,
8751,
3372,
1025,
2224,
17531,
14122,
1032,
17531,
28696,
24330,
8751,
3372,
1032,
6453,
1032,
30524,
1008,
1008,
1008,
17531,
14122,
2433,
28213,
2465,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
{# copyright and footer links #} | goliatone/sensor-sink | views/includes/footer.html | HTML | mit | 32 | [
30522,
1063,
1001,
9385,
1998,
3329,
2121,
6971,
1001,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.imrang.detector.domain;
import com.imrang.detector.convert.ActivityLogConverter;
import com.imrang.detector.convert.Converter;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
import org.junit.Test;
public class ActivityLogTest {
private static Converter<ActivityLog, String> converter = new ActivityLogConverter();
@Test
public void shouldFulfillEqualsHashCodeContract() {
ActivityLog activityLog = new ActivityLog("80.238.9.179", 133612947, Action.SIGNIN_SUCCESS,"Dave.Branning");
EqualsVerifier.forClass(ActivityLog.class)
.withPrefabValues(ActivityLog.class, activityLog, new ActivityLog())
.suppress(Warning.NONFINAL_FIELDS, Warning.NULL_FIELDS)
.verify();
}
public static ActivityLog buildActivityLog(String ip, Long time, Action action, String userName) {
return new ActivityLog(ip, time, action,userName);
}
public static ActivityLog buildActivityLog(String line) {
return converter.convert(line);
}
}
| gulimran/hackerdetector | detector/src/test/java/com/imrang/detector/domain/ActivityLogTest.java | Java | gpl-2.0 | 1,077 | [
30522,
7427,
4012,
1012,
10047,
24388,
1012,
19034,
1012,
5884,
1025,
12324,
4012,
1012,
10047,
24388,
1012,
19034,
1012,
10463,
1012,
4023,
21197,
8663,
16874,
2121,
1025,
12324,
4012,
1012,
10047,
24388,
1012,
19034,
1012,
10463,
1012,
1046... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-support/simd-altivec.h"
#include "../common/n2fv_8.c"
| termoshtt/rust-fftw3 | fftw-src/fftw-3.3.8/dft/simd/altivec/n2fv_8.c | C | mit | 125 | [
30522,
1013,
1008,
7013,
8073,
1012,
2079,
2025,
10086,
999,
1008,
1013,
1001,
9375,
21934,
2094,
1035,
20346,
1000,
21934,
2094,
1011,
2490,
1013,
21934,
2094,
1011,
12456,
3512,
2278,
1012,
1044,
1000,
1001,
2421,
1000,
1012,
1012,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
using System;
using System.ComponentModel;
using System.IO;
namespace UrlTouch.CommandLineParsing
{
/// <summary>
/// Converter that can convert from a string to a FileInfo.
/// </summary>
public class FileInfoConverter : TypeConverter
{
/// <summary>
/// Converts from a string to a FileInfo.
/// </summary>
/// <param name="context">Context.</param>
/// <param name="culture">Culture.</param>
/// <param name="value">Value to convert.</param>
/// <returns>FileInfo, or null if value was null or non-string.</returns>
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string && value != null)
{
return new FileInfo((string)value);
}
else
{
return null;
}
}
/// <summary>
/// Returns whether this converter can convert an object of the given type to a FileInfo.
/// </summary>
/// <param name="context">An ITypeDescriptorContext that provides a format context.</param>
/// <param name="sourceType">A Type that represents the type you want to convert from.</param>
/// <returns>True if this converter can perform the conversion; otherwise, False.</returns>
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
return (sourceType == typeof(string));
}
/// <summary>
/// Converts from a FileInfo to a string.
/// </summary>
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (value is FileInfo && destinationType == typeof(string))
{
return ((FileInfo)value).FullName;
}
else
{
return null;
}
}
/// <summary>
/// Returns whether this converter can convert a FileInfo object to the specified type.
/// </summary>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return (destinationType == typeof(string));
}
}
} | slav/UrlTouch | src/UrlTouch/CommandLineParsing/FileInfoConverter.cs | C# | bsd-3-clause | 2,655 | [
30522,
1013,
1013,
1006,
1039,
1007,
9385,
7513,
3840,
1012,
1013,
1013,
2023,
3120,
2003,
3395,
2000,
1996,
7513,
2270,
6105,
1006,
5796,
1011,
20228,
1007,
1012,
1013,
1013,
3531,
2156,
8299,
1024,
1013,
1013,
2175,
1012,
7513,
1012,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php namespace ProcessWire\GraphQL\Test\Permissions\Editor\Update\NotAvailable;
use ProcessWire\GraphQL\Test\GraphqlTestCase;
class TemplateTest extends GraphqlTestCase
{
/**
* + For Editor.
* + The user has edit permission for the template.
* - The template is not legal.
*/
public static function getSettings()
{
return [
"login" => "editor",
"legalTemplates" => ["skyscraper"], // <-- template "city" is not legal.
"access" => [
"templates" => [
[
"name" => "city",
"roles" => ["editor"],
"editRoles" => ["editor"],
],
[
"name" => "skyscraper",
"roles" => ["editor"],
"editRoles" => ["editor"],
],
],
],
];
}
public function testPermission()
{
assertTypePathNotExists(
["Mutation", "updateCity"],
"The update field should not be available for user if the target template is not legal."
);
}
}
| dadish/ProcessGraphQL | test/Permissions/Editor/Update/NotAvailable/TemplateTest.php | PHP | mit | 1,006 | [
30522,
1026,
1029,
25718,
3415,
15327,
2832,
20357,
1032,
10629,
4160,
2140,
1032,
3231,
1032,
6656,
2015,
1032,
3559,
1032,
10651,
1032,
2025,
12462,
11733,
3468,
1025,
2224,
2832,
20357,
1032,
10629,
4160,
2140,
1032,
3231,
1032,
10629,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package dataframe;
import org.apache.spark.sql.*;
import org.apache.spark.sql.types.DataTypes;
import org.apache.spark.sql.types.StructField;
import org.apache.spark.sql.types.StructType;
import static org.apache.spark.sql.functions.col;
import java.util.Arrays;
import java.util.List;
//
// Note that conceptually a DataFrame is a DataSet<Row>, bot the Java API
// doesn't actually have a definition of DataFrame.
//
// Create a Spark Dataset<Row> from a list of Row instances and a schema
// constructed explicitly. Query it.
//
// This example is fundamental for Dataset<Row> as the chema is created
// explicitly instead of being inferred via an Encoder like in the Dataset
// examples.
//
public class JavaFromRowsAndSchema {
public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("DataFrame-Jave-FromRowsAndSchema")
.master("local[4]")
.getOrCreate();
List<Row> customerRows = Arrays.asList(
RowFactory.create(1, "Widget Co", 120000.00, 0.00, "AZ"),
RowFactory.create(2, "Acme Widgets", 410500.00, 500.00, "CA"),
RowFactory.create(3, "Widgetry", 410500.00, 200.00, "CA"),
RowFactory.create(4, "Widgets R Us", 410500.00, 0.0, "CA"),
RowFactory.create(5, "Ye Olde Widgete", 500.00, 0.0, "MA")
);
List<StructField> fields = Arrays.asList(
DataTypes.createStructField("id", DataTypes.IntegerType, true),
DataTypes.createStructField("name", DataTypes.StringType, true),
DataTypes.createStructField("sales", DataTypes.DoubleType, true),
DataTypes.createStructField("discount", DataTypes.DoubleType, true),
DataTypes.createStructField("state", DataTypes.StringType, true)
);
StructType customerSchema = DataTypes.createStructType(fields);
Dataset<Row> customerDF =
spark.createDataFrame(customerRows, customerSchema);
System.out.println("*** the schema created");
customerDF.printSchema();
System.out.println("*** the data");
customerDF.show();
System.out.println("*** just the rows from CA");
customerDF.filter(col("state").equalTo("CA")).show();
spark.stop();
}
}
| chocolateBlack/LearningSpark | src/main/java/dataframe/JavaFromRowsAndSchema.java | Java | mit | 2,316 | [
30522,
7427,
2951,
15643,
1025,
12324,
8917,
1012,
15895,
1012,
12125,
1012,
29296,
1012,
1008,
1025,
12324,
8917,
1012,
15895,
1012,
12125,
1012,
29296,
1012,
4127,
1012,
2951,
13874,
2015,
1025,
12324,
8917,
1012,
15895,
1012,
12125,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_03.html">Class Test_AbaRouteValidator_03</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_4953_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03.html?line=58937#src-58937" >testAbaNumberCheck_4953_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:33:30
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_4953_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=14548#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | dcarda/aba.route.validator | target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03_testAbaNumberCheck_4953_good_b84.html | HTML | apache-2.0 | 9,178 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
20950,
3619,
1027,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
2639,
1013,
1060,
11039,
19968,
1000,
20950,
1024,
11374,
1027,
1000,
4372,
1000,
11374,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
develop:
python setup.py develop
undevelop:
python setup.py develop --uninstall
lint:
# Install mdl with "gem install mdl"
mdl .
flake8
test:
nosetests --with-coverage --cover-tests --cover-inclusive --cover-branches --cover-package=mackup
clean:
rm -rf dist/
rm -rf Mackup.egg-info/
release: clean
python setup.py sdist
twine upload dist/*
| devnulled/mackup | Makefile | Makefile | gpl-3.0 | 356 | [
30522,
4503,
1024,
18750,
16437,
1012,
1052,
2100,
4503,
6151,
18697,
4135,
2361,
1024,
18750,
16437,
1012,
1052,
2100,
4503,
1011,
1011,
4895,
7076,
9080,
2140,
11409,
2102,
1024,
1001,
16500,
9108,
2140,
2007,
1000,
17070,
16500,
9108,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Paramicropholis Aubrév. & Pellegr. GENUS
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Sapotaceae/Paramicropholis/README.md | Markdown | apache-2.0 | 183 | [
30522,
1001,
11498,
7712,
18981,
14854,
2483,
8740,
13578,
2615,
1012,
1004,
21877,
6216,
16523,
1012,
3562,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
1001,
1001,
1001,
1001,
2405,
1999,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# spring-microservices
Overview
This application is intended for beginners in springboot microservice development.
Frameworks used
- Springboot
- Swagger-ui
- Mybatis
- Maven
Installation/ startup
mvn install
Contributing
All pull requests are greatly appreciated! This project is intended for springboot users, but we've only implemented functionality we've needed to handle our current needs. If you need new features, open an issue on github, or better yet, contribute your own features!
This is a Maven/Java project.
Contact
For any questions, concerns, or problems, please feel free to contact the author vijay@javamix.net
Note:
It's an initial version of the code , will keep updating in periodical manner .
| kattavijay/spring-microservices | README.md | Markdown | gpl-3.0 | 742 | [
30522,
1001,
3500,
1011,
12702,
8043,
7903,
2229,
19184,
2023,
4646,
2003,
3832,
2005,
4088,
16912,
1999,
3500,
27927,
12702,
8043,
7903,
2063,
2458,
1012,
7705,
2015,
2109,
1011,
3500,
27927,
1011,
25430,
27609,
1011,
21318,
1011,
2026,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
.filebrowser table td { font-size: 10px; }
.filebrowser table a { font-size: 11px; }
.filebrowser thead th.sorted a { padding-right: 13px; }
.filebrowser td { padding: 9px 10px 7px 10px !important; }
.filebrowser td.fb_icon { padding: 6px 5px 5px 5px !important; }
table a.fb_deletelink, table a.fb_renamelink, table a.fb_selectlink, table a.fb_makethumblink, table a.fb_imagegeneratorlink {
cursor: pointer;
display: block; padding: 0; margin: 0;
width: 23px; height: 17px;
background-color: transparent;
background-position: 0 center;
background-repeat: no-repeat;
}
table .fb_deletelink:link, table .fb_deletelink:visited {
width: 15px;
background-image: url('../img/filebrowser_icon_delete.gif');
}
table .fb_deletelink:hover, table .fb_deletelink:active { background-image: url('../img/filebrowser_icon_delete_hover.gif'); }
table .fb_renamelink:link, table .fb_renamelink:visited {
width: 14px;
background-image: url('../img/filebrowser_icon_rename.gif');
}
table .fb_renamelink:hover, table .fb_renamelink:active { background-image: url('../img/filebrowser_icon_rename_hover.gif'); }
table .fb_selectlink:link, table .fb_selectlink:visited { background-image: url('../img/filebrowser_icon_select.gif'); }
table .fb_selectlink:hover, table .fb_selectlink:active { background-image: url('../img/filebrowser_icon_select_hover.gif'); }
table .fb_makethumblink:link, table .fb_makethumblink:visited {
width: 50px; height: 29px;
background-image: url('../img/filebrowser_icon_makethumb.gif');
}
table .fb_makethumblink:hover, table .fb_makethumblink:active { background-image: url('../img/filebrowser_icon_makethumb_hover.gif'); }
table .fb_imagegeneratorlink:link, table .fb_imagegeneratorlink:visited { background-image: url('../img/filebrowser_icon_imagegenerator.gif'); }
table .fb_imagegeneratorlink:hover, table .fb_imagegeneratorlink:active { background-image: url('../img/filebrowser_icon_imagegenerator_hover.gif'); }
/* Object Tools Basics (For Filebrowser without Grappelli)
----------------------------------------------------------------------- */
.object-tools {
position:relative; float:right;
font-weight:bold; font-family:Arial,Helvetica,sans-serif; text-transform: none;
margin-top: -23px; margin-bottom:-10px; padding:0;
}
.form-row .object-tools { margin-top:5px; margin-bottom:5px; float:none; }
.object-tools li { display:block; float:left; color: #ccc; font-size: 12px !important; line-height: 12px !important; padding: 0; background: none !important; }
.object-tools li:hover { background:none !important; }
.object-tools a {
display: block; float: left;
margin: -3px 0 0 15px; padding: 3px 0 2px 22px !important;
font-size: 12px !important; line-height: 12px !important;
background-color: #fff !important;
background-position: 0 0 !important;
background-repeat: no-repeat;
}
.object-tools a:link, .object-tools a:visited {
color: #659DC2 !important;
}
.object-tools a:hover, .object-tools a:active {
color: #555 !important;
}
/* Object Tools - Links
----------------------------------------------------------------------- */
.object-tools .fb_makedirectorylink:link, .object-tools .fb_makedirectorylink:visited {
padding-left: 28px !important;
background-image: url('../img/filebrowser_object-tools_icon_makedirectory.gif') !important;
}
.object-tools .fb_makedirectorylink:hover, .object-tools .fb_makedirectorylink:active { background-image: url('../img/filebrowser_object-tools_icon_makedirectory_hover.gif') !important; }
.object-tools .fb_multipleuploadlink:link, .object-tools .fb_multipleuploadlink:visited {
padding-left: 24px !important;
background-image: url('../img/filebrowser_object-tools_icon_multipleupload.gif') !important;
}
.object-tools .fb_multipleuploadlink:hover, .object-tools .fb_multipleuploadlink:active { background-image: url('../img/filebrowser_object-tools_icon_multipleupload_hover.gif') !important; }
.object-tools .fb_imagegeneratorlink:link, .object-tools .fb_imagegeneratorlink:visited {
padding-left: 26px !important;
background-image: url('../img/filebrowser_object-tools_icon_imagegenerator.gif') !important;
}
.object-tools .fb_imagegeneratorlink:hover, .object-tools .fb_imagegeneratorlink:active { background-image: url('../img/filebrowser_object-tools_icon_imagegenerator_hover.gif') !important; }
.object-tools .fb_makethumbslink:link, .object-tools .fb_makethumbslink:visited {
padding-left: 28px !important;
background-image: url('../img/filebrowser_object-tools_icon_makethumb.gif') !important;
}
.object-tools .fb_makethumbslink:hover, .object-tools .fb_makethumbslink:active { background-image: url('../img/filebrowser_object-tools_icon_makethumb_hover.gif') !important; } | caiges/populous | populous/filebrowser/media/filebrowser/css/filebrowser.css | CSS | bsd-3-clause | 4,776 | [
30522,
1012,
5371,
12618,
9333,
2121,
2795,
14595,
1063,
15489,
1011,
2946,
1024,
2184,
2361,
2595,
1025,
1065,
1012,
5371,
12618,
9333,
2121,
2795,
1037,
1063,
15489,
1011,
2946,
1024,
2340,
2361,
2595,
1025,
1065,
1012,
5371,
12618,
9333,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'strict-origin-when-cross-origin'</title>
<meta charset='utf-8'>
<meta name="description" content="Check that a priori insecure subresource gets no referrer information. Otherwise, cross-origin subresources get the origin portion of the referrer URL and same-origin get the stripped referrer URL.">
<link rel="author" title="Kristijan Burnik" href="burnik@chromium.org">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-strict-origin-when-cross-origin">
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context.">
<meta name="referrer" content="no-referrer">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/security-features/resources/common.sub.js"></script>
<script src="/referrer-policy/generic/test-case.sub.js"></script>
</head>
<body>
<script>
TestCase(
{
"expectation": "stripped-referrer",
"origin": "same-http",
"redirection": "no-redirect",
"source_context_list": [
{
"policyDeliveries": [
{
"deliveryType": "http-rp",
"key": "referrerPolicy",
"value": "strict-origin-when-cross-origin"
}
],
"sourceContextType": "worker-classic"
}
],
"source_scheme": "http",
"subresource": "fetch",
"subresource_policy_deliveries": []
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
| saneyuki/servo | tests/wpt/web-platform-tests/referrer-policy/gen/worker-classic.http-rp/strict-origin-when-cross-origin/fetch/same-http.no-redirect.http.html | HTML | mpl-2.0 | 2,046 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
2079,
2025,
10086,
999,
7013,
2011,
6523,
14544,
1011,
3343,
1013,
12391,
1013,
5906,
1013,
9699,
1012,
1052,
2100,
2478,
2691,
1013,
3036,
1011,
2838,
1013,
5906,
1013,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"log"
"mime"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
)
// Access Control Lists (ACLs)
// An ACLDefinitions object contains information about how to assign ACLs to a
// request.
type ACLDefinitions struct {
ConnectPorts map[int][]string
ContentTypes map[string][]string
Methods map[string][]string
Referers map[string][]string
StatusCodes map[int][]string
URLs *URLMatcher
URLTags map[string][]string
UserIPAddresses map[string][]string
UserIPRanges []rangeToGroup
UserNames map[string][]string
Times []struct {
schedule WeeklySchedule
acl string
}
UserAgents []struct {
regexp *regexp.Regexp
acl string
}
Descriptions map[string]string
Actions []ACLActionRule
}
var errEmptyACLRule = errors.New("empty ACL rule")
// AddRule adds a rule to an ACL.
func (a *ACLDefinitions) AddRule(acl string, newRule []string) error {
if len(newRule) == 0 {
return errEmptyACLRule
}
keyword := newRule[0]
args := newRule[1:]
switch keyword {
case "connect-port":
if a.ConnectPorts == nil {
a.ConnectPorts = make(map[int][]string)
}
for _, port := range args {
p, err := strconv.Atoi(port)
if err != nil {
return err
}
a.ConnectPorts[p] = append(a.ConnectPorts[p], acl)
}
case "content-type":
if a.ContentTypes == nil {
a.ContentTypes = make(map[string][]string)
}
for _, ct := range args {
a.ContentTypes[ct] = append(a.ContentTypes[ct], acl)
}
case "method":
if a.Methods == nil {
a.Methods = make(map[string][]string)
}
for _, m := range args {
a.Methods[m] = append(a.Methods[m], acl)
}
case "referer", "referrer":
if a.URLs == nil {
a.URLs = newURLMatcher()
}
if a.Referers == nil {
a.Referers = make(map[string][]string)
}
for _, u := range args {
u = strings.ToLower(u)
a.URLs.AddRule(rule{t: urlMatch, content: u})
a.Referers[u] = append(a.Referers[u], acl)
}
case "http-status":
if a.StatusCodes == nil {
a.StatusCodes = make(map[int][]string)
}
for _, s := range args {
status, err := strconv.Atoi(s)
if err != nil {
return fmt.Errorf("invalid HTTP status code: %q", s)
}
a.StatusCodes[status] = append(a.StatusCodes[status], acl)
}
case "time":
s, err := ParseWeeklySchedule(args)
if err != nil {
return err
}
a.Times = append(a.Times, struct {
schedule WeeklySchedule
acl string
}{s, acl})
case "url":
if a.URLs == nil {
a.URLs = newURLMatcher()
}
if a.URLTags == nil {
a.URLTags = make(map[string][]string)
}
for _, u := range args {
u = strings.ToLower(u)
a.URLs.AddRule(rule{t: urlMatch, content: u})
a.URLTags[u] = append(a.URLTags[u], acl)
}
case "user-agent":
exp := strings.Join(args, " ")
r, err := regexp.Compile(exp)
if err != nil {
return err
}
a.UserAgents = append(a.UserAgents, struct {
regexp *regexp.Regexp
acl string
}{r, acl})
case "user-ip":
if a.UserIPAddresses == nil {
a.UserIPAddresses = make(map[string][]string)
}
for _, addr := range args {
if ip := net.ParseIP(addr); ip != nil {
s := ip.String()
a.UserIPAddresses[s] = append(a.UserIPAddresses[s], acl)
continue
}
r, err := ParseIPRange(addr)
if err != nil {
return fmt.Errorf("invalid IP address or range: %s", addr)
}
a.UserIPRanges = append(a.UserIPRanges, rangeToGroup{r, acl})
}
case "user-name":
if a.UserNames == nil {
a.UserNames = make(map[string][]string)
}
for _, name := range args {
a.UserNames[name] = append(a.UserNames[name], acl)
}
default:
return fmt.Errorf("unknown ACL rule keyword: %s", keyword)
}
return nil
}
// load loads ACL definitions and actions from a file.
func (a *ACLDefinitions) load(filename string) error {
f, err := os.Open(filename)
if err != nil {
return err
}
defer f.Close()
scanner := bufio.NewScanner(f)
lineNo := 0
for scanner.Scan() {
lineNo++
line := scanner.Text()
words := strings.Fields(line)
for i, w := range words {
if strings.HasPrefix(w, "#") {
words = words[:i]
break
}
}
if len(words) == 0 {
continue
}
action := words[0]
args := words[1:]
switch action {
case "acl":
// Define an ACL.
if len(args) < 2 {
log.Printf("Incomplete ACL definition at %s, line %d", filename, lineNo)
continue
}
err = a.AddRule(args[0], args[1:])
if err != nil {
log.Printf("Error at %s, line %d: %v", filename, lineNo, err)
}
case "describe":
// Give an acl a description for the block page.
if len(args) < 2 {
log.Printf("Incomplete ACL description at %s, line %d", filename, lineNo)
continue
}
if a.Descriptions == nil {
a.Descriptions = make(map[string]string)
}
a.Descriptions[args[0]] = strings.Join(args[1:], " ")
case "include":
for _, file := range args {
if !filepath.IsAbs(file) {
file = filepath.Join(filepath.Dir(filename), file)
}
err := a.load(file)
if err != nil {
log.Printf("Error including acl file %s: %v", file, err)
}
}
case "allow", "block", "block-invisible", "censor-words", "disable-proxy-headers", "hash-image", "ignore-category", "phrase-scan", "require-auth", "ssl-bump":
r := ACLActionRule{Action: action}
argLoop:
for _, a := range args {
switch a[0] {
case '!':
r.Disallowed = append(r.Disallowed, a[1:])
case '"':
// Parse a description string.
quoted := line[strings.Index(line, a):]
_, err := fmt.Sscanf(quoted, "%q", &r.Description)
if err != nil {
log.Printf("Invalid quoted string at %s, line %d: %q", filename, lineNo, quoted)
}
break argLoop
default:
r.Needed = append(r.Needed, a)
}
}
a.Actions = append(a.Actions, r)
default:
log.Printf("Invalid ACL action at %s, line %d: %s", filename, lineNo, action)
}
}
return scanner.Err()
}
// requestACLs returns the set of ACLs that apply to r.
func (a *ACLDefinitions) requestACLs(r *http.Request, user string) map[string]bool {
acls := make(map[string]bool)
if host, _, err := net.SplitHostPort(r.RemoteAddr); err == nil {
if ip := net.ParseIP(host); ip != nil {
for _, a := range a.UserIPAddresses[ip.String()] {
acls[a] = true
}
for _, r := range a.UserIPRanges {
if r.r.Contains(ip) {
acls[r.group] = true
}
}
}
}
if user != "" {
for _, a := range a.UserNames[user] {
acls[a] = true
}
}
for _, a := range a.Methods[r.Method] {
acls[a] = true
}
if r.Method == "CONNECT" {
_, port, err := net.SplitHostPort(r.Host)
if err != nil {
port = "443"
}
p, err := strconv.Atoi(port)
if err != nil {
p = 443
}
for _, a := range a.ConnectPorts[p] {
acls[a] = true
}
}
now := time.Now()
for _, t := range a.Times {
if t.schedule.Contains(now) {
acls[t.acl] = true
}
}
if a.URLs != nil {
for match := range a.URLs.MatchingRules(r.URL) {
for _, acl := range a.URLTags[match.content] {
acls[acl] = true
}
}
if referer := r.Header.Get("Referer"); referer != "" {
refURL, err := url.Parse(referer)
if err == nil {
for match := range a.URLs.MatchingRules(refURL) {
for _, acl := range a.Referers[match.content] {
acls[acl] = true
}
}
}
}
}
if userAgent := r.Header.Get("User-Agent"); userAgent != "" {
for _, u := range a.UserAgents {
if u.regexp.MatchString(userAgent) {
acls[u.acl] = true
}
}
}
return acls
}
// responseACLs returns the set of ACLs that apply to resp.
func (a *ACLDefinitions) responseACLs(resp *http.Response) map[string]bool {
acls := make(map[string]bool)
ct, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
switch ct {
case "unknown/unknown", "application/unknown", "*/*", "":
// These types tend to be used for content whose type is unknown,
// so we should try to second-guess them.
preview := make([]byte, 512)
n, _ := resp.Body.Read(preview)
preview = preview[:n]
if n > 0 {
ct, _, _ = mime.ParseMediaType(http.DetectContentType(preview))
log.Printf("Detected Content-Type as %q for %v", ct, resp.Request.URL)
// Make the preview data available for re-reading.
var rc struct {
io.Reader
io.Closer
}
rc.Reader = io.MultiReader(bytes.NewReader(preview), resp.Body)
rc.Closer = resp.Body
resp.Body = rc
}
}
for _, acl := range a.ContentTypes[ct] {
acls[acl] = true
}
slash := strings.Index(ct, "/")
if slash != -1 {
generic := ct[:slash+1] + "*"
for _, acl := range a.ContentTypes[generic] {
acls[acl] = true
}
}
status := resp.StatusCode
for _, acl := range a.StatusCodes[status] {
acls[acl] = true
}
// Also include the general status code category (multiple of 100).
status = status / 100 * 100
for _, acl := range a.StatusCodes[status] {
acls[acl] = true
}
return acls
}
// An ACLActionRule specifies an action that will be performed if a request
// belongs to a certain set of ACLs.
type ACLActionRule struct {
// Action is the name of the action that will be taken.
Action string
// Needed is a list of ACLs that the request must belong to.
Needed []string
// Disallowed is a list of ACLs that the request must not belong to.
Disallowed []string
// Description is an explanation of why the action was chosen, suitable for
// display to end users.
Description string
}
// Conditions returns a string summarizing r's conditions.
func (r ACLActionRule) Conditions() string {
var desc []string
for _, a := range r.Needed {
desc = append(desc, a)
}
for _, a := range r.Disallowed {
desc = append(desc, "!"+a)
}
return strings.Join(desc, " ")
}
// ChooseACLAction returns the first ACL action rule that
// matches acls and has an action in actions. If no rule matches, it returns
// a blank rule.
func (a *ACLDefinitions) ChooseACLAction(acls map[string]bool, actions ...string) ACLActionRule {
choices := make(map[string]bool, len(actions))
for _, a := range actions {
choices[a] = true
}
ruleLoop:
for _, r := range a.Actions {
if !choices[r.Action] {
continue ruleLoop
}
for _, a := range r.Needed {
if !acls[a] {
continue ruleLoop
}
}
for _, a := range r.Disallowed {
if acls[a] {
continue ruleLoop
}
}
return r
}
return ACLActionRule{}
}
func copyACLSet(a map[string]bool) map[string]bool {
b := make(map[string]bool)
for k, v := range a {
if v {
b[k] = true
}
}
return b
}
func unionACLSets(sets ...map[string]bool) map[string]bool {
b := make(map[string]bool)
for _, a := range sets {
for k, v := range a {
if v {
b[k] = true
}
}
}
return b
}
// ChooseACLCategoryAction is like ChooseACLAction, except that it also takes
// a list of categories. The first category in the list is added to the set of
// ACLs. If the result is empty, the default action for that category will be
// used. Then if the result is "ignore-category", the process will be repeated
// with the next category in the list. Finally, if all categories are ignored,
// the process is repeated with just the original set of ACLs. The second
// return value is a list of the categories that were ignored.
func (c *config) ChooseACLCategoryAction(acls map[string]bool, categories []string, actions ...string) (ar ACLActionRule, ignored []string) {
actionsPlus := append(actions, "ignore-category")
choices := make(map[string]bool, len(actions))
for _, a := range actions {
choices[a] = true
}
for _, cat := range categories {
aclsPlus := copyACLSet(acls)
aclsPlus[cat] = true
r := c.ACLs.ChooseACLAction(aclsPlus, actionsPlus...)
if r.Action == "" {
cg := c.Categories[cat]
r.Needed = []string{cat}
switch cg.action {
case BLOCK:
if cg.invisible && choices["block-invisible"] {
r.Action = "block-invisible"
} else if choices["block"] {
r.Action = "block"
}
case IGNORE:
r.Action = "ignore-category"
case ALLOW:
if choices["allow"] {
r.Action = "allow"
}
}
}
if r.Action == "ignore-category" || r.Action == "" {
ignored = append(ignored, cat)
} else {
return r, ignored
}
}
return c.ACLs.ChooseACLAction(acls, actions...), ignored
}
| unixabg/redwood | acl.go | GO | bsd-2-clause | 12,303 | [
30522,
7427,
2364,
12324,
1006,
1000,
20934,
8873,
2080,
1000,
1000,
27507,
1000,
1000,
10697,
1000,
1000,
4718,
2102,
1000,
1000,
22834,
1000,
1000,
8833,
1000,
1000,
2771,
4168,
1000,
1000,
5658,
1000,
1000,
5658,
1013,
8299,
1000,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
## Container Class
Container functions are used for managing active directory OU's (organizational units).
### All
To retrieve all OU's from AD, use the `all()` method:
$folders = $ad->containers()->all();
Keep in mind that this query is by default recursive, and your results may be limited depending on your server.
### Find
To find a folder, use the `find()` method:
$folder = $ad->containers()->find('Accounting');
| Galax-e/laravel-enterprise-starter-kit | vendor/adldap2/adldap2/docs/classes/CONTAINERS.md | Markdown | gpl-3.0 | 439 | [
30522,
1001,
1001,
11661,
2465,
11661,
4972,
2024,
2109,
2005,
6605,
3161,
14176,
15068,
1005,
1055,
1006,
13296,
3197,
1007,
1012,
1001,
1001,
1001,
2035,
2000,
12850,
2035,
15068,
1005,
1055,
2013,
4748,
1010,
2224,
1996,
1036,
2035,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2016 Hewlett-Packard Development Company, L.P.
//
// 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.
//
// END OF TERMS AND CONDITIONS
const nock = require('nock');
const expect = require('chai').expect;
const encryptUtil = require('./../app/routes/auth/encrypt.es6');
const fs = require('fs');
const async = require('async');
const resources = require('../app/resources/strings.es6');
// TODO: add test for TTL expiration.
// Disable eslint to allow for Nock generated objects
/* eslint-disable quote-props*/
/* eslint-disable no-unused-expressions */
/* eslint-disable no-useless-escape */
/* eslint-disable camelcase */
process.env.HE_ISSUER = "issue";
process.env.HE_AUTH_SERVICE_PORT = 0;
process.env.HE_AUTH_NO_COLLECTOR = 1;
process.env.HE_AUDIENCE = "audience";
process.env.HE_AUTH_MOCK_AUTH = "true";
process.env.HE_AUTH_SSL_PASS = "default";
process.env.JWE_SECRETS_PATH = "./test/assets/jwe_secrets_assets.pem";
process.env.VAULT_DEV_ROOT_TOKEN_ID = "default";
process.env.HE_IDENTITY_PORTAL_ENDPOINT = "http://example.com";
process.env.HE_IDENTITY_WS_ENDPOINT = "http://example.com";
process.env.JWE_TOKEN_PATH = "./test/assets/jwe_secrets_assets.pem";
process.env.JWE_TOKEN_URL_PATH = "./test/assets/jwe_secrets_assets.pem";
process.env.JWT_TOKEN_PATH = "./test/assets/jwe_secrets_assets.pem";
process.env.JWE_TOKEN_URL_PATH_PUB = "./test/assets/jwe_secrets_pub_assets.pem";
process.env.JWT_TOKEN_PATH_PUB = "./test/assets/jwe_secrets_pub_assets.pem";
process.env.HE_AUTH_SSL_KEY = "./test/assets/key.pem";
process.env.HE_AUTH_SSL_CERT = "./test/assets/cert.pem";
if (process.env.HTTP_PROXY || process.env.http_proxy) {
process.env.NO_PROXY = process.env.NO_PROXY ? process.env.NO_PROXY + ',vault' : 'vault';
process.env.no_proxy = process.env.no_proxy ? process.env.no_proxy + ',vault' : 'vault';
process.env.NO_PROXY = process.env.NO_PROXY ? process.env.NO_PROXY + ',basicauth' : 'basicauth';
process.env.no_proxy = process.env.no_proxy ? process.env.no_proxy + ',basicauth' : 'basicauth';
process.env.NO_PROXY = process.env.NO_PROXY ? process.env.NO_PROXY + ',localhost' : 'localhost';
process.env.no_proxy = process.env.no_proxy ? process.env.no_proxy + ',localhost' : 'localhost';
}
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/sys/init')
.reply(200, {"initialized": true}, ['Content-Type',
'application/json',
'Date',
'Tue, 01 Nov 2016 05:04:04 GMT',
'Content-Length',
'21',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/sys/seal-status')
.reply(200, {
"sealed": false, "t": 1,
"n": 1,
"progress": 0,
"version": "Vault v0.6.1",
"cluster_name": "vault-cluster-8ed1001e",
"cluster_id": "48a3ee1a-14fd-be4e-3cc5-bb023c56024e"
}, [
'Content-Type',
'application/json',
'Date',
'Tue, 01 Nov 2016 05:04:04 GMT',
'Content-Length',
'159',
'Connection',
'close'
]);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/sys/mounts')
.reply(200, {
"secret/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "generic secret storage",
"type": "generic"
},
"cubbyhole/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "per-token private secret storage",
"type": "cubbyhole"
},
"sys/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "system endpoints used for control, policy and debugging",
"type": "system"
},
"request_id": "93f8c930-6ddf-6165-7989-63c598c14aac",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"cubbyhole/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "per-token private secret storage",
"type": "cubbyhole"
},
"secret/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "generic secret storage",
"type": "generic"
},
"sys/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "system endpoints used for control, policy and debugging",
"type": "system"
}
},
"wrap_info": null,
"warnings": null,
"auth": null
}, [
'Content-Type',
'application/json',
'Date',
'Tue, 01 Nov 2016 05:04:04 GMT',
'Content-Length',
'961',
'Connection',
'close'
]);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/sys/auth')
.reply(200, {
"token/": {
"config": {
"default_lease_ttl": 0,
"max_lease_ttl": 0
},
"description": "token based credentials",
"type": "token"
},
"request_id": "ad9b37e3-7963-3848-95b3-7915d8504202",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"token/": {
"config": {
"default_lease_ttl": 0, "max_lease_ttl": 0
},
"description": "token based credentials",
"type": "token"
}
},
"wrap_info": null,
"warnings": null,
"auth": null
}, [
'Content-Type',
'application/json',
'Date',
'Tue, 01 Nov 2016 05:04:04 GMT',
'Content-Length',
'393',
'Connection',
'close'
]);
nock('http://vault:8200', {"encodedQueryParams": true})
.put('/v1/secret/abcd/integration', {
"integration_info": {
"name": "integration", "auth": {"type": "basic_auth"}
},
"user_info": {
"id": "abcd"
},
"secrets": {"token": "YWRtaW46YWRtaW4="}
})
.reply(204, "", ['Content-Type',
'application/json',
'Date',
'Tue, 01 Nov 2016 04:18:12 GMT',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/secret/abcd/integration')
.reply(200, {
"request_id": "c48cf5e1-e9c2-c16d-dfaa-847944584e20",
"lease_id": "",
"renewable": false,
"lease_duration": 2592000,
"data": {
"integration_info": {"auth": "auth", "name": "integration"},
"secrets": {"username": "admin", "password": "admin"},
"user_info": {"id": "abcd"}
},
"wrap_info": null,
"warnings": null,
"auth": null
}, ['Content-Type',
'application/json',
'Date',
'Fri, 11 Nov 2016 14:44:08 GMT',
'Content-Length',
'273',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/secret/DoesNotExists/integration')
.reply(404, {"errors": []}, ['Content-Type',
'application/json',
'Date',
'Fri, 11 Nov 2016 14:45:20 GMT',
'Content-Length',
'14',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.get('/v1/secret/abcd/DoesNotExists')
.reply(404, {"errors": []}, ['Content-Type',
'application/json',
'Date',
'Fri, 11 Nov 2016 14:45:20 GMT',
'Content-Length',
'14',
'Connection',
'close']);
nock('http://basicauth', {"encodedQueryParams": true})
.get('/success')
.reply(200, {"authenticated": true, "user": "admin"}, ['Server',
'nginx',
'Date',
'Sat, 12 Nov 2016 03:10:08 GMT',
'Content-Type',
'application/json',
'Content-Length',
'48',
'Connection',
'close',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Credentials',
'true']);
nock('http://basicauth', {"encodedQueryParams": true})
.get('/failure')
.reply(401, {"authenticated": true, "user": "admin"}, ['Server',
'nginx',
'Date',
'Sat, 12 Nov 2016 03:10:08 GMT',
'Content-Type',
'application/json',
'Content-Length',
'48',
'Connection',
'close',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Credentials',
'true']);
nock('http://vault:8200', {"encodedQueryParams": true})
.put('/v1/secret/abcd/integration', {
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "GET"
}
}
}
},
"user_info": {
"id": "abcd"
},
"secrets": {
"token": "YWRtaW46YWRtaW4="
}
})
.reply(204, "", ['Content-Type',
'application/json',
'Date',
'Sat, 12 Nov 2016 03:10:08 GMT',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.put('/v1/secret/abcd/integration', {
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
}
}
},
"user_info": {
"id": "abcd"
},
"secrets": {
"token": "YWRtaW46YWRtaW4="
}
})
.reply(204, "", ['Content-Type',
'application/json',
'Date',
'Sat, 12 Nov 2016 03:10:08 GMT',
'Connection',
'close']);
nock('http://vault:8200', {"encodedQueryParams": true})
.put('/v1/secret/abcd/integration', {
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http:\/\/idmauth\/success",
verb: "POST"
}
}
}
},
"user_info": {
"id": "abcd"
},
"secrets": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"
}
})
.reply(204, "", ['Content-Type',
'application/json',
'Date',
'Sat, 12 Nov 2016 03:10:08 GMT',
'Connection',
'close']);
const authService = require('../server.es6');
const request = require('supertest')(authService.app);
/* eslint-disable no-undef */
let token = "";
let secret = "";
let secretPayload = {"username": "admin", "password": "admin"};
describe('Auth Service tests', function() {
this.timeout(20000);
before(function(done) {
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
});
it('should fail to yield token if fields are not properly set', function(done) {
request
.post('/token_urls')
.send({})
.expect(500, done);
});
it('should fail to yield token if url_props is not set', function(done) {
request
.post('/token_urls')
.send({
"user_info": {"id": "abcd"},
"integration_info": {"name": "integration", "auth": "auth"},
"bot_info": "xyz"
})
.expect(500, done);
});
it('should fail to yield token if bot_info is not set', function(done) {
request
.post('/token_urls')
.send({
"user_info": {"id": "abcd"},
"integration_info": {"name": "integration", "auth": "auth"},
"url_props": {"ttl": 300}
})
.expect(500, done);
});
it('should fail to yield token if integration_info is not set', function(done) {
request
.post('/token_urls')
.send({
"user_info": {"id": "abcd"},
"bot_info": "xyz",
"url_props": {"ttl": 300}
})
.expect(500, done);
});
it('should fail to yield token if user_info is not set', function(done) {
request
.post('/token_urls')
.send({
"integration_info": {"name": "integration", "auth": "auth"},
"bot_info": "xyz",
"url_props": {"ttl": 300}
})
.expect(500, done);
});
it('should fail to yield token if integration_info.name is not set', function(done) {
request
.post('/token_urls')
.send({
"integration_info": {"auth": "auth"},
"bot_info": "xyz",
"url_props": {"ttl": 300}
})
.expect(500, done);
});
it('should fail to yield token if integration_info.auth is not set', function(done) {
request
.post('/token_urls')
.send({
"integration_info": {"name": "integration"},
"bot_info": "xyz",
"url_props": {"ttl": 300}
})
.expect(500, done);
});
it('should yield valid token if body is correctly built', function(done) {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {"type": "basic_auth"}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
});
it('should return an error when posting secrets without providing a token or secret', function(done) {
request
.post('/secrets')
.send({})
.expect(500, done);
});
it('should return an error when posting secrets without providing a valid token', function(done) {
request
.post('/secrets')
.send({"secrets": secret})
.expect(500, done);
});
it('should return an error when posting secrets without providing a valid secret', function(done) {
request
.post('/secrets')
.send({"secrets": {"invalid": "secret"}, "token": token})
.expect(500, done);
});
it('should store the secret given a valid token and secret', function(done) {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(201, done);
});
it('should be able to retrieve the stored secret', function(done) {
let userID = 'abcd';
let integrationName = 'integration';
request
.get(`/secrets/${userID}/${integrationName}`)
.expect(200)
.expect(resp => {
expect(resp).to.exist;
expect(resp.body).to.exist;
expect(resp.body.secrets).to.exist;
expect(resp.body.secrets).to.be.an('object');
expect(resp.body.integration_info).to.exist;
expect(resp.body.integration_info).to.be.an('object');
expect(resp.body.integration_info.name).to.exist;
expect(resp.body.integration_info.auth).to.exist;
expect(resp.body.user_info).to.exist;
expect(resp.body.user_info).to.be.an('object');
expect(resp.body.user_info.id).to.exist;
})
.end(done);
});
it('should error out when a non-existing userID is given', function(done) {
let userID = 'DoesNotExists';
let integrationName = 'integration';
request
.get(`/secrets/${userID}/${integrationName}`)
.expect(404, done);
});
it('should error out when a non-existing integrationName is given', function(done) {
let userID = 'abcd';
let integrationName = 'DoesNotExists';
request
.get(`/secrets/${userID}/${integrationName}`)
.expect(404, done);
});
});
describe('Auth Service endpoint authentication test', function() {
it('should yield valid token with an embedded endpoint (credentials set to admin:admin)', function(done) {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "GET"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
});
it('should store the secret given valid credentials', function(done) {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(201, done);
});
});
describe('Auth Service endpoint authentication test for failure', function() {
it('should yield valid token with an embedded endpoint (credentials set to admin:newPassword)', function(done) {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
"endpoint": {
url: "http://basicauth/failure",
verb: "GET"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
});
it('should not store the secret given invalid credentials', function(done) {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(401, done);
});
it('should not store the secret if `verb` is not specified', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
"endpoint": {
url: "http://basicauth/success"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('should not store the secret if `url` is not specified', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
"endpoint": {
verb: "GET"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('should store the secret if `endpoint` is not specified', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "basic_auth",
"params": {
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(201, done);
});
});
});
describe('Test IDM authentication', function() {
it('Should fail if missing endpoint', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing url', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing verb', function(done) {
async.series([
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing secrets', function(done) {
request
.post('/secrets')
.send({"token": token})
.expect(500, done);
});
it('Should fail if missing user', function(done) {
async.series([
done => {
let secretPayload = {
"tenant": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing username in user structure', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"password": "admin"
},
"tenant": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing password in user structure', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin"
},
"tenant": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing tenant', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing username in tenant structure', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin",
"password": "admin"
},
"tenant": {
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing password in tenant structure', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin",
"password": "admin"
},
"tenant": {
"username": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if missing NAME in tenant structure', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin",
"password": "admin"
},
"tenant": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://basicauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should fail if an unsupported http verb is given.', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "admin",
"password": "admin"
},
"tenant": {
"username": "admin",
"password": "admin"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://idmauth/success",
verb: "GET"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(500, done);
});
});
it('Should successfully authenticate when payload is built correctly.', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": resources.MOCK_IDM_CREDS.username,
"password": resources.MOCK_IDM_CREDS.password
},
"tenant": {
"name": resources.MOCK_IDM_CREDS.tenantName,
"username": resources.MOCK_IDM_CREDS.tenantUsername,
"password": resources.MOCK_IDM_CREDS.tenantPassword
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://idmauth/success",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(201, done);
});
});
it('Should not allow access to an agent with incorrect user credentials.', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": "wrong",
"password": "wrong"
},
"tenant": {
"name": resources.MOCK_IDM_CREDS.tenantName,
"username": resources.MOCK_IDM_CREDS.tenantUsername,
"password": resources.MOCK_IDM_CREDS.tenantPassword
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://idmauth/failure",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(401, done);
});
});
it('Should not allow access to an agent with incorrect tenant credentials.', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": resources.MOCK_IDM_CREDS.username,
"password": resources.MOCK_IDM_CREDS.password
},
"tenant": {
"name": resources.MOCK_IDM_CREDS.tenantName,
"username": "wrong",
"password": "wrong"
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://idmauth/failure",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(401, done);
});
});
it('Should not allow access to an agent with incorrect tenant NAME', function(done) {
async.series([
done => {
let secretPayload = {
"user": {
"username": resources.MOCK_IDM_CREDS.username,
"password": resources.MOCK_IDM_CREDS.password
},
"tenant": {
"name": "wrong",
"username": resources.MOCK_IDM_CREDS.tenantUsername,
"password": resources.MOCK_IDM_CREDS.tenantPassword
}
};
let secretsPubKey = fs.readFileSync('./test/assets/jwe_secrets_pub_assets.pem');
encryptUtil.encryptWithKey(secretsPubKey, JSON.stringify(secretPayload),
(err, encryptedSecrets) => {
if (err)
return done(err);
secret = encryptedSecrets;
done();
});
},
done => {
let payload = {
"user_info": {
"id": "abcd"
},
"integration_info": {
"name": "integration",
"auth": {
"type": "idm_auth",
"params": {
"endpoint": {
url: "http://idmauth/failure",
verb: "POST"
}
}
}
},
"bot_info": "xyz",
"url_props": {
"ttl": 300
}
};
request
.post('/token_urls')
.send(payload)
.expect(201)
.expect(res => {
expect(res.body).exists;
expect(res.body.token).exists;
expect(res.body.message).equals('token_url created');
token = res.body.token;
})
.end(err => {
if (err) {
return done(err);
}
done();
});
}
], () => {
request
.post('/secrets')
.send({"secrets": secret, "token": token})
.expect(401, done);
});
});
});
| eedevops/he-auth-service | test/auth_service.js | JavaScript | mit | 47,884 | [
30522,
1013,
1013,
9385,
2355,
2002,
13668,
6582,
1011,
24100,
2458,
2194,
1010,
1048,
1012,
1052,
1012,
1013,
1013,
1013,
1013,
6656,
2003,
2182,
3762,
4379,
1010,
2489,
1997,
3715,
1010,
2000,
2151,
2711,
11381,
1037,
6100,
1997,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright 2016 James Craig
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.
*/
using Structure.Sketching.Filters.ColorMatrix.BaseClasses;
using Structure.Sketching.Numerics;
namespace Structure.Sketching.Filters.ColorMatrix.ColorBlindness
{
/// <summary>
/// Deuteranomaly matrix
/// </summary>
/// <seealso cref="Structure.Sketching.Filters.ColorMatrix.BaseClasses.MatrixBaseClass" />
public class Deuteranomaly : MatrixBaseClass
{
/// <summary>
/// Gets the matrix.
/// </summary>
/// <value>The matrix.</value>
public override Matrix5x5 Matrix => new Matrix5x5(
.8f, .258f, 0f, 0f, 0f,
.2f, .742f, .142f, 0f, 0f,
0f, 0f, .858f, 0f, 0f,
0f, 0f, 0f, 1f, 0f,
0f, 0f, 0f, 0f, 1f
);
}
} | JaCraig/Structure.Sketching | Structure.Sketching/Filters/ColorMatrix/ColorBlindness/Deuteranomaly.cs | C# | apache-2.0 | 1,343 | [
30522,
1013,
1008,
9385,
2355,
2508,
7010,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1996,
6105,
1012,
2017,
2089,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Manipulating JavaScript Objects
// I worked on this challenge: [by myself, with: ]
// There is a section below where you will write your code.
// DO NOT ALTER THIS OBJECT BY ADDING ANYTHING WITHIN THE CURLY BRACES!
var terah = {
name: "Terah",
age: 32,
height: 66,
weight: 130,
hairColor: "brown",
eyeColor: "brown"
}
// __________________________________________
// Write your code below.
var adam = {
}
adam.name = "Adam";
terah.spouse = adam;
terah.weight = 125;
delete terah.eyeColor;
adam.spouse = terah;
terah.children = new Object();
var carson = {
name: "Carson",
}
terah.children.carson = carson;
var carter = {
name: "Carter",
}
terah.children.carter = carter;
var colton = {
name: "Colton",
}
terah.children.colton = colton;
adam.children = terah.children;
// __________________________________________
// Reflection: Use the reflection guidelines
/*
What tests did you have trouble passing? What did you do to make
it pass? Why did that work?
There were two tests that I had difficulty with, the first was
assigning terah a spouse. This was mainly because I had misread
the instructions and I was passing terah adam.name and not the
object adam. The second was assigning carson to terah.children,
again this ending up being more a confusion with the instructions
and I failed to initially create carson as a property of
terah.children. Once I realized the mistake, I passed the tests
and moved on.
How difficult was it to add and delete properties outside of the
object itself?
It was easy for the most part and I just needed to spend more
time reading the directions and figuring out what was being asked.
What did you learn about manipulating objects in this challenge?
I started this challenge before finishing 7.2 Eloquent
JavaScript, having only completed the Codecademy JavaScript
track. So I had to do some research on deleting a property. Other
than that, it was mostly things I had already covered.
*/
// __________________________________________
// Driver Code: Do not alter code below this line.
function assert(test, message, test_number) {
if (!test) {
console.log(test_number + "false");
throw "ERROR: " + message;
}
console.log(test_number + "true");
return true;
}
assert(
(adam instanceof Object),
"The value of adam should be an Object.",
"1. "
)
assert(
(adam.name === "Adam"),
"The value of the adam name property should be 'Adam'.",
"2. "
)
assert(
terah.spouse === adam,
"terah should have a spouse property with the value of the object adam.",
"3. "
)
assert(
terah.weight === 125,
"The terah weight property should be 125.",
"4. "
)
assert(
terah.eyeColor === undefined || null,
"The terah eyeColor property should be deleted.",
"5. "
)
assert(
terah.spouse.spouse === terah,
"Terah's spouse's spouse property should refer back to the terah object.",
"6. "
)
assert(
(terah.children instanceof Object),
"The value of the terah children property should be defined as an Object.",
"7. "
)
assert(
(terah.children.carson instanceof Object),
"carson should be defined as an object and assigned as a child of Terah",
"8. "
)
assert(
terah.children.carson.name === "Carson",
"Terah's children should include an object called carson which has a name property equal to 'Carson'.",
"9. "
)
assert(
(terah.children.carter instanceof Object),
"carter should be defined as an object and assigned as a child of Terah",
"10. "
)
assert(
terah.children.carter.name === "Carter",
"Terah's children should include an object called carter which has a name property equal to 'Carter'.",
"11. "
)
assert(
(terah.children.colton instanceof Object),
"colton should be defined as an object and assigned as a child of Terah",
"12. "
)
assert(
terah.children.colton.name === "Colton",
"Terah's children should include an object called colton which has a name property equal to 'Colton'.",
"13. "
)
assert(
adam.children === terah.children,
"The value of the adam children property should be equal to the value of the terah children property",
"14. "
)
console.log("\nHere is your final terah object:")
console.log(terah) | toddseller/phase-0 | week-7/manipulating_objects.js | JavaScript | mit | 4,261 | [
30522,
1013,
1013,
30524,
2025,
11477,
2023,
4874,
2011,
5815,
2505,
2306,
1996,
17546,
17180,
2015,
999,
13075,
28774,
4430,
1027,
1063,
2171,
1024,
1000,
28774,
4430,
1000,
1010,
2287,
1024,
3590,
1010,
4578,
1024,
5764,
1010,
3635,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# How to contribute
To contribute, please fork the repository, add your changes to the code, and submit a pull request for review.
Prior to opening a pull request, all code should be formatted with `black` and `isort`, linted with `flake8`, and tested with `pytest`. Any issues raised by these tools should be resolved, or the lint and test checks in continuous integration will fail. Installing the pre-commit hooks as shown below will ensure that autoformatting and linting are run prior to new commits, but tests will need to be run separately.
To start developing locally, read through the [development guide](#development-guide) below!
# Development guide
## Setup
**1) [Follow regular installation instructions](../README.md#installation)**
**2) Install development dependencies**
```
pip install -e mugen[development]
```
**3) Download [Visual Studio Code](https://code.visualstudio.com/)**
It's recommended to use Visual Studio Code to take advantage of their integrated tooling.
**4) Configure Visual Studio Code**
In Visual Studio Code's Python settings:
- Set the formatter to `black`
- Set the imports sorter to `isort`
- Enable flake8 linting
- Enable format on save
Open Visual Studio Code's `settings.json` directly, and under the `[python]` section add the `organizeImports` code action on save:
```
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
},
```
If there is no python section, add it at the top level.
The settings above will ensure essential formatting and linting is performed automatically whenever a file is saved.
**5) Add pre-commit hooks**
```
pre-commit install
```
**6) Install [act](https://github.com/nektos/act)**
```
brew install act
```
Act enables testing Github Actions workflows locally.
## Linting and Testing
**Autoformat code with black**
```
black mugen scripts tests
```
**Autosort imports with isort**
```
isort
```
**Lint code with flake8**
```
flake8
```
**Run the test suite**
```
pytest
```
**Run the pre-commit hooks**
```
pre-commit run --all-files
```
This runs `black`, `isort`, and `flake8`
**Run a workflow locally**
```
act pull_request
```
**Run a specific workflow job locally**
```
act -j lint
```
| scherroman/mugen | documentation/CONTRIBUTING.md | Markdown | mit | 2,253 | [
30522,
1001,
2129,
2000,
9002,
2000,
9002,
1010,
3531,
9292,
1996,
22409,
1010,
5587,
2115,
3431,
2000,
1996,
3642,
1010,
1998,
12040,
1037,
4139,
5227,
2005,
3319,
1012,
3188,
2000,
3098,
1037,
4139,
5227,
1010,
2035,
3642,
2323,
2022,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module.exports.name = 'development';
module.exports.dbtype = "mssql";
module.exports.datasource = {user: "sa", password: "sa", host: "localhost", port: 1433};
module.exports.windwalkerPort = 8080; | BHare1985/Windshaft | config/environments/development.js | JavaScript | bsd-3-clause | 214 | [
30522,
11336,
1012,
14338,
1012,
2171,
1027,
1005,
2458,
1005,
1025,
11336,
1012,
14338,
1012,
16962,
13874,
1027,
1000,
5796,
2015,
4160,
2140,
1000,
1025,
11336,
1012,
14338,
1012,
2951,
6499,
3126,
3401,
1027,
1063,
5310,
1024,
1000,
784... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/times.h>
#include "clock.h"
/* Routines for using cycle counter */
/* Detect whether running on Alpha */
#ifdef __alpha
#define IS_ALPHA 1
#else
#define IS_ALPHA 0
#endif
/* Detect whether running on x86 */
#ifdef __i386__
#define IS_x86 1
#else
#define IS_x86 0
#endif
/* Keep track of most recent reading of cycle counter */
static unsigned cyc_hi = 0;
static unsigned cyc_lo = 0;
#if IS_ALPHA
/* Use Alpha cycle timer to compute cycles. Then use
measured clock speed to compute seconds
*/
/*
* counterRoutine is an array of Alpha instructions to access
* the Alpha's processor cycle counter. It uses the rpcc
* instruction to access the counter. This 64 bit register is
* divided into two parts. The lower 32 bits are the cycles
* used by the current process. The upper 32 bits are wall
* clock cycles. These instructions read the counter, and
* convert the lower 32 bits into an unsigned int - this is the
* user space counter value.
* NOTE: The counter has a very limited time span. With a
* 450MhZ clock the counter can time things for about 9
* seconds. */
static unsigned int counterRoutine[] =
{
0x601fc000u,
0x401f0000u,
0x6bfa8001u
};
/* Cast the above instructions into a function. */
static unsigned int (*counter)(void)= (void *)counterRoutine;
void start_counter()
{
/* Get cycle counter */
cyc_hi = 0;
cyc_lo = counter();
}
double get_counter()
{
unsigned ncyc_hi, ncyc_lo;
unsigned hi, lo, borrow;
double result;
ncyc_lo = counter();
ncyc_hi = 0;
lo = ncyc_lo - cyc_lo;
borrow = lo > ncyc_lo;
hi = ncyc_hi - cyc_hi - borrow;
result = (double) hi * (1 << 30) * 4 + lo;
if (result < 0) {
fprintf(stderr, "Error: Cycle counter returning negative value: %.0f\n", result);
}
return result;
}
#endif /* Alpha */
#if IS_x86
void access_counter(unsigned *hi, unsigned *lo)
{
/* Get cycle counter */
asm("rdtsc; movl %%edx,%0; movl %%eax,%1"
: "=r" (*hi), "=r" (*lo)
: /* No input */
: "%edx", "%eax");
}
void start_counter()
{
access_counter(&cyc_hi, &cyc_lo);
}
double get_counter()
{
unsigned ncyc_hi, ncyc_lo;
unsigned hi, lo, borrow;
double result;
/* Get cycle counter */
access_counter(&ncyc_hi, &ncyc_lo);
/* Do double precision subtraction */
lo = ncyc_lo - cyc_lo;
borrow = lo > ncyc_lo;
hi = ncyc_hi - cyc_hi - borrow;
result = (double) hi * (1 << 30) * 4 + lo;
if (result < 0) {
fprintf(stderr, "Error: Cycle counter returning negative value: %.0f\n", result);
}
return result;
}
#endif /* x86 */
double ovhd()
{
/* Do it twice to eliminate cache effects */
int i;
double result;
for (i = 0; i < 2; i++) {
start_counter();
result = get_counter();
}
return result;
}
/* Determine clock rate by measuring cycles
elapsed while sleeping for sleeptime seconds */
double mhz_full(int verbose, int sleeptime)
{
double rate;
start_counter();
sleep(sleeptime);
rate = get_counter()/(1e6*sleeptime);
if (verbose)
printf("Processor Clock Rate ~= %.1f MHz\n", rate);
return rate;
}
/* Version using a default sleeptime */
double mhz(int verbose)
{
return mhz_full(verbose, 2);
}
/** Special counters that compensate for timer interrupt overhead */
static double cyc_per_tick = 0.0;
#define NEVENT 100
#define THRESHOLD 1000
#define RECORDTHRESH 3000
/* Attempt to see how much time is used by timer interrupt */
static void callibrate(int verbose)
{
double oldt;
struct tms t;
clock_t oldc;
int e = 0;
times(&t);
oldc = t.tms_utime;
start_counter();
oldt = get_counter();
while (e <NEVENT) {
double newt = get_counter();
if (newt-oldt >= THRESHOLD) {
clock_t newc;
times(&t);
newc = t.tms_utime;
if (newc > oldc) {
double cpt = (newt-oldt)/(newc-oldc);
if ((cyc_per_tick == 0.0 || cyc_per_tick > cpt) && cpt > RECORDTHRESH)
cyc_per_tick = cpt;
/*
if (verbose)
printf("Saw event lasting %.0f cycles and %d ticks. Ratio = %f\n",
newt-oldt, (int) (newc-oldc), cpt);
*/
e++;
oldc = newc;
}
oldt = newt;
}
}
if (verbose)
printf("Setting cyc_per_tick to %f\n", cyc_per_tick);
}
static clock_t start_tick = 0;
void start_comp_counter() {
struct tms t;
if (cyc_per_tick == 0.0)
callibrate(0);
times(&t);
start_tick = t.tms_utime;
start_counter();
}
double get_comp_counter() {
double time = get_counter();
double ctime;
struct tms t;
clock_t ticks;
times(&t);
ticks = t.tms_utime - start_tick;
ctime = time - ticks*cyc_per_tick;
/*
printf("Measured %.0f cycles. Ticks = %d. Corrected %.0f cycles\n",
time, (int) ticks, ctime);
*/
return ctime;
}
| lihux/LHiOSAccumulates | LHiOSAccumulatesInObjectiveC/LHiOSAccumulatesInObjectiveC/LCTabs/LCDemo/LCDComputerSystem/LCDComputerSystemChapter6/clock.c | C | mit | 4,737 | [
30522,
1001,
2421,
1026,
2358,
20617,
1012,
1044,
1028,
1001,
2421,
1026,
2358,
19422,
12322,
1012,
1044,
1028,
1001,
2421,
1026,
4895,
2923,
2094,
1012,
1044,
1028,
1001,
2421,
1026,
25353,
2015,
1013,
2335,
1012,
1044,
1028,
1001,
2421,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you 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 org.apache.zookeeper.server.quorum;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.apache.jute.InputArchive;
import org.apache.jute.OutputArchive;
import org.apache.zookeeper.MockPacket;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.proto.ConnectRequest;
import org.apache.zookeeper.proto.ReplyHeader;
import org.apache.zookeeper.proto.RequestHeader;
import org.apache.zookeeper.proto.SetWatches;
import org.apache.zookeeper.server.MockNIOServerCnxn;
import org.apache.zookeeper.server.NIOServerCnxn;
import org.apache.zookeeper.server.NIOServerCnxnFactory;
import org.apache.zookeeper.server.MockSelectorThread;
import org.apache.zookeeper.server.ZKDatabase;
import org.apache.zookeeper.server.ZooTrace;
import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Demonstrate ZOOKEEPER-1382 : Watches leak on expired session
*/
@RunWith(Parameterized.class)
public class WatchLeakTest {
protected static final Logger LOG = LoggerFactory
.getLogger(WatchLeakTest.class);
final long SESSION_ID = 0xBABEL;
private final boolean sessionTimedout;
public WatchLeakTest(boolean sessionTimedout) {
this.sessionTimedout = sessionTimedout;
}
@Parameters
public static Collection<Object[]> configs() {
return Arrays.asList(new Object[][] {
{ false }, { true },
});
}
/**
* Check that if session has expired then no watch can be set
*/
@Test
public void testWatchesLeak() throws Exception {
NIOServerCnxnFactory serverCnxnFactory = mock(NIOServerCnxnFactory.class);
final SelectionKey sk = new FakeSK();
MockSelectorThread selectorThread = mock(MockSelectorThread.class);
when(selectorThread.addInterestOpsUpdateRequest(any(SelectionKey.class))).thenAnswer(new Answer<Boolean>() {
@Override
public Boolean answer(InvocationOnMock invocation) throws Throwable {
SelectionKey sk = (SelectionKey)invocation.getArguments()[0];
NIOServerCnxn nioSrvCnx = (NIOServerCnxn)sk.attachment();
sk.interestOps(nioSrvCnx.getInterestOps());
return true;
}
});
ZKDatabase database = new ZKDatabase(null);
database.setlastProcessedZxid(2L);
QuorumPeer quorumPeer = mock(QuorumPeer.class);
FileTxnSnapLog logfactory = mock(FileTxnSnapLog.class);
// Directories are not used but we need it to avoid NPE
when(logfactory.getDataDir()).thenReturn(new File(""));
when(logfactory.getSnapDir()).thenReturn(new File(""));
FollowerZooKeeperServer fzks = null;
try {
// Create a new follower
fzks = new FollowerZooKeeperServer(logfactory, quorumPeer, database);
fzks.startup();
fzks.setServerCnxnFactory(serverCnxnFactory);
quorumPeer.follower = new MyFollower(quorumPeer, fzks);
LOG.info("Follower created");
// Simulate a socket channel between a client and a follower
final SocketChannel socketChannel = createClientSocketChannel();
// Create the NIOServerCnxn that will handle the client requests
final MockNIOServerCnxn nioCnxn = new MockNIOServerCnxn(fzks,
socketChannel, sk, serverCnxnFactory, selectorThread);
sk.attach(nioCnxn);
// Send the connection request as a client do
nioCnxn.doIO(sk);
LOG.info("Client connection sent");
// Send the valid or invalid session packet to the follower
QuorumPacket qp = createValidateSessionPacketResponse(!sessionTimedout);
quorumPeer.follower.processPacket(qp);
LOG.info("Session validation sent");
// OK, now the follower knows that the session is valid or invalid, let's try
// to send the watches
nioCnxn.doIO(sk);
// wait for the the request processor to do his job
Thread.sleep(1000L);
LOG.info("Watches processed");
// If session has not been validated, there must be NO watches
int watchCount = database.getDataTree().getWatchCount();
if (sessionTimedout) {
// Session has not been re-validated !
LOG.info("session is not valid, watches = {}", watchCount);
assertEquals("Session is not valid so there should be no watches", 0, watchCount);
} else {
// Session has been re-validated
LOG.info("session is valid, watches = {}", watchCount);
assertEquals("Session is valid so the watch should be there", 1, watchCount);
}
} finally {
if (fzks != null) {
fzks.shutdown();
}
}
}
/**
* A follower with no real leader connection
*/
public static class MyFollower extends Follower {
/**
* Create a follower with a mocked leader connection
*
* @param self
* @param zk
*/
MyFollower(QuorumPeer self, FollowerZooKeeperServer zk) {
super(self, zk);
leaderOs = mock(OutputArchive.class);
leaderIs = mock(InputArchive.class);
bufferedOutput = mock(BufferedOutputStream.class);
}
}
/**
* Simulate the behavior of a real selection key
*/
private static class FakeSK extends SelectionKey {
@Override
public SelectableChannel channel() {
return null;
}
@Override
public Selector selector() {
return mock(Selector.class);
}
@Override
public boolean isValid() {
return true;
}
@Override
public void cancel() {
}
@Override
public int interestOps() {
return ops;
}
private int ops = OP_WRITE + OP_READ;
@Override
public SelectionKey interestOps(int ops) {
this.ops = ops;
return this;
}
@Override
public int readyOps() {
boolean reading = (ops & OP_READ) != 0;
boolean writing = (ops & OP_WRITE) != 0;
if (reading && writing) {
LOG.info("Channel is ready for reading and writing");
} else if (reading) {
LOG.info("Channel is ready for reading only");
} else if (writing) {
LOG.info("Channel is ready for writing only");
}
return ops;
}
}
/**
* Create a watches message with a single watch on /
*
* @return a message that attempts to set 1 watch on /
*/
private ByteBuffer createWatchesMessage() {
List<String> dataWatches = new ArrayList<String>(1);
dataWatches.add("/");
List<String> existWatches = Collections.emptyList();
List<String> childWatches = Collections.emptyList();
SetWatches sw = new SetWatches(1L, dataWatches, existWatches,
childWatches);
RequestHeader h = new RequestHeader();
h.setType(ZooDefs.OpCode.setWatches);
h.setXid(-8);
MockPacket p = new MockPacket(h, new ReplyHeader(), sw, null, null);
return p.createAndReturnBB();
}
/**
* This is the secret that we use to generate passwords, for the moment it
* is more of a sanity check.
*/
static final private long superSecret = 0XB3415C00L;
/**
* Create a connection request
*
* @return a serialized connection request
*/
private ByteBuffer createConnRequest() {
Random r = new Random(SESSION_ID ^ superSecret);
byte p[] = new byte[16];
r.nextBytes(p);
ConnectRequest conReq = new ConnectRequest(0, 1L, 30000, SESSION_ID, p);
MockPacket packet = new MockPacket(null, null, conReq, null, null, false);
return packet.createAndReturnBB();
}
/**
* Mock a client channel with a connection request and a watches message
* inside.
*
* @return a socket channel
* @throws IOException
*/
private SocketChannel createClientSocketChannel() throws IOException {
SocketChannel socketChannel = mock(SocketChannel.class);
Socket socket = mock(Socket.class);
InetSocketAddress socketAddress = new InetSocketAddress(1234);
when(socket.getRemoteSocketAddress()).thenReturn(socketAddress);
when(socketChannel.socket()).thenReturn(socket);
// Send watches packet to server connection
final ByteBuffer connRequest = createConnRequest();
final ByteBuffer watchesMessage = createWatchesMessage();
final ByteBuffer request = ByteBuffer.allocate(connRequest.limit()
+ watchesMessage.limit());
request.put(connRequest);
request.put(watchesMessage);
Answer<Integer> answer = new Answer<Integer>() {
int i = 0;
@Override
public Integer answer(InvocationOnMock invocation) throws Throwable {
Object[] args = invocation.getArguments();
ByteBuffer bb = (ByteBuffer) args[0];
for (int k = 0; k < bb.limit(); k++) {
bb.put(request.get(i));
i = i + 1;
}
return bb.limit();
}
};
when(socketChannel.read(any(ByteBuffer.class))).thenAnswer(answer);
return socketChannel;
}
/**
* Forge an invalid session packet as a LEADER do
*
* @param valid <code>true</code> to create a valid session message
*
* @throws Exception
*/
private QuorumPacket createValidateSessionPacketResponse(boolean valid) throws Exception {
QuorumPacket qp = createValidateSessionPacket();
ByteArrayInputStream bis = new ByteArrayInputStream(qp.getData());
DataInputStream dis = new DataInputStream(bis);
long id = dis.readLong();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
dos.writeLong(id);
// false means that the session has expired
dos.writeBoolean(valid);
qp.setData(bos.toByteArray());
return qp;
}
/**
* Forge an validate session packet as a LEARNER do
*
* @return
* @throws Exception
*/
private QuorumPacket createValidateSessionPacket() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
dos.writeLong(SESSION_ID);
dos.writeInt(3000);
dos.close();
QuorumPacket qp = new QuorumPacket(Leader.REVALIDATE, -1,
baos.toByteArray(), null);
return qp;
}
}
| bit1129/open-source-projects | src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java | Java | apache-2.0 | 12,847 | [
30522,
1013,
1008,
1008,
1008,
7000,
2000,
1996,
15895,
4007,
3192,
1006,
2004,
2546,
1007,
2104,
2028,
2030,
2062,
1008,
12130,
6105,
10540,
1012,
2156,
1996,
5060,
5371,
5500,
2007,
2023,
1008,
2147,
2005,
3176,
2592,
4953,
9385,
6095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/python
import sys
def tokens(nodes):
for i in range(0, nodes):
print (i * (2 ** 127 - 1) / nodes)
tokens(int(sys.argv[1]))
| aglne/Solandra | scripts/get_initial_tokens.py | Python | apache-2.0 | 148 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
18750,
12324,
25353,
2015,
13366,
19204,
2015,
1006,
14164,
1007,
1024,
2005,
1045,
1999,
2846,
1006,
1014,
1010,
14164,
1007,
1024,
6140,
1006,
1045,
1008,
1006,
1016,
1008,
1008,
13029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TARGET = $(TOPDIR)/linux/include/asm-i386/offset.h
all:
mrproper:
fastdep: $(TARGET)
.PHONY: all
$(TARGET): offset.h
cmp -s $^ $@ || (cp $^ $(TARGET).new && mv $(TARGET).new $(TARGET))
.PHONY : offset.h all modules modules_install
offset.h: offset.sed offset.c FORCE_RECOMPILE
$(CC) $(CFLAGS) -S -o offset.tmp offset.c
sed -n -f offset.sed < offset.tmp > offset.h
FORCE_RECOMPILE:
clean:
rm -f offset.[hs] $(TARGET).new offset.tmp
mrproper:
rm -f offset.[hs] $(TARGET)
rm -f $(TARGET)
include $(TOPDIR)/Rules.make
| rroart/freevms | linux/arch/i386/tools/Makefile | Makefile | gpl-2.0 | 538 | [
30522,
4539,
1027,
1002,
1006,
2327,
4305,
2099,
1007,
1013,
11603,
1013,
2421,
1013,
2004,
2213,
1011,
1045,
22025,
2575,
1013,
16396,
1012,
1044,
2035,
1024,
2720,
21572,
4842,
1024,
3435,
3207,
2361,
1024,
1002,
1006,
4539,
1007,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<h1 id="bytecodedumpload">Bytecode dump/load</h1>
<p>The API calls
<code><a href="api.html#duk_dump_function">duk_dump_function()</a></code> and
<code><a href="api.html#duk_load_function">duk_load_function()</a></code> allow
calling C code to (1) serialize an ECMAScript function into a portable
bytecode and then (2) load the bytecode to reconstitute the function.</p>
<p>The bytecode format is Duktape version specific and it's unsafe to
load bytecode from a different Duktape minor version (patch version
doesn't affect bytecode compatibility). Duktape configuration options
may also affect bytecode compatibility, so dump/load source and target
must be compiled with the same options. The bytecode format is platform
neutral so that you can compile bytecode on one platform and then load it
on another, which is useful for cross-platform builds. Duktape does not
validate loaded bytecode so calling code must ensure bytecode is intact
and valid for the running Duktape version.</p>
<div class="note">
Calling code must ensure that bytecode being loaded is intact and valid
for the running Duktape version (i.e. it has been compiled with the same
version of Duktape and hasn't been modified since). Loading invalid
bytecode may lead to memory unsafe behavior; loading maliciously crafted
bytecode may even lead to exploitable vulnerabilities.
</div>
<p>See
<a href="https://github.com/svaarala/duktape/blob/master/doc/bytecode.rst">bytecode.rst</a>
for more details.</p>
| svaarala/duktape | website/guide/bytecodedumpload.html | HTML | mit | 1,482 | [
30522,
1026,
1044,
2487,
8909,
1027,
1000,
24880,
16044,
8566,
8737,
11066,
1000,
1028,
24880,
16044,
15653,
1013,
7170,
1026,
1013,
1044,
2487,
1028,
1026,
1052,
1028,
1996,
17928,
4455,
1026,
3642,
1028,
1026,
1037,
17850,
12879,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
module NIDAG
# Exports a set of Articles in different formats
class Exporter
end
end | NIDAG/ACE | lib/Exporter.rb | Ruby | mit | 101 | [
30522,
11336,
9152,
2850,
2290,
1001,
14338,
1037,
2275,
1997,
4790,
1999,
2367,
11630,
2465,
9167,
2121,
2203,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class C:
def foo(self):
x = 1
y = 2
x = 1
def foo():
pass | akosyakov/intellij-community | python/testData/copyPaste/singleLine/IndentOnTopLevel.after.py | Python | apache-2.0 | 83 | [
30522,
2465,
1039,
1024,
13366,
29379,
1006,
2969,
1007,
1024,
1060,
1027,
1015,
1061,
1027,
1016,
1060,
1027,
1015,
13366,
29379,
1006,
1007,
1024,
3413,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package router
import (
"github.com/Unknwon/macaron"
"github.com/macaron-contrib/binding"
"github.com/containerops/crew/handler"
)
func SetRouters(m *macaron.Macaron) {
m.Group("/v1", func() {
//Session Router
m.Group("/token", func() {
m.Post("/", handler.W1PostToken)
})
//User Router
m.Group("/user", func() {
//Signin and Signup
m.Post("/", binding.Bind(handler.UserSignup{}), handler.W1UserSignup)
m.Post("/auth", handler.W1UserSignin)
//List All Users
m.Get("/list/:count/:page", handler.W1GetUserList)
//Profile
m.Put("/:user/profile", handler.W1PutUserProfile)
m.Get("/:user/profile", handler.W1GetUserProfile)
m.Post("/:user/gravatar", handler.W1PostUserGravatar)
//Put Password
m.Put("/:user/passwd", handler.W1PutUserPasswd)
//List User Teams and Organizations
m.Get("/:user/organizations", handler.W1GetUserOrganizations)
m.Get("/:user/teams", handler.W1GetUserTeams)
})
//Organization Router
m.Group("/org", func() {
m.Post("/", handler.W1PostOrganization)
m.Put("/:org", handler.W1PutOrganization)
m.Get("/:org", handler.W1GetOrganization)
m.Delete("/:org", handler.W1DeleteOrganization)
//Team Router
m.Group("/:org/team", func() {
m.Post("/", handler.W1PostTeam)
m.Get("/list", handler.W1GetTeams)
m.Put("/:team", handler.W1PutTeam)
m.Get("/:team", handler.W1GetTeam)
m.Delete("/:team", handler.W1DeleteTeam)
//User Management
m.Group("/:team/user", func() {
m.Get("/list", handler.W1GetTeamUsers)
m.Put("/:user", handler.W1PutTeamUser)
m.Delete("/:user", handler.W1DeleteTeamUser)
})
})
})
})
}
| yonh/wharf | Godeps/_workspace/src/github.com/containerops/crew/router/router.go | GO | mit | 1,656 | [
30522,
7427,
2799,
2099,
12324,
1006,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
4895,
2243,
2078,
19291,
1013,
6097,
10464,
2078,
1000,
1000,
21025,
2705,
12083,
1012,
4012,
1013,
6097,
10464,
2078,
1011,
9530,
18886,
2497,
1013,
8031,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Layers;
using Esri.ArcGISRuntime.Symbology;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace ArcGISRuntimeSDKDotNet_DesktopSamples.Samples
{
/// <summary>
/// This sample demonstrates the use of the GraphicsLayer.GraphicsSouce property. Here, three separate graphics source lists are initially created with random graphics. A button is used to switch the GraphicsSource property of the GraphicsLayer between the sources.
/// </summary>
/// <title>Graphics Source</title>
/// <category>Layers</category>
/// <subcategory>Graphics Layers</subcategory>
public partial class GraphicsSourceSample : UserControl
{
private Random _random = new Random();
private GraphicsLayer _graphicsLayer;
private List<List<Graphic>> _grahicsSources;
private int _graphicSourceIndex;
/// <summary>Construct Graphics Source sample control</summary>
public GraphicsSourceSample()
{
InitializeComponent();
_graphicsLayer = MyMapView.Map.Layers["graphicsLayer"] as GraphicsLayer;
MyMapView.NavigationCompleted += MyMapView_NavigationCompleted;
}
private void MyMapView_NavigationCompleted(object sender, EventArgs e)
{
MyMapView.NavigationCompleted -= MyMapView_NavigationCompleted;
CreateGraphics();
}
// Switch between pre-created graphics lists
private void SwitchGraphicSourceButton_Click(object sender, RoutedEventArgs e)
{
++_graphicSourceIndex;
if (_graphicSourceIndex == _grahicsSources.Count)
_graphicSourceIndex = 0;
_graphicsLayer.GraphicsSource = _grahicsSources[_graphicSourceIndex];
}
// Create three List<Graphic> objects with random graphics to serve as overlay GraphicsSources
private void CreateGraphics()
{
_grahicsSources = new List<List<Graphic>>()
{
new List<Graphic>(),
new List<Graphic>(),
new List<Graphic>()
};
foreach (var graphicList in _grahicsSources)
{
for (int n = 0; n < 10; ++n)
{
graphicList.Add(CreateRandomGraphic());
}
}
_graphicSourceIndex = 0;
_graphicsLayer.GraphicsSource = _grahicsSources[_graphicSourceIndex];
}
// Create a random graphic
private Graphic CreateRandomGraphic()
{
return new Graphic()
{
Geometry = GetRandomMapPoint(),
Symbol = new SimpleMarkerSymbol() { Color = GetRandomColor(), Size = 15, Style = GetRandomMarkerStyle() }
};
}
// Utility: Generate a random MapPoint within the current extent
private MapPoint GetRandomMapPoint()
{
double x = MyMapView.Extent.XMin + (_random.NextDouble() * MyMapView.Extent.Width);
double y = MyMapView.Extent.YMin + (_random.NextDouble() * MyMapView.Extent.Height);
return new MapPoint(x, y, MyMapView.SpatialReference);
}
// Utility: Generate a random System.Windows.Media.Color
private Color GetRandomColor()
{
var colorBytes = new byte[3];
_random.NextBytes(colorBytes);
return Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]);
}
// Utility: Generate a random marker style
private SimpleMarkerStyle GetRandomMarkerStyle()
{
return (SimpleMarkerStyle)_random.Next(0, 6);
}
}
}
| Tyshark9/arcgis-runtime-samples-dotnet | src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/GraphicsLayers/GraphicsSourceSample.xaml.cs | C# | apache-2.0 | 3,725 | [
30522,
2478,
9686,
3089,
1012,
8115,
17701,
15532,
7292,
1012,
10988,
1025,
2478,
9686,
3089,
1012,
8115,
17701,
15532,
7292,
1012,
9014,
1025,
2478,
9686,
3089,
1012,
8115,
17701,
15532,
7292,
1012,
6454,
15707,
1025,
2478,
2291,
1025,
247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* The slice property of Array has not prototype property
*
* @path ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A5.6.js
* @description Checking Array.prototype.slice.prototype
*/
//CHECK#1
if (Array.prototype.slice.prototype !== undefined) {
$ERROR('#1: Array.prototype.slice.prototype === undefined. Actual: ' + (Array.prototype.slice.prototype));
}
| Oceanswave/NiL.JS | Tests/tests/sputnik/ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A5.6.js | JavaScript | bsd-3-clause | 418 | [
30522,
1013,
1013,
9385,
2268,
1996,
11867,
4904,
8238,
6048,
1012,
2035,
2916,
30524,
1018,
1012,
1018,
1013,
2321,
1012,
1018,
1012,
1018,
1012,
2184,
1013,
1055,
16068,
1012,
1018,
1012,
1018,
1012,
2184,
1035,
1037,
2629,
1012,
1020,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/shared/each'
require 'timeout'
# force reload for Prime::method_added and Prime::instance
Object.send(:remove_const, :Prime) if defined?(Prime)
load 'prime.rb'
describe "Prime.each" do
it_behaves_like :prime_each, :each, Prime
end
describe "Prime#each" do
it_behaves_like :prime_each, :each, Prime.instance
end
describe "Prime#each", "when an instance created via Prime.new" do
before(:all) do
@enough_seconds = 3
@primes = [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,
89, 97
].freeze
end
before do
@ps = Prime.new
end
it "iterates the given block over all prime numbers" do
enumerated = []
@ps.each do |prime|
break if prime >= 100
enumerated << prime
end
enumerated.should == @primes
end
it "infinitely iterates the given block passing a prime" do
lambda {
Timeout.timeout(@enough_seconds) {
@ps.each {|prime|
primality = (2..Math.sqrt(prime)).all?{|n| prime%n != 0 }
primality.should be_true
}
}
}.should raise_error(Timeout::Error)
end
it "raises a ArgumentError when is called with some argumetns" do
lambda {
@ps.each(100) do |prime|
# do something
end
}.should raise_error(ArgumentError)
end
it "passes a prime to the given block ascendently" do
prev = 1
@ps.each do |prime|
break if prime >= 10000
prime.should > prev
prev = prime
end
end
it "returns an evaluated value of the given block" do
expected = Object.new
Prime.new.each{ break expected }.should equal(expected)
end
it "returns an enumerator (or a compatible object) if no block given" do
obj = @ps.each
obj.should be_kind_of(Enumerable)
obj.should respond_to(:with_index)
obj.should respond_to(:with_object)
obj.should respond_to(:next)
obj.should respond_to(:rewind)
end
it "raises an ArgumentError if no block given and is called with some arguments" do
lambda { @ps.each(100) }.should raise_error(ArgumentError)
end
it "does not rewind the generator, each loop start at the current value" do
@ps.next
result = []
@ps.each do |p|
result << p
break if p > 10
end
result.should == [3, 5, 7, 11]
result = []
@ps.each do |p|
result << p
break if p > 20
end
result.should == [13, 17, 19, 23]
end
end
| sorah/rubyspec | library/prime/each_spec.rb | Ruby | mit | 2,532 | [
30522,
5478,
5371,
1012,
16101,
18442,
1006,
1035,
1035,
5371,
1035,
1035,
1007,
1009,
1005,
1013,
1012,
1012,
1013,
1012,
1012,
1013,
28699,
1035,
2393,
2121,
1005,
5478,
5371,
1012,
16101,
18442,
1006,
1035,
1035,
5371,
1035,
1035,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#pragma once
#include <node.h>
class Contracts
{
public:
static bool RequireNumberOfArguments(const v8::FunctionCallbackInfo<v8::Value>& args, int requiredNumberOfArguments);
static bool RequireObjectArgument(const v8::FunctionCallbackInfo<v8::Value>& args, int argumentIndex);
static bool RequireNumberArgument(const v8::FunctionCallbackInfo<v8::Value>& args, int argumentIndex);
static bool RequireFunctionArgument(const v8::FunctionCallbackInfo<v8::Value>& args, int argumentIndex);
static bool OptionalFunctionArgument(const v8::FunctionCallbackInfo<v8::Value>& args, int argumentIndex);
};
#define REQUIRE_NUMBER_OF_ARGUMENTS(args, requiredNumberOfArguments) \
if (!Contracts::RequireNumberOfArguments(args, requiredNumberOfArguments)) \
{ \
return; \
}
#define REQUIRE_OBJECT(args, argumentIndex) \
if (!Contracts::RequireObjectArgument(args, argumentIndex)) \
{ \
return; \
}
#define REQUIRE_NUMBER(args, argumentIndex) \
if (!Contracts::RequireNumberArgument(args, argumentIndex)) \
{ \
return; \
}
#define REQUIRE_FUNCTION(args, argumentIndex) \
if (!Contracts::RequireFunctionArgument(args, argumentIndex)) \
{ \
return; \
}
#define OPTIONAL_FUNCTION(args, argumentIndex) \
if (!Contracts::OptionalFunctionArgument(args, argumentIndex)) \
{ \
return; \
}
| alexeiskachykhin/node-alienfx | sources/binding/contracts.h | C | mit | 1,395 | [
30522,
1001,
10975,
8490,
2863,
2320,
1001,
2421,
1026,
13045,
1012,
1044,
1028,
2465,
8311,
1063,
2270,
1024,
10763,
22017,
2140,
5478,
19172,
5677,
11253,
2906,
22850,
11187,
1006,
9530,
3367,
15754,
1024,
1024,
3853,
9289,
20850,
8684,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.